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

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

Issue 2237553004: Use IsPropertyName instead of IsInternalizedString in VisitObjectLiteral. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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/full-codegen/x64/full-codegen-x64.cc ('k') | no next file » | 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 324c7c196848ac5b17af4645d9d009d7f5d62782..26ff9b499472c8fbb3b6dc7b99f331a9f8b0c040 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -1634,7 +1634,7 @@ void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
if (property->IsCompileTimeValue()) continue;
RegisterAllocationScope inner_register_scope(this);
- Literal* literal_key = property->key()->AsLiteral();
+ Literal* key = property->key()->AsLiteral();
switch (property->kind()) {
case ObjectLiteral::Property::CONSTANT:
UNREACHABLE();
@@ -1644,11 +1644,7 @@ void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
case ObjectLiteral::Property::COMPUTED: {
// It is safe to use [[Put]] here because the boilerplate already
// contains computed properties with an uninitialized value.
-
- // TODO(5203): Remove this temporary exception.
- AllowHandleDereference allow_deref;
-
- if (literal_key->value()->IsInternalizedString()) {
+ if (key->IsPropertyName()) {
if (property->emit_store()) {
VisitForAccumulatorValue(property->value());
if (FunctionLiteral::NeedsHomeObject(property->value())) {
@@ -1656,12 +1652,12 @@ void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
Register value = register_allocator()->NewRegister();
builder()->StoreAccumulatorInRegister(value);
builder()->StoreNamedProperty(
- literal, literal_key->AsPropertyName(),
+ literal, key->AsPropertyName(),
feedback_index(property->GetSlot(0)), language_mode());
VisitSetHomeObject(value, literal, property, 1);
} else {
builder()->StoreNamedProperty(
- literal, literal_key->AsPropertyName(),
+ literal, key->AsPropertyName(),
feedback_index(property->GetSlot(0)), language_mode());
}
} else {
@@ -1705,12 +1701,12 @@ void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
}
case ObjectLiteral::Property::GETTER:
if (property->emit_store()) {
- accessor_table.lookup(literal_key)->second->getter = property;
+ accessor_table.lookup(key)->second->getter = property;
}
break;
case ObjectLiteral::Property::SETTER:
if (property->emit_store()) {
- accessor_table.lookup(literal_key)->second->setter = property;
+ accessor_table.lookup(key)->second->setter = property;
}
break;
}
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698