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

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

Issue 2586463002: Add CreateDataPropertyInLiteralFlags. (Closed)
Patch Set: Address review comments. Created 4 years 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-array-builder.cc ('k') | src/interpreter/bytecodes.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 74bdb7ebf4d4a778a2f4ba587f2528d565190b6a..4c1561479e14422a423cf995f403352981625360 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -1500,9 +1500,11 @@ void BytecodeGenerator::VisitClassLiteralProperties(ClassLiteral* expr,
switch (property->kind()) {
case ClassLiteral::Property::METHOD: {
- builder()
- ->LoadLiteral(Smi::FromInt(property->NeedsSetFunctionName()))
- .StoreDataPropertyInLiteral(receiver, key, value, attr);
+ DataPropertyInLiteralFlags flags = DataPropertyInLiteralFlag::kDontEnum;
+ if (property->NeedsSetFunctionName()) {
+ flags |= DataPropertyInLiteralFlag::kSetFunctionName;
+ }
+ builder()->StoreDataPropertyInLiteral(receiver, key, value, flags);
break;
}
case ClassLiteral::Property::GETTER: {
@@ -1737,13 +1739,14 @@ void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
Register value = VisitForRegisterValue(property->value());
VisitSetHomeObject(value, literal, property);
- Register attr = register_allocator()->NewRegister();
+ DataPropertyInLiteralFlags data_property_flags =
+ DataPropertyInLiteralFlag::kNoFlags;
+ if (property->NeedsSetFunctionName()) {
+ data_property_flags |= DataPropertyInLiteralFlag::kSetFunctionName;
+ }
- builder()
- ->LoadLiteral(Smi::FromInt(NONE))
- .StoreAccumulatorInRegister(attr)
- .LoadLiteral(Smi::FromInt(property->NeedsSetFunctionName()))
- .StoreDataPropertyInLiteral(literal, key, value, attr);
+ builder()->StoreDataPropertyInLiteral(literal, key, value,
+ data_property_flags);
break;
}
case ObjectLiteral::Property::GETTER:
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698