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

Unified Diff: src/interpreter/bytecode-generator.cc

Issue 1678103002: [interpreter] Remove special "prototype" load in class literals. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
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);

Powered by Google App Engine
This is Rietveld 408576698