Commit 459c45db authored by mstarzinger's avatar mstarzinger Committed by Commit bot

Allow --always-opt to go further into the pipeline (1).

R=rossberg@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#26112}
parent 79ed8f17
...@@ -2510,6 +2510,7 @@ bool Genesis::InstallJSBuiltins(Handle<JSBuiltinsObject> builtins) { ...@@ -2510,6 +2510,7 @@ bool Genesis::InstallJSBuiltins(Handle<JSBuiltinsObject> builtins) {
// TODO(mstarzinger): This is just a temporary hack to make TurboFan work, // TODO(mstarzinger): This is just a temporary hack to make TurboFan work,
// the correct solution is to restore the context register after invoking // the correct solution is to restore the context register after invoking
// builtins from full-codegen. // builtins from full-codegen.
function->shared()->set_disable_optimization_reason(kOptimizationDisabled);
function->shared()->set_optimization_disabled(true); function->shared()->set_optimization_disabled(true);
if (!Compiler::EnsureCompiled(function, CLEAR_EXCEPTION)) { if (!Compiler::EnsureCompiled(function, CLEAR_EXCEPTION)) {
return false; return false;
......
...@@ -967,7 +967,6 @@ MaybeHandle<Code> Compiler::GetLazyCode(Handle<JSFunction> function) { ...@@ -967,7 +967,6 @@ MaybeHandle<Code> Compiler::GetLazyCode(Handle<JSFunction> function) {
Code); Code);
if (FLAG_always_opt && isolate->use_crankshaft() && if (FLAG_always_opt && isolate->use_crankshaft() &&
!info.shared_info()->optimization_disabled() &&
!isolate->DebuggerHasBreakPoints()) { !isolate->DebuggerHasBreakPoints()) {
Handle<Code> opt_code; Handle<Code> opt_code;
if (Compiler::GetOptimizedCode( if (Compiler::GetOptimizedCode(
......
...@@ -1362,7 +1362,7 @@ static bool ShouldOptimizeNewClosure(Isolate* isolate, ...@@ -1362,7 +1362,7 @@ static bool ShouldOptimizeNewClosure(Isolate* isolate,
Handle<SharedFunctionInfo> info) { Handle<SharedFunctionInfo> info) {
return isolate->use_crankshaft() && !info->is_toplevel() && return isolate->use_crankshaft() && !info->is_toplevel() &&
info->is_compiled() && info->allows_lazy_compilation() && info->is_compiled() && info->allows_lazy_compilation() &&
!info->optimization_disabled() && !isolate->DebuggerHasBreakPoints(); !isolate->DebuggerHasBreakPoints();
} }
......
...@@ -9437,9 +9437,7 @@ void JSFunction::MarkForOptimization() { ...@@ -9437,9 +9437,7 @@ void JSFunction::MarkForOptimization() {
Isolate* isolate = GetIsolate(); Isolate* isolate = GetIsolate();
DCHECK(isolate->use_crankshaft()); DCHECK(isolate->use_crankshaft());
DCHECK(!IsOptimized()); DCHECK(!IsOptimized());
DCHECK(shared()->allows_lazy_compilation() || DCHECK(shared()->allows_lazy_compilation() || code()->optimizable());
code()->optimizable());
DCHECK(!shared()->is_generator());
set_code_no_write_barrier( set_code_no_write_barrier(
isolate->builtins()->builtin(Builtins::kCompileOptimized)); isolate->builtins()->builtin(Builtins::kCompileOptimized));
// No write barrier required, since the builtin is part of the root set. // No write barrier required, since the builtin is part of the root set.
...@@ -9466,7 +9464,6 @@ void JSFunction::AttemptConcurrentOptimization() { ...@@ -9466,7 +9464,6 @@ void JSFunction::AttemptConcurrentOptimization() {
DCHECK(is_compiled() || isolate->DebuggerHasBreakPoints()); DCHECK(is_compiled() || isolate->DebuggerHasBreakPoints());
DCHECK(!IsOptimized()); DCHECK(!IsOptimized());
DCHECK(shared()->allows_lazy_compilation() || code()->optimizable()); DCHECK(shared()->allows_lazy_compilation() || code()->optimizable());
DCHECK(!shared()->is_generator());
DCHECK(isolate->concurrent_recompilation_enabled()); DCHECK(isolate->concurrent_recompilation_enabled());
if (FLAG_trace_concurrent_recompilation) { if (FLAG_trace_concurrent_recompilation) {
PrintF(" ** Marking "); PrintF(" ** Marking ");
......
...@@ -53,9 +53,8 @@ RUNTIME_FUNCTION(Runtime_OptimizeFunctionOnNextCall) { ...@@ -53,9 +53,8 @@ RUNTIME_FUNCTION(Runtime_OptimizeFunctionOnNextCall) {
HandleScope scope(isolate); HandleScope scope(isolate);
RUNTIME_ASSERT(args.length() == 1 || args.length() == 2); RUNTIME_ASSERT(args.length() == 1 || args.length() == 2);
CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
// The following two assertions are lifted from the DCHECKs inside // The following assertion was lifted from the DCHECK inside
// JSFunction::MarkForOptimization(). // JSFunction::MarkForOptimization().
RUNTIME_ASSERT(!function->shared()->is_generator());
RUNTIME_ASSERT(function->shared()->allows_lazy_compilation() || RUNTIME_ASSERT(function->shared()->allows_lazy_compilation() ||
(function->code()->kind() == Code::FUNCTION && (function->code()->kind() == Code::FUNCTION &&
function->code()->optimizable())); function->code()->optimizable()));
......
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