Index: src/runtime/runtime-compiler.cc |
diff --git a/src/runtime/runtime-compiler.cc b/src/runtime/runtime-compiler.cc |
index 8790da05e39a1b62b50da1d22a1c229d02c79684..04d28e20381539ef32c96c1954cc4411c158db43 100644 |
--- a/src/runtime/runtime-compiler.cc |
+++ b/src/runtime/runtime-compiler.cc |
@@ -44,17 +44,13 @@ RUNTIME_FUNCTION(Runtime_CompileLazy) { |
} |
-RUNTIME_FUNCTION(Runtime_CompileOptimized) { |
- HandleScope scope(isolate); |
- DCHECK(args.length() == 2); |
- CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
- CONVERT_BOOLEAN_ARG_CHECKED(concurrent, 1); |
+namespace { |
+Object* CompileOptimized(Isolate* isolate, Handle<JSFunction> function, |
+ Compiler::ConcurrencyMode mode) { |
StackLimitCheck check(isolate); |
if (check.JsHasOverflowed(1 * KB)) return isolate->StackOverflow(); |
- Compiler::ConcurrencyMode mode = |
- concurrent ? Compiler::CONCURRENT : Compiler::NOT_CONCURRENT; |
Handle<Code> code; |
Handle<Code> unoptimized(function->shared()->code()); |
if (Compiler::GetOptimizedCode(function, unoptimized, mode).ToHandle(&code)) { |
@@ -80,6 +76,24 @@ RUNTIME_FUNCTION(Runtime_CompileOptimized) { |
return function->code(); |
} |
+} // namespace |
+ |
+ |
+RUNTIME_FUNCTION(Runtime_CompileOptimized_Concurrent) { |
+ HandleScope scope(isolate); |
+ DCHECK(args.length() == 1); |
+ CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
+ return CompileOptimized(isolate, function, Compiler::CONCURRENT); |
+} |
+ |
+ |
+RUNTIME_FUNCTION(Runtime_CompileOptimized_NotConcurrent) { |
+ HandleScope scope(isolate); |
+ DCHECK(args.length() == 1); |
+ CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
+ return CompileOptimized(isolate, function, Compiler::NOT_CONCURRENT); |
+} |
+ |
RUNTIME_FUNCTION(Runtime_NotifyStubFailure) { |
HandleScope scope(isolate); |