Mercurial > hg > graal-jvmci-8
comparison src/cpu/sparc/vm/sparc.ad @ 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 | 17b2fbdb6637 |
children | 52b4284cb496 85c339200299 271a32147391 |
comparison
equal
deleted
inserted
replaced
17978:ad51f24671c2 | 17980:0bf37f737702 |
---|---|
1191 | 1191 |
1192 if( VerifyThread ) { | 1192 if( VerifyThread ) { |
1193 st->print_cr("Verify_Thread"); st->print("\t"); | 1193 st->print_cr("Verify_Thread"); st->print("\t"); |
1194 } | 1194 } |
1195 | 1195 |
1196 size_t framesize = C->frame_slots() << LogBytesPerInt; | 1196 size_t framesize = C->frame_size_in_bytes(); |
1197 int bangsize = C->bang_size_in_bytes(); | |
1197 | 1198 |
1198 // Calls to C2R adapters often do not accept exceptional returns. | 1199 // Calls to C2R adapters often do not accept exceptional returns. |
1199 // We require that their callers must bang for them. But be careful, because | 1200 // We require that their callers must bang for them. But be careful, because |
1200 // some VM calls (such as call site linkage) can use several kilobytes of | 1201 // some VM calls (such as call site linkage) can use several kilobytes of |
1201 // stack. But the stack safety zone should account for that. | 1202 // stack. But the stack safety zone should account for that. |
1202 // See bugs 4446381, 4468289, 4497237. | 1203 // See bugs 4446381, 4468289, 4497237. |
1203 if (C->need_stack_bang(framesize)) { | 1204 if (C->need_stack_bang(bangsize)) { |
1204 st->print_cr("! stack bang"); st->print("\t"); | 1205 st->print_cr("! stack bang (%d bytes)", bangsize); st->print("\t"); |
1205 } | 1206 } |
1206 | 1207 |
1207 if (Assembler::is_simm13(-framesize)) { | 1208 if (Assembler::is_simm13(-framesize)) { |
1208 st->print ("SAVE R_SP,-%d,R_SP",framesize); | 1209 st->print ("SAVE R_SP,-%d,R_SP",framesize); |
1209 } else { | 1210 } else { |
1223 __ nop(); | 1224 __ nop(); |
1224 } | 1225 } |
1225 | 1226 |
1226 __ verify_thread(); | 1227 __ verify_thread(); |
1227 | 1228 |
1228 size_t framesize = C->frame_slots() << LogBytesPerInt; | 1229 size_t framesize = C->frame_size_in_bytes(); |
1229 assert(framesize >= 16*wordSize, "must have room for reg. save area"); | 1230 assert(framesize >= 16*wordSize, "must have room for reg. save area"); |
1230 assert(framesize%(2*wordSize) == 0, "must preserve 2*wordSize alignment"); | 1231 assert(framesize%(2*wordSize) == 0, "must preserve 2*wordSize alignment"); |
1232 int bangsize = C->bang_size_in_bytes(); | |
1231 | 1233 |
1232 // Calls to C2R adapters often do not accept exceptional returns. | 1234 // Calls to C2R adapters often do not accept exceptional returns. |
1233 // We require that their callers must bang for them. But be careful, because | 1235 // We require that their callers must bang for them. But be careful, because |
1234 // some VM calls (such as call site linkage) can use several kilobytes of | 1236 // some VM calls (such as call site linkage) can use several kilobytes of |
1235 // stack. But the stack safety zone should account for that. | 1237 // stack. But the stack safety zone should account for that. |
1236 // See bugs 4446381, 4468289, 4497237. | 1238 // See bugs 4446381, 4468289, 4497237. |
1237 if (C->need_stack_bang(framesize)) { | 1239 if (C->need_stack_bang(bangsize)) { |
1238 __ generate_stack_overflow_check(framesize); | 1240 __ generate_stack_overflow_check(bangsize); |
1239 } | 1241 } |
1240 | 1242 |
1241 if (Assembler::is_simm13(-framesize)) { | 1243 if (Assembler::is_simm13(-framesize)) { |
1242 __ save(SP, -framesize, SP); | 1244 __ save(SP, -framesize, SP); |
1243 } else { | 1245 } else { |
2545 %} | 2547 %} |
2546 | 2548 |
2547 enc_class call_epilog %{ | 2549 enc_class call_epilog %{ |
2548 if( VerifyStackAtCalls ) { | 2550 if( VerifyStackAtCalls ) { |
2549 MacroAssembler _masm(&cbuf); | 2551 MacroAssembler _masm(&cbuf); |
2550 int framesize = ra_->C->frame_slots() << LogBytesPerInt; | 2552 int framesize = ra_->C->frame_size_in_bytes(); |
2551 Register temp_reg = G3; | 2553 Register temp_reg = G3; |
2552 __ add(SP, framesize, temp_reg); | 2554 __ add(SP, framesize, temp_reg); |
2553 __ cmp(temp_reg, FP); | 2555 __ cmp(temp_reg, FP); |
2554 __ breakpoint_trap(Assembler::notEqual, Assembler::ptr_cc); | 2556 __ breakpoint_trap(Assembler::notEqual, Assembler::ptr_cc); |
2555 } | 2557 } |