# HG changeset patch # User twisti # Date 1357951643 28800 # Node ID c095a7f289aa366564816464faddc54f6d19e3ff # Parent c566b81b33235b0c93988a242526ca6c60ed2bfd 8005818: Shark: fix OSR for non-empty incoming stack Reviewed-by: twisti Contributed-by: Roman Kennke diff -r c566b81b3323 -r c095a7f289aa src/share/vm/shark/sharkCompiler.cpp --- a/src/share/vm/shark/sharkCompiler.cpp Fri Jan 11 16:47:23 2013 -0800 +++ b/src/share/vm/shark/sharkCompiler.cpp Fri Jan 11 16:47:23 2013 -0800 @@ -185,6 +185,9 @@ // Build the LLVM IR for the method Function *function = SharkFunction::build(env, &builder, flow, name); + if (env->failing()) { + return; + } // Generate native code. It's unpleasant that we have to drop into // the VM to do this -- it blocks safepoints -- but I can't see any diff -r c566b81b3323 -r c095a7f289aa src/share/vm/shark/sharkFunction.cpp --- a/src/share/vm/shark/sharkFunction.cpp Fri Jan 11 16:47:23 2013 -0800 +++ b/src/share/vm/shark/sharkFunction.cpp Fri Jan 11 16:47:23 2013 -0800 @@ -77,6 +77,10 @@ // Walk the tree from the start block to determine which // blocks are entered and which blocks require phis SharkTopLevelBlock *start_block = block(flow()->start_block_num()); + if (is_osr() && start_block->stack_depth_at_entry() != 0) { + env()->record_method_not_compilable("can't compile OSR block with incoming stack-depth > 0"); + return; + } assert(start_block->start() == flow()->start_bci(), "blocks out of order"); start_block->enter(); diff -r c566b81b3323 -r c095a7f289aa src/share/vm/shark/sharkInvariants.hpp --- a/src/share/vm/shark/sharkInvariants.hpp Fri Jan 11 16:47:23 2013 -0800 +++ b/src/share/vm/shark/sharkInvariants.hpp Fri Jan 11 16:47:23 2013 -0800 @@ -68,7 +68,7 @@ // // Accessing this directly is kind of ugly, so it's private. Add // new accessors below if you need something from it. - private: + protected: ciEnv* env() const { assert(_env != NULL, "env not available"); return _env;