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

[turbofan] Remove language mode from JSCall operator.

This removes the language mode parameter from all JSCall operators. The
information is no longer used anywhere and is not threaded through the
interpreter bytecode. We should only thread it through the bytecode if
it has a semantic impact on the compilation.

R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34073}
parent 76c054b1
...@@ -2483,9 +2483,8 @@ void AstGraphBuilder::VisitCall(Call* expr) { ...@@ -2483,9 +2483,8 @@ void AstGraphBuilder::VisitCall(Call* expr) {
// Create node to perform the function call. // Create node to perform the function call.
VectorSlotPair feedback = CreateVectorSlotPair(expr->CallFeedbackICSlot()); VectorSlotPair feedback = CreateVectorSlotPair(expr->CallFeedbackICSlot());
const Operator* call = const Operator* call = javascript()->CallFunction(
javascript()->CallFunction(args->length() + 2, language_mode(), feedback, args->length() + 2, feedback, receiver_hint, expr->tail_call_mode());
receiver_hint, expr->tail_call_mode());
FrameStateBeforeAndAfter states(this, expr->CallId()); FrameStateBeforeAndAfter states(this, expr->CallId());
Node* value = ProcessArguments(call, args->length() + 2); Node* value = ProcessArguments(call, args->length() + 2);
environment()->Push(value->InputAt(0)); // The callee passed to the call. environment()->Push(value->InputAt(0)); // The callee passed to the call.
...@@ -2563,8 +2562,7 @@ void AstGraphBuilder::VisitCallJSRuntime(CallRuntime* expr) { ...@@ -2563,8 +2562,7 @@ void AstGraphBuilder::VisitCallJSRuntime(CallRuntime* expr) {
VisitForValues(args); VisitForValues(args);
// Create node to perform the JS runtime call. // Create node to perform the JS runtime call.
const Operator* call = const Operator* call = javascript()->CallFunction(args->length() + 2);
javascript()->CallFunction(args->length() + 2, language_mode());
FrameStateBeforeAndAfter states(this, expr->CallId()); FrameStateBeforeAndAfter states(this, expr->CallId());
Node* value = ProcessArguments(call, args->length() + 2); Node* value = ProcessArguments(call, args->length() + 2);
states.AddToNode(value, expr->id(), ast_context()->GetStateCombine()); states.AddToNode(value, expr->id(), ast_context()->GetStateCombine());
......
...@@ -1007,8 +1007,8 @@ void BytecodeGraphBuilder::BuildCall() { ...@@ -1007,8 +1007,8 @@ void BytecodeGraphBuilder::BuildCall() {
CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(3)); CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(3));
// TODO(ishell): provide correct tail_call_mode value to CallFunction. // TODO(ishell): provide correct tail_call_mode value to CallFunction.
const Operator* call = javascript()->CallFunction( const Operator* call =
arg_count + 1, language_mode(), feedback, receiver_hint); javascript()->CallFunction(arg_count + 1, feedback, receiver_hint);
Node* value = ProcessCallArguments(call, callee, receiver, arg_count + 1); Node* value = ProcessCallArguments(call, callee, receiver, arg_count + 1);
environment()->BindAccumulator(value, &states); environment()->BindAccumulator(value, &states);
} }
...@@ -1025,8 +1025,7 @@ void BytecodeGraphBuilder::BuildCallJSRuntime() { ...@@ -1025,8 +1025,7 @@ void BytecodeGraphBuilder::BuildCallJSRuntime() {
size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2); size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2);
// Create node to perform the JS runtime call. // Create node to perform the JS runtime call.
const Operator* call = const Operator* call = javascript()->CallFunction(arg_count + 1);
javascript()->CallFunction(arg_count + 1, language_mode());
Node* value = ProcessCallArguments(call, callee, receiver, arg_count + 1); Node* value = ProcessCallArguments(call, callee, receiver, arg_count + 1);
environment()->BindAccumulator(value, &states); environment()->BindAccumulator(value, &states);
} }
......
...@@ -167,8 +167,7 @@ Reduction JSCallReducer::ReduceFunctionPrototypeApply(Node* node) { ...@@ -167,8 +167,7 @@ Reduction JSCallReducer::ReduceFunctionPrototypeApply(Node* node) {
} }
// Change {node} to the new {JSCallFunction} operator. // Change {node} to the new {JSCallFunction} operator.
NodeProperties::ChangeOp( NodeProperties::ChangeOp(
node, javascript()->CallFunction(arity, p.language_mode(), node, javascript()->CallFunction(arity, CallCountFeedback(p.feedback()),
CallCountFeedback(p.feedback()),
convert_mode, p.tail_call_mode())); convert_mode, p.tail_call_mode()));
// Change context of {node} to the Function.prototype.apply context, // Change context of {node} to the Function.prototype.apply context,
// to ensure any exception is thrown in the correct context. // to ensure any exception is thrown in the correct context.
...@@ -208,8 +207,7 @@ Reduction JSCallReducer::ReduceFunctionPrototypeCall(Node* node) { ...@@ -208,8 +207,7 @@ Reduction JSCallReducer::ReduceFunctionPrototypeCall(Node* node) {
--arity; --arity;
} }
NodeProperties::ChangeOp( NodeProperties::ChangeOp(
node, javascript()->CallFunction(arity, p.language_mode(), node, javascript()->CallFunction(arity, CallCountFeedback(p.feedback()),
CallCountFeedback(p.feedback()),
convert_mode, p.tail_call_mode())); convert_mode, p.tail_call_mode()));
// Try to further reduce the JSCallFunction {node}. // Try to further reduce the JSCallFunction {node}.
Reduction const reduction = ReduceJSCallFunction(node); Reduction const reduction = ReduceJSCallFunction(node);
...@@ -291,9 +289,8 @@ Reduction JSCallReducer::ReduceJSCallFunction(Node* node) { ...@@ -291,9 +289,8 @@ Reduction JSCallReducer::ReduceJSCallFunction(Node* node) {
jsgraph()->Constant(handle(bound_arguments->get(i), isolate()))); jsgraph()->Constant(handle(bound_arguments->get(i), isolate())));
arity++; arity++;
} }
NodeProperties::ChangeOp( NodeProperties::ChangeOp(node, javascript()->CallFunction(
node, javascript()->CallFunction(arity, p.language_mode(), arity, CallCountFeedback(p.feedback()),
CallCountFeedback(p.feedback()),
convert_mode, p.tail_call_mode())); convert_mode, p.tail_call_mode()));
// Try to further reduce the JSCallFunction {node}. // Try to further reduce the JSCallFunction {node}.
Reduction const reduction = ReduceJSCallFunction(node); Reduction const reduction = ReduceJSCallFunction(node);
......
...@@ -499,8 +499,8 @@ Reduction JSIntrinsicLowering::ReduceToString(Node* node) { ...@@ -499,8 +499,8 @@ Reduction JSIntrinsicLowering::ReduceToString(Node* node) {
Reduction JSIntrinsicLowering::ReduceCall(Node* node) { Reduction JSIntrinsicLowering::ReduceCall(Node* node) {
size_t const arity = CallRuntimeParametersOf(node->op()).arity(); size_t const arity = CallRuntimeParametersOf(node->op()).arity();
NodeProperties::ChangeOp( NodeProperties::ChangeOp(node,
node, javascript()->CallFunction(arity, STRICT, VectorSlotPair(), javascript()->CallFunction(arity, VectorSlotPair(),
ConvertReceiverMode::kAny, ConvertReceiverMode::kAny,
TailCallMode::kDisallow)); TailCallMode::kDisallow));
return Changed(node); return Changed(node);
...@@ -509,8 +509,8 @@ Reduction JSIntrinsicLowering::ReduceCall(Node* node) { ...@@ -509,8 +509,8 @@ Reduction JSIntrinsicLowering::ReduceCall(Node* node) {
Reduction JSIntrinsicLowering::ReduceTailCall(Node* node) { Reduction JSIntrinsicLowering::ReduceTailCall(Node* node) {
size_t const arity = CallRuntimeParametersOf(node->op()).arity(); size_t const arity = CallRuntimeParametersOf(node->op()).arity();
NodeProperties::ChangeOp( NodeProperties::ChangeOp(node,
node, javascript()->CallFunction(arity, STRICT, VectorSlotPair(), javascript()->CallFunction(arity, VectorSlotPair(),
ConvertReceiverMode::kAny, ConvertReceiverMode::kAny,
TailCallMode::kAllow)); TailCallMode::kAllow));
return Changed(node); return Changed(node);
......
...@@ -81,8 +81,7 @@ CallConstructParameters const& CallConstructParametersOf(Operator const* op) { ...@@ -81,8 +81,7 @@ CallConstructParameters const& CallConstructParametersOf(Operator const* op) {
std::ostream& operator<<(std::ostream& os, CallFunctionParameters const& p) { std::ostream& operator<<(std::ostream& os, CallFunctionParameters const& p) {
os << p.arity() << ", " << p.language_mode() << ", " << p.convert_mode() os << p.arity() << ", " << p.convert_mode() << ", " << p.tail_call_mode();
<< ", " << p.tail_call_mode();
return os; return os;
} }
...@@ -544,12 +543,11 @@ const Operator* JSOperatorBuilder::ToBoolean(ToBooleanHints hints) { ...@@ -544,12 +543,11 @@ const Operator* JSOperatorBuilder::ToBoolean(ToBooleanHints hints) {
hints); // parameter hints); // parameter
} }
const Operator* JSOperatorBuilder::CallFunction( const Operator* JSOperatorBuilder::CallFunction(
size_t arity, LanguageMode language_mode, VectorSlotPair const& feedback, size_t arity, VectorSlotPair const& feedback,
ConvertReceiverMode convert_mode, TailCallMode tail_call_mode) { ConvertReceiverMode convert_mode, TailCallMode tail_call_mode) {
CallFunctionParameters parameters(arity, language_mode, feedback, CallFunctionParameters parameters(arity, feedback, tail_call_mode,
tail_call_mode, convert_mode); convert_mode);
return new (zone()) Operator1<CallFunctionParameters>( // -- return new (zone()) Operator1<CallFunctionParameters>( // --
IrOpcode::kJSCallFunction, Operator::kNoProperties, // opcode IrOpcode::kJSCallFunction, Operator::kNoProperties, // opcode
"JSCallFunction", // name "JSCallFunction", // name
......
...@@ -80,20 +80,15 @@ CallConstructParameters const& CallConstructParametersOf(Operator const*); ...@@ -80,20 +80,15 @@ CallConstructParameters const& CallConstructParametersOf(Operator const*);
// used as a parameter by JSCallFunction operators. // used as a parameter by JSCallFunction operators.
class CallFunctionParameters final { class CallFunctionParameters final {
public: public:
CallFunctionParameters(size_t arity, LanguageMode language_mode, CallFunctionParameters(size_t arity, VectorSlotPair const& feedback,
VectorSlotPair const& feedback,
TailCallMode tail_call_mode, TailCallMode tail_call_mode,
ConvertReceiverMode convert_mode) ConvertReceiverMode convert_mode)
: bit_field_(ArityField::encode(arity) | : bit_field_(ArityField::encode(arity) |
ConvertReceiverModeField::encode(convert_mode) | ConvertReceiverModeField::encode(convert_mode) |
LanguageModeField::encode(language_mode) |
TailCallModeField::encode(tail_call_mode)), TailCallModeField::encode(tail_call_mode)),
feedback_(feedback) {} feedback_(feedback) {}
size_t arity() const { return ArityField::decode(bit_field_); } size_t arity() const { return ArityField::decode(bit_field_); }
LanguageMode language_mode() const {
return LanguageModeField::decode(bit_field_);
}
ConvertReceiverMode convert_mode() const { ConvertReceiverMode convert_mode() const {
return ConvertReceiverModeField::decode(bit_field_); return ConvertReceiverModeField::decode(bit_field_);
} }
...@@ -115,9 +110,8 @@ class CallFunctionParameters final { ...@@ -115,9 +110,8 @@ class CallFunctionParameters final {
return base::hash_combine(p.bit_field_, p.feedback_); return base::hash_combine(p.bit_field_, p.feedback_);
} }
typedef BitField<size_t, 0, 27> ArityField; typedef BitField<size_t, 0, 29> ArityField;
typedef BitField<ConvertReceiverMode, 27, 2> ConvertReceiverModeField; typedef BitField<ConvertReceiverMode, 29, 2> ConvertReceiverModeField;
typedef BitField<LanguageMode, 29, 2> LanguageModeField;
typedef BitField<TailCallMode, 31, 1> TailCallModeField; typedef BitField<TailCallMode, 31, 1> TailCallModeField;
const uint32_t bit_field_; const uint32_t bit_field_;
...@@ -427,8 +421,7 @@ class JSOperatorBuilder final : public ZoneObject { ...@@ -427,8 +421,7 @@ class JSOperatorBuilder final : public ZoneObject {
int literal_flags, int literal_index); int literal_flags, int literal_index);
const Operator* CallFunction( const Operator* CallFunction(
size_t arity, LanguageMode language_mode, size_t arity, VectorSlotPair const& feedback = VectorSlotPair(),
VectorSlotPair const& feedback = VectorSlotPair(),
ConvertReceiverMode convert_mode = ConvertReceiverMode::kAny, ConvertReceiverMode convert_mode = ConvertReceiverMode::kAny,
TailCallMode tail_call_mode = TailCallMode::kDisallow); TailCallMode tail_call_mode = TailCallMode::kDisallow);
const Operator* CallRuntime(Runtime::FunctionId id); const Operator* CallRuntime(Runtime::FunctionId id);
......
...@@ -1496,9 +1496,8 @@ Reduction JSTypedLowering::ReduceJSCallFunction(Node* node) { ...@@ -1496,9 +1496,8 @@ Reduction JSTypedLowering::ReduceJSCallFunction(Node* node) {
// Maybe we did at least learn something about the {receiver}. // Maybe we did at least learn something about the {receiver}.
if (p.convert_mode() != convert_mode) { if (p.convert_mode() != convert_mode) {
NodeProperties::ChangeOp( NodeProperties::ChangeOp(
node, node, javascript()->CallFunction(p.arity(), p.feedback(), convert_mode,
javascript()->CallFunction(p.arity(), p.language_mode(), p.feedback(), p.tail_call_mode()));
convert_mode, p.tail_call_mode()));
return Changed(node); return Changed(node);
} }
......
...@@ -64,10 +64,6 @@ Type* const kIntegral32Types[] = {Type::UnsignedSmall(), Type::Negative32(), ...@@ -64,10 +64,6 @@ Type* const kIntegral32Types[] = {Type::UnsignedSmall(), Type::Negative32(),
Type::Integral32()}; Type::Integral32()};
const LanguageMode kLanguageModes[] = {SLOPPY, STRICT, STRONG};
// TODO(mstarzinger): Find a common place and unify with test-js-typed-lowering.
Type* const kNumberTypes[] = { Type* const kNumberTypes[] = {
Type::UnsignedSmall(), Type::Negative32(), Type::Unsigned31(), Type::UnsignedSmall(), Type::Negative32(), Type::Unsigned31(),
Type::SignedSmall(), Type::Signed32(), Type::Unsigned32(), Type::SignedSmall(), Type::Signed32(), Type::Unsigned32(),
...@@ -88,15 +84,13 @@ TEST_F(JSBuiltinReducerTest, MathMax0) { ...@@ -88,15 +84,13 @@ TEST_F(JSBuiltinReducerTest, MathMax0) {
Node* control = graph()->start(); Node* control = graph()->start();
Node* context = UndefinedConstant(); Node* context = UndefinedConstant();
Node* frame_state = graph()->start(); Node* frame_state = graph()->start();
TRACED_FOREACH(LanguageMode, language_mode, kLanguageModes) { Node* call = graph()->NewNode(javascript()->CallFunction(2), function,
Node* call = graph()->NewNode(javascript()->CallFunction(2, language_mode), UndefinedConstant(), context, frame_state,
function, UndefinedConstant(), context, frame_state, effect, control);
frame_state, frame_state, effect, control);
Reduction r = Reduce(call); Reduction r = Reduce(call);
ASSERT_TRUE(r.Changed()); ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(), IsNumberConstant(-V8_INFINITY)); EXPECT_THAT(r.replacement(), IsNumberConstant(-V8_INFINITY));
}
} }
...@@ -107,19 +101,16 @@ TEST_F(JSBuiltinReducerTest, MathMax1) { ...@@ -107,19 +101,16 @@ TEST_F(JSBuiltinReducerTest, MathMax1) {
Node* control = graph()->start(); Node* control = graph()->start();
Node* context = UndefinedConstant(); Node* context = UndefinedConstant();
Node* frame_state = graph()->start(); Node* frame_state = graph()->start();
TRACED_FOREACH(LanguageMode, language_mode, kLanguageModes) {
TRACED_FOREACH(Type*, t0, kNumberTypes) { TRACED_FOREACH(Type*, t0, kNumberTypes) {
Node* p0 = Parameter(t0, 0); Node* p0 = Parameter(t0, 0);
Node* call = Node* call = graph()->NewNode(javascript()->CallFunction(3), function,
graph()->NewNode(javascript()->CallFunction(3, language_mode), UndefinedConstant(), p0, context, frame_state,
function, UndefinedConstant(), p0, context, frame_state, effect, control);
frame_state, frame_state, effect, control);
Reduction r = Reduce(call); Reduction r = Reduce(call);
ASSERT_TRUE(r.Changed()); ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(), p0); EXPECT_THAT(r.replacement(), p0);
} }
}
} }
...@@ -130,24 +121,20 @@ TEST_F(JSBuiltinReducerTest, MathMax2) { ...@@ -130,24 +121,20 @@ TEST_F(JSBuiltinReducerTest, MathMax2) {
Node* control = graph()->start(); Node* control = graph()->start();
Node* context = UndefinedConstant(); Node* context = UndefinedConstant();
Node* frame_state = graph()->start(); Node* frame_state = graph()->start();
TRACED_FOREACH(LanguageMode, language_mode, kLanguageModes) {
TRACED_FOREACH(Type*, t0, kIntegral32Types) { TRACED_FOREACH(Type*, t0, kIntegral32Types) {
TRACED_FOREACH(Type*, t1, kIntegral32Types) { TRACED_FOREACH(Type*, t1, kIntegral32Types) {
Node* p0 = Parameter(t0, 0); Node* p0 = Parameter(t0, 0);
Node* p1 = Parameter(t1, 1); Node* p1 = Parameter(t1, 1);
Node* call = Node* call = graph()->NewNode(javascript()->CallFunction(4), function,
graph()->NewNode(javascript()->CallFunction(4, language_mode), UndefinedConstant(), p0, p1, context,
function, UndefinedConstant(), p0, p1, context,
frame_state, frame_state, effect, control); frame_state, frame_state, effect, control);
Reduction r = Reduce(call); Reduction r = Reduce(call);
ASSERT_TRUE(r.Changed()); ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(), EXPECT_THAT(r.replacement(), IsSelect(MachineRepresentation::kNone,
IsSelect(MachineRepresentation::kNone,
IsNumberLessThan(p1, p0), p0, p1)); IsNumberLessThan(p1, p0), p0, p1));
} }
} }
}
} }
...@@ -162,14 +149,12 @@ TEST_F(JSBuiltinReducerTest, MathImul) { ...@@ -162,14 +149,12 @@ TEST_F(JSBuiltinReducerTest, MathImul) {
Node* control = graph()->start(); Node* control = graph()->start();
Node* context = UndefinedConstant(); Node* context = UndefinedConstant();
Node* frame_state = graph()->start(); Node* frame_state = graph()->start();
TRACED_FOREACH(LanguageMode, language_mode, kLanguageModes) {
TRACED_FOREACH(Type*, t0, kIntegral32Types) { TRACED_FOREACH(Type*, t0, kIntegral32Types) {
TRACED_FOREACH(Type*, t1, kIntegral32Types) { TRACED_FOREACH(Type*, t1, kIntegral32Types) {
Node* p0 = Parameter(t0, 0); Node* p0 = Parameter(t0, 0);
Node* p1 = Parameter(t1, 1); Node* p1 = Parameter(t1, 1);
Node* call = Node* call = graph()->NewNode(javascript()->CallFunction(4), function,
graph()->NewNode(javascript()->CallFunction(4, language_mode), UndefinedConstant(), p0, p1, context,
function, UndefinedConstant(), p0, p1, context,
frame_state, frame_state, effect, control); frame_state, frame_state, effect, control);
Reduction r = Reduce(call); Reduction r = Reduce(call);
...@@ -177,7 +162,6 @@ TEST_F(JSBuiltinReducerTest, MathImul) { ...@@ -177,7 +162,6 @@ TEST_F(JSBuiltinReducerTest, MathImul) {
EXPECT_THAT(r.replacement(), IsInt32Mul(p0, p1)); EXPECT_THAT(r.replacement(), IsInt32Mul(p0, p1));
} }
} }
}
} }
...@@ -192,19 +176,16 @@ TEST_F(JSBuiltinReducerTest, MathFround) { ...@@ -192,19 +176,16 @@ TEST_F(JSBuiltinReducerTest, MathFround) {
Node* control = graph()->start(); Node* control = graph()->start();
Node* context = UndefinedConstant(); Node* context = UndefinedConstant();
Node* frame_state = graph()->start(); Node* frame_state = graph()->start();
TRACED_FOREACH(LanguageMode, language_mode, kLanguageModes) {
TRACED_FOREACH(Type*, t0, kNumberTypes) { TRACED_FOREACH(Type*, t0, kNumberTypes) {
Node* p0 = Parameter(t0, 0); Node* p0 = Parameter(t0, 0);
Node* call = Node* call = graph()->NewNode(javascript()->CallFunction(3), function,
graph()->NewNode(javascript()->CallFunction(3, language_mode), UndefinedConstant(), p0, context, frame_state,
function, UndefinedConstant(), p0, context, frame_state, effect, control);
frame_state, frame_state, effect, control);
Reduction r = Reduce(call); Reduction r = Reduce(call);
ASSERT_TRUE(r.Changed()); ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(), IsTruncateFloat64ToFloat32(p0)); EXPECT_THAT(r.replacement(), IsTruncateFloat64ToFloat32(p0));
} }
}
} }
} // namespace compiler } // namespace compiler
......
...@@ -83,9 +83,9 @@ TEST_F(JSContextRelaxationTest, ...@@ -83,9 +83,9 @@ TEST_F(JSContextRelaxationTest,
ShallowFrameStateChain(outer_context, CALL_MAINTAINS_NATIVE_CONTEXT); ShallowFrameStateChain(outer_context, CALL_MAINTAINS_NATIVE_CONTEXT);
Node* const effect = graph()->start(); Node* const effect = graph()->start();
Node* const control = graph()->start(); Node* const control = graph()->start();
Node* node = graph()->NewNode( Node* node = graph()->NewNode(javascript()->CallFunction(2, VectorSlotPair()),
javascript()->CallFunction(2, STRICT, VectorSlotPair()), input0, input1, input0, input1, context, frame_state,
context, frame_state, frame_state, effect, control); frame_state, effect, control);
Reduction const r = Reduce(node); Reduction const r = Reduce(node);
EXPECT_TRUE(r.Changed()); EXPECT_TRUE(r.Changed());
EXPECT_EQ(outer_context, NodeProperties::GetContextInput(node)); EXPECT_EQ(outer_context, NodeProperties::GetContextInput(node));
...@@ -101,9 +101,9 @@ TEST_F(JSContextRelaxationTest, ...@@ -101,9 +101,9 @@ TEST_F(JSContextRelaxationTest,
ShallowFrameStateChain(outer_context, CALL_CHANGES_NATIVE_CONTEXT); ShallowFrameStateChain(outer_context, CALL_CHANGES_NATIVE_CONTEXT);
Node* const effect = graph()->start(); Node* const effect = graph()->start();
Node* const control = graph()->start(); Node* const control = graph()->start();
Node* node = graph()->NewNode( Node* node = graph()->NewNode(javascript()->CallFunction(2, VectorSlotPair()),
javascript()->CallFunction(2, STRICT, VectorSlotPair()), input0, input1, input0, input1, context, frame_state,
context, frame_state, frame_state, effect, control); frame_state, effect, control);
Reduction const r = Reduce(node); Reduction const r = Reduce(node);
EXPECT_FALSE(r.Changed()); EXPECT_FALSE(r.Changed());
EXPECT_EQ(context, NodeProperties::GetContextInput(node)); EXPECT_EQ(context, NodeProperties::GetContextInput(node));
...@@ -119,9 +119,9 @@ TEST_F(JSContextRelaxationTest, ...@@ -119,9 +119,9 @@ TEST_F(JSContextRelaxationTest,
DeepFrameStateChain(outer_context, CALL_MAINTAINS_NATIVE_CONTEXT); DeepFrameStateChain(outer_context, CALL_MAINTAINS_NATIVE_CONTEXT);
Node* const effect = graph()->start(); Node* const effect = graph()->start();
Node* const control = graph()->start(); Node* const control = graph()->start();
Node* node = graph()->NewNode( Node* node = graph()->NewNode(javascript()->CallFunction(2, VectorSlotPair()),
javascript()->CallFunction(2, STRICT, VectorSlotPair()), input0, input1, input0, input1, context, frame_state,
context, frame_state, frame_state, effect, control); frame_state, effect, control);
Reduction const r = Reduce(node); Reduction const r = Reduce(node);
EXPECT_TRUE(r.Changed()); EXPECT_TRUE(r.Changed());
EXPECT_EQ(outer_context, NodeProperties::GetContextInput(node)); EXPECT_EQ(outer_context, NodeProperties::GetContextInput(node));
...@@ -137,9 +137,9 @@ TEST_F(JSContextRelaxationTest, ...@@ -137,9 +137,9 @@ TEST_F(JSContextRelaxationTest,
DeepFrameStateChain(outer_context, CALL_CHANGES_NATIVE_CONTEXT); DeepFrameStateChain(outer_context, CALL_CHANGES_NATIVE_CONTEXT);
Node* const effect = graph()->start(); Node* const effect = graph()->start();
Node* const control = graph()->start(); Node* const control = graph()->start();
Node* node = graph()->NewNode( Node* node = graph()->NewNode(javascript()->CallFunction(2, VectorSlotPair()),
javascript()->CallFunction(2, STRICT, VectorSlotPair()), input0, input1, input0, input1, context, frame_state,
context, frame_state, frame_state, effect, control); frame_state, effect, control);
Reduction const r = Reduce(node); Reduction const r = Reduce(node);
EXPECT_FALSE(r.Changed()); EXPECT_FALSE(r.Changed());
EXPECT_EQ(context, NodeProperties::GetContextInput(node)); EXPECT_EQ(context, NodeProperties::GetContextInput(node));
...@@ -158,9 +158,9 @@ TEST_F(JSContextRelaxationTest, ...@@ -158,9 +158,9 @@ TEST_F(JSContextRelaxationTest,
op, graph()->start(), graph()->start(), outer_context, effect, control); op, graph()->start(), graph()->start(), outer_context, effect, control);
Node* const frame_state_2 = Node* const frame_state_2 =
ShallowFrameStateChain(nested_context, CALL_MAINTAINS_NATIVE_CONTEXT); ShallowFrameStateChain(nested_context, CALL_MAINTAINS_NATIVE_CONTEXT);
Node* node = graph()->NewNode( Node* node = graph()->NewNode(javascript()->CallFunction(2, VectorSlotPair()),
javascript()->CallFunction(2, STRICT, VectorSlotPair()), input0, input1, input0, input1, context, frame_state_2,
context, frame_state_2, frame_state_2, effect, control); frame_state_2, effect, control);
Reduction const r = Reduce(node); Reduction const r = Reduce(node);
EXPECT_TRUE(r.Changed()); EXPECT_TRUE(r.Changed());
EXPECT_EQ(outer_context, NodeProperties::GetContextInput(node)); EXPECT_EQ(outer_context, NodeProperties::GetContextInput(node));
...@@ -180,9 +180,9 @@ TEST_F(JSContextRelaxationTest, ...@@ -180,9 +180,9 @@ TEST_F(JSContextRelaxationTest,
op, graph()->start(), graph()->start(), outer_context, effect, control); op, graph()->start(), graph()->start(), outer_context, effect, control);
Node* const frame_state_2 = Node* const frame_state_2 =
ShallowFrameStateChain(nested_context, CALL_MAINTAINS_NATIVE_CONTEXT); ShallowFrameStateChain(nested_context, CALL_MAINTAINS_NATIVE_CONTEXT);
Node* node = graph()->NewNode( Node* node = graph()->NewNode(javascript()->CallFunction(2, VectorSlotPair()),
javascript()->CallFunction(2, STRICT, VectorSlotPair()), input0, input1, input0, input1, context, frame_state_2,
context, frame_state_2, frame_state_2, effect, control); frame_state_2, effect, control);
Reduction const r = Reduce(node); Reduction const r = Reduce(node);
EXPECT_TRUE(r.Changed()); EXPECT_TRUE(r.Changed());
EXPECT_EQ(outer_context, NodeProperties::GetContextInput(node)); EXPECT_EQ(outer_context, NodeProperties::GetContextInput(node));
...@@ -203,9 +203,9 @@ TEST_F(JSContextRelaxationTest, ...@@ -203,9 +203,9 @@ TEST_F(JSContextRelaxationTest,
graph()->NewNode(op, graph()->start(), outer_context, effect, control); graph()->NewNode(op, graph()->start(), outer_context, effect, control);
Node* const frame_state_2 = Node* const frame_state_2 =
ShallowFrameStateChain(nested_context, CALL_MAINTAINS_NATIVE_CONTEXT); ShallowFrameStateChain(nested_context, CALL_MAINTAINS_NATIVE_CONTEXT);
Node* node = graph()->NewNode( Node* node = graph()->NewNode(javascript()->CallFunction(2, VectorSlotPair()),
javascript()->CallFunction(2, STRICT, VectorSlotPair()), input0, input1, input0, input1, context, frame_state_2,
context, frame_state_2, frame_state_2, effect, control); frame_state_2, effect, control);
Reduction const r = Reduce(node); Reduction const r = Reduce(node);
EXPECT_TRUE(r.Changed()); EXPECT_TRUE(r.Changed());
EXPECT_EQ(outer_context, NodeProperties::GetContextInput(node)); EXPECT_EQ(outer_context, NodeProperties::GetContextInput(node));
...@@ -228,9 +228,9 @@ TEST_F(JSContextRelaxationTest, ...@@ -228,9 +228,9 @@ TEST_F(JSContextRelaxationTest,
frame_state_1, effect, control); frame_state_1, effect, control);
Node* const frame_state_2 = Node* const frame_state_2 =
ShallowFrameStateChain(nested_context, CALL_MAINTAINS_NATIVE_CONTEXT); ShallowFrameStateChain(nested_context, CALL_MAINTAINS_NATIVE_CONTEXT);
Node* node = graph()->NewNode( Node* node = graph()->NewNode(javascript()->CallFunction(2, VectorSlotPair()),
javascript()->CallFunction(2, STRICT, VectorSlotPair()), input0, input1, input0, input1, context, frame_state_2,
context, frame_state_2, frame_state_2, effect, control); frame_state_2, effect, control);
Reduction const r = Reduce(node); Reduction const r = Reduce(node);
EXPECT_TRUE(r.Changed()); EXPECT_TRUE(r.Changed());
EXPECT_EQ(nested_context, NodeProperties::GetContextInput(node)); EXPECT_EQ(nested_context, NodeProperties::GetContextInput(node));
...@@ -250,9 +250,9 @@ TEST_F(JSContextRelaxationTest, ...@@ -250,9 +250,9 @@ TEST_F(JSContextRelaxationTest,
op, graph()->start(), graph()->start(), outer_context, effect, control); op, graph()->start(), graph()->start(), outer_context, effect, control);
Node* const frame_state_2 = Node* const frame_state_2 =
ShallowFrameStateChain(nested_context, CALL_MAINTAINS_NATIVE_CONTEXT); ShallowFrameStateChain(nested_context, CALL_MAINTAINS_NATIVE_CONTEXT);
Node* node = graph()->NewNode( Node* node = graph()->NewNode(javascript()->CallFunction(2, VectorSlotPair()),
javascript()->CallFunction(2, STRICT, VectorSlotPair()), input0, input1, input0, input1, context, frame_state_2,
context, frame_state_2, frame_state_2, effect, control); frame_state_2, effect, control);
Reduction const r = Reduce(node); Reduction const r = Reduce(node);
EXPECT_TRUE(r.Changed()); EXPECT_TRUE(r.Changed());
EXPECT_EQ(nested_context, NodeProperties::GetContextInput(node)); EXPECT_EQ(nested_context, NodeProperties::GetContextInput(node));
...@@ -272,9 +272,9 @@ TEST_F(JSContextRelaxationTest, ...@@ -272,9 +272,9 @@ TEST_F(JSContextRelaxationTest,
graph()->NewNode(op, graph()->start(), outer_context, effect, control); graph()->NewNode(op, graph()->start(), outer_context, effect, control);
Node* const frame_state_2 = Node* const frame_state_2 =
ShallowFrameStateChain(nested_context, CALL_MAINTAINS_NATIVE_CONTEXT); ShallowFrameStateChain(nested_context, CALL_MAINTAINS_NATIVE_CONTEXT);
Node* node = graph()->NewNode( Node* node = graph()->NewNode(javascript()->CallFunction(2, VectorSlotPair()),
javascript()->CallFunction(2, STRICT, VectorSlotPair()), input0, input1, input0, input1, context, frame_state_2,
context, frame_state_2, frame_state_2, effect, control); frame_state_2, effect, control);
Reduction const r = Reduce(node); Reduction const r = Reduce(node);
EXPECT_FALSE(r.Changed()); EXPECT_FALSE(r.Changed());
EXPECT_EQ(context, NodeProperties::GetContextInput(node)); EXPECT_EQ(context, NodeProperties::GetContextInput(node));
......
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