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

Unified Diff: src/compiler/ast-graph-builder.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/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index aa0efe06539ea7f7ea8eee50fab44266e892af4d..eedb3902459a9a56d31952bcb90253960aed365a 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -1600,7 +1600,7 @@ void AstGraphBuilder::VisitClassLiteral(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);
environment()->Push(environment()->Peek(property->is_static() ? 1 : 0));
VisitForValue(property->key());
@@ -1625,11 +1625,7 @@ void AstGraphBuilder::VisitClassLiteral(ClassLiteral* expr) {
BuildSetHomeObject(value, receiver, property);
switch (property->kind()) {
- case ObjectLiteral::Property::CONSTANT:
- case ObjectLiteral::Property::MATERIALIZED_LITERAL:
- case ObjectLiteral::Property::PROTOTYPE:
- UNREACHABLE();
- case ObjectLiteral::Property::COMPUTED: {
+ case ClassLiteral::Property::METHOD: {
Node* attr = jsgraph()->Constant(DONT_ENUM);
Node* set_function_name =
jsgraph()->Constant(property->NeedsSetFunctionName());
@@ -1639,14 +1635,14 @@ void AstGraphBuilder::VisitClassLiteral(ClassLiteral* expr) {
PrepareFrameState(call, BailoutId::None());
break;
}
- case ObjectLiteral::Property::GETTER: {
+ case ClassLiteral::Property::GETTER: {
Node* attr = jsgraph()->Constant(DONT_ENUM);
const Operator* op = javascript()->CallRuntime(
Runtime::kDefineGetterPropertyUnchecked, 4);
NewNode(op, receiver, key, value, attr);
break;
}
- case ObjectLiteral::Property::SETTER: {
+ case ClassLiteral::Property::SETTER: {
Node* attr = jsgraph()->Constant(DONT_ENUM);
const Operator* op = javascript()->CallRuntime(
Runtime::kDefineSetterPropertyUnchecked, 4);
@@ -3695,9 +3691,8 @@ Node* AstGraphBuilder::BuildToObject(Node* input, BailoutId bailout_id) {
return object;
}
-
Node* AstGraphBuilder::BuildSetHomeObject(Node* value, Node* home_object,
- ObjectLiteralProperty* property,
+ LiteralProperty* property,
int slot_number) {
Expression* expr = property->value();
if (!FunctionLiteral::NeedsHomeObject(expr)) return value;

Powered by Google App Engine
This is Rietveld 408576698