@@ -1279,7 +1279,8 @@ private Object executeBodyFromBCI(VirtualFrame frame, int startBCI, int startTop
1279
1279
}
1280
1280
Object returnValue = getReturnValueAsObject (frame , top );
1281
1281
if (instrument != null ) {
1282
- instrument .exitAt (frame , statementIndex , returnValue );
1282
+ instrument .notifyExit (frame , this , returnValue );
1283
+ instrument .notifyStatementExit (frame , statementIndex , returnValue );
1283
1284
}
1284
1285
1285
1286
// This branch must not be a loop exit.
@@ -2739,64 +2740,64 @@ private int putField(VirtualFrame frame, int top, Field field, int curBCI, int o
2739
2740
case 'Z' :
2740
2741
boolean booleanValue = stackIntToBoolean (popInt (frame , top - 1 ));
2741
2742
if (instrumentation != null ) {
2742
- instrumentation .notifyFieldModification (frame , statementIndex , field , receiver , booleanValue );
2743
+ instrumentation .notifyFieldModification (frame , statementIndex , field , this , receiver , booleanValue );
2743
2744
}
2744
2745
InterpreterToVM .setFieldBoolean (booleanValue , receiver , field );
2745
2746
break ;
2746
2747
case 'B' :
2747
2748
byte byteValue = (byte ) popInt (frame , top - 1 );
2748
2749
if (instrumentation != null ) {
2749
- instrumentation .notifyFieldModification (frame , statementIndex , field , receiver , byteValue );
2750
+ instrumentation .notifyFieldModification (frame , statementIndex , field , this , receiver , byteValue );
2750
2751
}
2751
2752
InterpreterToVM .setFieldByte (byteValue , receiver , field );
2752
2753
break ;
2753
2754
case 'C' :
2754
2755
char charValue = (char ) popInt (frame , top - 1 );
2755
2756
if (instrumentation != null ) {
2756
- instrumentation .notifyFieldModification (frame , statementIndex , field , receiver , charValue );
2757
+ instrumentation .notifyFieldModification (frame , statementIndex , field , this , receiver , charValue );
2757
2758
}
2758
2759
InterpreterToVM .setFieldChar (charValue , receiver , field );
2759
2760
break ;
2760
2761
case 'S' :
2761
2762
short shortValue = (short ) popInt (frame , top - 1 );
2762
2763
if (instrumentation != null ) {
2763
- instrumentation .notifyFieldModification (frame , statementIndex , field , receiver , shortValue );
2764
+ instrumentation .notifyFieldModification (frame , statementIndex , field , this , receiver , shortValue );
2764
2765
}
2765
2766
InterpreterToVM .setFieldShort (shortValue , receiver , field );
2766
2767
break ;
2767
2768
case 'I' :
2768
2769
int intValue = popInt (frame , top - 1 );
2769
2770
if (instrumentation != null ) {
2770
- instrumentation .notifyFieldModification (frame , statementIndex , field , receiver , intValue );
2771
+ instrumentation .notifyFieldModification (frame , statementIndex , field , this , receiver , intValue );
2771
2772
}
2772
2773
InterpreterToVM .setFieldInt (intValue , receiver , field );
2773
2774
break ;
2774
2775
case 'D' :
2775
2776
double doubleValue = popDouble (frame , top - 1 );
2776
2777
if (instrumentation != null ) {
2777
- instrumentation .notifyFieldModification (frame , statementIndex , field , receiver , doubleValue );
2778
+ instrumentation .notifyFieldModification (frame , statementIndex , field , this , receiver , doubleValue );
2778
2779
}
2779
2780
InterpreterToVM .setFieldDouble (doubleValue , receiver , field );
2780
2781
break ;
2781
2782
case 'F' :
2782
2783
float floatValue = popFloat (frame , top - 1 );
2783
2784
if (instrumentation != null ) {
2784
- instrumentation .notifyFieldModification (frame , statementIndex , field , receiver , floatValue );
2785
+ instrumentation .notifyFieldModification (frame , statementIndex , field , this , receiver , floatValue );
2785
2786
}
2786
2787
InterpreterToVM .setFieldFloat (floatValue , receiver , field );
2787
2788
break ;
2788
2789
case 'J' :
2789
2790
long longValue = popLong (frame , top - 1 );
2790
2791
if (instrumentation != null ) {
2791
- instrumentation .notifyFieldModification (frame , statementIndex , field , receiver , longValue );
2792
+ instrumentation .notifyFieldModification (frame , statementIndex , field , this , receiver , longValue );
2792
2793
}
2793
2794
InterpreterToVM .setFieldLong (longValue , receiver , field );
2794
2795
break ;
2795
2796
case '[' : // fall through
2796
2797
case 'L' :
2797
2798
StaticObject value = popObject (frame , top - 1 );
2798
2799
if (instrumentation != null ) {
2799
- instrumentation .notifyFieldModification (frame , statementIndex , field , receiver , value );
2800
+ instrumentation .notifyFieldModification (frame , statementIndex , field , this , receiver , value );
2800
2801
}
2801
2802
InterpreterToVM .setFieldObject (value , receiver , field );
2802
2803
break ;
@@ -2847,7 +2848,7 @@ private int getField(VirtualFrame frame, int top, Field field, int curBCI, int o
2847
2848
}
2848
2849
2849
2850
if (instrumentation != null ) {
2850
- instrumentation .notifyFieldAccess (frame , statementIndex , field , receiver );
2851
+ instrumentation .notifyFieldAccess (frame , statementIndex , field , this , receiver );
2851
2852
}
2852
2853
2853
2854
int resultAt = mode .isStatic () ? top : (top - 1 );
@@ -2901,14 +2902,14 @@ public String toString() {
2901
2902
public void notifyFieldModification (VirtualFrame frame , int index , Field field , StaticObject receiver , Object value ) {
2902
2903
// Notifications are only for Espresso objects
2903
2904
if (instrumentation != null && (noForeignObjects .isValid () || receiver .isEspressoObject ())) {
2904
- instrumentation .notifyFieldModification (frame , index , field , receiver , value );
2905
+ instrumentation .notifyFieldModification (frame , index , field , this , receiver , value );
2905
2906
}
2906
2907
}
2907
2908
2908
2909
public void notifyFieldAccess (VirtualFrame frame , int index , Field field , StaticObject receiver ) {
2909
2910
// Notifications are only for Espresso objects
2910
2911
if (instrumentation != null && (noForeignObjects .isValid () || receiver .isEspressoObject ())) {
2911
- instrumentation .notifyFieldAccess (frame , index , field , receiver );
2912
+ instrumentation .notifyFieldAccess (frame , index , field , this , receiver );
2912
2913
}
2913
2914
}
2914
2915
@@ -2980,7 +2981,7 @@ private static boolean assertionsEnabled() {
2980
2981
*/
2981
2982
void notifyStatementChange (VirtualFrame frame , int statementIndex , int nextStatementIndex , int targetBci ) {
2982
2983
assert statementIndex != nextStatementIndex ;
2983
- notifyStatementExit (frame , statementIndex );
2984
+ notifyStatementExit (frame , statementIndex , StaticObject . NULL );
2984
2985
setBCI (frame , targetBci );
2985
2986
notifyStatementEnter (frame , nextStatementIndex );
2986
2987
}
@@ -2995,20 +2996,26 @@ void notifyStatementResume(VirtualFrame frame, int statementIndex) {
2995
2996
resumeAt (frame , statementIndex );
2996
2997
}
2997
2998
2998
- void notifyStatementExit (VirtualFrame frame , int statementIndex ) {
2999
+ void notifyStatementExit (VirtualFrame frame , int statementIndex , Object returnValue ) {
2999
3000
CompilerAsserts .partialEvaluationConstant (statementIndex );
3000
- exitAt (frame , statementIndex , StaticObject . NULL );
3001
+ exitAt (frame , statementIndex , returnValue );
3001
3002
}
3002
3003
3003
3004
public void notifyEntry (VirtualFrame frame , AbstractInstrumentableBytecodeNode instrumentableNode ) {
3004
3005
if (context .shouldReportVMEvents () && method .getMethod ().hasActiveHook ()) {
3005
- context .reportOnMethodEntry (method , instrumentableNode .getScope (frame , true ));
3006
+ context .reportOnMethodEntry (method , instrumentableNode , instrumentableNode .getScope (frame , true ));
3006
3007
}
3007
3008
}
3008
3009
3009
3010
public void notifyResume (VirtualFrame frame , AbstractInstrumentableBytecodeNode instrumentableNode ) {
3010
3011
if (context .shouldReportVMEvents () && method .getMethod ().hasActiveHook ()) {
3011
- context .reportOnMethodEntry (method , instrumentableNode .getScope (frame , true ));
3012
+ context .reportOnMethodEntry (method , instrumentableNode , instrumentableNode .getScope (frame , true ));
3013
+ }
3014
+ }
3015
+
3016
+ public void notifyExit (@ SuppressWarnings ("unused" ) VirtualFrame frame , AbstractInstrumentableBytecodeNode instrumentableNode , Object returnValue ) {
3017
+ if (context .shouldReportVMEvents () && method .getMethod ().hasActiveHook ()) {
3018
+ context .reportOnMethodReturn (method , instrumentableNode , returnValue );
3012
3019
}
3013
3020
}
3014
3021
@@ -3028,17 +3035,17 @@ void notifyYieldAt(VirtualFrame frame, Object o, int statementIndex) {
3028
3035
probeNode .onYield (frame , o );
3029
3036
}
3030
3037
3031
- public void notifyFieldModification (VirtualFrame frame , int index , Field field , StaticObject receiver , Object value ) {
3038
+ public void notifyFieldModification (VirtualFrame frame , int index , Field field , AbstractInstrumentableBytecodeNode instrumentableNode , StaticObject receiver , Object value ) {
3032
3039
if (context .shouldReportVMEvents () && field .hasActiveBreakpoint ()) {
3033
- if (context .reportOnFieldModification (field , receiver , value )) {
3040
+ if (context .reportOnFieldModification (field , instrumentableNode , receiver , value )) {
3034
3041
enterAt (frame , index );
3035
3042
}
3036
3043
}
3037
3044
}
3038
3045
3039
- public void notifyFieldAccess (VirtualFrame frame , int index , Field field , StaticObject receiver ) {
3046
+ public void notifyFieldAccess (VirtualFrame frame , int index , Field field , AbstractInstrumentableBytecodeNode instrumentableNode , StaticObject receiver ) {
3040
3047
if (context .shouldReportVMEvents () && field .hasActiveBreakpoint ()) {
3041
- if (context .reportOnFieldAccess (field , receiver )) {
3048
+ if (context .reportOnFieldAccess (field , instrumentableNode , receiver )) {
3042
3049
enterAt (frame , index );
3043
3050
}
3044
3051
}
0 commit comments