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

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

Issue 2302643002: Split the AST representation of class properties from object properties (Closed)
Patch Set: rebase 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
« no previous file with comments | « src/interpreter/bytecode-generator.h ('k') | src/parsing/parameter-initializer-rewriter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index 24d48a20a6cb117e80bb654d2493f9f5cb52c115..e894e7638e24204a9cb72475dc04aef7dba134c5 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -1544,7 +1544,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;
@@ -1575,13 +1575,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);
@@ -1589,12 +1583,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;
@@ -3235,7 +3229,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)) {
« no previous file with comments | « src/interpreter/bytecode-generator.h ('k') | src/parsing/parameter-initializer-rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698