File path: /jruby-1.4.0/src/org/jruby/compiler/impl/StandardInvocationCompiler.java | File path: /jruby-1.4.0/src/org/jruby/compiler/impl/StandardInvocationCompiler.java | |||
Method name: void invokeOpAsgnWithOr(String, String, CompilerCallback, ArgumentsCallback)
|
Method name: void invokeOpAsgnWithAnd(String, String, CompilerCallback, ArgumentsCallback)
|
|||
Number of AST nodes: 22 | Number of AST nodes: 22 | |||
1 | receiverCallback.call(methodCompiler);↵ | 1 | receiverCallback.call(methodCompiler);↵ | |
2 | method.dup();↵ | 2 | method.dup();↵ | |
3 | methodCompiler.loadThreadContext();↵ | 3 | methodCompiler.loadThreadContext();↵ | |
4 | methodCompiler.loadSelf();↵ | 4 | methodCompiler.loadSelf();↵ | |
5 | methodCompiler.getScriptCompiler().getCacheCompiler().cacheCallSite(methodCompiler, attrName, CallType.FUNCTIONAL);↵ | 5 | methodCompiler.getScriptCompiler().getCacheCompiler().cacheCallSite(methodCompiler, attrName, CallType.FUNCTIONAL);↵ | |
6 | ↵ | 6 | ↵ | |
7 | methodCompiler.invokeUtilityMethod("preOpAsgnWithOrAnd", sig(IRubyObject.class, IRubyObject.class, ThreadContext.class, IRubyObject.class, CallSite.class));↵ | 7 | methodCompiler.invokeUtilityMethod("preOpAsgnWithOrAnd", sig(IRubyObject.class, IRubyObject.class, ThreadContext.class, IRubyObject.class, CallSite.class));↵ | |
8 | ↵ | 8 | ↵ | |
9 | Label done = new Label();↵ | 9 | Label done = new Label();↵ | |
10 | Label isTrue = new Label();↵ | 10 | Label isFalse = new Label();↵ | |
11 | ↵ | 11 | ↵ | |
12 | method.dup();↵ | 12 | method.dup();↵ | |
13 | methodCompiler.invokeIRubyObject("isTrue", sig(boolean.class));↵ | 13 | methodCompiler.invokeIRubyObject("isTrue", sig(boolean.class));↵ | |
14 | method.ifne(isTrue);↵ | 14 | method.ifeq(isFalse);↵ | |
15 | ↵ | 15 | ↵ | |
16 | method.pop(); // pop extra attr value↵ | 16 | method.pop(); // pop extra attr value↵ | |
17 | argsCallback.call(methodCompiler);↵ | 17 | argsCallback.call(methodCompiler);↵ | |
18 | methodCompiler.loadThreadContext();↵ | 18 | methodCompiler.loadThreadContext();↵ | |
19 | methodCompiler.loadSelf();↵ | 19 | methodCompiler.loadSelf();↵ | |
20 | methodCompiler.getScriptCompiler().getCacheCompiler().cacheCallSite(methodCompiler, attrAsgnName, CallType.NORMAL);↵ | 20 | methodCompiler.getScriptCompiler().getCacheCompiler().cacheCallSite(methodCompiler, attrAsgnName, CallType.NORMAL);↵ | |
21 | ↵ | 21 | ↵ | |
22 | methodCompiler.invokeUtilityMethod("postOpAsgnWithOrAnd",↵ | 22 | methodCompiler.invokeUtilityMethod("postOpAsgnWithOrAnd",↵ | |
23 | sig(IRubyObject.class, IRubyObject.class, IRubyObject.class, ThreadContext.class, IRubyObject.class, CallSite.class));↵ | 23 | sig(IRubyObject.class, IRubyObject.class, IRubyObject.class, ThreadContext.class, IRubyObject.class, CallSite.class));↵ | |
24 | method.go_to(done);↵ | 24 | method.go_to(done);↵ | |
25 | ↵ | 25 | ↵ | |
26 | method.label(isTrue);↵ | 26 | method.label(isFalse);↵ | |
27 | method.swap();↵ | 27 | method.swap();↵ | |
28 | method.pop();↵ | 28 | method.pop();↵ | |
29 | ↵ | 29 | ↵ | |
30 | method.label(done); | 30 |
| |
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 | 163 |
Number of mapped statements | 22 |
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 | receiverCallback.call(methodCompiler); | 1 | receiverCallback.call(methodCompiler); | ||||||||||||||||||
2 | method.dup(); | 2 | method.dup(); | ||||||||||||||||||
3 | methodCompiler.loadThreadContext(); | 3 | methodCompiler.loadThreadContext(); | ||||||||||||||||||
4 | methodCompiler.loadSelf(); | 4 | methodCompiler.loadSelf(); | ||||||||||||||||||
5 | methodCompiler.getScriptCompiler().getCacheCompiler().cacheCallSite(methodCompiler, attrName, CallType.FUNCTIONAL); | 5 | methodCompiler.getScriptCompiler().getCacheCompiler().cacheCallSite(methodCompiler, attrName, CallType.FUNCTIONAL); | ||||||||||||||||||
6 | methodCompiler.invokeUtilityMethod("preOpAsgnWithOrAnd", sig(IRubyObject.class, IRubyObject.class, ThreadContext.class, IRubyObject.class, CallSite.class)); | 6 | methodCompiler.invokeUtilityMethod("preOpAsgnWithOrAnd", sig(IRubyObject.class, IRubyObject.class, ThreadContext.class, IRubyObject.class, CallSite.class)); | ||||||||||||||||||
7 | Label done = new Label(); | 7 | Label done = new Label(); | ||||||||||||||||||
8 | Label isTrue = new Label(); |
| 8 | Label isFalse = new Label(); | |||||||||||||||||
9 | method.dup(); | 9 | method.dup(); | ||||||||||||||||||
10 | methodCompiler.invokeIRubyObject("isTrue", sig(boolean.class)); | 10 | methodCompiler.invokeIRubyObject("isTrue", sig(boolean.class)); | ||||||||||||||||||
11 | method.ifne(isTrue); |
| 11 | method.ifeq(isFalse); | |||||||||||||||||
12 | method.pop(); | 12 | method.pop(); | ||||||||||||||||||
13 | argsCallback.call(methodCompiler); | 13 | argsCallback.call(methodCompiler); | ||||||||||||||||||
14 | methodCompiler.loadThreadContext(); | 14 | methodCompiler.loadThreadContext(); | ||||||||||||||||||
15 | methodCompiler.loadSelf(); | 15 | methodCompiler.loadSelf(); | ||||||||||||||||||
16 | methodCompiler.getScriptCompiler().getCacheCompiler().cacheCallSite(methodCompiler, attrAsgnName, CallType.NORMAL); | 16 | methodCompiler.getScriptCompiler().getCacheCompiler().cacheCallSite(methodCompiler, attrAsgnName, CallType.NORMAL); | ||||||||||||||||||
17 | methodCompiler.invokeUtilityMethod("postOpAsgnWithOrAnd", sig(IRubyObject.class, IRubyObject.class, IRubyObject.class, ThreadContext.class, IRubyObject.class, CallSite.class)); | 17 | methodCompiler.invokeUtilityMethod("postOpAsgnWithOrAnd", sig(IRubyObject.class, IRubyObject.class, IRubyObject.class, ThreadContext.class, IRubyObject.class, CallSite.class)); | ||||||||||||||||||
18 | method.go_to(done); | 18 | method.go_to(done); | ||||||||||||||||||
19 | method.label(isTrue); |
| 19 | method.label(isFalse); | |||||||||||||||||
20 | method.swap(); | 20 | method.swap(); | ||||||||||||||||||
21 | method.pop(); | 21 | method.pop(); | ||||||||||||||||||
22 | method.label(done); | 22 | method.label(done); |
Row | Violation |
---|---|
1 | Expression method.ifne(isTrue) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression method.ifeq(isFalse) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression method.ifne(isTrue) is a void method call, and thus it cannot be parameterized |
4 | Expression method.ifeq(isFalse) is a void method call, and thus it cannot be parameterized |