diff --git a/src/runtime/runtime-compiler.cc b/src/runtime/runtime-compiler.cc index 872cd8babd..8790da05e3 100644 --- a/src/runtime/runtime-compiler.cc +++ b/src/runtime/runtime-compiler.cc @@ -28,6 +28,8 @@ RUNTIME_FUNCTION(Runtime_CompileLazy) { PrintF("]\n"); } #endif + StackLimitCheck check(isolate); + if (check.JsHasOverflowed(1 * KB)) return isolate->StackOverflow(); // Compile the target function. DCHECK(function->shared()->allows_lazy_compilation()); @@ -48,6 +50,9 @@ RUNTIME_FUNCTION(Runtime_CompileOptimized) { CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); CONVERT_BOOLEAN_ARG_CHECKED(concurrent, 1); + StackLimitCheck check(isolate); + if (check.JsHasOverflowed(1 * KB)) return isolate->StackOverflow(); + Compiler::ConcurrencyMode mode = concurrent ? Compiler::CONCURRENT : Compiler::NOT_CONCURRENT; Handle code;