Reviewers: jarin,
Description:
[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.
[email protected]
TEST=mjsunit/compiler/eager-deopt-simple
Please review this at https://codereview.chromium.org/988333003/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+7, -5 lines):
M src/compiler/js-intrinsic-lowering.h
M src/compiler/js-intrinsic-lowering.cc
M src/compiler/linkage.cc
M test/mjsunit/compiler/eager-deopt-simple.js
Index: src/compiler/js-intrinsic-lowering.cc
diff --git a/src/compiler/js-intrinsic-lowering.cc
b/src/compiler/js-intrinsic-lowering.cc
index
b87796cc3aaf410a3566e3308d8c8500148a8458..171b36e8d2300cac891fddaa7bbedf8b88cc62bf
100644
--- a/src/compiler/js-intrinsic-lowering.cc
+++ b/src/compiler/js-intrinsic-lowering.cc
@@ -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);
Index: src/compiler/js-intrinsic-lowering.h
diff --git a/src/compiler/js-intrinsic-lowering.h
b/src/compiler/js-intrinsic-lowering.h
index
2ef02a19b90b5533f51baf4511adb38cf8dc1dd6..bc78f531ffd14a24e04bfa731c94b9ef7f52b66f
100644
--- a/src/compiler/js-intrinsic-lowering.h
+++ b/src/compiler/js-intrinsic-lowering.h
@@ -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);
Index: src/compiler/linkage.cc
diff --git a/src/compiler/linkage.cc b/src/compiler/linkage.cc
index
b4c479170e2e72e0189d9da7523ede5067fb9055..13283b44ef8391dc39aad69823e95a9033a50aca
100644
--- a/src/compiler/linkage.cc
+++ b/src/compiler/linkage.cc
@@ -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;
Index: test/mjsunit/compiler/eager-deopt-simple.js
diff --git a/test/mjsunit/compiler/eager-deopt-simple.js
b/test/mjsunit/compiler/eager-deopt-simple.js
index
72ca317a50a7cb8656f61ac3b2479ae32300afbb..067400cfc629bdd28b58540f45bcc9dc1c36ecbb
100644
--- a/test/mjsunit/compiler/eager-deopt-simple.js
+++ b/test/mjsunit/compiler/eager-deopt-simple.js
@@ -9,7 +9,7 @@ function g(a, b, c) {
}
function f() {
- return g(1, (%DeoptimizeNow(), 2), 3);
+ return g(1, (%_DeoptimizeNow(), 2), 3);
}
f();
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.