src/cpu/x86/vm/c1_MacroAssembler_x86.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8068945-8u-patched Sdiff src/cpu/x86/vm

src/cpu/x86/vm/c1_MacroAssembler_x86.cpp

Print this page
rev 7386 : 8068945: Use RBP register as proper frame pointer in JIT compiled code on x86
Summary: Introduce the PreserveFramePointer flag to control if RBP is used as the frame pointer or as a general purpose register.
Reviewed-by: kvn, roland, dlong, enevill, shade


 342   }
 343   // if icache check fails, then jump to runtime routine
 344   // Note: RECEIVER must still contain the receiver!
 345   jump_cc(Assembler::notEqual,
 346           RuntimeAddress(SharedRuntime::get_ic_miss_stub()));
 347   const int ic_cmp_size = LP64_ONLY(10) NOT_LP64(9);
 348   assert(UseCompressedClassPointers || offset() - start_offset == ic_cmp_size, "check alignment in emit_method_entry");
 349 }
 350 
 351 
 352 void C1_MacroAssembler::build_frame(int frame_size_in_bytes, int bang_size_in_bytes) {
 353   assert(bang_size_in_bytes >= frame_size_in_bytes, "stack bang size incorrect");
 354   // Make sure there is enough stack space for this method's activation.
 355   // Note that we do this before doing an enter(). This matches the
 356   // ordering of C2's stack overflow check / rsp decrement and allows
 357   // the SharedRuntime stack overflow handling to be consistent
 358   // between the two compilers.
 359   generate_stack_overflow_check(bang_size_in_bytes);
 360 
 361   push(rbp);



 362 #ifdef TIERED
 363   // c2 leaves fpu stack dirty. Clean it on entry
 364   if (UseSSE < 2 ) {
 365     empty_FPU_stack();
 366   }
 367 #endif // TIERED
 368   decrement(rsp, frame_size_in_bytes); // does not emit code for frame_size == 0
 369 }
 370 
 371 
 372 void C1_MacroAssembler::remove_frame(int frame_size_in_bytes) {
 373   increment(rsp, frame_size_in_bytes);  // Does not emit code for frame_size == 0
 374   pop(rbp);
 375 }
 376 
 377 
 378 void C1_MacroAssembler::unverified_entry(Register receiver, Register ic_klass) {
 379   if (C1Breakpoint) int3();
 380   inline_cache_check(receiver, ic_klass);
 381 }




 342   }
 343   // if icache check fails, then jump to runtime routine
 344   // Note: RECEIVER must still contain the receiver!
 345   jump_cc(Assembler::notEqual,
 346           RuntimeAddress(SharedRuntime::get_ic_miss_stub()));
 347   const int ic_cmp_size = LP64_ONLY(10) NOT_LP64(9);
 348   assert(UseCompressedClassPointers || offset() - start_offset == ic_cmp_size, "check alignment in emit_method_entry");
 349 }
 350 
 351 
 352 void C1_MacroAssembler::build_frame(int frame_size_in_bytes, int bang_size_in_bytes) {
 353   assert(bang_size_in_bytes >= frame_size_in_bytes, "stack bang size incorrect");
 354   // Make sure there is enough stack space for this method's activation.
 355   // Note that we do this before doing an enter(). This matches the
 356   // ordering of C2's stack overflow check / rsp decrement and allows
 357   // the SharedRuntime stack overflow handling to be consistent
 358   // between the two compilers.
 359   generate_stack_overflow_check(bang_size_in_bytes);
 360 
 361   push(rbp);
 362   if (PreserveFramePointer) {
 363     mov(rbp, rsp);
 364   }
 365 #ifdef TIERED
 366   // c2 leaves fpu stack dirty. Clean it on entry
 367   if (UseSSE < 2 ) {
 368     empty_FPU_stack();
 369   }
 370 #endif // TIERED
 371   decrement(rsp, frame_size_in_bytes); // does not emit code for frame_size == 0
 372 }
 373 
 374 
 375 void C1_MacroAssembler::remove_frame(int frame_size_in_bytes) {
 376   increment(rsp, frame_size_in_bytes);  // Does not emit code for frame_size == 0
 377   pop(rbp);
 378 }
 379 
 380 
 381 void C1_MacroAssembler::unverified_entry(Register receiver, Register ic_klass) {
 382   if (C1Breakpoint) int3();
 383   inline_cache_check(receiver, ic_klass);
 384 }


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