Commit d6085f27 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

Make compiler more acceptive wrt Isolate::use_crankshaft.

This allows using %OptimizeFunctionOnNextCall and friends even when
Crankshaft is disabled. Note that this should only affect code paths
that are not relevant to performance. By now we have a single bailout
point in place within OptimizedCompileJob::CreateGraph that ensures
Crankshaft is only used when enabled and supported.

R=titzer@chromium.org

Review URL: https://codereview.chromium.org/999173007

Cr-Commit-Position: refs/heads/master@{#27367}
parent d931700b
...@@ -1353,8 +1353,8 @@ Handle<JSObject> Factory::NewFunctionPrototype(Handle<JSFunction> function) { ...@@ -1353,8 +1353,8 @@ Handle<JSObject> Factory::NewFunctionPrototype(Handle<JSFunction> function) {
static bool ShouldOptimizeNewClosure(Isolate* isolate, static bool ShouldOptimizeNewClosure(Isolate* isolate,
Handle<SharedFunctionInfo> info) { Handle<SharedFunctionInfo> info) {
return isolate->use_crankshaft() && !info->is_toplevel() && return !info->is_toplevel() && info->is_compiled() &&
info->is_compiled() && info->allows_lazy_compilation(); info->allows_lazy_compilation();
} }
......
...@@ -9626,7 +9626,6 @@ void JSFunction::JSFunctionIterateBody(int object_size, ObjectVisitor* v) { ...@@ -9626,7 +9626,6 @@ void JSFunction::JSFunctionIterateBody(int object_size, ObjectVisitor* v) {
void JSFunction::MarkForOptimization() { void JSFunction::MarkForOptimization() {
Isolate* isolate = GetIsolate(); Isolate* isolate = GetIsolate();
DCHECK(isolate->use_crankshaft());
DCHECK(!IsOptimized()); DCHECK(!IsOptimized());
DCHECK(shared()->allows_lazy_compilation() || code()->optimizable()); DCHECK(shared()->allows_lazy_compilation() || code()->optimizable());
set_code_no_write_barrier( set_code_no_write_barrier(
...@@ -9650,7 +9649,6 @@ void JSFunction::AttemptConcurrentOptimization() { ...@@ -9650,7 +9649,6 @@ void JSFunction::AttemptConcurrentOptimization() {
// recompilation race. This goes away as soon as OSR becomes one-shot. // recompilation race. This goes away as soon as OSR becomes one-shot.
return; return;
} }
DCHECK(isolate->use_crankshaft());
DCHECK(!IsInOptimizationQueue()); DCHECK(!IsInOptimizationQueue());
DCHECK(is_compiled() || isolate->debug()->has_break_points()); DCHECK(is_compiled() || isolate->debug()->has_break_points());
DCHECK(!IsOptimized()); DCHECK(!IsOptimized());
......
...@@ -47,7 +47,6 @@ RUNTIME_FUNCTION(Runtime_CompileOptimized) { ...@@ -47,7 +47,6 @@ RUNTIME_FUNCTION(Runtime_CompileOptimized) {
DCHECK(args.length() == 2); DCHECK(args.length() == 2);
CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
CONVERT_BOOLEAN_ARG_CHECKED(concurrent, 1); CONVERT_BOOLEAN_ARG_CHECKED(concurrent, 1);
DCHECK(isolate->use_crankshaft());
Compiler::ConcurrencyMode mode = Compiler::ConcurrencyMode mode =
concurrent ? Compiler::CONCURRENT : Compiler::NOT_CONCURRENT; concurrent ? Compiler::CONCURRENT : Compiler::NOT_CONCURRENT;
......
...@@ -89,8 +89,6 @@ RUNTIME_FUNCTION(Runtime_OptimizeFunctionOnNextCall) { ...@@ -89,8 +89,6 @@ RUNTIME_FUNCTION(Runtime_OptimizeFunctionOnNextCall) {
(function->code()->kind() == Code::FUNCTION && (function->code()->kind() == Code::FUNCTION &&
function->code()->optimizable())); function->code()->optimizable()));
if (!isolate->use_crankshaft()) return isolate->heap()->undefined_value();
// If the function is already optimized, just return. // If the function is already optimized, just return.
if (function->IsOptimized()) return isolate->heap()->undefined_value(); if (function->IsOptimized()) return isolate->heap()->undefined_value();
...@@ -136,8 +134,6 @@ RUNTIME_FUNCTION(Runtime_OptimizeOsr) { ...@@ -136,8 +134,6 @@ RUNTIME_FUNCTION(Runtime_OptimizeOsr) {
(function->code()->kind() == Code::FUNCTION && (function->code()->kind() == Code::FUNCTION &&
function->code()->optimizable())); function->code()->optimizable()));
if (!isolate->use_crankshaft()) return isolate->heap()->undefined_value();
// If the function is already optimized, just return. // If the function is already optimized, just return.
if (function->IsOptimized()) return isolate->heap()->undefined_value(); if (function->IsOptimized()) return isolate->heap()->undefined_value();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment