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

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

Issue 2445333002: Ensure slow properties for simple {__proto__:null} literals. (Closed)
Patch Set: fixing compilation issue Created 3 years, 8 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-flags.h ('k') | src/objects.h » ('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 6cf3216f8542caf9af4c8a6543b56b097de79037..097dcb4ff66d678f16c0fa887a7eaed1969ff96f 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -1756,6 +1756,8 @@ void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
break;
}
case ObjectLiteral::Property::PROTOTYPE: {
+ // __proto__:null is handled by CreateObjectLiteral.
+ if (property->IsNullPrototype()) break;
DCHECK(property->emit_store());
RegisterList args = register_allocator()->NewRegisterList(2);
builder()->MoveRegister(literal, args[0]);
@@ -1805,7 +1807,9 @@ void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
ObjectLiteral::Property* property = expr->properties()->at(property_index);
RegisterAllocationScope inner_register_scope(this);
- if (property->kind() == ObjectLiteral::Property::PROTOTYPE) {
+ if (property->IsPrototype()) {
+ // __proto__:null is handled by CreateObjectLiteral.
+ if (property->IsNullPrototype()) continue;
DCHECK(property->emit_store());
RegisterList args = register_allocator()->NewRegisterList(2);
builder()->MoveRegister(literal, args[0]);
« no previous file with comments | « src/interpreter/bytecode-flags.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698