Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Unified Diff: test/cctest/compiler/test-js-typed-lowering.cc

Issue 983153002: [turbofan] Add an extra frame state for deoptimization before binary op. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tweak Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/compiler/simplified-graph-builder.cc ('k') | test/unittests/compiler/js-operator-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-js-typed-lowering.cc
diff --git a/test/cctest/compiler/test-js-typed-lowering.cc b/test/cctest/compiler/test-js-typed-lowering.cc
index 15611f5cbddd26d622ec8f97b94a15d151428338..7320e78e64e92572e229d0fe39c3124f9fb4355d 100644
--- a/test/cctest/compiler/test-js-typed-lowering.cc
+++ b/test/cctest/compiler/test-js-typed-lowering.cc
@@ -113,9 +113,13 @@ class JSTypedLoweringTester : public HandleAndZoneScope {
Node* Binop(const Operator* op, Node* left, Node* right) {
// JS binops also require context, effect, and control
- if (OperatorProperties::HasFrameStateInput(op)) {
+ if (OperatorProperties::GetFrameStateInputCount(op) == 1) {
return graph.NewNode(op, left, right, context(),
EmptyFrameState(context()), start(), control());
+ } else if (OperatorProperties::GetFrameStateInputCount(op) == 2) {
+ return graph.NewNode(op, left, right, context(),
+ EmptyFrameState(context()),
+ EmptyFrameState(context()), start(), control());
} else {
return graph.NewNode(op, left, right, context(), start(), control());
}
@@ -123,7 +127,8 @@ class JSTypedLoweringTester : public HandleAndZoneScope {
Node* Unop(const Operator* op, Node* input) {
// JS unops also require context, effect, and control
- if (OperatorProperties::HasFrameStateInput(op)) {
+ if (OperatorProperties::GetFrameStateInputCount(op) > 0) {
+ DCHECK(OperatorProperties::GetFrameStateInputCount(op) == 1);
return graph.NewNode(op, input, context(), EmptyFrameState(context()),
start(), control());
} else {
@@ -133,7 +138,10 @@ class JSTypedLoweringTester : public HandleAndZoneScope {
Node* UseForEffect(Node* node) {
// TODO(titzer): use EffectPhi after fixing EffectCount
- if (OperatorProperties::HasFrameStateInput(javascript.ToNumber())) {
+ if (OperatorProperties::GetFrameStateInputCount(javascript.ToNumber()) >
+ 0) {
+ DCHECK(OperatorProperties::GetFrameStateInputCount(
+ javascript.ToNumber()) == 1);
return graph.NewNode(javascript.ToNumber(), node, context(),
EmptyFrameState(context()), node, control());
} else {
@@ -748,8 +756,9 @@ TEST(RemoveToNumberEffects) {
switch (i) {
case 0:
- // TODO(jarin) Replace with a query of FLAG_turbo_deoptimization.
- if (OperatorProperties::HasFrameStateInput(R.javascript.ToNumber())) {
+ if (FLAG_turbo_deoptimization) {
+ DCHECK(OperatorProperties::GetFrameStateInputCount(
+ R.javascript.ToNumber()) == 1);
effect_use = R.graph.NewNode(R.javascript.ToNumber(), p0, R.context(),
frame_state, ton, R.start());
} else {
@@ -758,8 +767,9 @@ TEST(RemoveToNumberEffects) {
}
break;
case 1:
- // TODO(jarin) Replace with a query of FLAG_turbo_deoptimization.
- if (OperatorProperties::HasFrameStateInput(R.javascript.ToNumber())) {
+ if (FLAG_turbo_deoptimization) {
+ DCHECK(OperatorProperties::GetFrameStateInputCount(
+ R.javascript.ToNumber()) == 1);
effect_use =
R.graph.NewNode(R.javascript.ToNumber(), ton, R.context(),
frame_state, ton, R.start());
@@ -772,11 +782,11 @@ TEST(RemoveToNumberEffects) {
effect_use = R.graph.NewNode(R.common.EffectPhi(1), ton, R.start());
case 3:
effect_use = R.graph.NewNode(R.javascript.Add(), ton, ton, R.context(),
- frame_state, ton, R.start());
+ frame_state, frame_state, ton, R.start());
break;
case 4:
effect_use = R.graph.NewNode(R.javascript.Add(), p0, p0, R.context(),
- frame_state, ton, R.start());
+ frame_state, frame_state, ton, R.start());
break;
case 5:
effect_use = R.graph.NewNode(R.common.Return(), p0, ton, R.start());
« no previous file with comments | « test/cctest/compiler/simplified-graph-builder.cc ('k') | test/unittests/compiler/js-operator-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698