Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index d1b4a2b9d8a53ab3a9cbcf17f4a4440ff9f92838..613830c51901e05cf911955a232f8b5b39f2d8a5 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -8344,16 +8344,6 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ConcurrentRecompile) { |
} |
-RUNTIME_FUNCTION(MaybeObject*, Runtime_InstallRecompiledCode) { |
- HandleScope handle_scope(isolate); |
- ASSERT(args.length() == 1); |
- CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
- ASSERT(isolate->use_crankshaft() && FLAG_concurrent_recompilation); |
- isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); |
- return function->code(); |
-} |
- |
- |
class ActivationsFinder : public ThreadVisitor { |
public: |
Code* code_; |
@@ -8551,8 +8541,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationStatus) { |
} |
CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
if (FLAG_concurrent_recompilation && sync_with_compiler_thread) { |
- while (function->IsInRecompileQueue() || |
- function->IsMarkedForInstallingRecompiledCode()) { |
+ while (function->IsInRecompileQueue()) { |
isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); |
OS::Sleep(50); |
} |
@@ -9380,7 +9369,6 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StackGuard) { |
// First check if this is a real stack overflow. |
if (isolate->stack_guard()->IsStackOverflow()) { |
- SealHandleScope shs(isolate); |
return isolate->StackOverflow(); |
} |
@@ -9388,6 +9376,23 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StackGuard) { |
} |
+RUNTIME_FUNCTION(MaybeObject*, Runtime_TryInstallRecompiledCode) { |
+ HandleScope scope(isolate); |
+ ASSERT(args.length() == 1); |
+ CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
+ |
+ // First check if this is a real stack overflow. |
+ if (isolate->stack_guard()->IsStackOverflow()) { |
+ SealHandleScope shs(isolate); |
+ return isolate->StackOverflow(); |
+ } |
+ |
+ isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); |
+ return (function->IsOptimized()) ? function->code() |
+ : function->shared()->code(); |
+} |
+ |
+ |
RUNTIME_FUNCTION(MaybeObject*, Runtime_Interrupt) { |
SealHandleScope shs(isolate); |
ASSERT(args.length() == 0); |