6474243: suspicious jvmti code that uses oop unsafely across GC point
authorcoleenp
Mon, 24 Nov 2008 14:45:47 -0500
changeset 1603 720c1119ad5e
parent 1602 6859fd21ba2b
child 1604 6d43194ed39c
child 1619 c6ee85e55858
6474243: suspicious jvmti code that uses oop unsafely across GC point Summary: oop stored in unsafely in Lscratch noticed by visual inspection will not be updated by GC. Reviewed-by: kamg, never, kvn
hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
--- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp	Sat Nov 22 00:16:09 2008 -0800
+++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp	Mon Nov 24 14:45:47 2008 -0500
@@ -2085,7 +2085,7 @@
     } else {
       if (has_tos) {
       // save object pointer before call_VM() clobbers it
-        __ mov(Otos_i, Lscratch);
+        __ push_ptr(Otos_i);  // put object on tos where GC wants it.
       } else {
         // Load top of stack (do not pop the value off the stack);
         __ ld_ptr(Lesp, Interpreter::expr_offset_in_bytes(0), Otos_i);
@@ -2097,7 +2097,7 @@
     __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_field_access),
                Otos_i, Rcache);
     if (!is_static && has_tos) {
-      __ mov(Lscratch, Otos_i);  // restore object pointer
+      __ pop_ptr(Otos_i);  // restore object pointer
       __ verify_oop(Otos_i);
     }
     __ get_cache_and_index_at_bcp(Rcache, index, 1);