Mercurial > hg > graal-compiler
comparison src/cpu/x86/vm/macroAssembler_x86.cpp @ 17980:0bf37f737702
8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
Summary: make compiled code bang the stack by the worst case size of the interpreter frame at deoptimization points.
Reviewed-by: twisti, kvn
author | roland |
---|---|
date | Tue, 01 Apr 2014 09:36:49 +0200 |
parents | 78bbf4d43a14 |
children | 52b4284cb496 b1bc1af04c6e |
comparison
equal
deleted
inserted
replaced
17978:ad51f24671c2 | 17980:0bf37f737702 |
---|---|
1050 // At this point, (tmp-0) is the last address touched, so don't | 1050 // At this point, (tmp-0) is the last address touched, so don't |
1051 // touch it again. (It was touched as (tmp-pagesize) but then tmp | 1051 // touch it again. (It was touched as (tmp-pagesize) but then tmp |
1052 // was post-decremented.) Skip this address by starting at i=1, and | 1052 // was post-decremented.) Skip this address by starting at i=1, and |
1053 // touch a few more pages below. N.B. It is important to touch all | 1053 // touch a few more pages below. N.B. It is important to touch all |
1054 // the way down to and including i=StackShadowPages. | 1054 // the way down to and including i=StackShadowPages. |
1055 for (int i = 1; i <= StackShadowPages; i++) { | 1055 for (int i = 1; i < StackShadowPages; i++) { |
1056 // this could be any sized move but this is can be a debugging crumb | 1056 // this could be any sized move but this is can be a debugging crumb |
1057 // so the bigger the better. | 1057 // so the bigger the better. |
1058 movptr(Address(tmp, (-i*os::vm_page_size())), size ); | 1058 movptr(Address(tmp, (-i*os::vm_page_size())), size ); |
1059 } | 1059 } |
1060 } | 1060 } |
6094 | 6094 |
6095 #endif // _LP64 | 6095 #endif // _LP64 |
6096 | 6096 |
6097 | 6097 |
6098 // C2 compiled method's prolog code. | 6098 // C2 compiled method's prolog code. |
6099 void MacroAssembler::verified_entry(int framesize, bool stack_bang, bool fp_mode_24b) { | 6099 void MacroAssembler::verified_entry(int framesize, int stack_bang_size, bool fp_mode_24b) { |
6100 | 6100 |
6101 // WARNING: Initial instruction MUST be 5 bytes or longer so that | 6101 // WARNING: Initial instruction MUST be 5 bytes or longer so that |
6102 // NativeJump::patch_verified_entry will be able to patch out the entry | 6102 // NativeJump::patch_verified_entry will be able to patch out the entry |
6103 // code safely. The push to verify stack depth is ok at 5 bytes, | 6103 // code safely. The push to verify stack depth is ok at 5 bytes, |
6104 // the frame allocation can be either 3 or 6 bytes. So if we don't do | 6104 // the frame allocation can be either 3 or 6 bytes. So if we don't do |
6105 // stack bang then we must use the 6 byte frame allocation even if | 6105 // stack bang then we must use the 6 byte frame allocation even if |
6106 // we have no frame. :-( | 6106 // we have no frame. :-( |
6107 assert(stack_bang_size >= framesize || stack_bang_size <= 0, "stack bang size incorrect"); | |
6107 | 6108 |
6108 assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned"); | 6109 assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned"); |
6109 // Remove word for return addr | 6110 // Remove word for return addr |
6110 framesize -= wordSize; | 6111 framesize -= wordSize; |
6112 stack_bang_size -= wordSize; | |
6111 | 6113 |
6112 // Calls to C2R adapters often do not accept exceptional returns. | 6114 // Calls to C2R adapters often do not accept exceptional returns. |
6113 // We require that their callers must bang for them. But be careful, because | 6115 // We require that their callers must bang for them. But be careful, because |
6114 // some VM calls (such as call site linkage) can use several kilobytes of | 6116 // some VM calls (such as call site linkage) can use several kilobytes of |
6115 // stack. But the stack safety zone should account for that. | 6117 // stack. But the stack safety zone should account for that. |
6116 // See bugs 4446381, 4468289, 4497237. | 6118 // See bugs 4446381, 4468289, 4497237. |
6117 if (stack_bang) { | 6119 if (stack_bang_size > 0) { |
6118 generate_stack_overflow_check(framesize); | 6120 generate_stack_overflow_check(stack_bang_size); |
6119 | 6121 |
6120 // We always push rbp, so that on return to interpreter rbp, will be | 6122 // We always push rbp, so that on return to interpreter rbp, will be |
6121 // restored correctly and we can correct the stack. | 6123 // restored correctly and we can correct the stack. |
6122 push(rbp); | 6124 push(rbp); |
6123 // Remove word for ebp | 6125 // Remove word for ebp |