File path: /jruby-1.4.0/src/org/jruby/compiler/impl/BaseBodyCompiler.java | File path: /jruby-1.4.0/src/org/jruby/compiler/impl/BaseBodyCompiler.java | |||
Method name: void isGlobalDefined(String, BranchCallback, BranchCallback)
|
Method name: void isInstanceVariableDefined(String, BranchCallback, BranchCallback)
|
|||
Number of AST nodes: 12 | Number of AST nodes: 12 | |||
1 | loadRuntime();↵ | 1 | loadSelf();↵ | |
2 | invokeRuby("getGlobalVariables", sig(GlobalVariables.class));↵ | 2 | invokeIRubyObject("getInstanceVariables", sig(InstanceVariables.class));↵ | |
3 | method.ldc(name);↵ | 3 | method.ldc(name);↵ | |
4 | method.invokevirtual(p(GlobalVariables.class), "isDefined↵ | 4 | //method.invokeinterface(p(IRubyObject.class), "getInstanceVariable", sig(IRubyObject.class, params(String.class)));↵ | |
5 | ", sig(boolean.class, params(String.class)));↵ | 5 | method.invokeinterface(p(InstanceVariables.class), "fastHasInstanceVariable", sig(boolean.class, params(String.class)));↵ | |
6 | Label falseLabel = new Label();↵ | 6 | Label trueLabel = new Label();↵ | |
7 | Label exitLabel = new Label();↵ | 7 | Label exitLabel = new Label();↵ | |
8 | method.ifeq(falseLabel); // EQ == 0 (i.e. false)↵ | 8 | //method.ifnonnull(trueLabel);↵ | |
9 | method.ifne(trueLabel);↵ | |||
9 | trueBranch.branch(this);↵ | 10 | falseBranch.branch(this);↵ | |
10 | method.go_to(exitLabel);↵ | 11 | method.go_to(exitLabel);↵ | |
11 | method.label(falseLabel);↵ | 12 | method.label(trueLabel);↵ | |
12 | falseBranch.branch(this);↵ | 13 | trueBranch.branch(this);↵ | |
13 | method.label(exitLabel); | 14 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 103 |
Number of mapped statements | 12 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | loadRuntime(); |
| 1 | loadSelf(); | |||||||||||||||||
2 | invokeRuby("getGlobalVariables", sig(GlobalVariables.class)); |
| 2 | invokeIRubyObject("getInstanceVariables", sig(InstanceVariables.class)); | |||||||||||||||||
3 | method.ldc(name); | 3 | method.ldc(name); | ||||||||||||||||||
4 | method.invokevirtual(p(GlobalVariables.class), "isDefined", sig(boolean.class, params(String.class))); |
| 4 | method.invokeinterface(p(InstanceVariables.class), "fastHasInstanceVariable", sig(boolean.class, params(String.class))); | |||||||||||||||||
5 | Label falseLabel = new Label(); |
| 5 | Label trueLabel = new Label(); | |||||||||||||||||
6 | Label exitLabel = new Label(); | 6 | Label exitLabel = new Label(); | ||||||||||||||||||
7 | method.ifeq(falseLabel); |
| 7 | method.ifne(trueLabel); | |||||||||||||||||
8 | trueBranch.branch(this); | 11 | trueBranch.branch(this); | ||||||||||||||||||
9 | method.go_to(exitLabel); | 9 | method.go_to(exitLabel); | ||||||||||||||||||
10 | method.label(falseLabel); |
| 10 | method.label(trueLabel); | |||||||||||||||||
11 | falseBranch.branch(this); | 8 | falseBranch.branch(this); | ||||||||||||||||||
12 | method.label(exitLabel); | 12 | method.label(exitLabel); |
Row | Violation |
---|---|
1 | Expression loadRuntime() is a void method call, and thus it cannot be parameterized |
2 | Expression loadSelf() is a void method call, and thus it cannot be parameterized |
3 | Expression invokeRuby("getGlobalVariables",sig(GlobalVariables.class)) is a void method call, and thus it cannot be parameterized |
4 | Expression invokeIRubyObject("getInstanceVariables",sig(InstanceVariables.class)) is a void method call, and thus it cannot be parameterized |
5 | Expression method.invokevirtual(p(GlobalVariables.class),"isDefined",sig(boolean.class,params(String.class))) is a void method call, and thus it cannot be parameterized |
6 | Expression method.invokeinterface(p(InstanceVariables.class),"fastHasInstanceVariable",sig(boolean.class,params(String.class))) is a void method call, and thus it cannot be parameterized |
7 | Expression method.ifeq(falseLabel) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression method.ifne(trueLabel) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression method.ifeq(falseLabel) is a void method call, and thus it cannot be parameterized |
10 | Expression method.ifne(trueLabel) is a void method call, and thus it cannot be parameterized |