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

Unified Diff: src/ast.cc

Issue 873823003: Move object literal checking into checker classes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix assert Created 5 years, 11 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/arm64/full-codegen-arm64.cc ('k') | src/compiler/ast-graph-builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.cc
diff --git a/src/ast.cc b/src/ast.cc
index 7369e75ea1558c7d5b5d2a692b97d2f263ecd5c7..4280a983649608aae812c1b9d260f83ca4581d49 100644
--- a/src/ast.cc
+++ b/src/ast.cc
@@ -239,7 +239,6 @@ void ObjectLiteral::CalculateEmitStore(Zone* zone) {
ZoneHashMap table(Literal::Match, ZoneHashMap::kDefaultHashMapCapacity,
allocator);
- bool seen_prototype = false;
for (int i = properties()->length() - 1; i >= 0; i--) {
ObjectLiteral::Property* property = properties()->at(i);
if (property->is_computed_name()) continue;
@@ -252,13 +251,7 @@ void ObjectLiteral::CalculateEmitStore(Zone* zone) {
property->kind() == ObjectLiteral::Property::COMPUTED) &&
table.Lookup(literal, hash, false, allocator) != NULL) {
property->set_emit_store(false);
- } else if (property->kind() == ObjectLiteral::Property::PROTOTYPE) {
- // Only emit a store for the last prototype property. Make sure we do not
- // clobber the "__proto__" name for instance properties (using method or
- // literal shorthand syntax).
- property->set_emit_store(!seen_prototype);
- seen_prototype = true;
- } else {
+ } else if (property->kind() != ObjectLiteral::Property::PROTOTYPE) {
// Add key to the table.
table.Lookup(literal, hash, true, allocator);
}
« no previous file with comments | « src/arm64/full-codegen-arm64.cc ('k') | src/compiler/ast-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698