| Index: src/runtime.cc
|
| diff --git a/src/runtime.cc b/src/runtime.cc
|
| index 7dc96f201970eec90466b79f20fa2823271fe737..3d447ae28040492507a86337c9554d66a949c097 100644
|
| --- a/src/runtime.cc
|
| +++ b/src/runtime.cc
|
| @@ -8705,8 +8705,20 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CompileForOnStackReplacement) {
|
| // Prevent regular recompilation if we queue this for OSR.
|
| // TODO(yangguo): remove this as soon as OSR becomes one-shot.
|
| function->ReplaceCode(*unoptimized);
|
| + } else if (function->IsOptimized() &&
|
| + !isolate->optimizing_compiler_thread()->
|
| + IsQueuedForOSR(function, pc_offset)) {
|
| + // Function has already been optimized and no OSR job has been queued.
|
| + // This means that we have found cached code.
|
| + result = Handle<Code>(function->code());
|
| + ast_id = result->OsrAstId();
|
| + ASSERT(!ast_id.IsNone());
|
| + ASSERT_EQ(ast_id.ToInt(),
|
| + unoptimized->TranslatePcOffsetToAstId(pc_offset).ToInt());
|
| + // Fall through to the part where we use the OSR code.
|
| + } else {
|
| + return NULL;
|
| }
|
| - return NULL;
|
| }
|
| // Fall through to the end in case of failure.
|
| } else {
|
|
|