< prev index next >

src/hotspot/cpu/x86/templateTable_x86.cpp

Print this page




 430   // non-null object (String, MethodType, etc.)
 431   assert_different_registers(result, tmp);
 432   __ get_cache_index_at_bcp(tmp, 1, index_size);
 433   __ load_resolved_reference_at_index(result, tmp);
 434   __ testptr(result, result);
 435   __ jcc(Assembler::notZero, resolved);
 436 
 437   address entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_ldc);
 438 
 439   // first time invocation - must resolve first
 440   __ movl(rarg, (int)bytecode());
 441   __ call_VM(result, entry, rarg);
 442   __ bind(resolved);
 443 
 444   { // Check for the null sentinel.
 445     // If we just called the VM, it already did the mapping for us,
 446     // but it's harmless to retry.
 447     Label notNull;
 448     ExternalAddress null_sentinel((address)Universe::the_null_sentinel_addr());
 449     __ movptr(tmp, null_sentinel);
 450     __ cmpptr(tmp, result);
 451     __ jccb(Assembler::notEqual, notNull);
 452     __ xorptr(result, result);  // NULL object reference
 453     __ bind(notNull);
 454   }
 455 
 456   if (VerifyOops) {
 457     __ verify_oop(result);
 458   }
 459 }
 460 
 461 void TemplateTable::ldc2_w() {
 462   transition(vtos, vtos);
 463   Label notDouble, notLong, Done;
 464   __ get_unsigned_2_byte_index_at_bcp(rbx, 1);
 465 
 466   __ get_cpool_and_tags(rcx, rax);
 467   const int base_offset = ConstantPool::header_size() * wordSize;
 468   const int tags_offset = Array<u1>::base_offset_in_bytes();
 469 
 470   // get type


4340 // Note: monitorenter & exit are symmetric routines; which is reflected
4341 //       in the assembly code structure as well
4342 //
4343 // Stack layout:
4344 //
4345 // [expressions  ] <--- rsp               = expression stack top
4346 // ..
4347 // [expressions  ]
4348 // [monitor entry] <--- monitor block top = expression stack bot
4349 // ..
4350 // [monitor entry]
4351 // [frame data   ] <--- monitor block bot
4352 // ...
4353 // [saved rbp    ] <--- rbp
4354 void TemplateTable::monitorenter() {
4355   transition(atos, vtos);
4356 
4357   // check for NULL object
4358   __ null_check(rax);
4359 


4360   const Address monitor_block_top(
4361         rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
4362   const Address monitor_block_bot(
4363         rbp, frame::interpreter_frame_initial_sp_offset * wordSize);
4364   const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
4365 
4366   Label allocated;
4367 
4368   Register rtop = LP64_ONLY(c_rarg3) NOT_LP64(rcx);
4369   Register rbot = LP64_ONLY(c_rarg2) NOT_LP64(rbx);
4370   Register rmon = LP64_ONLY(c_rarg1) NOT_LP64(rdx);
4371 
4372   // initialize entry pointer
4373   __ xorl(rmon, rmon); // points to free slot or NULL
4374 
4375   // find a free slot in the monitor block (result in rmon)
4376   {
4377     Label entry, loop, exit;
4378     __ movptr(rtop, monitor_block_top); // points to current entry,
4379                                         // starting with top-most entry


4436   __ increment(rbcp);
4437 
4438   // store object
4439   __ movptr(Address(rmon, BasicObjectLock::obj_offset_in_bytes()), rax);
4440   __ lock_object(rmon);
4441 
4442   // check to make sure this monitor doesn't cause stack overflow after locking
4443   __ save_bcp();  // in case of exception
4444   __ generate_stack_overflow_check(0);
4445 
4446   // The bcp has already been incremented. Just need to dispatch to
4447   // next instruction.
4448   __ dispatch_next(vtos);
4449 }
4450 
4451 void TemplateTable::monitorexit() {
4452   transition(atos, vtos);
4453 
4454   // check for NULL object
4455   __ null_check(rax);


4456 
4457   const Address monitor_block_top(
4458         rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
4459   const Address monitor_block_bot(
4460         rbp, frame::interpreter_frame_initial_sp_offset * wordSize);
4461   const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
4462 
4463   Register rtop = LP64_ONLY(c_rarg1) NOT_LP64(rdx);
4464   Register rbot = LP64_ONLY(c_rarg2) NOT_LP64(rbx);
4465 
4466   Label found;
4467 
4468   // find matching slot
4469   {
4470     Label entry, loop;
4471     __ movptr(rtop, monitor_block_top); // points to current entry,
4472                                         // starting with top-most entry
4473     __ lea(rbot, monitor_block_bot);    // points to word before bottom
4474                                         // of monitor block
4475     __ jmpb(entry);




 430   // non-null object (String, MethodType, etc.)
 431   assert_different_registers(result, tmp);
 432   __ get_cache_index_at_bcp(tmp, 1, index_size);
 433   __ load_resolved_reference_at_index(result, tmp);
 434   __ testptr(result, result);
 435   __ jcc(Assembler::notZero, resolved);
 436 
 437   address entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_ldc);
 438 
 439   // first time invocation - must resolve first
 440   __ movl(rarg, (int)bytecode());
 441   __ call_VM(result, entry, rarg);
 442   __ bind(resolved);
 443 
 444   { // Check for the null sentinel.
 445     // If we just called the VM, it already did the mapping for us,
 446     // but it's harmless to retry.
 447     Label notNull;
 448     ExternalAddress null_sentinel((address)Universe::the_null_sentinel_addr());
 449     __ movptr(tmp, null_sentinel);
 450     __ cmpoop(tmp, result);
 451     __ jccb(Assembler::notEqual, notNull);
 452     __ xorptr(result, result);  // NULL object reference
 453     __ bind(notNull);
 454   }
 455 
 456   if (VerifyOops) {
 457     __ verify_oop(result);
 458   }
 459 }
 460 
 461 void TemplateTable::ldc2_w() {
 462   transition(vtos, vtos);
 463   Label notDouble, notLong, Done;
 464   __ get_unsigned_2_byte_index_at_bcp(rbx, 1);
 465 
 466   __ get_cpool_and_tags(rcx, rax);
 467   const int base_offset = ConstantPool::header_size() * wordSize;
 468   const int tags_offset = Array<u1>::base_offset_in_bytes();
 469 
 470   // get type


4340 // Note: monitorenter & exit are symmetric routines; which is reflected
4341 //       in the assembly code structure as well
4342 //
4343 // Stack layout:
4344 //
4345 // [expressions  ] <--- rsp               = expression stack top
4346 // ..
4347 // [expressions  ]
4348 // [monitor entry] <--- monitor block top = expression stack bot
4349 // ..
4350 // [monitor entry]
4351 // [frame data   ] <--- monitor block bot
4352 // ...
4353 // [saved rbp    ] <--- rbp
4354 void TemplateTable::monitorenter() {
4355   transition(atos, vtos);
4356 
4357   // check for NULL object
4358   __ null_check(rax);
4359 
4360   __ resolve_for_write(IS_NOT_NULL, rax);
4361 
4362   const Address monitor_block_top(
4363         rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
4364   const Address monitor_block_bot(
4365         rbp, frame::interpreter_frame_initial_sp_offset * wordSize);
4366   const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
4367 
4368   Label allocated;
4369 
4370   Register rtop = LP64_ONLY(c_rarg3) NOT_LP64(rcx);
4371   Register rbot = LP64_ONLY(c_rarg2) NOT_LP64(rbx);
4372   Register rmon = LP64_ONLY(c_rarg1) NOT_LP64(rdx);
4373 
4374   // initialize entry pointer
4375   __ xorl(rmon, rmon); // points to free slot or NULL
4376 
4377   // find a free slot in the monitor block (result in rmon)
4378   {
4379     Label entry, loop, exit;
4380     __ movptr(rtop, monitor_block_top); // points to current entry,
4381                                         // starting with top-most entry


4438   __ increment(rbcp);
4439 
4440   // store object
4441   __ movptr(Address(rmon, BasicObjectLock::obj_offset_in_bytes()), rax);
4442   __ lock_object(rmon);
4443 
4444   // check to make sure this monitor doesn't cause stack overflow after locking
4445   __ save_bcp();  // in case of exception
4446   __ generate_stack_overflow_check(0);
4447 
4448   // The bcp has already been incremented. Just need to dispatch to
4449   // next instruction.
4450   __ dispatch_next(vtos);
4451 }
4452 
4453 void TemplateTable::monitorexit() {
4454   transition(atos, vtos);
4455 
4456   // check for NULL object
4457   __ null_check(rax);
4458 
4459   __ resolve_for_write(IS_NOT_NULL, rax);
4460 
4461   const Address monitor_block_top(
4462         rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
4463   const Address monitor_block_bot(
4464         rbp, frame::interpreter_frame_initial_sp_offset * wordSize);
4465   const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
4466 
4467   Register rtop = LP64_ONLY(c_rarg1) NOT_LP64(rdx);
4468   Register rbot = LP64_ONLY(c_rarg2) NOT_LP64(rbx);
4469 
4470   Label found;
4471 
4472   // find matching slot
4473   {
4474     Label entry, loop;
4475     __ movptr(rtop, monitor_block_top); // points to current entry,
4476                                         // starting with top-most entry
4477     __ lea(rbot, monitor_block_bot);    // points to word before bottom
4478                                         // of monitor block
4479     __ jmpb(entry);


< prev index next >