Skip to content

Commit 24befe5

Browse files
committed
House cleaning! Delete a bunch of unused and/or deprecated classes of strange and wonderful origins, eliminate all deprecated Callback-related code, reduce environment lookup to a simple System.getenv call, kill off the last of the old stackless interpreter's "Instruction" interface, and other miscellaneous cleanup.
git-svn-id: http://svn.codehaus.org/jruby/trunk/jruby@8395 961051c9-f516-0410-bf72-c9f7e237a7b7
1 parent 3809576 commit 24befe5

155 files changed

Lines changed: 326 additions & 7298 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/org/jruby/RubyGlobal.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242

4343
import org.jruby.anno.JRubyMethod;
4444
import org.jruby.common.IRubyWarnings.ID;
45-
import org.jruby.environment.OSEnvironmentReaderExcepton;
4645
import org.jruby.environment.OSEnvironment;
4746
import org.jruby.internal.runtime.ValueAccessor;
4847
import org.jruby.javasupport.JavaUtil;
@@ -249,15 +248,9 @@ public static void createGlobals(ThreadContext context, Ruby runtime) {
249248
}
250249

251250
private static void defineGlobalEnvConstants(Ruby runtime) {
252-
253251
Map environmentVariableMap = null;
254252
OSEnvironment environment = new OSEnvironment();
255-
try {
256-
environmentVariableMap = environment.getEnvironmentVariableMap(runtime);
257-
} catch (OSEnvironmentReaderExcepton e) {
258-
// If the environment variables are not accessible shouldn't terminate
259-
runtime.getWarnings().warn(ID.MISCELLANEOUS, e.getMessage());
260-
}
253+
environmentVariableMap = environment.getEnvironmentVariableMap(runtime);
261254

262255
if (environmentVariableMap == null) {
263256
// if the environment variables can't be obtained, define an empty ENV
@@ -273,7 +266,6 @@ private static void defineGlobalEnvConstants(Ruby runtime) {
273266
Map systemProps = environment.getSystemPropertiesMap(runtime);
274267
runtime.defineGlobalConstant("ENV_JAVA", new StringOnlyRubyHash(
275268
runtime, systemProps, runtime.getNil()));
276-
277269
}
278270

279271
private static class NonEffectiveGlobalVariable extends GlobalVariable {

src/org/jruby/RubyMethod.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import org.jruby.internal.runtime.methods.DynamicMethod;
3838
import org.jruby.runtime.Block;
3939
import org.jruby.runtime.CallbackFactory;
40+
import org.jruby.runtime.DynamicScope;
4041
import org.jruby.runtime.MethodBlock;
4142
import org.jruby.runtime.ObjectAllocator;
4243
import org.jruby.runtime.ThreadContext;
@@ -155,8 +156,14 @@ public RubyMethod rbClone() {
155156
public IRubyObject to_proc(ThreadContext context, Block unusedBlock) {
156157
Ruby runtime = context.getRuntime();
157158
CallbackFactory f = runtime.callbackFactory(RubyMethod.class);
158-
Block block = MethodBlock.createMethodBlock(context, context.getCurrentScope(),
159-
f.getBlockMethod("bmcall"), this, runtime.getTopSelf());
159+
DynamicScope currentScope = context.getCurrentScope();
160+
MethodBlock mb = new MethodBlock(this, currentScope.getStaticScope()) {
161+
@Override
162+
public IRubyObject callback(IRubyObject value, IRubyObject method, IRubyObject self, Block block) {
163+
return bmcall(value, method, self, block);
164+
}
165+
};
166+
Block block = MethodBlock.createMethodBlock(context, runtime.getTopSelf(), context.getCurrentScope(), mb);
160167

161168
while (true) {
162169
try {

src/org/jruby/ast/AliasNode.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535

3636
import org.jruby.Ruby;
3737
import org.jruby.ast.visitor.NodeVisitor;
38-
import org.jruby.evaluator.Instruction;
3938
import org.jruby.javasupport.util.RuntimeHelpers;
4039
import org.jruby.lexer.yacc.ISourcePosition;
4140
import org.jruby.runtime.Block;
@@ -58,7 +57,7 @@ public AliasNode(ISourcePosition position, String newName, String oldName) {
5857
* Accept for the visitor pattern.
5958
* @param iVisitor the visitor
6059
**/
61-
public Instruction accept(NodeVisitor iVisitor) {
60+
public Object accept(NodeVisitor iVisitor) {
6261
return iVisitor.visitAliasNode(this);
6362
}
6463

src/org/jruby/ast/AndNode.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535

3636
import org.jruby.Ruby;
3737
import org.jruby.ast.visitor.NodeVisitor;
38-
import org.jruby.evaluator.Instruction;
3938
import org.jruby.lexer.yacc.ISourcePosition;
4039
import org.jruby.runtime.Block;
4140
import org.jruby.runtime.ThreadContext;
@@ -58,7 +57,7 @@ public AndNode(ISourcePosition position, Node firstNode, Node secondNode) {
5857
this.secondNode = secondNode;
5958
}
6059

61-
public Instruction accept(NodeVisitor iVisitor) {
60+
public Object accept(NodeVisitor iVisitor) {
6261
return iVisitor.visitAndNode(this);
6362
}
6463

src/org/jruby/ast/ArgAuxillaryNode.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030
import java.util.List;
3131
import org.jruby.ast.visitor.NodeVisitor;
32-
import org.jruby.evaluator.Instruction;
3332
import org.jruby.lexer.yacc.ISourcePosition;
3433
/**
3534
*
@@ -54,7 +53,7 @@ public String getName() {
5453
}
5554

5655
@Override
57-
public Instruction accept(NodeVisitor visitor) {
56+
public Object accept(NodeVisitor visitor) {
5857
throw new UnsupportedOperationException("Not supported yet.");
5958
}
6059

src/org/jruby/ast/ArgsCatNode.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535

3636
import org.jruby.Ruby;
3737
import org.jruby.ast.visitor.NodeVisitor;
38-
import org.jruby.evaluator.Instruction;
3938
import org.jruby.javasupport.util.RuntimeHelpers;
4039
import org.jruby.lexer.yacc.ISourcePosition;
4140
import org.jruby.runtime.Block;
@@ -56,7 +55,7 @@ public ArgsCatNode(ISourcePosition position, Node firstNode, Node secondNode) {
5655
this.secondNode = secondNode;
5756
}
5857

59-
public Instruction accept(NodeVisitor visitor) {
58+
public Object accept(NodeVisitor visitor) {
6059
return visitor.visitArgsCatNode(this);
6160
}
6261

src/org/jruby/ast/ArgsNode.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
import org.jruby.Ruby;
3939
import org.jruby.RubyArray;
4040
import org.jruby.ast.visitor.NodeVisitor;
41-
import org.jruby.evaluator.Instruction;
4241
import org.jruby.javasupport.util.RuntimeHelpers;
4342
import org.jruby.lexer.yacc.ISourcePosition;
4443
import org.jruby.runtime.Arity;
@@ -114,7 +113,7 @@ protected Arity calculateArity() {
114113
* Accept for the visitor pattern.
115114
* @param iVisitor the visitor
116115
**/
117-
public Instruction accept(NodeVisitor iVisitor) {
116+
public Object accept(NodeVisitor iVisitor) {
118117
return iVisitor.visitArgsNode(this);
119118
}
120119

src/org/jruby/ast/ArgsPushNode.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import org.jruby.Ruby;
3434
import org.jruby.RubyArray;
3535
import org.jruby.ast.visitor.NodeVisitor;
36-
import org.jruby.evaluator.Instruction;
3736
import org.jruby.lexer.yacc.ISourcePosition;
3837
import org.jruby.runtime.Block;
3938
import org.jruby.runtime.ThreadContext;
@@ -53,7 +52,7 @@ public ArgsPushNode(ISourcePosition position, Node firstNode, Node secondNode) {
5352
this.secondNode = secondNode;
5453
}
5554

56-
public Instruction accept(NodeVisitor visitor) {
55+
public Object accept(NodeVisitor visitor) {
5756
return visitor.visitArgsPushNode(this);
5857
}
5958

src/org/jruby/ast/ArgumentNode.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
import org.jruby.ast.types.INameNode;
3434
import org.jruby.ast.visitor.NodeVisitor;
35-
import org.jruby.evaluator.Instruction;
3635
import org.jruby.lexer.yacc.ISourcePosition;
3736

3837
/**
@@ -52,7 +51,7 @@ protected ArgumentNode(ISourcePosition position, NodeType type, String identifie
5251
this.identifier = identifier;
5352
}
5453

55-
public Instruction accept(NodeVisitor visitor) {
54+
public Object accept(NodeVisitor visitor) {
5655
throw new RuntimeException("ArgumentNode should never be evaluated");
5756
}
5857

src/org/jruby/ast/ArrayNode.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import org.jruby.Ruby;
3636
import org.jruby.ast.types.ILiteralNode;
3737
import org.jruby.ast.visitor.NodeVisitor;
38-
import org.jruby.evaluator.Instruction;
3938
import org.jruby.lexer.yacc.ISourcePosition;
4039
import org.jruby.runtime.Block;
4140
import org.jruby.runtime.ThreadContext;
@@ -64,7 +63,7 @@ public ArrayNode(ISourcePosition position) {
6463
* @param iVisitor the visitor
6564
**/
6665
@Override
67-
public Instruction accept(NodeVisitor iVisitor) {
66+
public Object accept(NodeVisitor iVisitor) {
6867
return iVisitor.visitArrayNode(this);
6968
}
7069

0 commit comments

Comments
 (0)