JDK-6253538 : Support early return from methods
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: 6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-04-11
  • Updated: 2011-09-22
  • Resolved: 2005-05-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b37Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
We need the following 6 functions to be implemented in JVM TI to support debugger:

jvmtiError ForceEarlyReturnObject(jvmtiEnv* env, jthread thread, jobject value);
jvmtiError ForceEarlyReturnInt(jvmtiEnv* env, jthread thread, jint value);
jvmtiError ForceEarlyReturnLong(jvmtiEnv* env, jthread thread, jlong value);
jvmtiError ForceEarlyReturnFloat(jvmtiEnv* env, jthread thread, jfloat value);
jvmtiError ForceEarlyReturnDouble(jvmtiEnv* env, jthread thread, jdouble value);
jvmtiError ForceEarlyReturnVoid(jvmtiEnv* env, jthread thread);

Please, see the corresponding Debugger CR:
   6175634: Allow early return from methods

Short description:
  - Simulate a return from the topmost stack frame of thread's stack,
    returning 'value' if needed.
  - 'value' must be assignment compatible with the return type of the method
     for the topmost frame.
  - Locks acquired by the topmost frame are released.
  - Finally blocks are not executed.
  - The specified thread must be the current thread or must be suspended.
  - The current method must be non-native Java programming language methods
  - JVM TI events are generated as in usual return.
  - This function may only be called during the live phase.
  - The set of the return codes is the same as for PopFrame plus this one:
      JVMTI_ERROR_TYPE_MISMATCH - If the top-frame function return type is not
                                  an appropriate type for the function used.
###@###.### 2005-04-11 20:20:22 GMT
###@###.### 2005-04-26 06:57:42 GMT

Comments
SUGGESTED FIX Please, see the webrev file hs_eret.Apr25.tar.gz in attachments. ###@###.### 2005-05-11 08:19:55 GMT
11-05-2005

EVALUATION Please, see description. ###@###.### 2005-04-11 20:28:11 GMT
11-04-2005

WORK AROUND No workaround is available. ###@###.### 2005-04-11 20:28:11 GMT
11-04-2005