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

Unified Diff: src/compiler/ast-graph-builder.cc

Issue 1679813002: [compiler] Remove the special case "prototype" load in class literals. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix mips. Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698