Index: src/interpreter/bytecode-generator.cc |
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc |
index 6a23812ae906566308e34373a9f4d98d59ef906c..25bf0550d0eb3ba0e7f7b860808565435f2b906f 100644 |
--- a/src/interpreter/bytecode-generator.cc |
+++ b/src/interpreter/bytecode-generator.cc |
@@ -1241,15 +1241,16 @@ void BytecodeGenerator::VisitClassLiteral(ClassLiteral* expr) { |
void BytecodeGenerator::VisitClassLiteralContents(ClassLiteral* expr) { |
VisitClassLiteralForRuntimeDefinition(expr); |
- // The prototype is ensured to exist by Runtime_DefineClass in |
- // VisitClassForRuntimeDefinition. No access check is needed here |
- // since the constructor is created by the class literal. |
+ |
+ // Load the "prototype" from the constructor. |
register_allocator()->PrepareForConsecutiveAllocations(2); |
Register literal = register_allocator()->NextConsecutiveRegister(); |
Register prototype = register_allocator()->NextConsecutiveRegister(); |
+ Handle<String> name = isolate()->factory()->prototype_string(); |
+ FeedbackVectorSlot slot = expr->PrototypeSlot(); |
builder() |
->StoreAccumulatorInRegister(literal) |
- .LoadPrototypeOrInitialMap() |
+ .LoadNamedProperty(literal, name, feedback_index(slot), language_mode()) |
.StoreAccumulatorInRegister(prototype); |
VisitClassLiteralProperties(expr, literal, prototype); |