[runtime] remove left-over distinction between AccessorInfo and ExecutableAccessorInfo

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

Cr-Commit-Position: refs/heads/master@{#33364}
This commit is contained in:
verwaest 2016-01-18 07:08:36 -08:00 committed by Commit bot
parent 5346972186
commit e4b41d64e5
30 changed files with 138 additions and 196 deletions

View File

@ -7132,7 +7132,7 @@ class Internals {
static const int kNodeIsPartiallyDependentShift = 4;
static const int kNodeIsActiveShift = 4;
static const int kJSObjectType = 0xb7;
static const int kJSObjectType = 0xb5;
static const int kFirstNonstringType = 0x80;
static const int kOddballType = 0x83;
static const int kForeignType = 0x87;

View File

@ -27,7 +27,7 @@ Handle<AccessorInfo> Accessors::MakeAccessor(
AccessorNameSetterCallback setter,
PropertyAttributes attributes) {
Factory* factory = isolate->factory();
Handle<ExecutableAccessorInfo> info = factory->NewExecutableAccessorInfo();
Handle<AccessorInfo> info = factory->NewAccessorInfo();
info->set_property_attributes(attributes);
info->set_all_can_read(false);
info->set_all_can_write(false);
@ -41,11 +41,10 @@ Handle<AccessorInfo> Accessors::MakeAccessor(
}
Handle<ExecutableAccessorInfo> Accessors::CloneAccessor(
Isolate* isolate,
Handle<ExecutableAccessorInfo> accessor) {
Handle<AccessorInfo> Accessors::CloneAccessor(Isolate* isolate,
Handle<AccessorInfo> accessor) {
Factory* factory = isolate->factory();
Handle<ExecutableAccessorInfo> info = factory->NewExecutableAccessorInfo();
Handle<AccessorInfo> info = factory->NewAccessorInfo();
info->set_name(accessor->name());
info->set_flag(accessor->flag());
info->set_expected_receiver_type(accessor->expected_receiver_type());
@ -1453,7 +1452,7 @@ Handle<AccessorInfo> Accessors::MakeModuleExport(
PropertyAttributes attributes) {
Isolate* isolate = name->GetIsolate();
Factory* factory = isolate->factory();
Handle<ExecutableAccessorInfo> info = factory->NewExecutableAccessorInfo();
Handle<AccessorInfo> info = factory->NewAccessorInfo();
info->set_property_attributes(attributes);
info->set_all_can_read(true);
info->set_all_can_write(true);

View File

@ -15,7 +15,7 @@ namespace v8 {
namespace internal {
// Forward declarations.
class ExecutableAccessorInfo;
class AccessorInfo;
// The list of accessor descriptors. This is a second-order macro
// taking a macro to be applied to all accessor descriptor names.
@ -101,9 +101,8 @@ class Accessors : public AllStatic {
AccessorNameSetterCallback setter,
PropertyAttributes attributes);
static Handle<ExecutableAccessorInfo> CloneAccessor(
Isolate* isolate,
Handle<ExecutableAccessorInfo> accessor);
static Handle<AccessorInfo> CloneAccessor(Isolate* isolate,
Handle<AccessorInfo> accessor);
};
} // namespace internal

View File

@ -1125,8 +1125,7 @@ static i::Handle<i::AccessorInfo> MakeAccessorInfo(
v8::AccessControl settings, v8::PropertyAttribute attributes,
v8::Local<AccessorSignature> signature) {
i::Isolate* isolate = Utils::OpenHandle(*name)->GetIsolate();
i::Handle<i::ExecutableAccessorInfo> obj =
isolate->factory()->NewExecutableAccessorInfo();
i::Handle<i::AccessorInfo> obj = isolate->factory()->NewAccessorInfo();
SET_FIELD_WRAPPED(obj, set_getter, getter);
SET_FIELD_WRAPPED(obj, set_setter, setter);
if (data.IsEmpty()) {

View File

@ -30,7 +30,7 @@ bool ContextMeasure::IsShared(HeapObject* object) {
if (object->IsSharedFunctionInfo()) return true;
if (object->IsScopeInfo()) return true;
if (object->IsCode() && !Code::cast(object)->is_optimized_code()) return true;
if (object->IsExecutableAccessorInfo()) return true;
if (object->IsAccessorInfo()) return true;
if (object->IsWeakCell()) return true;
return false;
}

View File

@ -902,7 +902,7 @@ class ElementsAccessorBase : public ElementsAccessor {
Handle<Object> value = ElementsAccessorSubclass::GetImpl(from, i);
DCHECK(!value->IsTheHole());
DCHECK(!value->IsAccessorPair());
DCHECK(!value->IsExecutableAccessorInfo());
DCHECK(!value->IsAccessorInfo());
accumulator->AddKey(value, convert);
}
}

View File

@ -868,10 +868,9 @@ Handle<AliasedArgumentsEntry> Factory::NewAliasedArgumentsEntry(
}
Handle<ExecutableAccessorInfo> Factory::NewExecutableAccessorInfo() {
Handle<ExecutableAccessorInfo> info =
Handle<ExecutableAccessorInfo>::cast(
NewStruct(EXECUTABLE_ACCESSOR_INFO_TYPE));
Handle<AccessorInfo> Factory::NewAccessorInfo() {
Handle<AccessorInfo> info =
Handle<AccessorInfo>::cast(NewStruct(ACCESSOR_INFO_TYPE));
info->set_flag(0); // Must clear the flag, it was initialized as undefined.
return info;
}

View File

@ -262,7 +262,7 @@ class Factory final {
Handle<AliasedArgumentsEntry> NewAliasedArgumentsEntry(
int aliased_context_slot);
Handle<ExecutableAccessorInfo> NewExecutableAccessorInfo();
Handle<AccessorInfo> NewAccessorInfo();
Handle<Script> NewScript(Handle<String> source);

View File

@ -594,7 +594,7 @@ void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) {
void NamedLoadHandlerCompiler::GenerateLoadCallback(
Register reg, Handle<ExecutableAccessorInfo> callback) {
Register reg, Handle<AccessorInfo> callback) {
// Build AccessorInfo::args_ list on the stack and push property name below
// the exit frame to make GC aware of them and store pointers to them.
STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 0);
@ -608,7 +608,7 @@ void NamedLoadHandlerCompiler::GenerateLoadCallback(
DCHECK(!scratch3().is(reg));
DCHECK(!scratch4().is(reg));
__ push(receiver());
// Push data from ExecutableAccessorInfo.
// Push data from AccessorInfo.
Handle<Object> data(callback->data(), isolate());
if (data->IsUndefined() || data->IsSmi()) {
__ Move(scratch3(), data);
@ -714,8 +714,7 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) {
Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback(
Handle<JSObject> object, Handle<Name> name,
Handle<ExecutableAccessorInfo> callback) {
Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback) {
Register holder_reg = Frontend(name);
__ push(receiver()); // receiver

View File

@ -645,10 +645,10 @@ void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) {
void NamedLoadHandlerCompiler::GenerateLoadCallback(
Register reg, Handle<ExecutableAccessorInfo> callback) {
Register reg, Handle<AccessorInfo> callback) {
DCHECK(!AreAliased(scratch2(), scratch3(), scratch4(), reg));
// Build ExecutableAccessorInfo::args_ list on the stack and push property
// Build AccessorInfo::args_ list on the stack and push property
// name below the exit frame to make GC aware of them and store pointers to
// them.
STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 0);
@ -774,8 +774,7 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) {
Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback(
Handle<JSObject> object, Handle<Name> name,
Handle<ExecutableAccessorInfo> callback) {
Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback) {
ASM_LOCATION("NamedStoreHandlerCompiler::CompileStoreCallback");
Register holder_reg = Frontend(name);

View File

@ -228,7 +228,7 @@ Handle<Code> NamedLoadHandlerCompiler::CompileLoadNonexistent(
Handle<Code> NamedLoadHandlerCompiler::CompileLoadCallback(
Handle<Name> name, Handle<ExecutableAccessorInfo> callback) {
Handle<Name> name, Handle<AccessorInfo> callback) {
Register reg = Frontend(name);
GenerateLoadCallback(reg, callback);
return GetCode(kind(), Code::FAST, name);
@ -278,7 +278,7 @@ void NamedLoadHandlerCompiler::InterceptorVectorSlotPop(Register holder_reg,
Handle<Code> NamedLoadHandlerCompiler::CompileLoadInterceptor(
LookupIterator* it) {
// So far the most popular follow ups for interceptor loads are DATA and
// ExecutableAccessorInfo, so inline only them. Other cases may be added
// AccessorInfo, so inline only them. Other cases may be added
// later.
bool inline_followup = false;
switch (it->state()) {
@ -296,12 +296,11 @@ Handle<Code> NamedLoadHandlerCompiler::CompileLoadInterceptor(
break;
case LookupIterator::ACCESSOR: {
Handle<Object> accessors = it->GetAccessors();
if (accessors->IsExecutableAccessorInfo()) {
Handle<ExecutableAccessorInfo> info =
Handle<ExecutableAccessorInfo>::cast(accessors);
inline_followup = info->getter() != NULL &&
ExecutableAccessorInfo::IsCompatibleReceiverMap(
isolate(), info, map());
if (accessors->IsAccessorInfo()) {
Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(accessors);
inline_followup =
info->getter() != NULL &&
AccessorInfo::IsCompatibleReceiverMap(isolate(), info, map());
} else if (accessors->IsAccessorPair()) {
Handle<JSObject> property_holder(it->GetHolder<JSObject>());
Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(),
@ -396,9 +395,9 @@ void NamedLoadHandlerCompiler::GenerateLoadPostInterceptor(
break;
}
case LookupIterator::ACCESSOR:
if (it->GetAccessors()->IsExecutableAccessorInfo()) {
Handle<ExecutableAccessorInfo> info =
Handle<ExecutableAccessorInfo>::cast(it->GetAccessors());
if (it->GetAccessors()->IsAccessorInfo()) {
Handle<AccessorInfo> info =
Handle<AccessorInfo>::cast(it->GetAccessors());
DCHECK_NOT_NULL(info->getter());
GenerateLoadCallback(reg, info);
} else {

View File

@ -123,7 +123,7 @@ class NamedLoadHandlerCompiler : public PropertyHandlerCompiler {
Handle<Code> CompileLoadField(Handle<Name> name, FieldIndex index);
Handle<Code> CompileLoadCallback(Handle<Name> name,
Handle<ExecutableAccessorInfo> callback);
Handle<AccessorInfo> callback);
Handle<Code> CompileLoadCallback(Handle<Name> name,
const CallOptimization& call_optimization,
@ -180,8 +180,7 @@ class NamedLoadHandlerCompiler : public PropertyHandlerCompiler {
private:
Handle<Code> CompileLoadNonexistent(Handle<Name> name);
void GenerateLoadConstant(Handle<Object> value);
void GenerateLoadCallback(Register reg,
Handle<ExecutableAccessorInfo> callback);
void GenerateLoadCallback(Register reg, Handle<AccessorInfo> callback);
void GenerateLoadCallback(const CallOptimization& call_optimization,
Handle<Map> receiver_map);
@ -224,7 +223,7 @@ class NamedStoreHandlerCompiler : public PropertyHandlerCompiler {
Handle<Name> name);
Handle<Code> CompileStoreField(LookupIterator* it);
Handle<Code> CompileStoreCallback(Handle<JSObject> object, Handle<Name> name,
Handle<ExecutableAccessorInfo> callback);
Handle<AccessorInfo> callback);
Handle<Code> CompileStoreCallback(Handle<JSObject> object, Handle<Name> name,
const CallOptimization& call_optimization,
int accessor_index);

View File

@ -593,7 +593,7 @@ void NamedStoreHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) {
void NamedLoadHandlerCompiler::GenerateLoadCallback(
Register reg, Handle<ExecutableAccessorInfo> callback) {
Register reg, Handle<AccessorInfo> callback) {
// Insert additional parameters into the stack frame above return address.
DCHECK(!scratch3().is(reg));
__ pop(scratch3()); // Get return address to place it below.
@ -605,7 +605,7 @@ void NamedLoadHandlerCompiler::GenerateLoadCallback(
STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 4);
STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 5);
__ push(receiver()); // receiver
// Push data from ExecutableAccessorInfo.
// Push data from AccessorInfo.
Handle<Object> data(callback->data(), isolate());
if (data->IsUndefined() || data->IsSmi()) {
__ push(Immediate(data));
@ -731,8 +731,7 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) {
Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback(
Handle<JSObject> object, Handle<Name> name,
Handle<ExecutableAccessorInfo> callback) {
Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback) {
Register holder_reg = Frontend(name);
__ pop(scratch1()); // remove the return address

View File

@ -976,12 +976,10 @@ bool IsCompatibleReceiver(LookupIterator* lookup, Handle<Map> receiver_map) {
DCHECK(lookup->state() == LookupIterator::ACCESSOR);
Isolate* isolate = lookup->isolate();
Handle<Object> accessors = lookup->GetAccessors();
if (accessors->IsExecutableAccessorInfo()) {
Handle<ExecutableAccessorInfo> info =
Handle<ExecutableAccessorInfo>::cast(accessors);
if (accessors->IsAccessorInfo()) {
Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(accessors);
if (info->getter() != NULL &&
!ExecutableAccessorInfo::IsCompatibleReceiverMap(isolate, info,
receiver_map)) {
!AccessorInfo::IsCompatibleReceiverMap(isolate, info, receiver_map)) {
return false;
}
} else if (accessors->IsAccessorPair()) {
@ -1169,12 +1167,10 @@ Handle<Code> LoadIC::CompileHandler(LookupIterator* lookup,
}
Handle<Object> accessors = lookup->GetAccessors();
if (accessors->IsExecutableAccessorInfo()) {
Handle<ExecutableAccessorInfo> info =
Handle<ExecutableAccessorInfo>::cast(accessors);
if (accessors->IsAccessorInfo()) {
Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(accessors);
if (v8::ToCData<Address>(info->getter()) == 0) break;
if (!ExecutableAccessorInfo::IsCompatibleReceiverMap(isolate(), info,
map)) {
if (!AccessorInfo::IsCompatibleReceiverMap(isolate(), info, map)) {
// This case should be already handled in LoadIC::UpdateCaches.
UNREACHABLE();
break;
@ -1733,9 +1729,8 @@ Handle<Code> StoreIC::CompileHandler(LookupIterator* lookup,
break;
}
Handle<Object> accessors = lookup->GetAccessors();
if (accessors->IsExecutableAccessorInfo()) {
Handle<ExecutableAccessorInfo> info =
Handle<ExecutableAccessorInfo>::cast(accessors);
if (accessors->IsAccessorInfo()) {
Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(accessors);
if (v8::ToCData<Address>(info->setter()) == 0) {
TRACE_GENERIC_IC(isolate(), "StoreIC", "setter == 0");
break;
@ -1746,8 +1741,8 @@ Handle<Code> StoreIC::CompileHandler(LookupIterator* lookup,
"special data property in prototype chain");
break;
}
if (!ExecutableAccessorInfo::IsCompatibleReceiverMap(isolate(), info,
receiver_map())) {
if (!AccessorInfo::IsCompatibleReceiverMap(isolate(), info,
receiver_map())) {
TRACE_GENERIC_IC(isolate(), "StoreIC", "incompatible receiver type");
break;
}
@ -2820,11 +2815,10 @@ RUNTIME_FUNCTION(Runtime_StoreCallbackProperty) {
Handle<Object> value = args.at<Object>(4);
HandleScope scope(isolate);
Handle<ExecutableAccessorInfo> callback(
Handle<AccessorInfo> callback(
callback_or_cell->IsWeakCell()
? ExecutableAccessorInfo::cast(
WeakCell::cast(*callback_or_cell)->value())
: ExecutableAccessorInfo::cast(*callback_or_cell));
? AccessorInfo::cast(WeakCell::cast(*callback_or_cell)->value())
: AccessorInfo::cast(*callback_or_cell));
DCHECK(callback->IsCompatibleReceiver(*receiver));

View File

@ -584,7 +584,7 @@ void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) {
void NamedLoadHandlerCompiler::GenerateLoadCallback(
Register reg, Handle<ExecutableAccessorInfo> callback) {
Register reg, Handle<AccessorInfo> callback) {
// Build AccessorInfo::args_ list on the stack and push property name below
// the exit frame to make GC aware of them and store pointers to them.
STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 0);
@ -705,8 +705,7 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) {
Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback(
Handle<JSObject> object, Handle<Name> name,
Handle<ExecutableAccessorInfo> callback) {
Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback) {
Register holder_reg = Frontend(name);
__ Push(receiver(), holder_reg); // Receiver.

View File

@ -584,7 +584,7 @@ void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) {
void NamedLoadHandlerCompiler::GenerateLoadCallback(
Register reg, Handle<ExecutableAccessorInfo> callback) {
Register reg, Handle<AccessorInfo> callback) {
// Build AccessorInfo::args_ list on the stack and push property name below
// the exit frame to make GC aware of them and store pointers to them.
STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 0);
@ -705,8 +705,7 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) {
Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback(
Handle<JSObject> object, Handle<Name> name,
Handle<ExecutableAccessorInfo> callback) {
Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback) {
Register holder_reg = Frontend(name);
__ Push(receiver(), holder_reg); // Receiver.

View File

@ -592,7 +592,7 @@ void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) {
void NamedLoadHandlerCompiler::GenerateLoadCallback(
Register reg, Handle<ExecutableAccessorInfo> callback) {
Register reg, Handle<AccessorInfo> callback) {
// Build AccessorInfo::args_ list on the stack and push property name below
// the exit frame to make GC aware of them and store pointers to them.
STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 0);
@ -606,7 +606,7 @@ void NamedLoadHandlerCompiler::GenerateLoadCallback(
DCHECK(!scratch3().is(reg));
DCHECK(!scratch4().is(reg));
__ push(receiver());
// Push data from ExecutableAccessorInfo.
// Push data from AccessorInfo.
Handle<Object> data(callback->data(), isolate());
if (data->IsUndefined() || data->IsSmi()) {
__ Move(scratch3(), data);
@ -711,8 +711,7 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) {
Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback(
Handle<JSObject> object, Handle<Name> name,
Handle<ExecutableAccessorInfo> callback) {
Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback) {
Register holder_reg = Frontend(name);
__ Push(receiver(), holder_reg); // receiver

View File

@ -592,7 +592,7 @@ void NamedStoreHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) {
void NamedLoadHandlerCompiler::GenerateLoadCallback(
Register reg, Handle<ExecutableAccessorInfo> callback) {
Register reg, Handle<AccessorInfo> callback) {
// Insert additional parameters into the stack frame above return address.
DCHECK(!scratch4().is(reg));
__ PopReturnAddressTo(scratch4());
@ -722,8 +722,7 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) {
Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback(
Handle<JSObject> object, Handle<Name> name,
Handle<ExecutableAccessorInfo> callback) {
Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback) {
Register holder_reg = Frontend(name);
__ PopReturnAddressTo(scratch1());

View File

@ -593,7 +593,7 @@ void NamedStoreHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) {
void NamedLoadHandlerCompiler::GenerateLoadCallback(
Register reg, Handle<ExecutableAccessorInfo> callback) {
Register reg, Handle<AccessorInfo> callback) {
// Insert additional parameters into the stack frame above return address.
DCHECK(!scratch3().is(reg));
__ pop(scratch3()); // Get return address to place it below.
@ -605,7 +605,7 @@ void NamedLoadHandlerCompiler::GenerateLoadCallback(
STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 4);
STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 5);
__ push(receiver()); // receiver
// Push data from ExecutableAccessorInfo.
// Push data from AccessorInfo.
Handle<Object> data(callback->data(), isolate());
if (data->IsUndefined() || data->IsSmi()) {
__ push(Immediate(data));
@ -731,8 +731,7 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) {
Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback(
Handle<JSObject> object, Handle<Name> name,
Handle<ExecutableAccessorInfo> callback) {
Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback) {
Register holder_reg = Frontend(name);
__ pop(scratch1()); // remove the return address

View File

@ -1749,8 +1749,8 @@ void Logger::LogAccessorCallbacks() {
HeapIterator iterator(heap);
DisallowHeapAllocation no_gc;
for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) {
if (!obj->IsExecutableAccessorInfo()) continue;
ExecutableAccessorInfo* ai = ExecutableAccessorInfo::cast(obj);
if (!obj->IsAccessorInfo()) continue;
AccessorInfo* ai = AccessorInfo::cast(obj);
if (!ai->name()->IsName()) continue;
Address getter_entry = v8::ToCData<Address>(ai->getter());
Name* name = Name::cast(ai->name());

View File

@ -909,12 +909,6 @@ void PrototypeInfo::PrototypeInfoVerify() {
}
void AccessorInfo::AccessorInfoVerify() {
VerifyPointer(name());
VerifyPointer(expected_receiver_type());
}
void SloppyBlockWithEvalContextExtension::
SloppyBlockWithEvalContextExtensionVerify() {
CHECK(IsSloppyBlockWithEvalContextExtension());
@ -923,9 +917,10 @@ void SloppyBlockWithEvalContextExtension::
}
void ExecutableAccessorInfo::ExecutableAccessorInfoVerify() {
CHECK(IsExecutableAccessorInfo());
AccessorInfoVerify();
void AccessorInfo::AccessorInfoVerify() {
CHECK(IsAccessorInfo());
VerifyPointer(name());
VerifyPointer(expected_receiver_type());
VerifyPointer(getter());
VerifyPointer(setter());
VerifyPointer(data());

View File

@ -150,9 +150,6 @@ bool Object::IsExternal() const {
}
bool Object::IsAccessorInfo() const { return IsExecutableAccessorInfo(); }
TYPE_CHECKER(HeapNumber, HEAP_NUMBER_TYPE)
TYPE_CHECKER(MutableHeapNumber, MUTABLE_HEAP_NUMBER_TYPE)
TYPE_CHECKER(Symbol, SYMBOL_TYPE)
@ -3181,7 +3178,6 @@ void SeededNumberDictionary::set_requires_slow_elements() {
// Cast operations
CAST_ACCESSOR(AccessorInfo)
CAST_ACCESSOR(ArrayList)
CAST_ACCESSOR(Bool16x8)
CAST_ACCESSOR(Bool32x4)
@ -5478,9 +5474,9 @@ SMI_ACCESSORS(AccessorInfo, flag, kFlagOffset)
ACCESSORS(AccessorInfo, expected_receiver_type, Object,
kExpectedReceiverTypeOffset)
ACCESSORS(ExecutableAccessorInfo, getter, Object, kGetterOffset)
ACCESSORS(ExecutableAccessorInfo, setter, Object, kSetterOffset)
ACCESSORS(ExecutableAccessorInfo, data, Object, kDataOffset)
ACCESSORS(AccessorInfo, getter, Object, kGetterOffset)
ACCESSORS(AccessorInfo, setter, Object, kSetterOffset)
ACCESSORS(AccessorInfo, data, Object, kDataOffset)
ACCESSORS(Box, value, Object, kValueOffset)

View File

@ -966,9 +966,8 @@ void Foreign::ForeignPrint(std::ostream& os) { // NOLINT
}
void ExecutableAccessorInfo::ExecutableAccessorInfoPrint(
std::ostream& os) { // NOLINT
HeapObject::PrintHeader(os, "ExecutableAccessorInfo");
void AccessorInfo::AccessorInfoPrint(std::ostream& os) { // NOLINT
HeapObject::PrintHeader(os, "AccessorInfo");
os << "\n - name: " << Brief(name());
os << "\n - flag: " << flag();
os << "\n - getter: " << Brief(getter());

View File

@ -936,9 +936,8 @@ Handle<Object> JSReceiver::GetDataProperty(LookupIterator* it) {
it->NotFound();
return it->isolate()->factory()->undefined_value();
case LookupIterator::ACCESSOR:
// TODO(verwaest): For now this doesn't call into
// ExecutableAccessorInfo, since clients don't need it. Update once
// relevant.
// TODO(verwaest): For now this doesn't call into AccessorInfo, since
// clients don't need it. Update once relevant.
it->NotFound();
return it->isolate()->factory()->undefined_value();
case LookupIterator::INTEGER_INDEXED_EXOTIC:
@ -1147,8 +1146,7 @@ MaybeHandle<Object> Object::GetPropertyWithAccessor(
if (structure->IsAccessorInfo()) {
Handle<JSObject> holder = it->GetHolder<JSObject>();
Handle<Name> name = it->GetName();
Handle<ExecutableAccessorInfo> info =
Handle<ExecutableAccessorInfo>::cast(structure);
Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(structure);
if (!info->IsCompatibleReceiver(*receiver)) {
THROW_NEW_ERROR(isolate,
NewTypeError(MessageTemplate::kIncompatibleMethodReceiver,
@ -1207,11 +1205,10 @@ Maybe<bool> Object::SetPropertyWithAccessor(LookupIterator* it,
DCHECK(!structure->IsForeign());
// API style callbacks.
if (structure->IsExecutableAccessorInfo()) {
if (structure->IsAccessorInfo()) {
Handle<JSObject> holder = it->GetHolder<JSObject>();
Handle<Name> name = it->GetName();
Handle<ExecutableAccessorInfo> info =
Handle<ExecutableAccessorInfo>::cast(structure);
Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(structure);
if (!info->IsCompatibleReceiver(*receiver)) {
isolate->Throw(*isolate->factory()->NewTypeError(
MessageTemplate::kIncompatibleMethodReceiver, name, receiver));
@ -1221,10 +1218,10 @@ Maybe<bool> Object::SetPropertyWithAccessor(LookupIterator* it,
v8::AccessorNameSetterCallback call_fun =
v8::ToCData<v8::AccessorNameSetterCallback>(info->setter());
if (call_fun == nullptr) return Just(true);
// TODO(verwaest): Shouldn't this case be unreachable (at least in the
// long run?) Should we have ExecutableAccessorPairs with missing setter
// that are "writable"? If they aren't writable, shouldn't we have bailed
// out already earlier?
// TODO(verwaest): Shouldn't this case be unreachable (at least in the long
// run?) Should we have AccessorInfo with missing setter that are
// "writable"? If they aren't writable, shouldn't we have bailed out already
// earlier?
LOG(isolate, ApiNamedPropertyAccess("store", *holder, *name));
PropertyCallbackArguments args(isolate, info->data(), *receiver, *holder);
@ -5208,7 +5205,7 @@ void JSObject::AddProperty(Handle<JSObject> object, Handle<Name> name,
// static
void ExecutableAccessorInfo::ClearSetter(Handle<ExecutableAccessorInfo> info) {
void AccessorInfo::ClearSetter(Handle<AccessorInfo> info) {
Handle<Object> object = v8::FromCData(info->GetIsolate(), nullptr);
info->set_setter(*object);
}
@ -5220,7 +5217,7 @@ void ExecutableAccessorInfo::ClearSetter(Handle<ExecutableAccessorInfo> info) {
// hidden prototypes.
MaybeHandle<Object> JSObject::DefineOwnPropertyIgnoreAttributes(
LookupIterator* it, Handle<Object> value, PropertyAttributes attributes,
ExecutableAccessorInfoHandling handling) {
AccessorInfoHandling handling) {
MAYBE_RETURN_NULL(DefineOwnPropertyIgnoreAttributes(
it, value, attributes, THROW_ON_ERROR, handling));
return value;
@ -5229,7 +5226,7 @@ MaybeHandle<Object> JSObject::DefineOwnPropertyIgnoreAttributes(
Maybe<bool> JSObject::DefineOwnPropertyIgnoreAttributes(
LookupIterator* it, Handle<Object> value, PropertyAttributes attributes,
ShouldThrow should_throw, ExecutableAccessorInfoHandling handling) {
ShouldThrow should_throw, AccessorInfoHandling handling) {
Handle<JSObject> object = Handle<JSObject>::cast(it->GetReceiver());
bool is_observed = object->map()->is_observed() &&
(it->IsElement() ||
@ -5268,10 +5265,9 @@ Maybe<bool> JSObject::DefineOwnPropertyIgnoreAttributes(
case LookupIterator::ACCESSOR: {
Handle<Object> accessors = it->GetAccessors();
// Special handling for ExecutableAccessorInfo, which behaves like a
// data property.
if (accessors->IsExecutableAccessorInfo() &&
handling == DONT_FORCE_FIELD) {
// Special handling for AccessorInfo, which behaves like a data
// property.
if (accessors->IsAccessorInfo() && handling == DONT_FORCE_FIELD) {
PropertyDetails details = it->property_details();
// Ensure the context isn't changed after calling into accessors.
AssertNoContextChange ncc(it->isolate());
@ -5283,15 +5279,13 @@ Maybe<bool> JSObject::DefineOwnPropertyIgnoreAttributes(
if (details.attributes() == attributes) return Just(true);
// Reconfigure the accessor if attributes mismatch.
Handle<ExecutableAccessorInfo> new_data = Accessors::CloneAccessor(
it->isolate(), Handle<ExecutableAccessorInfo>::cast(accessors));
Handle<AccessorInfo> new_data = Accessors::CloneAccessor(
it->isolate(), Handle<AccessorInfo>::cast(accessors));
new_data->set_property_attributes(attributes);
// By clearing the setter we don't have to introduce a lookup to
// the setter, simply make it unavailable to reflect the
// attributes.
if (attributes & READ_ONLY) {
ExecutableAccessorInfo::ClearSetter(new_data);
}
if (attributes & READ_ONLY) AccessorInfo::ClearSetter(new_data);
it->TransitionToAccessorPair(new_data, attributes);
} else {
@ -5353,7 +5347,7 @@ Maybe<bool> JSObject::DefineOwnPropertyIgnoreAttributes(
MaybeHandle<Object> JSObject::SetOwnPropertyIgnoreAttributes(
Handle<JSObject> object, Handle<Name> name, Handle<Object> value,
PropertyAttributes attributes, ExecutableAccessorInfoHandling handling) {
PropertyAttributes attributes, AccessorInfoHandling handling) {
DCHECK(!value->IsTheHole());
LookupIterator it(object, name, LookupIterator::OWN);
return DefineOwnPropertyIgnoreAttributes(&it, value, attributes, handling);
@ -5362,7 +5356,7 @@ MaybeHandle<Object> JSObject::SetOwnPropertyIgnoreAttributes(
MaybeHandle<Object> JSObject::SetOwnElementIgnoreAttributes(
Handle<JSObject> object, uint32_t index, Handle<Object> value,
PropertyAttributes attributes, ExecutableAccessorInfoHandling handling) {
PropertyAttributes attributes, AccessorInfoHandling handling) {
Isolate* isolate = object->GetIsolate();
LookupIterator it(isolate, object, index, LookupIterator::OWN);
return DefineOwnPropertyIgnoreAttributes(&it, value, attributes, handling);
@ -5371,7 +5365,7 @@ MaybeHandle<Object> JSObject::SetOwnElementIgnoreAttributes(
MaybeHandle<Object> JSObject::DefinePropertyOrElementIgnoreAttributes(
Handle<JSObject> object, Handle<Name> name, Handle<Object> value,
PropertyAttributes attributes, ExecutableAccessorInfoHandling handling) {
PropertyAttributes attributes, AccessorInfoHandling handling) {
Isolate* isolate = object->GetIsolate();
LookupIterator it = LookupIterator::PropertyOrElement(isolate, object, name,
LookupIterator::OWN);

View File

@ -134,7 +134,6 @@
// - Struct
// - Box
// - AccessorInfo
// - ExecutableAccessorInfo
// - AccessorPair
// - AccessCheckInfo
// - InterceptorInfo
@ -384,9 +383,7 @@ const int kStubMinorKeyBits = kSmiValueSize - kStubMajorKeyBits - 1;
\
V(FILLER_TYPE) \
\
V(DECLARED_ACCESSOR_DESCRIPTOR_TYPE) \
V(DECLARED_ACCESSOR_INFO_TYPE) \
V(EXECUTABLE_ACCESSOR_INFO_TYPE) \
V(ACCESSOR_INFO_TYPE) \
V(ACCESSOR_PAIR_TYPE) \
V(ACCESS_CHECK_INFO_TYPE) \
V(INTERCEPTOR_INFO_TYPE) \
@ -505,8 +502,7 @@ const int kStubMinorKeyBits = kSmiValueSize - kStubMajorKeyBits - 1;
// manually.
#define STRUCT_LIST(V) \
V(BOX, Box, box) \
V(EXECUTABLE_ACCESSOR_INFO, ExecutableAccessorInfo, \
executable_accessor_info) \
V(ACCESSOR_INFO, AccessorInfo, accessor_info) \
V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \
V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \
V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \
@ -676,9 +672,7 @@ enum InstanceType {
FILLER_TYPE, // LAST_DATA_TYPE
// Structs.
DECLARED_ACCESSOR_DESCRIPTOR_TYPE,
DECLARED_ACCESSOR_INFO_TYPE,
EXECUTABLE_ACCESSOR_INFO_TYPE,
ACCESSOR_INFO_TYPE,
ACCESSOR_PAIR_TYPE,
ACCESS_CHECK_INFO_TYPE,
INTERCEPTOR_INFO_TYPE,
@ -1043,7 +1037,6 @@ class Object {
INLINE(bool IsFixedArrayBase() const);
INLINE(bool IsExternal() const);
INLINE(bool IsAccessorInfo() const);
INLINE(bool IsStruct() const);
#define DECLARE_STRUCT_PREDICATE(NAME, Name, name) \
@ -2076,27 +2069,27 @@ class JSObject: public JSReceiver {
LookupIterator* it, Handle<Object> value);
// SetLocalPropertyIgnoreAttributes converts callbacks to fields. We need to
// grant an exemption to ExecutableAccessor callbacks in some cases.
enum ExecutableAccessorInfoHandling { DEFAULT_HANDLING, DONT_FORCE_FIELD };
// grant an exemption to AccessorInfo callbacks in some cases.
enum AccessorInfoHandling { DEFAULT_HANDLING, DONT_FORCE_FIELD };
MUST_USE_RESULT static MaybeHandle<Object> DefineOwnPropertyIgnoreAttributes(
LookupIterator* it, Handle<Object> value, PropertyAttributes attributes,
ExecutableAccessorInfoHandling handling = DEFAULT_HANDLING);
AccessorInfoHandling handling = DEFAULT_HANDLING);
MUST_USE_RESULT static Maybe<bool> DefineOwnPropertyIgnoreAttributes(
LookupIterator* it, Handle<Object> value, PropertyAttributes attributes,
ShouldThrow should_throw,
ExecutableAccessorInfoHandling handling = DEFAULT_HANDLING);
AccessorInfoHandling handling = DEFAULT_HANDLING);
MUST_USE_RESULT static MaybeHandle<Object> SetOwnPropertyIgnoreAttributes(
Handle<JSObject> object, Handle<Name> name, Handle<Object> value,
PropertyAttributes attributes,
ExecutableAccessorInfoHandling handling = DEFAULT_HANDLING);
AccessorInfoHandling handling = DEFAULT_HANDLING);
MUST_USE_RESULT static MaybeHandle<Object> SetOwnElementIgnoreAttributes(
Handle<JSObject> object, uint32_t index, Handle<Object> value,
PropertyAttributes attributes,
ExecutableAccessorInfoHandling handling = DEFAULT_HANDLING);
AccessorInfoHandling handling = DEFAULT_HANDLING);
// Equivalent to one of the above depending on whether |name| can be converted
// to an array index.
@ -2104,7 +2097,7 @@ class JSObject: public JSReceiver {
DefinePropertyOrElementIgnoreAttributes(
Handle<JSObject> object, Handle<Name> name, Handle<Object> value,
PropertyAttributes attributes = NONE,
ExecutableAccessorInfoHandling handling = DEFAULT_HANDLING);
AccessorInfoHandling handling = DEFAULT_HANDLING);
// Adds or reconfigures a property to attributes NONE. It will fail when it
// cannot.
@ -10187,11 +10180,28 @@ class JSRegExpResult: public JSArray {
};
// An accessor must have a getter, but can have no setter.
//
// When setting a property, V8 searches accessors in prototypes.
// If an accessor was found and it does not have a setter,
// the request is ignored.
//
// If the accessor in the prototype has the READ_ONLY property attribute, then
// a new value is added to the derived object when the property is set.
// This shadows the accessor in the prototype.
class AccessorInfo: public Struct {
public:
DECL_ACCESSORS(name, Object)
DECL_INT_ACCESSORS(flag)
DECL_ACCESSORS(expected_receiver_type, Object)
DECL_ACCESSORS(getter, Object)
DECL_ACCESSORS(setter, Object)
DECL_ACCESSORS(data, Object)
// Dispatched behavior.
DECLARE_PRINTER(AccessorInfo)
static void ClearSetter(Handle<AccessorInfo> info);
inline bool all_can_read();
inline void set_all_can_read(bool value);
@ -10225,7 +10235,11 @@ class AccessorInfo: public Struct {
static const int kNameOffset = HeapObject::kHeaderSize;
static const int kFlagOffset = kNameOffset + kPointerSize;
static const int kExpectedReceiverTypeOffset = kFlagOffset + kPointerSize;
static const int kSize = kExpectedReceiverTypeOffset + kPointerSize;
static const int kGetterOffset = kExpectedReceiverTypeOffset + kPointerSize;
static const int kSetterOffset = kGetterOffset + kPointerSize;
static const int kDataOffset = kSetterOffset + kPointerSize;
static const int kSize = kDataOffset + kPointerSize;
private:
inline bool HasExpectedReceiverType();
@ -10240,39 +10254,6 @@ class AccessorInfo: public Struct {
};
// An accessor must have a getter, but can have no setter.
//
// When setting a property, V8 searches accessors in prototypes.
// If an accessor was found and it does not have a setter,
// the request is ignored.
//
// If the accessor in the prototype has the READ_ONLY property attribute, then
// a new value is added to the derived object when the property is set.
// This shadows the accessor in the prototype.
class ExecutableAccessorInfo: public AccessorInfo {
public:
DECL_ACCESSORS(getter, Object)
DECL_ACCESSORS(setter, Object)
DECL_ACCESSORS(data, Object)
DECLARE_CAST(ExecutableAccessorInfo)
// Dispatched behavior.
DECLARE_PRINTER(ExecutableAccessorInfo)
DECLARE_VERIFIER(ExecutableAccessorInfo)
static const int kGetterOffset = AccessorInfo::kSize;
static const int kSetterOffset = kGetterOffset + kPointerSize;
static const int kDataOffset = kSetterOffset + kPointerSize;
static const int kSize = kDataOffset + kPointerSize;
static void ClearSetter(Handle<ExecutableAccessorInfo> info);
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(ExecutableAccessorInfo);
};
// Support for JavaScript accessors: A pair of a getter and a setter. Each
// accessor can either be
// * a pointer to a JavaScript function or proxy: a real accessor

View File

@ -1421,18 +1421,17 @@ void V8HeapExplorer::ExtractAccessorInfoReferences(
SetInternalReference(accessor_info, entry, "expected_receiver_type",
accessor_info->expected_receiver_type(),
AccessorInfo::kExpectedReceiverTypeOffset);
if (accessor_info->IsExecutableAccessorInfo()) {
ExecutableAccessorInfo* executable_accessor_info =
ExecutableAccessorInfo::cast(accessor_info);
if (accessor_info->IsAccessorInfo()) {
AccessorInfo* executable_accessor_info = AccessorInfo::cast(accessor_info);
SetInternalReference(executable_accessor_info, entry, "getter",
executable_accessor_info->getter(),
ExecutableAccessorInfo::kGetterOffset);
AccessorInfo::kGetterOffset);
SetInternalReference(executable_accessor_info, entry, "setter",
executable_accessor_info->setter(),
ExecutableAccessorInfo::kSetterOffset);
AccessorInfo::kSetterOffset);
SetInternalReference(executable_accessor_info, entry, "data",
executable_accessor_info->data(),
ExecutableAccessorInfo::kDataOffset);
AccessorInfo::kDataOffset);
}
}

View File

@ -1567,7 +1567,7 @@ bool PartialSerializer::ShouldBeInThePartialSnapshotCache(HeapObject* o) {
// would cause dupes.
DCHECK(!o->IsScript());
return o->IsName() || o->IsSharedFunctionInfo() || o->IsHeapNumber() ||
o->IsCode() || o->IsScopeInfo() || o->IsExecutableAccessorInfo() ||
o->IsCode() || o->IsScopeInfo() || o->IsAccessorInfo() ||
o->map() ==
startup_serializer_->isolate()->heap()->fixed_cow_array_map();
}

View File

@ -267,8 +267,7 @@ TypeImpl<Config>::BitsetType::Lub(i::Map* map) {
// over type or class variables, esp ones with bounds...
return kDetectable & kTaggedPointer;
case ALLOCATION_SITE_TYPE:
case DECLARED_ACCESSOR_INFO_TYPE:
case EXECUTABLE_ACCESSOR_INFO_TYPE:
case ACCESSOR_INFO_TYPE:
case SHARED_FUNCTION_INFO_TYPE:
case ACCESSOR_PAIR_TYPE:
case FIXED_ARRAY_TYPE:
@ -292,7 +291,6 @@ TypeImpl<Config>::BitsetType::Lub(i::Map* map) {
TYPED_ARRAYS(FIXED_TYPED_ARRAY_CASE)
#undef FIXED_TYPED_ARRAY_CASE
case FILLER_TYPE:
case DECLARED_ACCESSOR_DESCRIPTOR_TYPE:
case ACCESS_CHECK_INFO_TYPE:
case INTERCEPTOR_INFO_TYPE:
case CALL_HANDLER_INFO_TYPE:

View File

@ -2135,7 +2135,7 @@ static void ThrowingSymbolAccessorGetter(
}
THREADED_TEST(ExecutableAccessorIsPreservedOnAttributeChange) {
THREADED_TEST(AccessorIsPreservedOnAttributeChange) {
v8::Isolate* isolate = CcTest::isolate();
v8::HandleScope scope(isolate);
LocalContext env;
@ -2145,11 +2145,11 @@ THREADED_TEST(ExecutableAccessorIsPreservedOnAttributeChange) {
CHECK_GT(i::FixedArray::cast(a->map()->instance_descriptors())->length(), 0);
CompileRun("Object.defineProperty(a, 'length', { writable: false });");
CHECK_EQ(i::FixedArray::cast(a->map()->instance_descriptors())->length(), 0);
// But we should still have an ExecutableAccessorInfo.
// But we should still have an AccessorInfo.
i::Handle<i::String> name(v8::Utils::OpenHandle(*v8_str("length")));
i::LookupIterator it(a, name, i::LookupIterator::OWN_SKIP_INTERCEPTOR);
CHECK_EQ(i::LookupIterator::ACCESSOR, it.state());
CHECK(it.GetAccessors()->IsExecutableAccessorInfo());
CHECK(it.GetAccessors()->IsAccessorInfo());
}

View File

@ -2071,7 +2071,7 @@ TEST(AccessorInfo) {
const v8::HeapGraphNode* length_accessor =
GetProperty(descriptors, v8::HeapGraphEdge::kInternal, "4");
CHECK(length_accessor);
CHECK_EQ(0, strcmp("system / ExecutableAccessorInfo",
CHECK_EQ(0, strcmp("system / AccessorInfo",
*v8::String::Utf8Value(length_accessor->GetName())));
const v8::HeapGraphNode* name =
GetProperty(length_accessor, v8::HeapGraphEdge::kInternal, "name");