10 #include "testing/gmock-support.h"
12 using testing::Capture;
25 MachineOperatorBuilder machine;
27 JSBuiltinReducer reducer(&jsgraph);
28 return reducer.Reduce(node);
53 Type::UnsignedSmall(), Type::OtherSignedSmall(), Type::OtherUnsigned31(),
54 Type::OtherUnsigned32(), Type::OtherSigned32(), Type::SignedSmall(),
55 Type::Signed32(), Type::Unsigned32(), Type::Integral32(),
56 Type::MinusZero(), Type::NaN(), Type::OtherNumber(),
57 Type::OrderedNumber(), Type::Number()};
70 Node*
p0 = Parameter(t0, 0);
73 fun, UndefinedConstant(),
p0);
74 Reduction r = Reduce(call);
76 if (t0->Is(Type::Unsigned32())) {
77 ASSERT_TRUE(r.Changed());
78 EXPECT_THAT(r.replacement(),
p0);
80 Capture<Node*> branch;
81 ASSERT_TRUE(r.Changed());
89 graph()->start()))))));
103 Node*
p0 = Parameter(t0, 0);
106 fun, UndefinedConstant(),
p0);
107 Reduction r = Reduce(call);
109 ASSERT_TRUE(r.Changed());
124 fun, UndefinedConstant());
125 Reduction r = Reduce(call);
127 ASSERT_TRUE(r.Changed());
136 Node*
p0 = Parameter(t0, 0);
139 fun, UndefinedConstant(),
p0);
140 Reduction r = Reduce(call);
142 ASSERT_TRUE(r.Changed());
143 EXPECT_THAT(r.replacement(),
p0);
153 Node*
p0 = Parameter(t0, 0);
154 Node*
p1 = Parameter(t1, 1);
158 UndefinedConstant(),
p0,
p1);
159 Reduction r = Reduce(call);
161 if (t0->Is(Type::Integral32()) && t1->Is(Type::Integral32())) {
162 Capture<Node*> branch;
163 ASSERT_TRUE(r.Changed());
170 graph()->start()))))));
172 ASSERT_FALSE(r.Changed());
173 EXPECT_EQ(IrOpcode::kJSCallFunction, call->opcode());
189 Node*
p0 = Parameter(t0, 0);
190 Node*
p1 = Parameter(t1, 1);
194 UndefinedConstant(),
p0,
p1);
195 Reduction r = Reduce(call);
197 if (t0->Is(Type::Integral32()) && t1->Is(Type::Integral32())) {
198 ASSERT_TRUE(r.Changed());
201 ASSERT_FALSE(r.Changed());
202 EXPECT_EQ(IrOpcode::kJSCallFunction, call->opcode());
216 isolate()->factory()->NewStringFromAsciiChecked(
217 "Math")).ToHandleChecked();
220 "fround")).ToHandleChecked());
223 Node*
p0 = Parameter(t0, 0);
226 fun, UndefinedConstant(),
p0);
227 Reduction r = Reduce(call);
229 ASSERT_TRUE(r.Changed());
static Handle< T > cast(Handle< S > that)
static MUST_USE_RESULT MaybeHandle< Object > GetProperty(LookupIterator *it)
Factory * factory() const
CommonOperatorBuilder * common()
Node * HeapConstant(const Unique< HeapObject > &value)
Node * NewNode(const Operator *op, int input_count, Node **inputs)
Node * UndefinedConstant()
JSOperatorBuilder * javascript()
JSOperatorBuilder javascript_
Reduction Reduce(Node *node)
Node * Parameter(Type *t, int32_t index=0)
static void SetBounds(Node *node, Bounds bounds)
Type *const kNumberTypes[]
Matcher< Node * > IsMerge(const Matcher< Node * > &control0_matcher, const Matcher< Node * > &control1_matcher)
Matcher< Node * > IsTruncateFloat64ToFloat32(const Matcher< Node * > &input_matcher)
Matcher< Node * > IsFloat64Sqrt(const Matcher< Node * > &input_matcher)
Matcher< Node * > IsIfFalse(const Matcher< Node * > &control_matcher)
Matcher< Node * > IsBranch(const Matcher< Node * > &value_matcher, const Matcher< Node * > &control_matcher)
Matcher< Node * > IsNumberLessThan(const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)
Matcher< Node * > IsNumberConstant(const Matcher< double > &value_matcher)
Matcher< Node * > IsInt32Mul(const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)
Matcher< Node * > IsIfTrue(const Matcher< Node * > &control_matcher)
Matcher< Node * > IsNumberSubtract(const Matcher< Node * > &lhs_matcher, const Matcher< Node * > &rhs_matcher)
Matcher< Node * > IsPhi(const Matcher< MachineType > &type_matcher, const Matcher< Node * > &value0_matcher, const Matcher< Node * > &value1_matcher, const Matcher< Node * > &merge_matcher)
TEST_F(InstructionSelectorTest, ChangeFloat32ToFloat64WithParameter)
BoundsImpl< ZoneTypeConfig > Bounds
Debugger support for the V8 JavaScript engine.