Commit 2d2396a8 authored by verwaest@chromium.org's avatar verwaest@chromium.org

Get rid of all non-IC uses of LookupOwnRealNamedProperty

BUG=
R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/491023002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23262 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 49e4aebb
...@@ -20,7 +20,10 @@ JSReceiver* LookupIterator::NextHolder(Map* map) { ...@@ -20,7 +20,10 @@ JSReceiver* LookupIterator::NextHolder(Map* map) {
next->map()->is_hidden_prototype()); next->map()->is_hidden_prototype());
if (!check_derived() && if (!check_derived() &&
!(check_hidden() && next->map()->is_hidden_prototype())) { !(check_hidden() && next->map()->is_hidden_prototype()) &&
// Always lookup behind the JSGlobalProxy into the JSGlobalObject, even
// when not checking other hidden prototypes.
!(map->IsJSGlobalProxyMap() && next->IsJSGlobalObject())) {
return NULL; return NULL;
} }
......
...@@ -12944,11 +12944,11 @@ bool JSArray::WouldChangeReadOnlyLength(Handle<JSArray> array, ...@@ -12944,11 +12944,11 @@ bool JSArray::WouldChangeReadOnlyLength(Handle<JSArray> array,
uint32_t length = 0; uint32_t length = 0;
CHECK(array->length()->ToArrayIndex(&length)); CHECK(array->length()->ToArrayIndex(&length));
if (length <= index) { if (length <= index) {
Isolate* isolate = array->GetIsolate(); LookupIterator it(array, array->GetIsolate()->factory()->length_string(),
LookupResult lookup(isolate); LookupIterator::CHECK_PROPERTY);
Handle<Name> length_string = isolate->factory()->length_string(); CHECK(it.IsFound());
array->LookupOwnRealNamedProperty(length_string, &lookup); CHECK(it.HasProperty());
return lookup.IsReadOnly(); return it.IsReadOnly();
} }
return false; return false;
} }
...@@ -13332,20 +13332,10 @@ MaybeHandle<JSObject> JSObject::GetKeysForIndexedInterceptor( ...@@ -13332,20 +13332,10 @@ MaybeHandle<JSObject> JSObject::GetKeysForIndexedInterceptor(
Maybe<bool> JSObject::HasRealNamedProperty(Handle<JSObject> object, Maybe<bool> JSObject::HasRealNamedProperty(Handle<JSObject> object,
Handle<Name> key) { Handle<Name> key) {
Isolate* isolate = object->GetIsolate(); LookupIterator it(object, key, LookupIterator::CHECK_ACCESS_CHECK);
SealHandleScope shs(isolate); Maybe<PropertyAttributes> maybe_result = GetPropertyAttributes(&it);
// Check access rights if needed. if (!maybe_result.has_value) return Maybe<bool>();
if (object->IsAccessCheckNeeded()) { return maybe(it.IsFound());
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());
} }
...@@ -13380,20 +13370,10 @@ Maybe<bool> JSObject::HasRealElementProperty(Handle<JSObject> object, ...@@ -13380,20 +13370,10 @@ Maybe<bool> JSObject::HasRealElementProperty(Handle<JSObject> object,
Maybe<bool> JSObject::HasRealNamedCallbackProperty(Handle<JSObject> object, Maybe<bool> JSObject::HasRealNamedCallbackProperty(Handle<JSObject> object,
Handle<Name> key) { Handle<Name> key) {
Isolate* isolate = object->GetIsolate(); LookupIterator it(object, key, LookupIterator::CHECK_ACCESS_CHECK);
SealHandleScope shs(isolate); Maybe<PropertyAttributes> maybe_result = GetPropertyAttributes(&it);
// Check access rights if needed. if (!maybe_result.has_value) return Maybe<bool>();
if (object->IsAccessCheckNeeded()) { return maybe(it.IsFound() && it.property_kind() == LookupIterator::ACCESSOR);
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());
} }
......
...@@ -21771,7 +21771,6 @@ TEST(AccessCheckThrows) { ...@@ -21771,7 +21771,6 @@ TEST(AccessCheckThrows) {
// Create a context and set an x property on it's global object. // Create a context and set an x property on it's global object.
LocalContext context0(NULL, global_template); LocalContext context0(NULL, global_template);
context0->Global()->Set(v8_str("x"), v8_num(42));
v8::Handle<v8::Object> global0 = context0->Global(); v8::Handle<v8::Object> global0 = context0->Global();
// Create a context with a different security token so that the // Create a context with a different security token so that the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment