File path: /jruby-1.4.0/src/org/jruby/compiler/ir/IR_Builder.java | File path: /jruby-1.4.0/src/org/jruby/compiler/ir/IR_Builder.java | |||
Method name: Operand buildOr(OrNode, IR_Scope)
|
Method name: Operand buildAnd(AndNode, IR_Scope)
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | Variable ret = m.getNewVariable();↵ | 1 | Variable ret = m.getNewVariable();↵ | |
2 | Label l = m.getNewLabel();↵ | 2 | Label l = m.getNewLabel();↵ | |
3 | Operand v1 = build(orNode.getFirstNode(), m);↵ | 3 | Operand v1 = build(andNode.getFirstNode(), m);↵ | |
4 | m.addInstr(new COPY_Instr(ret, BooleanLiteral.TRUE));↵ | 4 | m.addInstr(new COPY_Instr(ret, BooleanLiteral.FALSE));↵ | |
5 | m.addInstr(new BEQ_Instr(v1, BooleanLiteral.TRUE, l));↵ | 5 | m.addInstr(new BEQ_Instr(v1, BooleanLiteral.FALSE, l));↵ | |
6 | Operand v2 = build(orNode.getSecondNode(), m);↵ | 6 | Operand v2 = build(andNode.getSecondNode(), m);↵ | |
7 | m.addInstr(new COPY_Instr(ret, v2));↵ | 7 | m.addInstr(new COPY_Instr(ret, v2));↵ | |
8 | m.addInstr(new LABEL_Instr(l));↵ | 8 | m.addInstr(new LABEL_Instr(l));↵ | |
9 | return ret; | 9 |
| |
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 | 81 |
Number of mapped statements | 9 |
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 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | Variable ret = m.getNewVariable(); | 7 | Variable ret = m.getNewVariable(); | |||||||||||||||
8 | Label l = m.getNewLabel(); | 8 | Label l = m.getNewLabel(); | |||||||||||||||
9 | Operand v1 = build(orNode.getFirstNode(), m); |
| 9 | Operand v1 = build(andNode.getFirstNode(), m); | ||||||||||||||
10 | m.addInstr(new COPY_Instr(ret, BooleanLiteral.TRUE)); |
| 10 | m.addInstr(new COPY_Instr(ret, BooleanLiteral.FALSE)); | ||||||||||||||
11 | m.addInstr(new BEQ_Instr(v1, BooleanLiteral.TRUE, l)); |
| 11 | m.addInstr(new BEQ_Instr(v1, BooleanLiteral.FALSE, l)); | ||||||||||||||
12 | Operand v2 = build(orNode.getSecondNode(), m); |
| 12 | Operand v2 = build(andNode.getSecondNode(), m); | ||||||||||||||
13 | m.addInstr(new COPY_Instr(ret, v2)); | 13 | m.addInstr(new COPY_Instr(ret, v2)); | |||||||||||||||
14 | m.addInstr(new LABEL_Instr(l)); | 14 | m.addInstr(new LABEL_Instr(l)); | |||||||||||||||
15 | return ret; | 15 | return ret; |
Row | Violation |
---|---|
1 | Expression orNode cannot be unified with expression andNode , because common superclass org.jruby.ast.Node does not declare member(s) public org.jruby.ast.Node getFirstNode() |
2 | Expression orNode cannot be unified with expression andNode , because common superclass org.jruby.ast.Node does not declare member(s) public org.jruby.ast.Node getSecondNode() |