# HG changeset patch # User twisti # Date 1357951643 28800 # Node ID b86a40ac02ff89ff6ba2b5df9af03683ba0f84df # Parent 17da82a12ff48bd592397cb2ec6c8f269302c0d3 8005818: Shark: fix OSR for non-empty incoming stack Reviewed-by: twisti Contributed-by: Roman Kennke diff -r 17da82a12ff4 -r b86a40ac02ff hotspot/src/share/vm/shark/sharkCompiler.cpp --- a/hotspot/src/share/vm/shark/sharkCompiler.cpp Fri Jan 11 16:47:23 2013 -0800 +++ b/hotspot/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 17da82a12ff4 -r b86a40ac02ff hotspot/src/share/vm/shark/sharkFunction.cpp --- a/hotspot/src/share/vm/shark/sharkFunction.cpp Fri Jan 11 16:47:23 2013 -0800 +++ b/hotspot/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 17da82a12ff4 -r b86a40ac02ff hotspot/src/share/vm/shark/sharkInvariants.hpp --- a/hotspot/src/share/vm/shark/sharkInvariants.hpp Fri Jan 11 16:47:23 2013 -0800 +++ b/hotspot/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;