Commit 1fc5ca85 authored by jochen's avatar jochen Committed by Commit bot

Fix --noopt to not optimize

BUG=v8:5904,chromium:639217
R=mstarzinger@chromium.org

Review-Url: https://codereview.chromium.org/2660103002
Cr-Commit-Position: refs/heads/master@{#42777}
parent f87ce44f
......@@ -124,7 +124,7 @@ bool CompilationInfo::is_this_defined() const { return !IsStub(); }
// profiler, so they trigger their own optimization when they're called
// for the SharedFunctionInfo::kCallsUntilPrimitiveOptimization-th time.
bool CompilationInfo::ShouldSelfOptimize() {
return FLAG_crankshaft &&
return FLAG_opt && FLAG_crankshaft &&
!(literal()->flags() & AstProperties::kDontSelfOptimize) &&
!literal()->dont_optimize() &&
literal()->scope()->AllowsLazyCompilation() &&
......
......@@ -2902,8 +2902,7 @@ Map* Isolate::get_initial_js_array_map(ElementsKind kind) {
bool Isolate::use_crankshaft() const {
return FLAG_crankshaft &&
!serializer_enabled_ &&
return FLAG_opt && FLAG_crankshaft && !serializer_enabled_ &&
CpuFeatures::SupportsCrankshaft();
}
......
......@@ -66,7 +66,7 @@ void V8::InitializeOncePerProcessImpl() {
FLAG_max_semi_space_size = 1;
}
if (FLAG_turbo && strcmp(FLAG_turbo_filter, "~~") == 0) {
if (FLAG_opt && FLAG_turbo && strcmp(FLAG_turbo_filter, "~~") == 0) {
const char* filter_flag = "--turbo-filter=*";
FlagList::SetFlagsFromString(filter_flag, StrLength(filter_flag));
}
......
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax --noopt --no-always-opt
// Check that --noopt actually works.
function f() { return 42; }
f();
f();
%OptimizeFunctionOnNextCall(f);
f();
assertUnoptimized(f);
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