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

Unified Diff: src/objects.cc

Issue 1765713003: Reland "Speed up the LookupIterator" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: wrap in assertThrows 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/objects.h ('k') | src/objects-body-descriptors-inl.h » ('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 0a80e0008098e80a60016cca2b3c12aeaa0347b8..6f1c4e44e9484c4a80f672c91b7dfc30b47a48a5 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -4129,7 +4129,7 @@ Maybe<bool> Object::SetPropertyInternal(LookupIterator* it,
LanguageMode language_mode,
StoreFromKeyed store_mode,
bool* found) {
- it->UpdateProtector();
+ DCHECK(it->IsFound());
ShouldThrow should_throw =
is_sloppy(language_mode) ? DONT_THROW : THROW_ON_ERROR;
@@ -4137,7 +4137,7 @@ Maybe<bool> Object::SetPropertyInternal(LookupIterator* it,
// interceptor calls.
AssertNoContextChange ncc(it->isolate());
- for (; it->IsFound(); it->Next()) {
+ do {
switch (it->state()) {
case LookupIterator::NOT_FOUND:
UNREACHABLE();
@@ -4200,7 +4200,8 @@ Maybe<bool> Object::SetPropertyInternal(LookupIterator* it,
*found = false;
return Nothing<bool>();
}
- }
+ it->Next();
+ } while (it->IsFound());
*found = false;
return Nothing<bool>();
@@ -4210,10 +4211,13 @@ Maybe<bool> Object::SetPropertyInternal(LookupIterator* it,
Maybe<bool> Object::SetProperty(LookupIterator* it, Handle<Object> value,
LanguageMode language_mode,
StoreFromKeyed store_mode) {
- bool found = true;
- Maybe<bool> result =
- SetPropertyInternal(it, value, language_mode, store_mode, &found);
- if (found) return result;
+ it->UpdateProtector();
+ if (it->IsFound()) {
+ bool found = true;
+ Maybe<bool> result =
+ SetPropertyInternal(it, value, language_mode, store_mode, &found);
+ if (found) return result;
+ }
// If the receiver is the JSGlobalObject, the store was contextual. In case
// the property did not exist yet on the global object itself, we have to
@@ -4235,10 +4239,13 @@ Maybe<bool> Object::SetSuperProperty(LookupIterator* it, Handle<Object> value,
StoreFromKeyed store_mode) {
Isolate* isolate = it->isolate();
- bool found = true;
- Maybe<bool> result =
- SetPropertyInternal(it, value, language_mode, store_mode, &found);
- if (found) return result;
+ it->UpdateProtector();
+ if (it->IsFound()) {
+ bool found = true;
+ Maybe<bool> result =
+ SetPropertyInternal(it, value, language_mode, store_mode, &found);
+ if (found) return result;
+ }
// The property either doesn't exist on the holder or exists there as a data
// property.
@@ -4313,8 +4320,7 @@ Maybe<bool> Object::SetSuperProperty(LookupIterator* it, Handle<Object> value,
}
}
- return JSObject::AddDataProperty(&own_lookup, value, NONE, should_throw,
- store_mode);
+ return AddDataProperty(&own_lookup, value, NONE, should_throw, store_mode);
}
MaybeHandle<Object> Object::ReadAbsentProperty(LookupIterator* it) {
@@ -8373,9 +8379,8 @@ bool Map::OnlyHasSimpleProperties() {
// Wrapped string elements aren't explicitly stored in the elements backing
// store, but are loaded indirectly from the underlying string.
return !IsStringWrapperElementsKind(elements_kind()) &&
- !is_access_check_needed() && !has_named_interceptor() &&
- !has_indexed_interceptor() && !has_hidden_prototype() &&
- !is_dictionary_map();
+ instance_type() > LAST_SPECIAL_RECEIVER_TYPE &&
+ !has_hidden_prototype() && !is_dictionary_map();
}
namespace {
« no previous file with comments | « src/objects.h ('k') | src/objects-body-descriptors-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698