| Index: src/compiler/ast-graph-builder.cc
|
| diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
|
| index c3cac45a4cd8e12f4ea117ec02291d0a428be8cd..d640fadaa9f6656f2ac3102ff276cd695bb2e6fa 100644
|
| --- a/src/compiler/ast-graph-builder.cc
|
| +++ b/src/compiler/ast-graph-builder.cc
|
| @@ -1582,15 +1582,15 @@ void AstGraphBuilder::VisitClassLiteralContents(ClassLiteral* expr) {
|
| Node* literal = NewNode(opc, extends, constructor, start, end);
|
| PrepareFrameState(literal, expr->CreateLiteralId(),
|
| OutputFrameStateCombine::Push());
|
| -
|
| - // The prototype is ensured to exist by Runtime_DefineClass. No access check
|
| - // is needed here since the constructor is created by the class literal.
|
| - Node* prototype =
|
| - BuildLoadObjectField(literal, JSFunction::kPrototypeOrInitialMapOffset);
|
| -
|
| - // The class literal and the prototype are both expected on the operand stack
|
| - // during evaluation of the method values.
|
| environment()->Push(literal);
|
| +
|
| + // Load the "prototype" from the constructor.
|
| + FrameStateBeforeAndAfter states(this, expr->CreateLiteralId());
|
| + Handle<Name> name = isolate()->factory()->prototype_string();
|
| + VectorSlotPair pair = CreateVectorSlotPair(expr->PrototypeSlot());
|
| + Node* prototype = BuildNamedLoad(literal, name, pair);
|
| + states.AddToNode(prototype, expr->PrototypeId(),
|
| + OutputFrameStateCombine::Push());
|
| environment()->Push(prototype);
|
|
|
| // Create nodes to store method values into the literal.
|
| @@ -3671,12 +3671,6 @@ Node* AstGraphBuilder::BuildGlobalStore(Handle<Name> name, Node* value,
|
| }
|
|
|
|
|
| -Node* AstGraphBuilder::BuildLoadObjectField(Node* object, int offset) {
|
| - return NewNode(jsgraph()->machine()->Load(MachineType::AnyTagged()), object,
|
| - jsgraph()->IntPtrConstant(offset - kHeapObjectTag));
|
| -}
|
| -
|
| -
|
| Node* AstGraphBuilder::BuildLoadImmutableObjectField(Node* object, int offset) {
|
| return graph()->NewNode(jsgraph()->machine()->Load(MachineType::AnyTagged()),
|
| object,
|
|
|