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

src/cpu/x86/vm/templateInterpreter_x86_32.cpp

Print this page




 535 // Allocate monitor and lock method (asm interpreter)
 536 // rbx, - methodOop
 537 //
 538 void InterpreterGenerator::lock_method(void) {
 539   // synchronize method
 540   const Address access_flags      (rbx, methodOopDesc::access_flags_offset());
 541   const Address monitor_block_top (rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
 542   const int entry_size            = frame::interpreter_frame_monitor_size() * wordSize;
 543 
 544   #ifdef ASSERT
 545     { Label L;
 546       __ movl(rax, access_flags);
 547       __ testl(rax, JVM_ACC_SYNCHRONIZED);
 548       __ jcc(Assembler::notZero, L);
 549       __ stop("method doesn't need synchronization");
 550       __ bind(L);
 551     }
 552   #endif // ASSERT
 553   // get synchronization object
 554   { Label done;
 555     const int mirror_offset = klassOopDesc::klass_part_offset_in_bytes() + Klass::java_mirror_offset_in_bytes();
 556     __ movl(rax, access_flags);
 557     __ testl(rax, JVM_ACC_STATIC);
 558     __ movptr(rax, Address(rdi, Interpreter::local_offset_in_bytes(0)));  // get receiver (assume this is frequent case)
 559     __ jcc(Assembler::zero, done);
 560     __ movptr(rax, Address(rbx, methodOopDesc::constants_offset()));
 561     __ movptr(rax, Address(rax, constantPoolOopDesc::pool_holder_offset_in_bytes()));
 562     __ movptr(rax, Address(rax, mirror_offset));
 563     __ bind(done);
 564   }
 565   // add space for monitor & lock
 566   __ subptr(rsp, entry_size);                                           // add space for a monitor entry
 567   __ movptr(monitor_block_top, rsp);                                    // set new monitor block top
 568   __ movptr(Address(rsp, BasicObjectLock::obj_offset_in_bytes()), rax); // store object
 569   __ mov(rdx, rsp);                                                    // object address
 570   __ lock_object(rdx);
 571 }
 572 
 573 //
 574 // Generate a fixed interpreter frame. This is identical setup for interpreted methods
 575 // and for native methods hence the shared code.


 995     __ bind(L);
 996   }
 997 
 998   // call signature handler
 999   assert(InterpreterRuntime::SignatureHandlerGenerator::from() == rdi, "adjust this code");
1000   assert(InterpreterRuntime::SignatureHandlerGenerator::to  () == rsp, "adjust this code");
1001   assert(InterpreterRuntime::SignatureHandlerGenerator::temp() == t  , "adjust this code");
1002   // The generated handlers do not touch RBX (the method oop).
1003   // However, large signatures cannot be cached and are generated
1004   // each time here.  The slow-path generator will blow RBX
1005   // sometime, so we must reload it after the call.
1006   __ call(t);
1007   __ get_method(method);        // slow path call blows RBX on DevStudio 5.0
1008 
1009   // result handler is in rax,
1010   // set result handler
1011   __ movptr(Address(rbp, frame::interpreter_frame_result_handler_offset*wordSize), rax);
1012 
1013   // pass mirror handle if static call
1014   { Label L;
1015     const int mirror_offset = klassOopDesc::klass_part_offset_in_bytes() + Klass::java_mirror_offset_in_bytes();
1016     __ movl(t, Address(method, methodOopDesc::access_flags_offset()));
1017     __ testl(t, JVM_ACC_STATIC);
1018     __ jcc(Assembler::zero, L);
1019     // get mirror
1020     __ movptr(t, Address(method, methodOopDesc:: constants_offset()));
1021     __ movptr(t, Address(t, constantPoolOopDesc::pool_holder_offset_in_bytes()));
1022     __ movptr(t, Address(t, mirror_offset));
1023     // copy mirror into activation frame
1024     __ movptr(Address(rbp, frame::interpreter_frame_oop_temp_offset * wordSize), t);
1025     // pass handle to mirror
1026     __ lea(t, Address(rbp, frame::interpreter_frame_oop_temp_offset * wordSize));
1027     __ movptr(Address(rsp, wordSize), t);
1028     __ bind(L);
1029   }
1030 
1031   // get native function entry point
1032   { Label L;
1033     __ movptr(rax, Address(method, methodOopDesc::native_function_offset()));
1034     ExternalAddress unsatisfied(SharedRuntime::native_method_throw_unsatisfied_link_error_entry());
1035     __ cmpptr(rax, unsatisfied.addr());




 535 // Allocate monitor and lock method (asm interpreter)
 536 // rbx, - methodOop
 537 //
 538 void InterpreterGenerator::lock_method(void) {
 539   // synchronize method
 540   const Address access_flags      (rbx, methodOopDesc::access_flags_offset());
 541   const Address monitor_block_top (rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
 542   const int entry_size            = frame::interpreter_frame_monitor_size() * wordSize;
 543 
 544   #ifdef ASSERT
 545     { Label L;
 546       __ movl(rax, access_flags);
 547       __ testl(rax, JVM_ACC_SYNCHRONIZED);
 548       __ jcc(Assembler::notZero, L);
 549       __ stop("method doesn't need synchronization");
 550       __ bind(L);
 551     }
 552   #endif // ASSERT
 553   // get synchronization object
 554   { Label done;
 555     const int mirror_offset = in_bytes(Klass::java_mirror_offset());
 556     __ movl(rax, access_flags);
 557     __ testl(rax, JVM_ACC_STATIC);
 558     __ movptr(rax, Address(rdi, Interpreter::local_offset_in_bytes(0)));  // get receiver (assume this is frequent case)
 559     __ jcc(Assembler::zero, done);
 560     __ movptr(rax, Address(rbx, methodOopDesc::constants_offset()));
 561     __ movptr(rax, Address(rax, constantPoolOopDesc::pool_holder_offset_in_bytes()));
 562     __ movptr(rax, Address(rax, mirror_offset));
 563     __ bind(done);
 564   }
 565   // add space for monitor & lock
 566   __ subptr(rsp, entry_size);                                           // add space for a monitor entry
 567   __ movptr(monitor_block_top, rsp);                                    // set new monitor block top
 568   __ movptr(Address(rsp, BasicObjectLock::obj_offset_in_bytes()), rax); // store object
 569   __ mov(rdx, rsp);                                                    // object address
 570   __ lock_object(rdx);
 571 }
 572 
 573 //
 574 // Generate a fixed interpreter frame. This is identical setup for interpreted methods
 575 // and for native methods hence the shared code.


 995     __ bind(L);
 996   }
 997 
 998   // call signature handler
 999   assert(InterpreterRuntime::SignatureHandlerGenerator::from() == rdi, "adjust this code");
1000   assert(InterpreterRuntime::SignatureHandlerGenerator::to  () == rsp, "adjust this code");
1001   assert(InterpreterRuntime::SignatureHandlerGenerator::temp() == t  , "adjust this code");
1002   // The generated handlers do not touch RBX (the method oop).
1003   // However, large signatures cannot be cached and are generated
1004   // each time here.  The slow-path generator will blow RBX
1005   // sometime, so we must reload it after the call.
1006   __ call(t);
1007   __ get_method(method);        // slow path call blows RBX on DevStudio 5.0
1008 
1009   // result handler is in rax,
1010   // set result handler
1011   __ movptr(Address(rbp, frame::interpreter_frame_result_handler_offset*wordSize), rax);
1012 
1013   // pass mirror handle if static call
1014   { Label L;
1015     const int mirror_offset = in_bytes(Klass::java_mirror_offset());
1016     __ movl(t, Address(method, methodOopDesc::access_flags_offset()));
1017     __ testl(t, JVM_ACC_STATIC);
1018     __ jcc(Assembler::zero, L);
1019     // get mirror
1020     __ movptr(t, Address(method, methodOopDesc:: constants_offset()));
1021     __ movptr(t, Address(t, constantPoolOopDesc::pool_holder_offset_in_bytes()));
1022     __ movptr(t, Address(t, mirror_offset));
1023     // copy mirror into activation frame
1024     __ movptr(Address(rbp, frame::interpreter_frame_oop_temp_offset * wordSize), t);
1025     // pass handle to mirror
1026     __ lea(t, Address(rbp, frame::interpreter_frame_oop_temp_offset * wordSize));
1027     __ movptr(Address(rsp, wordSize), t);
1028     __ bind(L);
1029   }
1030 
1031   // get native function entry point
1032   { Label L;
1033     __ movptr(rax, Address(method, methodOopDesc::native_function_offset()));
1034     ExternalAddress unsatisfied(SharedRuntime::native_method_throw_unsatisfied_link_error_entry());
1035     __ cmpptr(rax, unsatisfied.addr());


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