6474243: suspicious jvmti code that uses oop unsafely across GC point

Mon, 24 Nov 2008 14:45:47 -0500

author
coleenp
date
Mon, 24 Nov 2008 14:45:47 -0500
changeset 885
b22701a8b88f
parent 884
171e581e8161
child 886
a60eabc24e2c
child 901
63d1bf926938

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

src/cpu/sparc/vm/templateTable_sparc.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/cpu/sparc/vm/templateTable_sparc.cpp	Sat Nov 22 00:16:09 2008 -0800
     1.2 +++ b/src/cpu/sparc/vm/templateTable_sparc.cpp	Mon Nov 24 14:45:47 2008 -0500
     1.3 @@ -2085,7 +2085,7 @@
     1.4      } else {
     1.5        if (has_tos) {
     1.6        // save object pointer before call_VM() clobbers it
     1.7 -        __ mov(Otos_i, Lscratch);
     1.8 +        __ push_ptr(Otos_i);  // put object on tos where GC wants it.
     1.9        } else {
    1.10          // Load top of stack (do not pop the value off the stack);
    1.11          __ ld_ptr(Lesp, Interpreter::expr_offset_in_bytes(0), Otos_i);
    1.12 @@ -2097,7 +2097,7 @@
    1.13      __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_field_access),
    1.14                 Otos_i, Rcache);
    1.15      if (!is_static && has_tos) {
    1.16 -      __ mov(Lscratch, Otos_i);  // restore object pointer
    1.17 +      __ pop_ptr(Otos_i);  // restore object pointer
    1.18        __ verify_oop(Otos_i);
    1.19      }
    1.20      __ get_cache_and_index_at_bcp(Rcache, index, 1);

mercurial