Index: src/ast/ast.cc |
diff --git a/src/ast/ast.cc b/src/ast/ast.cc |
index 5b98e3165447f69f292b898139d85d8ab5161b6c..8e847c4c86e20e049093f2d2d155b4f28d033421 100644 |
--- a/src/ast/ast.cc |
+++ b/src/ast/ast.cc |
@@ -490,7 +490,7 @@ void ObjectLiteral::AssignFeedbackSlots(FeedbackVectorSpec* spec, |
ObjectLiteral::Property* property = properties()->at(property_index); |
Expression* value = property->value(); |
- if (property->kind() != ObjectLiteral::Property::PROTOTYPE) { |
+ if (!property->IsPrototype()) { |
if (FunctionLiteral::NeedsHomeObject(value)) { |
property->SetSlot(spec->AddStoreICSlot(language_mode)); |
} |
@@ -512,7 +512,7 @@ void ObjectLiteral::CalculateEmitStore(Zone* zone) { |
for (int i = properties()->length() - 1; i >= 0; i--) { |
ObjectLiteral::Property* property = properties()->at(i); |
if (property->is_computed_name()) continue; |
- if (property->kind() == ObjectLiteral::Property::PROTOTYPE) continue; |
+ if (property->IsPrototype()) continue; |
Literal* literal = property->key()->AsLiteral(); |
DCHECK(!literal->IsNullLiteral()); |
@@ -534,8 +534,7 @@ void ObjectLiteral::CalculateEmitStore(Zone* zone) { |
bool ObjectLiteral::IsBoilerplateProperty(ObjectLiteral::Property* property) { |
- return property != NULL && |
- property->kind() != ObjectLiteral::Property::PROTOTYPE; |
+ return property != NULL && !property->IsPrototype(); |
} |
void ObjectLiteral::InitDepthAndFlags() { |
@@ -550,6 +549,9 @@ void ObjectLiteral::InitDepthAndFlags() { |
for (int i = 0; i < properties()->length(); i++) { |
ObjectLiteral::Property* property = properties()->at(i); |
if (!IsBoilerplateProperty(property)) { |
+ // __proto__:null at the first position has no side-effects and is set |
adamk
2017/03/13 18:10:44
Why do you say "first position"? The placement of
|
+ // directly on the boilerplate. |
+ if (property->IsNullPrototype()) continue; |
is_simple = false; |
continue; |
} |