From 426cbdccfdf8fcfcda07b86d8e524d1034b2d0b7 Mon Sep 17 00:00:00 2001 From: acolyer Date: Thu, 22 Jun 2006 04:49:26 +0000 Subject: tests and "fix" for pr148007 - workaround JRockit "goto" bug by generating code closer to that produced by javac when weaving after and after returning. In particular: avoid adding a goto that branches to the next instruction (now replaces that return opcode with a nop instead), and store the return value on the top of the stack in a temp before branching to the after advice dispatch and restore it afterwards. --- weaver/testdata/AfterReturningHelloWorld.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'weaver/testdata/AfterReturningHelloWorld.txt') diff --git a/weaver/testdata/AfterReturningHelloWorld.txt b/weaver/testdata/AfterReturningHelloWorld.txt index 6f58d2f3d..abc748eb5 100644 --- a/weaver/testdata/AfterReturningHelloWorld.txt +++ b/weaver/testdata/AfterReturningHelloWorld.txt @@ -1,10 +1,11 @@ public class HelloWorld extends java.lang.Object: public void (): - ALOAD_0 // HelloWorld this (line 5) + ALOAD_0 // LHelloWorld; this (line 5) INVOKESPECIAL java.lang.Object. ()V constructor-execution(void HelloWorld.()) - | GOTO L0 - | L0: INVOKESTATIC Aspect.ajc_afterReturning_constructor_execution ()V + | NOP + | INVOKESTATIC Aspect.ajc_afterReturning_constructor_execution ()V + | RETURN | RETURN constructor-execution(void HelloWorld.()) end public void () @@ -22,8 +23,9 @@ public class HelloWorld extends java.lang.Object: | | INVOKESTATIC Aspect.ajc_afterReturning_method_call ()V | | NOP | method-call(void java.io.PrintStream.println(java.lang.String)) - | GOTO L0 (line 11) - | L0: INVOKESTATIC Aspect.ajc_afterReturning_method_execution ()V + | NOP (line 11) + | INVOKESTATIC Aspect.ajc_afterReturning_method_execution ()V + | RETURN | RETURN method-execution(void HelloWorld.main(java.lang.String[])) end public static void main(String[]) -- cgit v1.2.3