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

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

Issue 2302643002: Split the AST representation of class properties from object properties (Closed)
Patch Set: remove spurious classliteralproperty typedef Created 4 years, 3 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 640ac14f9e64368db3f153b36048f1f7e7293f6d..254a014c2810e3ae212ae4b65f6f497a42c7161e 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -1545,7 +1545,7 @@ void BytecodeGenerator::VisitClassLiteralProperties(ClassLiteral* expr,
// Create nodes to store method values into the literal.
for (int i = 0; i < expr->properties()->length(); i++) {
- ObjectLiteral::Property* property = expr->properties()->at(i);
+ ClassLiteral::Property* property = expr->properties()->at(i);
// Set-up receiver.
Register new_receiver = property->is_static() ? literal : prototype;
@@ -1576,13 +1576,7 @@ void BytecodeGenerator::VisitClassLiteralProperties(ClassLiteral* expr,
}
switch (property->kind()) {
- case ObjectLiteral::Property::CONSTANT:
- case ObjectLiteral::Property::MATERIALIZED_LITERAL:
- case ObjectLiteral::Property::PROTOTYPE:
- // Invalid properties for ES6 classes.
- UNREACHABLE();
- break;
- case ObjectLiteral::Property::COMPUTED: {
+ case ClassLiteral::Property::METHOD: {
builder()
->LoadLiteral(Smi::FromInt(property->NeedsSetFunctionName()))
.StoreAccumulatorInRegister(set_function_name);
@@ -1590,12 +1584,12 @@ void BytecodeGenerator::VisitClassLiteralProperties(ClassLiteral* expr,
5);
break;
}
- case ObjectLiteral::Property::GETTER: {
+ case ClassLiteral::Property::GETTER: {
builder()->CallRuntime(Runtime::kDefineGetterPropertyUnchecked,
receiver, 4);
break;
}
- case ObjectLiteral::Property::SETTER: {
+ case ClassLiteral::Property::SETTER: {
builder()->CallRuntime(Runtime::kDefineSetterPropertyUnchecked,
receiver, 4);
break;
@@ -3227,7 +3221,7 @@ void BytecodeGenerator::VisitObjectLiteralAccessor(
}
void BytecodeGenerator::VisitSetHomeObject(Register value, Register home_object,
- ObjectLiteralProperty* property,
+ LiteralProperty* property,
int slot_number) {
Expression* expr = property->value();
if (FunctionLiteral::NeedsHomeObject(expr)) {

Powered by Google App Engine
This is Rietveld 408576698