42 |
42 |
43 VirtualObject[] compile(TestAssembler asm, JavaValue[] frameValues); |
43 VirtualObject[] compile(TestAssembler asm, JavaValue[] frameValues); |
44 } |
44 } |
45 |
45 |
46 protected void test(DebugInfoCompiler compiler, Method method, int bci, JavaKind... slotKinds) { |
46 protected void test(DebugInfoCompiler compiler, Method method, int bci, JavaKind... slotKinds) { |
|
47 test(compiler, method, bci, new Location[0], new Location[0], new int[0], slotKinds); |
|
48 } |
|
49 |
|
50 protected void test(DebugInfoCompiler compiler, Method method, int bci, Location[] objects, Location[] derivedBase, int[] sizeInBytes, JavaKind... slotKinds) { |
47 ResolvedJavaMethod resolvedMethod = metaAccess.lookupJavaMethod(method); |
51 ResolvedJavaMethod resolvedMethod = metaAccess.lookupJavaMethod(method); |
48 |
52 |
49 int numLocals = resolvedMethod.getMaxLocals(); |
53 int numLocals = resolvedMethod.getMaxLocals(); |
50 int numStack = slotKinds.length - numLocals; |
54 int numStack = slotKinds.length - numLocals; |
51 JavaValue[] values = new JavaValue[slotKinds.length]; |
55 JavaValue[] values = new JavaValue[slotKinds.length]; |
52 test(asm -> { |
56 test(asm -> { |
53 VirtualObject[] vobjs = compiler.compile(asm, values); |
57 VirtualObject[] vobjs = compiler.compile(asm, values); |
54 |
58 |
55 BytecodeFrame frame = new BytecodeFrame(null, resolvedMethod, bci, false, false, values, slotKinds, numLocals, numStack, 0); |
59 BytecodeFrame frame = new BytecodeFrame(null, resolvedMethod, bci, false, false, values, slotKinds, numLocals, numStack, 0); |
56 DebugInfo info = new DebugInfo(frame, vobjs); |
60 DebugInfo info = new DebugInfo(frame, vobjs); |
57 info.setReferenceMap(new HotSpotReferenceMap(new Location[0], new Location[0], new int[0], 8)); |
61 info.setReferenceMap(new HotSpotReferenceMap(objects, derivedBase, sizeInBytes, 8)); |
58 |
62 |
59 asm.emitTrap(info); |
63 asm.emitTrap(info); |
60 }, method); |
64 }, method); |
61 } |
65 } |
62 } |
66 } |