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

Unified Diff: src/runtime/runtime-object.cc

Issue 942963004: Remove internal use of v8::AccessType, always pass v8::ACCESS_HAS instead. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove the distinction between named/indexed access checks, always pass "undefined" as "name" 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/runtime/runtime-classes.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-object.cc
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc
index 96d9331038c91cfe3e19f3d88982f51a79e84011..d05da302728eda7f89112b5feb5fef7efee001b6 100644
--- a/src/runtime/runtime-object.cc
+++ b/src/runtime/runtime-object.cc
@@ -249,12 +249,10 @@ MaybeHandle<Object> Runtime::GetPrototype(Isolate* isolate,
PrototypeIterator iter(isolate, obj, PrototypeIterator::START_AT_RECEIVER);
do {
if (PrototypeIterator::GetCurrent(iter)->IsAccessCheckNeeded() &&
- !isolate->MayNamedAccess(
- Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter)),
- isolate->factory()->proto_string(), v8::ACCESS_GET)) {
+ !isolate->MayAccess(
+ Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter)))) {
isolate->ReportFailedAccessCheck(
- Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter)),
- v8::ACCESS_GET);
+ Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter)));
RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object);
return isolate->factory()->undefined_value();
}
@@ -297,10 +295,8 @@ RUNTIME_FUNCTION(Runtime_SetPrototype) {
DCHECK(args.length() == 2);
CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0);
CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1);
- if (obj->IsAccessCheckNeeded() &&
- !isolate->MayNamedAccess(obj, isolate->factory()->proto_string(),
- v8::ACCESS_SET)) {
- isolate->ReportFailedAccessCheck(obj, v8::ACCESS_SET);
+ if (obj->IsAccessCheckNeeded() && !isolate->MayAccess(obj)) {
+ isolate->ReportFailedAccessCheck(obj);
RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate);
return isolate->heap()->undefined_value();
}
@@ -917,10 +913,8 @@ RUNTIME_FUNCTION(Runtime_GetOwnPropertyNames) {
// real global object.
if (obj->IsJSGlobalProxy()) {
// Only collect names if access is permitted.
- if (obj->IsAccessCheckNeeded() &&
- !isolate->MayNamedAccess(obj, isolate->factory()->undefined_value(),
- v8::ACCESS_KEYS)) {
- isolate->ReportFailedAccessCheck(obj, v8::ACCESS_KEYS);
+ if (obj->IsAccessCheckNeeded() && !isolate->MayAccess(obj)) {
+ isolate->ReportFailedAccessCheck(obj);
RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate);
return *isolate->factory()->NewJSArray(0);
}
@@ -941,11 +935,8 @@ RUNTIME_FUNCTION(Runtime_GetOwnPropertyNames) {
Handle<JSObject> jsproto =
Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter));
// Only collect names if access is permitted.
- if (jsproto->IsAccessCheckNeeded() &&
- !isolate->MayNamedAccess(jsproto,
- isolate->factory()->undefined_value(),
- v8::ACCESS_KEYS)) {
- isolate->ReportFailedAccessCheck(jsproto, v8::ACCESS_KEYS);
+ if (jsproto->IsAccessCheckNeeded() && !isolate->MayAccess(jsproto)) {
+ isolate->ReportFailedAccessCheck(jsproto);
RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate);
return *isolate->factory()->NewJSArray(0);
}
@@ -1094,10 +1085,8 @@ RUNTIME_FUNCTION(Runtime_OwnKeys) {
if (object->IsJSGlobalProxy()) {
// Do access checks before going to the global object.
- if (object->IsAccessCheckNeeded() &&
- !isolate->MayNamedAccess(object, isolate->factory()->undefined_value(),
- v8::ACCESS_KEYS)) {
- isolate->ReportFailedAccessCheck(object, v8::ACCESS_KEYS);
+ if (object->IsAccessCheckNeeded() && !isolate->MayAccess(object)) {
+ isolate->ReportFailedAccessCheck(object);
RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate);
return *isolate->factory()->NewJSArray(0);
}
@@ -1442,7 +1431,7 @@ RUNTIME_FUNCTION(Runtime_DefineDataPropertyUnchecked) {
LookupIterator it(js_object, name, LookupIterator::OWN_SKIP_INTERCEPTOR);
if (it.IsFound() && it.state() == LookupIterator::ACCESS_CHECK) {
- if (!isolate->MayNamedAccess(js_object, name, v8::ACCESS_SET)) {
+ if (!isolate->MayAccess(js_object)) {
return isolate->heap()->undefined_value();
}
it.Next();
« no previous file with comments | « src/runtime/runtime-classes.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698