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 forEachInValueArray(int, int, Object, int, Object, ArrayCallback, CompilerCallback)
|
Method name: void forEachInValueArray(int, int, Object, ArrayCallback, CompilerCallback)
|
|||
Number of AST nodes: 30 | Number of AST nodes: 28 | |||
1 | if (start < preCount || argsCallback != null) {↵ | 1 | if (start < count || argsCallback != null) {↵ | |
2 | int tempLocal = getVariableCompiler().grabTempLocal();↵ | 2 | int tempLocal = getVariableCompiler().grabTempLocal();↵ | |
3 | getVariableCompiler().setTempLocal(tempLocal);↵ | 3 | getVariableCompiler().setTempLocal(tempLocal);↵ | |
4 | ↵ | |||
4 | for (; start < preCount; start++) {↵ | 5 | for (; start < count; start++) {↵ | |
5 | getVariableCompiler().getTempLocal(tempLocal);↵ | 6 | getVariableCompiler().getTempLocal(tempLocal);↵ | |
6 | switch (start) {↵ | 7 | switch (start) {↵ | |
7 | case 0:↵ | 8 | case 0:↵ | |
8 | invokeUtilityMethod("arrayEntryOrNilZero", sig(IRubyObject.class, RubyArray.class));↵ | 9 | invokeUtilityMethod("arrayEntryOrNilZero", sig(IRubyObject.class, RubyArray.class));↵ | |
9 | break;↵ | 10 | break;↵ | |
10 | case 1:↵ | 11 | case 1:↵ | |
11 | invokeUtilityMethod("arrayEntryOrNilOne", sig(IRubyObject.class, RubyArray.class));↵ | 12 | invokeUtilityMethod("arrayEntryOrNilOne", sig(IRubyObject.class, RubyArray.class));↵ | |
12 | break;↵ | 13 | break;↵ | |
13 | case 2:↵ | 14 | case 2:↵ | |
14 | invokeUtilityMethod("arrayEntryOrNilTwo", sig(IRubyObject.class, RubyArray.class));↵ | 15 | invokeUtilityMethod("arrayEntryOrNilTwo", sig(IRubyObject.class, RubyArray.class));↵ | |
15 | break;↵ | 16 | break;↵ | |
16 | default:↵ | 17 | default:↵ | |
17 | method.pushInt(start);↵ | 18 | method.pushInt(start);↵ | |
18 | invokeUtilityMethod("arrayEntryOrNil", sig(IRubyObject.class, RubyArray.class, int.class));↵ | 19 | invokeUtilityMethod("arrayEntryOrNil", sig(IRubyObject.class, RubyArray.class, int.class));↵ | |
19 | break;↵ | 20 | break;↵ | |
20 | }↵ | 21 | }↵ | |
21 | callback.nextValue(this, preSource, start);↵ | 22 | callback.nextValue(this, source, start);↵ | |
22 | }↵ | 23 | }↵ | |
23 | if (argsCallback != null) {↵ | 24 | if (argsCallback != null) {↵ | |
24 | getVariableCompiler().getTempLocal(tempLocal);↵ | 25 | getVariableCompiler().getTempLocal(tempLocal);↵ | |
25 | loadRuntime();↵ | 26 | loadRuntime();↵ | |
26 | method.pushInt(start);↵ | 27 | method.pushInt(start);↵ | |
27 | invokeUtilityMethod("subarrayOrEmpty", sig(RubyArray.class, RubyArray.class, Ruby.class, int.class));↵ | 28 | invokeUtilityMethod("subarrayOrEmpty", sig(RubyArray.class, RubyArray.class, Ruby.class, int.class));↵ | |
28 | argsCallback.call(this);↵ | 29 | argsCallback.call(this);↵ | |
29 | }↵ | 30 | }↵ | |
30 | if (postCount > 0) {↵ | |||
31 | throw new NotCompilableException("1.9 mode can't handle post variables in masgn yet");↵ | |||
32 | }↵ | |||
33 | getVariableCompiler().getTempLocal(tempLocal);↵ | 31 | getVariableCompiler().getTempLocal(tempLocal);↵ | |
34 | getVariableCompiler().releaseTempLocal();↵ | 32 | getVariableCompiler().releaseTempLocal();↵ | |
35 | } | 33 |
| |
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) | 1.8 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 178 |
Number of mapped statements | 28 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 29.5 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (start < preCount || argsCallback != null) |
| 1 | if (start < count || argsCallback != null) | ||||||||||
2 | int tempLocal = getVariableCompiler().grabTempLocal(); | 2 | int tempLocal = getVariableCompiler().grabTempLocal(); | |||||||||||
3 | getVariableCompiler().setTempLocal(tempLocal); | 3 | getVariableCompiler().setTempLocal(tempLocal); | |||||||||||
4 | for (; start < preCount; start++) |
| 4 | for (; start < count; start++) | ||||||||||
5 | getVariableCompiler().getTempLocal(tempLocal); | 5 | getVariableCompiler().getTempLocal(tempLocal); | |||||||||||
6 | switch (start) | 6 | switch (start) | |||||||||||
7 | case 0: | 7 | case 0: | |||||||||||
8 | invokeUtilityMethod("arrayEntryOrNilZero", sig(IRubyObject.class, RubyArray.class)); | 8 | invokeUtilityMethod("arrayEntryOrNilZero", sig(IRubyObject.class, RubyArray.class)); | |||||||||||
9 | break; | 9 | break; | |||||||||||
10 | case 1: | 10 | case 1: | |||||||||||
11 | invokeUtilityMethod("arrayEntryOrNilOne", sig(IRubyObject.class, RubyArray.class)); | 11 | invokeUtilityMethod("arrayEntryOrNilOne", sig(IRubyObject.class, RubyArray.class)); | |||||||||||
12 | break; | 12 | break; | |||||||||||
13 | case 2: | 13 | case 2: | |||||||||||
14 | invokeUtilityMethod("arrayEntryOrNilTwo", sig(IRubyObject.class, RubyArray.class)); | 14 | invokeUtilityMethod("arrayEntryOrNilTwo", sig(IRubyObject.class, RubyArray.class)); | |||||||||||
15 | break; | 15 | break; | |||||||||||
16 | default: | 16 | default: | |||||||||||
17 | method.pushInt(start); | 17 | method.pushInt(start); | |||||||||||
18 | invokeUtilityMethod("arrayEntryOrNil", sig(IRubyObject.class, RubyArray.class, int.class)); | 18 | invokeUtilityMethod("arrayEntryOrNil", sig(IRubyObject.class, RubyArray.class, int.class)); | |||||||||||
19 | break; | 19 | break; | |||||||||||
20 | callback.nextValue(this, preSource, start); |
| 20 | callback.nextValue(this, source, start); | ||||||||||
21 | if (argsCallback != null) | 21 | if (argsCallback != null) | |||||||||||
22 | getVariableCompiler().getTempLocal(tempLocal); | 22 | getVariableCompiler().getTempLocal(tempLocal); | |||||||||||
23 | loadRuntime(); | 23 | loadRuntime(); | |||||||||||
24 | method.pushInt(start); | 24 | method.pushInt(start); | |||||||||||
25 | invokeUtilityMethod("subarrayOrEmpty", sig(RubyArray.class, RubyArray.class, Ruby.class, int.class)); | 25 | invokeUtilityMethod("subarrayOrEmpty", sig(RubyArray.class, RubyArray.class, Ruby.class, int.class)); | |||||||||||
26 | argsCallback.call(this); | 26 | argsCallback.call(this); | |||||||||||
27 | if (postCount > 0) | | ||||||||||||
28 | throw new NotCompilableException("1.9 mode can't handle post variables in masgn yet"); |
| | |||||||||||
29 | getVariableCompiler().getTempLocal(tempLocal); | 27 | getVariableCompiler().getTempLocal(tempLocal); | |||||||||||
30 | getVariableCompiler().releaseTempLocal(); | 28 | getVariableCompiler().releaseTempLocal(); |
Row | Violation |
---|---|
1 | Unmatched throw new NotCompilableException("1.9 mode can't handle post variables in masgn yet"); |