src/cpu/sparc/vm/templateInterpreter_sparc.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 7118863 Sdiff src/cpu/sparc/vm

src/cpu/sparc/vm/templateInterpreter_sparc.cpp

Print this page




 349 }
 350 
 351 // Allocate monitor and lock method (asm interpreter)
 352 // ebx - methodOop
 353 //
 354 void InterpreterGenerator::lock_method(void) {
 355   __ ld(Lmethod, in_bytes(methodOopDesc::access_flags_offset()), O0);  // Load access flags.
 356 
 357 #ifdef ASSERT
 358  { Label ok;
 359    __ btst(JVM_ACC_SYNCHRONIZED, O0);
 360    __ br( Assembler::notZero, false, Assembler::pt, ok);
 361    __ delayed()->nop();
 362    __ stop("method doesn't need synchronization");
 363    __ bind(ok);
 364   }
 365 #endif // ASSERT
 366 
 367   // get synchronization object to O0
 368   { Label done;
 369     const int mirror_offset = klassOopDesc::klass_part_offset_in_bytes() + Klass::java_mirror_offset_in_bytes();
 370     __ btst(JVM_ACC_STATIC, O0);
 371     __ br( Assembler::zero, true, Assembler::pt, done);
 372     __ delayed()->ld_ptr(Llocals, Interpreter::local_offset_in_bytes(0), O0); // get receiver for not-static case
 373 
 374     __ ld_ptr( Lmethod, in_bytes(methodOopDesc::constants_offset()), O0);
 375     __ ld_ptr( O0, constantPoolOopDesc::pool_holder_offset_in_bytes(), O0);
 376 
 377     // lock the mirror, not the klassOop
 378     __ ld_ptr( O0, mirror_offset, O0);
 379 
 380 #ifdef ASSERT
 381     __ tst(O0);
 382     __ breakpoint_trap(Assembler::zero);
 383 #endif // ASSERT
 384 
 385     __ bind(done);
 386   }
 387 
 388   __ add_monitor_to_stack(true, noreg, noreg);  // allocate monitor elem
 389   __ st_ptr( O0, Lmonitors, BasicObjectLock::obj_offset_in_bytes());   // store object


 967 
 968   // call signature handler, It will move the arg properly since Llocals in current frame
 969   // matches that in outer frame
 970 
 971   __ callr(G3_scratch, 0);
 972   __ delayed()->nop();
 973 
 974   // Result handler is in Lscratch
 975 
 976   // Reload interpreter frame's Lmethod since slow signature handler may block
 977   __ ld_ptr(FP, (Lmethod->sp_offset_in_saved_window() * wordSize) + STACK_BIAS, Lmethod);
 978 
 979   { Label not_static;
 980 
 981     __ ld(Laccess_flags, O0);
 982     __ btst(JVM_ACC_STATIC, O0);
 983     __ br( Assembler::zero, false, Assembler::pt, not_static);
 984     // get native function entry point(O0 is a good temp until the very end)
 985     __ delayed()->ld_ptr(Lmethod, in_bytes(methodOopDesc::native_function_offset()), O0);
 986     // for static methods insert the mirror argument
 987     const int mirror_offset = klassOopDesc::klass_part_offset_in_bytes() + Klass::java_mirror_offset_in_bytes();
 988 
 989     __ ld_ptr(Lmethod, methodOopDesc:: constants_offset(), O1);
 990     __ ld_ptr(O1, constantPoolOopDesc::pool_holder_offset_in_bytes(), O1);
 991     __ ld_ptr(O1, mirror_offset, O1);
 992 #ifdef ASSERT
 993     if (!PrintSignatureHandlers)  // do not dirty the output with this
 994     { Label L;
 995       __ br_notnull_short(O1, Assembler::pt, L);
 996       __ stop("mirror is missing");
 997       __ bind(L);
 998     }
 999 #endif // ASSERT
1000     __ st_ptr(O1, Lscratch2, 0);
1001     __ mov(Lscratch2, O1);
1002     __ bind(not_static);
1003   }
1004 
1005   // At this point, arguments have been copied off of stack into
1006   // their JNI positions, which are O1..O5 and SP[68..].
1007   // Oops are boxed in-place on the stack, with handles copied to arguments.




 349 }
 350 
 351 // Allocate monitor and lock method (asm interpreter)
 352 // ebx - methodOop
 353 //
 354 void InterpreterGenerator::lock_method(void) {
 355   __ ld(Lmethod, in_bytes(methodOopDesc::access_flags_offset()), O0);  // Load access flags.
 356 
 357 #ifdef ASSERT
 358  { Label ok;
 359    __ btst(JVM_ACC_SYNCHRONIZED, O0);
 360    __ br( Assembler::notZero, false, Assembler::pt, ok);
 361    __ delayed()->nop();
 362    __ stop("method doesn't need synchronization");
 363    __ bind(ok);
 364   }
 365 #endif // ASSERT
 366 
 367   // get synchronization object to O0
 368   { Label done;
 369     const int mirror_offset = Klass::java_mirror_offset_in_bytes();
 370     __ btst(JVM_ACC_STATIC, O0);
 371     __ br( Assembler::zero, true, Assembler::pt, done);
 372     __ delayed()->ld_ptr(Llocals, Interpreter::local_offset_in_bytes(0), O0); // get receiver for not-static case
 373 
 374     __ ld_ptr( Lmethod, in_bytes(methodOopDesc::constants_offset()), O0);
 375     __ ld_ptr( O0, constantPoolOopDesc::pool_holder_offset_in_bytes(), O0);
 376 
 377     // lock the mirror, not the klassOop
 378     __ ld_ptr( O0, mirror_offset, O0);
 379 
 380 #ifdef ASSERT
 381     __ tst(O0);
 382     __ breakpoint_trap(Assembler::zero);
 383 #endif // ASSERT
 384 
 385     __ bind(done);
 386   }
 387 
 388   __ add_monitor_to_stack(true, noreg, noreg);  // allocate monitor elem
 389   __ st_ptr( O0, Lmonitors, BasicObjectLock::obj_offset_in_bytes());   // store object


 967 
 968   // call signature handler, It will move the arg properly since Llocals in current frame
 969   // matches that in outer frame
 970 
 971   __ callr(G3_scratch, 0);
 972   __ delayed()->nop();
 973 
 974   // Result handler is in Lscratch
 975 
 976   // Reload interpreter frame's Lmethod since slow signature handler may block
 977   __ ld_ptr(FP, (Lmethod->sp_offset_in_saved_window() * wordSize) + STACK_BIAS, Lmethod);
 978 
 979   { Label not_static;
 980 
 981     __ ld(Laccess_flags, O0);
 982     __ btst(JVM_ACC_STATIC, O0);
 983     __ br( Assembler::zero, false, Assembler::pt, not_static);
 984     // get native function entry point(O0 is a good temp until the very end)
 985     __ delayed()->ld_ptr(Lmethod, in_bytes(methodOopDesc::native_function_offset()), O0);
 986     // for static methods insert the mirror argument
 987     const int mirror_offset = Klass::java_mirror_offset_in_bytes();
 988 
 989     __ ld_ptr(Lmethod, methodOopDesc:: constants_offset(), O1);
 990     __ ld_ptr(O1, constantPoolOopDesc::pool_holder_offset_in_bytes(), O1);
 991     __ ld_ptr(O1, mirror_offset, O1);
 992 #ifdef ASSERT
 993     if (!PrintSignatureHandlers)  // do not dirty the output with this
 994     { Label L;
 995       __ br_notnull_short(O1, Assembler::pt, L);
 996       __ stop("mirror is missing");
 997       __ bind(L);
 998     }
 999 #endif // ASSERT
1000     __ st_ptr(O1, Lscratch2, 0);
1001     __ mov(Lscratch2, O1);
1002     __ bind(not_static);
1003   }
1004 
1005   // At this point, arguments have been copied off of stack into
1006   // their JNI positions, which are O1..O5 and SP[68..].
1007   // Oops are boxed in-place on the stack, with handles copied to arguments.


src/cpu/sparc/vm/templateInterpreter_sparc.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File