Mercurial > hg > truffle
comparison src/share/vm/runtime/deoptimization.cpp @ 17620:69dc1be43fce
8029873: compiler/uncommontrap/TestStackBangRbp.java crashes with SIGSEGV
Summary: May end up in uncommon trap blob/deopt blob with unguarded stack
Reviewed-by: kvn, twisti
author | roland |
---|---|
date | Wed, 08 Jan 2014 09:49:31 +0100 |
parents | 190899198332 |
children | 63a4eb8bcd23 abec000618bf b8413a9cbb84 |
comparison
equal
deleted
inserted
replaced
17619:5231c2210388 | 17620:69dc1be43fce |
---|---|
1222 void Deoptimization::load_class_by_index(constantPoolHandle constant_pool, int index) { | 1222 void Deoptimization::load_class_by_index(constantPoolHandle constant_pool, int index) { |
1223 EXCEPTION_MARK; | 1223 EXCEPTION_MARK; |
1224 load_class_by_index(constant_pool, index, THREAD); | 1224 load_class_by_index(constant_pool, index, THREAD); |
1225 if (HAS_PENDING_EXCEPTION) { | 1225 if (HAS_PENDING_EXCEPTION) { |
1226 // Exception happened during classloading. We ignore the exception here, since it | 1226 // Exception happened during classloading. We ignore the exception here, since it |
1227 // is going to be rethrown since the current activation is going to be deoptimzied and | 1227 // is going to be rethrown since the current activation is going to be deoptimized and |
1228 // the interpreter will re-execute the bytecode. | 1228 // the interpreter will re-execute the bytecode. |
1229 CLEAR_PENDING_EXCEPTION; | 1229 CLEAR_PENDING_EXCEPTION; |
1230 // Class loading called java code which may have caused a stack | |
1231 // overflow. If the exception was thrown right before the return | |
1232 // to the runtime the stack is no longer guarded. Reguard the | |
1233 // stack otherwise if we return to the uncommon trap blob and the | |
1234 // stack bang causes a stack overflow we crash. | |
1235 assert(THREAD->is_Java_thread(), "only a java thread can be here"); | |
1236 JavaThread* thread = (JavaThread*)THREAD; | |
1237 bool guard_pages_enabled = thread->stack_yellow_zone_enabled(); | |
1238 if (!guard_pages_enabled) guard_pages_enabled = thread->reguard_stack(); | |
1239 assert(guard_pages_enabled, "stack banging in uncommon trap blob may cause crash"); | |
1230 } | 1240 } |
1231 } | 1241 } |
1232 | 1242 |
1233 JRT_ENTRY(void, Deoptimization::uncommon_trap_inner(JavaThread* thread, jint trap_request)) { | 1243 JRT_ENTRY(void, Deoptimization::uncommon_trap_inner(JavaThread* thread, jint trap_request)) { |
1234 HandleMark hm; | 1244 HandleMark hm; |