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

Unified Diff: src/lookup.cc

Issue 1704353002: [runtime] Force internalize names used before lookup in in DescriptorArray and TransitionArray (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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/lookup.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lookup.cc
diff --git a/src/lookup.cc b/src/lookup.cc
index 3463322f33694bdf976e80e32fee351b52158dc6..83bfc79c8eefe6435b9134c33943e91f1d6bad83 100644
--- a/src/lookup.cc
+++ b/src/lookup.cc
@@ -38,7 +38,7 @@ LookupIterator LookupIterator::PropertyOrElement(Isolate* isolate,
LookupIterator it(isolate, receiver, index, configuration);
// Here we try to avoid having to rebuild the string later
// by storing it on the indexed LookupIterator.
- it.name_ = name;
+ it.name_ = isolate->factory()->InternalizeName(name);
return it;
}
@@ -239,7 +239,6 @@ void LookupIterator::PrepareTransitionToDataProperty(
state_ = TRANSITION;
if (map->IsJSGlobalObjectMap()) {
// Install a property cell.
- InternalizeName();
auto cell = JSGlobalObject::EnsurePropertyCell(
Handle<JSGlobalObject>::cast(receiver), name());
DCHECK(cell->value()->IsTheHole());
@@ -534,12 +533,6 @@ void LookupIterator::WriteDataValue(Handle<Object> value) {
}
-void LookupIterator::InternalizeName() {
- if (name_->IsUniqueName()) return;
- name_ = factory()->InternalizeString(Handle<String>::cast(name_));
-}
-
-
bool LookupIterator::HasInterceptor(Map* map) const {
if (IsElement()) return map->has_indexed_interceptor();
return map->has_named_interceptor();
« no previous file with comments | « src/lookup.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698