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

Unified Diff: src/objects.cc

Issue 911713003: add transitions for global properties in ics (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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/objects.h ('k') | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 20fd66b37eb90b1f1523627350edace29096bfa9..033a8fccf1f19d1a1bd1d1997db567298bb8b3d1 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -1752,9 +1752,7 @@ void JSObject::AddSlowProperty(Handle<JSObject> object,
dict->SetEntry(entry, name, cell, details);
return;
}
- Handle<PropertyCell> cell = isolate->factory()->NewPropertyCell(value);
- PropertyCell::SetValueInferType(cell, value);
- value = cell;
+ value = isolate->factory()->NewPropertyCell(value);
}
PropertyDetails details(attributes, DATA, 0);
Handle<NameDictionary> result =
@@ -3056,6 +3054,7 @@ MaybeHandle<Object> Object::AddDataProperty(LookupIterator* it,
if (receiver->map()->is_dictionary_map()) {
// TODO(verwaest): Probably should ensure this is done beforehand.
it->InternalizeName();
+ // TODO(dcarney): just populate TransitionPropertyCell here?
JSObject::AddSlowProperty(receiver, it->name(), value, attributes);
} else {
// Write the property value.
@@ -15133,15 +15132,13 @@ void GlobalObject::InvalidatePropertyCell(Handle<GlobalObject> global,
}
-Handle<PropertyCell> JSGlobalObject::EnsurePropertyCell(
- Handle<JSGlobalObject> global,
- Handle<Name> name) {
+Handle<PropertyCell> GlobalObject::EnsurePropertyCell(
+ Handle<GlobalObject> global, Handle<Name> name) {
DCHECK(!global->HasFastProperties());
int entry = global->property_dictionary()->FindEntry(name);
if (entry == NameDictionary::kNotFound) {
Isolate* isolate = global->GetIsolate();
- Handle<PropertyCell> cell = isolate->factory()->NewPropertyCell(
- isolate->factory()->the_hole_value());
+ Handle<PropertyCell> cell = isolate->factory()->NewPropertyCellWithHole();
PropertyDetails details(NONE, DATA, 0);
details = details.AsDeleted();
Handle<NameDictionary> dictionary = NameDictionary::Add(
@@ -16940,10 +16937,12 @@ Handle<Object> PropertyCell::SetValueInferType(Handle<PropertyCell> cell,
const int kMaxLengthForInternalization = 200;
if ((cell->type()->Is(HeapType::None()) ||
cell->type()->Is(HeapType::Undefined())) &&
- value->IsString() &&
- Handle<String>::cast(value)->length() <= kMaxLengthForInternalization) {
- value = cell->GetIsolate()->factory()->InternalizeString(
- Handle<String>::cast(value));
+ value->IsString()) {
+ auto string = Handle<String>::cast(value);
+ if (string->length() <= kMaxLengthForInternalization &&
+ !string->map()->is_undetectable()) {
+ value = cell->GetIsolate()->factory()->InternalizeString(string);
+ }
}
cell->set_value(*value);
if (!HeapType::Any()->Is(cell->type())) {
« no previous file with comments | « src/objects.h ('k') | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698