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

Unified Diff: src/objects.cc

Issue 332863003: Remove AccessControl from AccessorPairs, as it's an invalid usecase of AllCan* (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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-debug.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 06c4a4b7563ceff3d06f97e932704fc326c26bf5..285280b68b753d6a12b8458876f172ded27c1a63 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -575,8 +575,6 @@ static bool FindAllCanReadHolder(LookupIterator* it) {
Handle<Object> accessors = it->GetAccessors();
if (accessors->IsAccessorInfo()) {
if (AccessorInfo::cast(*accessors)->all_can_read()) return true;
- } else if (accessors->IsAccessorPair()) {
- if (AccessorPair::cast(*accessors)->all_can_read()) return true;
}
}
}
@@ -619,8 +617,6 @@ static bool FindAllCanWriteHolder(LookupResult* result,
Object* callback_obj = result->GetCallbackObject();
if (callback_obj->IsAccessorInfo()) {
if (AccessorInfo::cast(callback_obj)->all_can_write()) return true;
- } else if (callback_obj->IsAccessorPair()) {
- if (AccessorPair::cast(callback_obj)->all_can_write()) return true;
}
}
if (!check_prototype) break;
@@ -6425,8 +6421,7 @@ void JSObject::DefineElementAccessor(Handle<JSObject> object,
uint32_t index,
Handle<Object> getter,
Handle<Object> setter,
- PropertyAttributes attributes,
- v8::AccessControl access_control) {
+ PropertyAttributes attributes) {
switch (object->GetElementsKind()) {
case FAST_SMI_ELEMENTS:
case FAST_ELEMENTS:
@@ -6483,7 +6478,6 @@ void JSObject::DefineElementAccessor(Handle<JSObject> object,
Isolate* isolate = object->GetIsolate();
Handle<AccessorPair> accessors = isolate->factory()->NewAccessorPair();
accessors->SetComponents(*getter, *setter);
- accessors->set_access_flags(access_control);
SetElementCallback(object, index, accessors, attributes);
}
@@ -6514,13 +6508,11 @@ void JSObject::DefinePropertyAccessor(Handle<JSObject> object,
Handle<Name> name,
Handle<Object> getter,
Handle<Object> setter,
- PropertyAttributes attributes,
- v8::AccessControl access_control) {
+ PropertyAttributes attributes) {
// We could assert that the property is configurable here, but we would need
// to do a lookup, which seems to be a bit of overkill.
bool only_attribute_changes = getter->IsNull() && setter->IsNull();
if (object->HasFastProperties() && !only_attribute_changes &&
- access_control == v8::DEFAULT &&
(object->map()->NumberOfOwnDescriptors() <= kMaxNumberOfDescriptors)) {
bool getterOk = getter->IsNull() ||
DefineFastAccessor(object, name, ACCESSOR_GETTER, getter, attributes);
@@ -6531,7 +6523,6 @@ void JSObject::DefinePropertyAccessor(Handle<JSObject> object,
Handle<AccessorPair> accessors = CreateAccessorPairFor(object, name);
accessors->SetComponents(*getter, *setter);
- accessors->set_access_flags(access_control);
SetPropertyCallback(object, name, accessors, attributes);
}
@@ -6632,8 +6623,7 @@ void JSObject::DefineAccessor(Handle<JSObject> object,
Handle<Name> name,
Handle<Object> getter,
Handle<Object> setter,
- PropertyAttributes attributes,
- v8::AccessControl access_control) {
+ PropertyAttributes attributes) {
Isolate* isolate = object->GetIsolate();
// Check access rights if needed.
if (object->IsAccessCheckNeeded() &&
@@ -6651,8 +6641,7 @@ void JSObject::DefineAccessor(Handle<JSObject> object,
name,
getter,
setter,
- attributes,
- access_control);
+ attributes);
return;
}
@@ -6689,11 +6678,9 @@ void JSObject::DefineAccessor(Handle<JSObject> object,
}
if (is_element) {
- DefineElementAccessor(
- object, index, getter, setter, attributes, access_control);
+ DefineElementAccessor(object, index, getter, setter, attributes);
} else {
- DefinePropertyAccessor(
- object, name, getter, setter, attributes, access_control);
+ DefinePropertyAccessor(object, name, getter, setter, attributes);
}
if (is_observed) {
@@ -6769,8 +6756,10 @@ bool JSObject::DefineFastAccessor(Handle<JSObject> object,
ASSERT(target->NumberOfOwnDescriptors() ==
object->map()->NumberOfOwnDescriptors());
// This works since descriptors are sorted in order of addition.
- ASSERT(object->map()->instance_descriptors()->
- GetKey(descriptor_number) == *name);
+ ASSERT(Name::Equals(
+ handle(object->map()->instance_descriptors()->GetKey(
+ descriptor_number)),
+ name));
return TryAccessorTransition(object, target, descriptor_number,
component, accessor, attributes);
}
« no previous file with comments | « src/objects.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698