File path: /jruby-1.4.0/src/org/jruby/internal/runtime/methods/InvocationMethodFactory.java | File path: /jruby-1.4.0/src/org/jruby/runtime/callback/InvocationCallbackFactory.java | |||
Method name: CompiledBlockCallback19 getBlockCallback19(String, Object)
|
Method name: CompiledBlockCallback19 getBlockCallback19(String, Object)
|
|||
Number of AST nodes: 22 | Number of AST nodes: 22 | |||
1 | Class typeClass = scriptObject.getClass();↵ | 1 | Class typeClass = scriptObject.getClass();↵ | |
2 | String typePathString = p(typeClass);↵ | 2 | String typePathString = p(typeClass);↵ | |
3 | String mname = typeClass.getName() + "BlockCallback$" + method + "xx1";↵ | 3 | String mname = typeClass.getName() + "BlockCallback$" + method + "xx1";↵ | |
4 | String mnamePath = typePathString + "BlockCallback$" + method + "xx1";↵ | 4 | String mnamePath = typePathString + "BlockCallback$" + method + "xx1";↵ | |
5 | synchronized (classLoader) {↵ | 5 | synchronized (classLoader) {↵ | |
6 | Class c = tryClass(mname);↵ | 6 | Class c = tryClass(mname);↵ | |
7 | try {↵ | 7 | try {↵ | |
8 | if (c == null) {↵ | 8 | if (c == null) {↵ | |
9 | ClassWriter cw = createBlockCtor19(mnamePath, typeClass);↵ | 9 | ClassWriter cw = createBlockCtor19(mnamePath, typeClass);↵ | |
10 | SkinnyMethodAdapter mv = startBlockCall19(cw);↵ | 10 | SkinnyMethodAdapter mv = startBlockCall19(cw);↵ | |
11 | mv.aload(0);↵ | 11 | mv.aload(0);↵ | |
12 | mv.getfield(mnamePath, "$scriptObject", ci(typeClass));↵ | 12 | mv.getfield(mnamePath, "$scriptObject", ci(typeClass));↵ | |
13 | mv.aload(1);↵ | 13 | mv.aload(1);↵ | |
14 | mv.aload(2);↵ | 14 | mv.aload(2);↵ | |
15 | mv.aload(3);↵ | 15 | mv.aload(3);↵ | |
16 | mv.aload(4);↵ | 16 | mv.aload(4);↵ | |
17 | mv.invokestatic(typePathString, method, sig(↵ | 17 | mv.invokestatic(typePathString, method, sig(↵ | |
18 | IRubyObject.class, "L" + typePathString + ";", ThreadContext.class,↵ | 18 | IRubyObject.class, "L" + typePathString + ";", ThreadContext.class,↵ | |
19 | IRubyObject.class, IRubyObject[].class, Block.class));↵ | 19 | IRubyObject.class, IRubyObject[].class, Block.class));↵ | |
20 | mv.areturn();↵ | 20 | mv.areturn();↵ | |
21 | mv.visitMaxs(2, 3);↵ | 21 | mv.visitMaxs(2, 3);↵ | |
22 | c = endCall(cw, mv, mname);↵ | 22 | c = endCall(cw, mv, mname);↵ | |
23 | }↵ | 23 | }↵ | |
24 | CompiledBlockCallback19 ic = (CompiledBlockCallback19) c.getConstructor(Object.class).newInstance(scriptObject);↵ | 24 | CompiledBlockCallback19 ic = (CompiledBlockCallback19) c.getConstructor(Object.class).newInstance(scriptObject);↵ | |
25 | return ic;↵ | 25 | return ic;↵ | |
26 | } catch (IllegalArgumentException e) {↵ | 26 | } catch (IllegalArgumentException e) {↵ | |
27 | throw e;↵ | 27 | throw e;↵ | |
28 | } catch (Exception e) {↵ | 28 | } catch (Exception e) {↵ | |
29 | e.printStackTrace();↵ | 29 | e.printStackTrace();↵ | |
30 | throw new IllegalArgumentException(e.getMessage());↵ | 30 | throw new IllegalArgumentException(e.getMessage());↵ | |
31 | }↵ | 31 | }↵ | |
32 | } | 32 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 1.4 |
Clones location | Clones are in different classes |
Number of node comparisons | 192 |
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) | 64.2 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
1 | Class typeClass = scriptObject.getClass(); | 1 | Class typeClass = scriptObject.getClass(); | |
2 | String typePathString = p(typeClass); | 2 | String typePathString = p(typeClass); | |
3 | String mname = typeClass.getName() + "BlockCallback$" + method + "xx1"; | 3 | String mname = typeClass.getName() + "BlockCallback$" + method + "xx1"; | |
4 | String mnamePath = typePathString + "BlockCallback$" + method + "xx1"; | 4 | String mnamePath = typePathString + "BlockCallback$" + method + "xx1"; | |
5 | synchronized (classLoader) | 5 | synchronized (classLoader) | |
6 | Class c = tryClass(mname); | 6 | Class c = tryClass(mname); | |
7 | try | 7 | try | |
8 | if (c == null) | 8 | if (c == null) | |
9 | ClassWriter cw = createBlockCtor19(mnamePath, typeClass); | 9 | ClassWriter cw = createBlockCtor19(mnamePath, typeClass); | |
10 | SkinnyMethodAdapter mv = startBlockCall19(cw); | 10 | SkinnyMethodAdapter mv = startBlockCall19(cw); | |
11 | mv.aload(0); | 11 | mv.aload(0); | |
12 | mv.getfield(mnamePath, "$scriptObject", ci(typeClass)); | 12 | mv.getfield(mnamePath, "$scriptObject", ci(typeClass)); | |
13 | mv.aload(1); | 13 | mv.aload(1); | |
14 | mv.aload(2); | 14 | mv.aload(2); | |
15 | mv.aload(3); | 15 | mv.aload(3); | |
16 | mv.aload(4); | 16 | mv.aload(4); | |
17 | mv.invokestatic(typePathString, method, sig(IRubyObject.class, "L" + typePathString + ";", ThreadContext.class, IRubyObject.class, IRubyObject[].class, Block.class)); | 17 | mv.invokestatic(typePathString, method, sig(IRubyObject.class, "L" + typePathString + ";", ThreadContext.class, IRubyObject.class, IRubyObject[].class, Block.class)); | |
18 | mv.areturn(); | 18 | mv.areturn(); | |
19 | mv.visitMaxs(2, 3); | 19 | mv.visitMaxs(2, 3); | |
20 | c = endCall(cw, mv, mname); | 20 | c = endCall(cw, mv, mname); | |
21 | CompiledBlockCallback19 ic = (CompiledBlockCallback19)c.getConstructor(Object.class).newInstance(scriptObject); | 21 | CompiledBlockCallback19 ic = (CompiledBlockCallback19)c.getConstructor(Object.class).newInstance(scriptObject); | |
22 | return ic; | 22 | return ic; |
Row | Violation |
---|