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

Unified Diff: src/objects.cc

Issue 491023002: Get rid of all non-IC uses of LookupOwnRealNamedProperty (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index f77384a90a57acab6909897f5a009d5a63afcec9..1f8c70eb7d37e7bf383265ef305f7c0997cb0faa 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -12951,11 +12951,11 @@ bool JSArray::WouldChangeReadOnlyLength(Handle<JSArray> array,
uint32_t length = 0;
CHECK(array->length()->ToArrayIndex(&length));
if (length <= index) {
- Isolate* isolate = array->GetIsolate();
- LookupResult lookup(isolate);
- Handle<Name> length_string = isolate->factory()->length_string();
- array->LookupOwnRealNamedProperty(length_string, &lookup);
- return lookup.IsReadOnly();
+ LookupIterator it(array, array->GetIsolate()->factory()->length_string(),
+ LookupIterator::CHECK_PROPERTY);
+ CHECK(it.IsFound());
+ CHECK(it.HasProperty());
+ return it.IsReadOnly();
}
return false;
}
@@ -13339,20 +13339,10 @@ MaybeHandle<JSObject> JSObject::GetKeysForIndexedInterceptor(
Maybe<bool> JSObject::HasRealNamedProperty(Handle<JSObject> object,
Handle<Name> key) {
- Isolate* isolate = object->GetIsolate();
- SealHandleScope shs(isolate);
- // Check access rights if needed.
- if (object->IsAccessCheckNeeded()) {
- if (!isolate->MayNamedAccess(object, key, v8::ACCESS_HAS)) {
- isolate->ReportFailedAccessCheck(object, v8::ACCESS_HAS);
- RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Maybe<bool>());
- return maybe(false);
- }
- }
-
- LookupResult result(isolate);
- object->LookupOwnRealNamedProperty(key, &result);
- return maybe(result.IsFound() && !result.IsInterceptor());
+ LookupIterator it(object, key, LookupIterator::CHECK_ACCESS_CHECK);
+ Maybe<PropertyAttributes> maybe_result = GetPropertyAttributes(&it);
+ if (!maybe_result.has_value) return Maybe<bool>();
+ return maybe(it.IsFound());
}
@@ -13387,20 +13377,10 @@ Maybe<bool> JSObject::HasRealElementProperty(Handle<JSObject> object,
Maybe<bool> JSObject::HasRealNamedCallbackProperty(Handle<JSObject> object,
Handle<Name> key) {
- Isolate* isolate = object->GetIsolate();
- SealHandleScope shs(isolate);
- // Check access rights if needed.
- if (object->IsAccessCheckNeeded()) {
- if (!isolate->MayNamedAccess(object, key, v8::ACCESS_HAS)) {
- isolate->ReportFailedAccessCheck(object, v8::ACCESS_HAS);
- RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Maybe<bool>());
- return maybe(false);
- }
- }
-
- LookupResult result(isolate);
- object->LookupOwnRealNamedProperty(key, &result);
- return maybe(result.IsPropertyCallbacks());
+ LookupIterator it(object, key, LookupIterator::CHECK_ACCESS_CHECK);
+ Maybe<PropertyAttributes> maybe_result = GetPropertyAttributes(&it);
+ if (!maybe_result.has_value) return Maybe<bool>();
+ return maybe(it.IsFound() && it.property_kind() == LookupIterator::ACCESSOR);
}
« no previous file with comments | « src/lookup-inl.h ('k') | test/cctest/test-api.cc » ('j') | test/cctest/test-api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698