< prev index next >

src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp

Print this page




 308   jump_cc(Assembler::notEqual,
 309           RuntimeAddress(SharedRuntime::get_ic_miss_stub()));
 310   const int ic_cmp_size = LP64_ONLY(10) NOT_LP64(9);
 311   assert(UseCompressedClassPointers || offset() - start_offset == ic_cmp_size, "check alignment in emit_method_entry");
 312 }
 313 
 314 
 315 void C1_MacroAssembler::build_frame(int frame_size_in_bytes, int bang_size_in_bytes) {
 316   assert(bang_size_in_bytes >= frame_size_in_bytes, "stack bang size incorrect");
 317   // Make sure there is enough stack space for this method's activation.
 318   // Note that we do this before doing an enter(). This matches the
 319   // ordering of C2's stack overflow check / rsp decrement and allows
 320   // the SharedRuntime stack overflow handling to be consistent
 321   // between the two compilers.
 322   generate_stack_overflow_check(bang_size_in_bytes);
 323 
 324   push(rbp);
 325   if (PreserveFramePointer) {
 326     mov(rbp, rsp);
 327   }
 328 #ifdef TIERED
 329   // c2 leaves fpu stack dirty. Clean it on entry
 330   if (UseSSE < 2 ) {

 331     empty_FPU_stack();
 332   }
 333 #endif // TIERED
 334   decrement(rsp, frame_size_in_bytes); // does not emit code for frame_size == 0
 335 
 336   BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
 337   bs->nmethod_entry_barrier(this);
 338 }
 339 
 340 
 341 void C1_MacroAssembler::remove_frame(int frame_size_in_bytes) {
 342   increment(rsp, frame_size_in_bytes);  // Does not emit code for frame_size == 0
 343   pop(rbp);
 344 }
 345 
 346 
 347 void C1_MacroAssembler::verified_entry() {
 348   if (C1Breakpoint || VerifyFPU || !UseStackBanging) {
 349     // Verified Entry first instruction should be 5 bytes long for correct
 350     // patching by patch_verified_entry().
 351     //
 352     // C1Breakpoint and VerifyFPU have one byte first instruction.
 353     // Also first instruction will be one byte "push(rbp)" if stack banging
 354     // code is not generated (see build_frame() above).
 355     // For all these cases generate long instruction first.
 356     fat_nop();
 357   }
 358   if (C1Breakpoint)int3();
 359   // build frame
 360   verify_FPU(0, "method_entry");
 361 }
 362 
 363 void C1_MacroAssembler::load_parameter(int offset_in_words, Register reg) {
 364   // rbp, + 0: link
 365   //     + 1: return address
 366   //     + 2: argument with offset 0
 367   //     + 3: argument with offset 1
 368   //     + 4: ...
 369 
 370   movptr(reg, Address(rbp, (offset_in_words + 2) * BytesPerWord));
 371 }
 372 
 373 #ifndef PRODUCT
 374 
 375 void C1_MacroAssembler::verify_stack_oop(int stack_offset) {
 376   if (!VerifyOops) return;
 377   verify_oop_addr(Address(rsp, stack_offset));
 378 }
 379 
 380 void C1_MacroAssembler::verify_not_null_oop(Register r) {




 308   jump_cc(Assembler::notEqual,
 309           RuntimeAddress(SharedRuntime::get_ic_miss_stub()));
 310   const int ic_cmp_size = LP64_ONLY(10) NOT_LP64(9);
 311   assert(UseCompressedClassPointers || offset() - start_offset == ic_cmp_size, "check alignment in emit_method_entry");
 312 }
 313 
 314 
 315 void C1_MacroAssembler::build_frame(int frame_size_in_bytes, int bang_size_in_bytes) {
 316   assert(bang_size_in_bytes >= frame_size_in_bytes, "stack bang size incorrect");
 317   // Make sure there is enough stack space for this method's activation.
 318   // Note that we do this before doing an enter(). This matches the
 319   // ordering of C2's stack overflow check / rsp decrement and allows
 320   // the SharedRuntime stack overflow handling to be consistent
 321   // between the two compilers.
 322   generate_stack_overflow_check(bang_size_in_bytes);
 323 
 324   push(rbp);
 325   if (PreserveFramePointer) {
 326     mov(rbp, rsp);
 327   }
 328 #if !defined(_LP64) && defined(TIERED)

 329   if (UseSSE < 2 ) {
 330     // c2 leaves fpu stack dirty. Clean it on entry
 331     empty_FPU_stack();
 332   }
 333 #endif // !_LP64 && TIERED
 334   decrement(rsp, frame_size_in_bytes); // does not emit code for frame_size == 0
 335 
 336   BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
 337   bs->nmethod_entry_barrier(this);
 338 }
 339 
 340 
 341 void C1_MacroAssembler::remove_frame(int frame_size_in_bytes) {
 342   increment(rsp, frame_size_in_bytes);  // Does not emit code for frame_size == 0
 343   pop(rbp);
 344 }
 345 
 346 
 347 void C1_MacroAssembler::verified_entry() {
 348   if (C1Breakpoint || VerifyFPU || !UseStackBanging) {
 349     // Verified Entry first instruction should be 5 bytes long for correct
 350     // patching by patch_verified_entry().
 351     //
 352     // C1Breakpoint and VerifyFPU have one byte first instruction.
 353     // Also first instruction will be one byte "push(rbp)" if stack banging
 354     // code is not generated (see build_frame() above).
 355     // For all these cases generate long instruction first.
 356     fat_nop();
 357   }
 358   if (C1Breakpoint)int3();
 359   // build frame
 360   IA32_ONLY( verify_FPU(0, "method_entry"); )
 361 }
 362 
 363 void C1_MacroAssembler::load_parameter(int offset_in_words, Register reg) {
 364   // rbp, + 0: link
 365   //     + 1: return address
 366   //     + 2: argument with offset 0
 367   //     + 3: argument with offset 1
 368   //     + 4: ...
 369 
 370   movptr(reg, Address(rbp, (offset_in_words + 2) * BytesPerWord));
 371 }
 372 
 373 #ifndef PRODUCT
 374 
 375 void C1_MacroAssembler::verify_stack_oop(int stack_offset) {
 376   if (!VerifyOops) return;
 377   verify_oop_addr(Address(rsp, stack_offset));
 378 }
 379 
 380 void C1_MacroAssembler::verify_not_null_oop(Register r) {


< prev index next >