Fri, 11 Jan 2013 16:47:23 -0800
8005818: Shark: fix OSR for non-empty incoming stack
Reviewed-by: twisti
Contributed-by: Roman Kennke <rkennke@redhat.com>
1.1 --- a/src/share/vm/shark/sharkCompiler.cpp Fri Jan 11 16:47:23 2013 -0800 1.2 +++ b/src/share/vm/shark/sharkCompiler.cpp Fri Jan 11 16:47:23 2013 -0800 1.3 @@ -185,6 +185,9 @@ 1.4 1.5 // Build the LLVM IR for the method 1.6 Function *function = SharkFunction::build(env, &builder, flow, name); 1.7 + if (env->failing()) { 1.8 + return; 1.9 + } 1.10 1.11 // Generate native code. It's unpleasant that we have to drop into 1.12 // the VM to do this -- it blocks safepoints -- but I can't see any
2.1 --- a/src/share/vm/shark/sharkFunction.cpp Fri Jan 11 16:47:23 2013 -0800 2.2 +++ b/src/share/vm/shark/sharkFunction.cpp Fri Jan 11 16:47:23 2013 -0800 2.3 @@ -77,6 +77,10 @@ 2.4 // Walk the tree from the start block to determine which 2.5 // blocks are entered and which blocks require phis 2.6 SharkTopLevelBlock *start_block = block(flow()->start_block_num()); 2.7 + if (is_osr() && start_block->stack_depth_at_entry() != 0) { 2.8 + env()->record_method_not_compilable("can't compile OSR block with incoming stack-depth > 0"); 2.9 + return; 2.10 + } 2.11 assert(start_block->start() == flow()->start_bci(), "blocks out of order"); 2.12 start_block->enter(); 2.13
3.1 --- a/src/share/vm/shark/sharkInvariants.hpp Fri Jan 11 16:47:23 2013 -0800 3.2 +++ b/src/share/vm/shark/sharkInvariants.hpp Fri Jan 11 16:47:23 2013 -0800 3.3 @@ -68,7 +68,7 @@ 3.4 // 3.5 // Accessing this directly is kind of ugly, so it's private. Add 3.6 // new accessors below if you need something from it. 3.7 - private: 3.8 + protected: 3.9 ciEnv* env() const { 3.10 assert(_env != NULL, "env not available"); 3.11 return _env;