File path: /jruby-1.4.0/src/org/jruby/compiler/ASTCompiler.java | File path: /jruby-1.4.0/src/org/jruby/compiler/ASTCompiler.java | |||
Method name: void compileFixnum(Node, BodyCompiler, boolean)
|
Method name: void compileInstVar(Node, BodyCompiler, boolean)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | FixnumNode fixnumNode = (FixnumNode) node;↵ | 1 | InstVarNode instVarNode = (InstVarNode) node;↵ | |
2 | if (RubyInstanceConfig.PEEPHOLE_OPTZ) {↵ | 2 | if (RubyInstanceConfig.PEEPHOLE_OPTZ) {↵ | |
3 | if (expr) context.createNewFixnum(fixnumNode.getValue());↵ | 3 | if (expr) context.retrieveInstanceVariable(instVarNode.getName());↵ | |
4 | } else {↵ | 4 | } else {↵ | |
5 | context.createNewFixnum(fixnumNode.getValue());↵ | 5 | context.retrieveInstanceVariable(instVarNode.getName());↵ | |
6 | if (!expr) context.consumeCurrentValue();↵ | 6 | if (!expr) context.consumeCurrentValue();↵ | |
7 | } | 7 |
| |
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 15 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 2.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | FixnumNode fixnumNode = (FixnumNode)node; |
| 1 | InstVarNode instVarNode = (InstVarNode)node; | |||||||||||||||||||
2 | if (RubyInstanceConfig.PEEPHOLE_OPTZ) |
| 2 | if (RubyInstanceConfig.PEEPHOLE_OPTZ) | |||||||||||||||||||
3 | if (expr) |
| 6 | if (!expr) | |||||||||||||||||||
4 | context.createNewFixnum(fixnumNode.getValue()); |
| 7 | context.consumeCurrentValue(); | |||||||||||||||||||
else | else | ||||||||||||||||||||||
5 | context.createNewFixnum(fixnumNode.getValue()); | | |||||||||||||||||||||
6 | if (!expr) |
| 3 | if (expr) | |||||||||||||||||||
7 | context.consumeCurrentValue(); |
| 4 | context.retrieveInstanceVariable(instVarNode.getName()); | |||||||||||||||||||
| 5 | context.retrieveInstanceVariable(instVarNode.getName()); |
Row | Violation |
---|---|
1 | Expression context.createNewFixnum(fixnumNode.getValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression context.createNewFixnum(fixnumNode.getValue()) is a void method call, and thus it cannot be parameterized |
3 | Expression context.consumeCurrentValue() is a void method call, and thus it cannot be parameterized |
4 | Expression context.createNewFixnum(fixnumNode.getValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression context.createNewFixnum(fixnumNode.getValue()) is a void method call, and thus it cannot be parameterized |
6 | Expression context.consumeCurrentValue() is a void method call, and thus it cannot be parameterized |
7 | Expression context.retrieveInstanceVariable(instVarNode.getName()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression context.consumeCurrentValue() is a void method call, and thus it cannot be parameterized |
9 | Expression context.retrieveInstanceVariable(instVarNode.getName()) is a void method call, and thus it cannot be parameterized |
10 | Expression context.retrieveInstanceVariable(instVarNode.getName()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression context.consumeCurrentValue() is a void method call, and thus it cannot be parameterized |
12 | Expression context.retrieveInstanceVariable(instVarNode.getName()) is a void method call, and thus it cannot be parameterized |
13 | Clone fragment #1 returns variable fixnumNode with type org.jruby.ast.FixnumNode , while Clone fragment #2 returns variable instVarNode with type org.jruby.ast.InstVarNode |