Commit 6a132845 authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] The JSCreateWithContext operator doesn't need a frame state.

Creating a with context cannot lazy/eager deoptimize, so we don't need
to pass a frame state.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#32711}
parent 67c99a99
...@@ -57,7 +57,6 @@ int OperatorProperties::GetFrameStateInputCount(const Operator* op) { ...@@ -57,7 +57,6 @@ int OperatorProperties::GetFrameStateInputCount(const Operator* op) {
// Context operations // Context operations
case IrOpcode::kJSLoadDynamic: case IrOpcode::kJSLoadDynamic:
case IrOpcode::kJSCreateScriptContext: case IrOpcode::kJSCreateScriptContext:
case IrOpcode::kJSCreateWithContext:
// Conversions // Conversions
case IrOpcode::kJSToName: case IrOpcode::kJSToName:
......
...@@ -173,13 +173,10 @@ TEST_F(JSContextRelaxationTest, ...@@ -173,13 +173,10 @@ TEST_F(JSContextRelaxationTest,
Node* const context = Parameter(2); Node* const context = Parameter(2);
Node* const outer_context = Parameter(3); Node* const outer_context = Parameter(3);
const Operator* op = javascript()->CreateWithContext(); const Operator* op = javascript()->CreateWithContext();
Node* const frame_state_1 =
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* nested_context = Node* nested_context = graph()->NewNode(
graph()->NewNode(op, graph()->start(), graph()->start(), outer_context, op, graph()->start(), graph()->start(), outer_context, 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(
......
...@@ -80,7 +80,7 @@ const SharedOperator kSharedOperators[] = { ...@@ -80,7 +80,7 @@ const SharedOperator kSharedOperators[] = {
SHARED(HasProperty, Operator::kNoProperties, 2, 1, 1, 1, 1, 1, 2), SHARED(HasProperty, Operator::kNoProperties, 2, 1, 1, 1, 1, 1, 2),
SHARED(TypeOf, Operator::kEliminatable, 1, 0, 1, 0, 1, 1, 0), SHARED(TypeOf, Operator::kEliminatable, 1, 0, 1, 0, 1, 1, 0),
SHARED(InstanceOf, Operator::kNoProperties, 2, 1, 1, 1, 1, 1, 2), SHARED(InstanceOf, Operator::kNoProperties, 2, 1, 1, 1, 1, 1, 2),
SHARED(CreateWithContext, Operator::kNoProperties, 2, 1, 1, 1, 1, 1, 2), SHARED(CreateWithContext, Operator::kNoProperties, 2, 0, 1, 1, 1, 1, 2),
SHARED(CreateModuleContext, Operator::kNoProperties, 2, 0, 1, 1, 1, 1, 2), SHARED(CreateModuleContext, Operator::kNoProperties, 2, 0, 1, 1, 1, 1, 2),
#undef SHARED #undef SHARED
}; };
......
...@@ -1124,12 +1124,11 @@ TEST_F(JSTypedLoweringTest, JSCreateWithContext) { ...@@ -1124,12 +1124,11 @@ TEST_F(JSTypedLoweringTest, JSCreateWithContext) {
Node* const object = Parameter(Type::Receiver()); Node* const object = Parameter(Type::Receiver());
Node* const closure = Parameter(Type::Function()); Node* const closure = Parameter(Type::Function());
Node* const context = Parameter(Type::Any()); Node* const context = Parameter(Type::Any());
Node* const frame_state = EmptyFrameState();
Node* const effect = graph()->start(); Node* const effect = graph()->start();
Node* const control = graph()->start(); Node* const control = graph()->start();
Reduction r = Reduction r =
Reduce(graph()->NewNode(javascript()->CreateWithContext(), object, Reduce(graph()->NewNode(javascript()->CreateWithContext(), object,
closure, context, frame_state, effect, control)); closure, context, effect, control));
ASSERT_TRUE(r.Changed()); ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(), EXPECT_THAT(r.replacement(),
IsFinishRegion(IsAllocate(IsNumberConstant(Context::SizeFor( IsFinishRegion(IsAllocate(IsNumberConstant(Context::SizeFor(
......
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