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

Side by Side Diff: test/cctest/compiler/test-simplified-lowering.cc

Issue 999173003: [turbofan] Remove indirection in JSToBoolean/JSUnaryNot lowering. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add comment. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <limits> 5 #include <limits>
6 6
7 #include "src/compiler/access-builder.h" 7 #include "src/compiler/access-builder.h"
8 #include "src/compiler/change-lowering.h" 8 #include "src/compiler/change-lowering.h"
9 #include "src/compiler/control-builders.h" 9 #include "src/compiler/control-builders.h"
10 #include "src/compiler/graph-reducer.h" 10 #include "src/compiler/graph-reducer.h"
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 return graph()->NewNode(common()->Int64Constant(v)); 783 return graph()->NewNode(common()->Int64Constant(v));
784 } 784 }
785 785
786 SimplifiedOperatorBuilder* simplified() { return &main_simplified_; } 786 SimplifiedOperatorBuilder* simplified() { return &main_simplified_; }
787 MachineOperatorBuilder* machine() { return &main_machine_; } 787 MachineOperatorBuilder* machine() { return &main_machine_; }
788 CommonOperatorBuilder* common() { return &main_common_; } 788 CommonOperatorBuilder* common() { return &main_common_; }
789 Graph* graph() { return main_graph_; } 789 Graph* graph() { return main_graph_; }
790 }; 790 };
791 791
792 792
793 #if V8_TURBOFAN_TARGET
794
795 TEST(LowerAnyToBoolean_tagged_tagged) {
796 // AnyToBoolean(x: kRepTagged) used as kRepTagged
797 TestingGraph t(Type::Any());
798 Node* x = t.p0;
799 Node* cnv = t.graph()->NewNode(t.simplified()->AnyToBoolean(), x);
800 Node* use = t.Use(cnv, kRepTagged);
801 t.Return(use);
802 t.Lower();
803 CHECK_EQ(IrOpcode::kCall, cnv->opcode());
804 CHECK_EQ(IrOpcode::kHeapConstant, cnv->InputAt(0)->opcode());
805 CHECK_EQ(x, cnv->InputAt(1));
806 CHECK_EQ(t.jsgraph.NoContextConstant(), cnv->InputAt(2));
807 }
808
809 #endif
810
811
812 TEST(LowerBooleanNot_bit_bit) { 793 TEST(LowerBooleanNot_bit_bit) {
813 // BooleanNot(x: kRepBit) used as kRepBit 794 // BooleanNot(x: kRepBit) used as kRepBit
814 TestingGraph t(Type::Boolean()); 795 TestingGraph t(Type::Boolean());
815 Node* b = t.ExampleWithOutput(kRepBit); 796 Node* b = t.ExampleWithOutput(kRepBit);
816 Node* inv = t.graph()->NewNode(t.simplified()->BooleanNot(), b); 797 Node* inv = t.graph()->NewNode(t.simplified()->BooleanNot(), b);
817 Node* use = t.Branch(inv); 798 Node* use = t.Branch(inv);
818 t.Lower(); 799 t.Lower();
819 Node* cmp = use->InputAt(0); 800 Node* cmp = use->InputAt(0);
820 CHECK_EQ(t.machine()->Word32Equal()->opcode(), cmp->opcode()); 801 CHECK_EQ(t.machine()->Word32Equal()->opcode(), cmp->opcode());
821 CHECK(b == cmp->InputAt(0) || b == cmp->InputAt(1)); 802 CHECK(b == cmp->InputAt(0) || b == cmp->InputAt(1));
(...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after
2072 Bounds phi_bounds = Bounds::Either(Bounds(d.arg1), Bounds(d.arg2), z); 2053 Bounds phi_bounds = Bounds::Either(Bounds(d.arg1), Bounds(d.arg2), z);
2073 NodeProperties::SetBounds(phi, phi_bounds); 2054 NodeProperties::SetBounds(phi, phi_bounds);
2074 2055
2075 Node* use = t.Use(phi, d.use); 2056 Node* use = t.Use(phi, d.use);
2076 t.Return(use); 2057 t.Return(use);
2077 t.Lower(); 2058 t.Lower();
2078 2059
2079 CHECK_EQ(d.expected, OpParameter<MachineType>(phi)); 2060 CHECK_EQ(d.expected, OpParameter<MachineType>(phi));
2080 } 2061 }
2081 } 2062 }
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-js-typed-lowering.cc ('k') | test/unittests/compiler/js-typed-lowering-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698