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

[turbofan] Only reduce inline %DeoptimizeNow.

This makes sure only the %_DeoptimizeNow intrinsic is inlined, and
not the %DeoptimizeNow one. It hence re-establishes the invariant
that JSIntrinsicLowering only deals with inline intrinsics.

R=jarin@chromium.org
TEST=mjsunit/compiler/eager-deopt-simple

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

Cr-Commit-Position: refs/heads/master@{#27070}
parent eacd6d8b
......@@ -20,9 +20,10 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) {
if (node->opcode() != IrOpcode::kJSCallRuntime) return NoChange();
const Runtime::Function* const f =
Runtime::FunctionForId(CallRuntimeParametersOf(node->op()).id());
if (f->intrinsic_type != Runtime::IntrinsicType::INLINE) return NoChange();
switch (f->function_id) {
case Runtime::kDeoptimizeNow:
return ReduceDeoptimizeNow(node);
case Runtime::kInlineDeoptimizeNow:
return ReduceInlineDeoptimizeNow(node);
case Runtime::kInlineIsSmi:
return ReduceInlineIsSmi(node);
case Runtime::kInlineIsNonNegativeSmi:
......@@ -48,7 +49,7 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) {
}
Reduction JSIntrinsicLowering::ReduceDeoptimizeNow(Node* node) {
Reduction JSIntrinsicLowering::ReduceInlineDeoptimizeNow(Node* node) {
if (!FLAG_turbo_deoptimization) return NoChange();
Node* frame_state = NodeProperties::GetFrameStateInput(node, 0);
......
......@@ -27,7 +27,7 @@ class JSIntrinsicLowering FINAL : public Reducer {
Reduction Reduce(Node* node) FINAL;
private:
Reduction ReduceDeoptimizeNow(Node* node);
Reduction ReduceInlineDeoptimizeNow(Node* node);
Reduction ReduceInlineIsSmi(Node* node);
Reduction ReduceInlineIsNonNegativeSmi(Node* node);
Reduction ReduceInlineIsInstanceType(Node* node, InstanceType instance_type);
......
......@@ -129,6 +129,7 @@ bool Linkage::NeedsFrameState(Runtime::FunctionId function) {
case Runtime::kInlineArguments:
case Runtime::kInlineCallFunction:
case Runtime::kInlineDateField:
case Runtime::kInlineDeoptimizeNow:
case Runtime::kInlineGetPrototype:
case Runtime::kInlineRegExpExec:
return true;
......
......@@ -9,7 +9,7 @@ function g(a, b, c) {
}
function f() {
return g(1, (%DeoptimizeNow(), 2), 3);
return g(1, (%_DeoptimizeNow(), 2), 3);
}
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