Commit a64ac457 authored by bmeurer's avatar bmeurer Committed by Commit bot

Fix %NeverOptimizeFunction() intrinsic.

Set a valid reason for disabling optimization when using
%NeverOptimizeFunction.

TEST=mjsunit/compiler/regress-445732
BUG=chromium:445732
LOG=y
TBR=machenbach@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#25949}
parent 643ed5b8
...@@ -94,6 +94,7 @@ RUNTIME_FUNCTION(Runtime_NeverOptimizeFunction) { ...@@ -94,6 +94,7 @@ RUNTIME_FUNCTION(Runtime_NeverOptimizeFunction) {
HandleScope scope(isolate); HandleScope scope(isolate);
DCHECK(args.length() == 1); DCHECK(args.length() == 1);
CONVERT_ARG_CHECKED(JSFunction, function, 0); CONVERT_ARG_CHECKED(JSFunction, function, 0);
function->shared()->set_disable_optimization_reason(kOptimizationDisabled);
function->shared()->set_optimization_disabled(true); function->shared()->set_optimization_disabled(true);
return isolate->heap()->undefined_value(); return isolate->heap()->undefined_value();
} }
......
// Copyright 2014 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 --turbo-asm
"use asm";
%NeverOptimizeFunction(f);
function f() { }
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