1049 // At this point, (tmp-0) is the last address touched, so don't |
1049 // At this point, (tmp-0) is the last address touched, so don't |
1050 // touch it again. (It was touched as (tmp-pagesize) but then tmp |
1050 // touch it again. (It was touched as (tmp-pagesize) but then tmp |
1051 // was post-decremented.) Skip this address by starting at i=1, and |
1051 // was post-decremented.) Skip this address by starting at i=1, and |
1052 // touch a few more pages below. N.B. It is important to touch all |
1052 // touch a few more pages below. N.B. It is important to touch all |
1053 // the way down to and including i=StackShadowPages. |
1053 // the way down to and including i=StackShadowPages. |
1054 for (int i = 1; i <= StackShadowPages; i++) { |
1054 for (int i = 1; i < StackShadowPages; i++) { |
1055 // this could be any sized move but this is can be a debugging crumb |
1055 // this could be any sized move but this is can be a debugging crumb |
1056 // so the bigger the better. |
1056 // so the bigger the better. |
1057 movptr(Address(tmp, (-i*os::vm_page_size())), size ); |
1057 movptr(Address(tmp, (-i*os::vm_page_size())), size ); |
1058 } |
1058 } |
1059 } |
1059 } |
6091 |
6091 |
6092 #endif // _LP64 |
6092 #endif // _LP64 |
6093 |
6093 |
6094 |
6094 |
6095 // C2 compiled method's prolog code. |
6095 // C2 compiled method's prolog code. |
6096 void MacroAssembler::verified_entry(int framesize, bool stack_bang, bool fp_mode_24b) { |
6096 void MacroAssembler::verified_entry(int framesize, int stack_bang_size, bool fp_mode_24b) { |
6097 |
6097 |
6098 // WARNING: Initial instruction MUST be 5 bytes or longer so that |
6098 // WARNING: Initial instruction MUST be 5 bytes or longer so that |
6099 // NativeJump::patch_verified_entry will be able to patch out the entry |
6099 // NativeJump::patch_verified_entry will be able to patch out the entry |
6100 // code safely. The push to verify stack depth is ok at 5 bytes, |
6100 // code safely. The push to verify stack depth is ok at 5 bytes, |
6101 // the frame allocation can be either 3 or 6 bytes. So if we don't do |
6101 // the frame allocation can be either 3 or 6 bytes. So if we don't do |
6102 // stack bang then we must use the 6 byte frame allocation even if |
6102 // stack bang then we must use the 6 byte frame allocation even if |
6103 // we have no frame. :-( |
6103 // we have no frame. :-( |
|
6104 assert(stack_bang_size >= framesize || stack_bang_size <= 0, "stack bang size incorrect"); |
6104 |
6105 |
6105 assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned"); |
6106 assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned"); |
6106 // Remove word for return addr |
6107 // Remove word for return addr |
6107 framesize -= wordSize; |
6108 framesize -= wordSize; |
|
6109 stack_bang_size -= wordSize; |
6108 |
6110 |
6109 // Calls to C2R adapters often do not accept exceptional returns. |
6111 // Calls to C2R adapters often do not accept exceptional returns. |
6110 // We require that their callers must bang for them. But be careful, because |
6112 // We require that their callers must bang for them. But be careful, because |
6111 // some VM calls (such as call site linkage) can use several kilobytes of |
6113 // some VM calls (such as call site linkage) can use several kilobytes of |
6112 // stack. But the stack safety zone should account for that. |
6114 // stack. But the stack safety zone should account for that. |
6113 // See bugs 4446381, 4468289, 4497237. |
6115 // See bugs 4446381, 4468289, 4497237. |
6114 if (stack_bang) { |
6116 if (stack_bang_size > 0) { |
6115 generate_stack_overflow_check(framesize); |
6117 generate_stack_overflow_check(stack_bang_size); |
6116 |
6118 |
6117 // We always push rbp, so that on return to interpreter rbp, will be |
6119 // We always push rbp, so that on return to interpreter rbp, will be |
6118 // restored correctly and we can correct the stack. |
6120 // restored correctly and we can correct the stack. |
6119 push(rbp); |
6121 push(rbp); |
6120 // Remove word for ebp |
6122 // Remove word for ebp |