const int kDetailsOffset =
SeededNumberDictionary::kElementsStartOffset + 2 * kPointerSize;
ldr(t1, FieldMemOperand(t2, kDetailsOffset));
- DCHECK_EQ(FIELD, 0);
+ DCHECK_EQ(DATA, 0);
tst(t1, Operand(Smi::FromInt(PropertyDetails::TypeField::kMask)));
b(ne, miss);
const int kDetailsOffset =
SeededNumberDictionary::kElementsStartOffset + 2 * kPointerSize;
Ldrsw(scratch1, UntagSmiFieldMemOperand(scratch2, kDetailsOffset));
- DCHECK_EQ(FIELD, 0);
+ DCHECK_EQ(DATA, 0);
TestAndBranchIfAnySet(scratch1, PropertyDetails::TypeField::kMask, miss);
// Get the value at the masked, scaled index and return.
Handle<AccessorInfo> length =
Accessors::FunctionLengthInfo(isolate(), attribs);
{ // Add length.
- CallbacksDescriptor d(Handle<Name>(Name::cast(length->name())),
- length, attribs);
+ AccessorConstantDescriptor d(Handle<Name>(Name::cast(length->name())),
+ length, attribs);
map->AppendDescriptor(&d);
}
Handle<AccessorInfo> name =
Accessors::FunctionNameInfo(isolate(), attribs);
{ // Add name.
- CallbacksDescriptor d(Handle<Name>(Name::cast(name->name())),
- name, attribs);
+ AccessorConstantDescriptor d(Handle<Name>(Name::cast(name->name())), name,
+ attribs);
map->AppendDescriptor(&d);
}
Handle<AccessorInfo> args =
Accessors::FunctionArgumentsInfo(isolate(), attribs);
{ // Add arguments.
- CallbacksDescriptor d(Handle<Name>(Name::cast(args->name())),
- args, attribs);
+ AccessorConstantDescriptor d(Handle<Name>(Name::cast(args->name())), args,
+ attribs);
map->AppendDescriptor(&d);
}
Handle<AccessorInfo> caller =
Accessors::FunctionCallerInfo(isolate(), attribs);
{ // Add caller.
- CallbacksDescriptor d(Handle<Name>(Name::cast(caller->name())),
- caller, attribs);
+ AccessorConstantDescriptor d(Handle<Name>(Name::cast(caller->name())),
+ caller, attribs);
map->AppendDescriptor(&d);
}
if (IsFunctionModeWithPrototype(function_mode)) {
}
Handle<AccessorInfo> prototype =
Accessors::FunctionPrototypeInfo(isolate(), attribs);
- CallbacksDescriptor d(Handle<Name>(Name::cast(prototype->name())),
- prototype, attribs);
+ AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())),
+ prototype, attribs);
map->AppendDescriptor(&d);
}
}
// Add length.
if (function_mode == BOUND_FUNCTION) {
Handle<String> length_string = isolate()->factory()->length_string();
- FieldDescriptor d(length_string, 0, ro_attribs, Representation::Tagged());
+ DataDescriptor d(length_string, 0, ro_attribs, Representation::Tagged());
map->AppendDescriptor(&d);
} else {
DCHECK(function_mode == FUNCTION_WITH_WRITEABLE_PROTOTYPE ||
function_mode == FUNCTION_WITHOUT_PROTOTYPE);
Handle<AccessorInfo> length =
Accessors::FunctionLengthInfo(isolate(), ro_attribs);
- CallbacksDescriptor d(Handle<Name>(Name::cast(length->name())),
- length, ro_attribs);
+ AccessorConstantDescriptor d(Handle<Name>(Name::cast(length->name())),
+ length, ro_attribs);
map->AppendDescriptor(&d);
}
Handle<AccessorInfo> name =
Accessors::FunctionNameInfo(isolate(), ro_attribs);
{ // Add name.
- CallbacksDescriptor d(Handle<Name>(Name::cast(name->name())),
- name, ro_attribs);
+ AccessorConstantDescriptor d(Handle<Name>(Name::cast(name->name())), name,
+ ro_attribs);
map->AppendDescriptor(&d);
}
{ // Add arguments.
- CallbacksDescriptor d(factory()->arguments_string(), arguments,
- rw_attribs);
+ AccessorConstantDescriptor d(factory()->arguments_string(), arguments,
+ rw_attribs);
map->AppendDescriptor(&d);
}
{ // Add caller.
- CallbacksDescriptor d(factory()->caller_string(), caller, rw_attribs);
+ AccessorConstantDescriptor d(factory()->caller_string(), caller,
+ rw_attribs);
map->AppendDescriptor(&d);
}
if (IsFunctionModeWithPrototype(function_mode)) {
: ro_attribs;
Handle<AccessorInfo> prototype =
Accessors::FunctionPrototypeInfo(isolate(), attribs);
- CallbacksDescriptor d(Handle<Name>(Name::cast(prototype->name())),
- prototype, attribs);
+ AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())),
+ prototype, attribs);
map->AppendDescriptor(&d);
}
}
Handle<AccessorPair> accessor_pair) {
DescriptorArray* descriptors = map->instance_descriptors();
int idx = descriptors->SearchWithCache(*name, *map);
- CallbacksDescriptor descriptor(name, accessor_pair, attributes);
+ AccessorConstantDescriptor descriptor(name, accessor_pair, attributes);
descriptors->Replace(idx, &descriptor);
}
Handle<AccessorInfo> array_length =
Accessors::ArrayLengthInfo(isolate, attribs);
{ // Add length.
- CallbacksDescriptor d(
- Handle<Name>(Name::cast(array_length->name())),
- array_length, attribs);
+ AccessorConstantDescriptor d(
+ Handle<Name>(Name::cast(array_length->name())), array_length,
+ attribs);
initial_map->AppendDescriptor(&d);
}
Accessors::StringLengthInfo(isolate, attribs));
{ // Add length.
- CallbacksDescriptor d(factory->length_string(), string_length, attribs);
+ AccessorConstantDescriptor d(factory->length_string(), string_length,
+ attribs);
string_map->AppendDescriptor(&d);
}
}
// ECMA-262, section 15.10.7.1.
Handle<AccessorInfo> regexp_source(
Accessors::RegExpSourceInfo(isolate, final));
- CallbacksDescriptor d(factory->source_string(), regexp_source, final);
+ AccessorConstantDescriptor d(factory->source_string(), regexp_source,
+ final);
initial_map->AppendDescriptor(&d);
}
{
// ECMA-262, section 15.10.7.2.
- FieldDescriptor field(factory->global_string(),
- JSRegExp::kGlobalFieldIndex,
- final,
- Representation::Tagged());
+ DataDescriptor field(factory->global_string(),
+ JSRegExp::kGlobalFieldIndex, final,
+ Representation::Tagged());
initial_map->AppendDescriptor(&field);
}
{
// ECMA-262, section 15.10.7.3.
- FieldDescriptor field(factory->ignore_case_string(),
- JSRegExp::kIgnoreCaseFieldIndex,
- final,
- Representation::Tagged());
+ DataDescriptor field(factory->ignore_case_string(),
+ JSRegExp::kIgnoreCaseFieldIndex, final,
+ Representation::Tagged());
initial_map->AppendDescriptor(&field);
}
{
// ECMA-262, section 15.10.7.4.
- FieldDescriptor field(factory->multiline_string(),
- JSRegExp::kMultilineFieldIndex,
- final,
- Representation::Tagged());
+ DataDescriptor field(factory->multiline_string(),
+ JSRegExp::kMultilineFieldIndex, final,
+ Representation::Tagged());
initial_map->AppendDescriptor(&field);
}
{
// ECMA-262, section 15.10.7.5.
PropertyAttributes writable =
static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE);
- FieldDescriptor field(factory->last_index_string(),
- JSRegExp::kLastIndexFieldIndex,
- writable,
- Representation::Tagged());
+ DataDescriptor field(factory->last_index_string(),
+ JSRegExp::kLastIndexFieldIndex, writable,
+ Representation::Tagged());
initial_map->AppendDescriptor(&field);
}
Map::EnsureDescriptorSlack(iterator_result_map,
JSGeneratorObject::kResultPropertyCount);
- FieldDescriptor value_descr(factory->value_string(),
- JSGeneratorObject::kResultValuePropertyIndex,
- NONE, Representation::Tagged());
+ DataDescriptor value_descr(factory->value_string(),
+ JSGeneratorObject::kResultValuePropertyIndex,
+ NONE, Representation::Tagged());
iterator_result_map->AppendDescriptor(&value_descr);
- FieldDescriptor done_descr(factory->done_string(),
- JSGeneratorObject::kResultDonePropertyIndex,
- NONE, Representation::Tagged());
+ DataDescriptor done_descr(factory->done_string(),
+ JSGeneratorObject::kResultDonePropertyIndex, NONE,
+ Representation::Tagged());
iterator_result_map->AppendDescriptor(&done_descr);
iterator_result_map->set_unused_property_fields(0);
Map::EnsureDescriptorSlack(map, 2);
{ // length
- FieldDescriptor d(factory->length_string(), Heap::kArgumentsLengthIndex,
- DONT_ENUM, Representation::Tagged());
+ DataDescriptor d(factory->length_string(), Heap::kArgumentsLengthIndex,
+ DONT_ENUM, Representation::Tagged());
map->AppendDescriptor(&d);
}
{ // callee
- FieldDescriptor d(factory->callee_string(), Heap::kArgumentsCalleeIndex,
- DONT_ENUM, Representation::Tagged());
+ DataDescriptor d(factory->callee_string(), Heap::kArgumentsCalleeIndex,
+ DONT_ENUM, Representation::Tagged());
map->AppendDescriptor(&d);
}
// @@iterator method is added later.
Map::EnsureDescriptorSlack(map, 3);
{ // length
- FieldDescriptor d(factory->length_string(), Heap::kArgumentsLengthIndex,
- DONT_ENUM, Representation::Tagged());
+ DataDescriptor d(factory->length_string(), Heap::kArgumentsLengthIndex,
+ DONT_ENUM, Representation::Tagged());
map->AppendDescriptor(&d);
}
{ // callee
- CallbacksDescriptor d(factory->callee_string(), callee, attributes);
+ AccessorConstantDescriptor d(factory->callee_string(), callee,
+ attributes);
map->AppendDescriptor(&d);
}
{ // caller
- CallbacksDescriptor d(factory->caller_string(), caller, attributes);
+ AccessorConstantDescriptor d(factory->caller_string(), caller,
+ attributes);
map->AppendDescriptor(&d);
}
// @@iterator method is added later.
Handle<AccessorInfo> array_length =
Accessors::ArrayLengthInfo(isolate(), attribs);
{ // Add length.
- CallbacksDescriptor d(
- Handle<Name>(Name::cast(array_length->name())), array_length, attribs);
+ AccessorConstantDescriptor d(Handle<Name>(Name::cast(array_length->name())),
+ array_length, attribs);
initial_map->AppendDescriptor(&d);
}
Handle<AccessorInfo> script_column =
Accessors::ScriptColumnOffsetInfo(isolate(), attribs);
{
- CallbacksDescriptor d(Handle<Name>(Name::cast(script_column->name())),
- script_column, attribs);
+ AccessorConstantDescriptor d(
+ Handle<Name>(Name::cast(script_column->name())), script_column,
+ attribs);
script_map->AppendDescriptor(&d);
}
Handle<AccessorInfo> script_id =
Accessors::ScriptIdInfo(isolate(), attribs);
{
- CallbacksDescriptor d(Handle<Name>(Name::cast(script_id->name())),
- script_id, attribs);
+ AccessorConstantDescriptor d(Handle<Name>(Name::cast(script_id->name())),
+ script_id, attribs);
script_map->AppendDescriptor(&d);
}
Handle<AccessorInfo> script_name =
Accessors::ScriptNameInfo(isolate(), attribs);
{
- CallbacksDescriptor d(Handle<Name>(Name::cast(script_name->name())),
- script_name, attribs);
+ AccessorConstantDescriptor d(
+ Handle<Name>(Name::cast(script_name->name())), script_name, attribs);
script_map->AppendDescriptor(&d);
}
Handle<AccessorInfo> script_line =
Accessors::ScriptLineOffsetInfo(isolate(), attribs);
{
- CallbacksDescriptor d(Handle<Name>(Name::cast(script_line->name())),
- script_line, attribs);
+ AccessorConstantDescriptor d(
+ Handle<Name>(Name::cast(script_line->name())), script_line, attribs);
script_map->AppendDescriptor(&d);
}
Handle<AccessorInfo> script_source =
Accessors::ScriptSourceInfo(isolate(), attribs);
{
- CallbacksDescriptor d(Handle<Name>(Name::cast(script_source->name())),
- script_source, attribs);
+ AccessorConstantDescriptor d(
+ Handle<Name>(Name::cast(script_source->name())), script_source,
+ attribs);
script_map->AppendDescriptor(&d);
}
Handle<AccessorInfo> script_type =
Accessors::ScriptTypeInfo(isolate(), attribs);
{
- CallbacksDescriptor d(Handle<Name>(Name::cast(script_type->name())),
- script_type, attribs);
+ AccessorConstantDescriptor d(
+ Handle<Name>(Name::cast(script_type->name())), script_type, attribs);
script_map->AppendDescriptor(&d);
}
Handle<AccessorInfo> script_compilation_type =
Accessors::ScriptCompilationTypeInfo(isolate(), attribs);
{
- CallbacksDescriptor d(
+ AccessorConstantDescriptor d(
Handle<Name>(Name::cast(script_compilation_type->name())),
script_compilation_type, attribs);
script_map->AppendDescriptor(&d);
Handle<AccessorInfo> script_line_ends =
Accessors::ScriptLineEndsInfo(isolate(), attribs);
{
- CallbacksDescriptor d(Handle<Name>(Name::cast(script_line_ends->name())),
- script_line_ends, attribs);
+ AccessorConstantDescriptor d(
+ Handle<Name>(Name::cast(script_line_ends->name())), script_line_ends,
+ attribs);
script_map->AppendDescriptor(&d);
}
Handle<AccessorInfo> script_context_data =
Accessors::ScriptContextDataInfo(isolate(), attribs);
{
- CallbacksDescriptor d(
+ AccessorConstantDescriptor d(
Handle<Name>(Name::cast(script_context_data->name())),
script_context_data, attribs);
script_map->AppendDescriptor(&d);
Handle<AccessorInfo> script_eval_from_script =
Accessors::ScriptEvalFromScriptInfo(isolate(), attribs);
{
- CallbacksDescriptor d(
+ AccessorConstantDescriptor d(
Handle<Name>(Name::cast(script_eval_from_script->name())),
script_eval_from_script, attribs);
script_map->AppendDescriptor(&d);
Handle<AccessorInfo> script_eval_from_script_position =
Accessors::ScriptEvalFromScriptPositionInfo(isolate(), attribs);
{
- CallbacksDescriptor d(
+ AccessorConstantDescriptor d(
Handle<Name>(Name::cast(script_eval_from_script_position->name())),
script_eval_from_script_position, attribs);
script_map->AppendDescriptor(&d);
Handle<AccessorInfo> script_eval_from_function_name =
Accessors::ScriptEvalFromFunctionNameInfo(isolate(), attribs);
{
- CallbacksDescriptor d(
+ AccessorConstantDescriptor d(
Handle<Name>(Name::cast(script_eval_from_function_name->name())),
script_eval_from_function_name, attribs);
script_map->AppendDescriptor(&d);
Handle<AccessorInfo> script_source_url =
Accessors::ScriptSourceUrlInfo(isolate(), attribs);
{
- CallbacksDescriptor d(Handle<Name>(Name::cast(script_source_url->name())),
- script_source_url, attribs);
+ AccessorConstantDescriptor d(
+ Handle<Name>(Name::cast(script_source_url->name())),
+ script_source_url, attribs);
script_map->AppendDescriptor(&d);
}
Handle<AccessorInfo> script_source_mapping_url =
Accessors::ScriptSourceMappingUrlInfo(isolate(), attribs);
{
- CallbacksDescriptor d(
+ AccessorConstantDescriptor d(
Handle<Name>(Name::cast(script_source_mapping_url->name())),
script_source_mapping_url, attribs);
script_map->AppendDescriptor(&d);
int old = array_descriptors->SearchWithCache(
*length, array_function->initial_map());
DCHECK(old != DescriptorArray::kNotFound);
- CallbacksDescriptor desc(length,
- handle(array_descriptors->GetValue(old),
- isolate()),
- array_descriptors->GetDetails(old).attributes());
+ AccessorConstantDescriptor desc(
+ length, handle(array_descriptors->GetValue(old), isolate()),
+ array_descriptors->GetDetails(old).attributes());
initial_map->AppendDescriptor(&desc);
}
{
- FieldDescriptor index_field(factory()->index_string(),
- JSRegExpResult::kIndexIndex,
- NONE,
- Representation::Tagged());
+ DataDescriptor index_field(factory()->index_string(),
+ JSRegExpResult::kIndexIndex, NONE,
+ Representation::Tagged());
initial_map->AppendDescriptor(&index_field);
}
{
- FieldDescriptor input_field(factory()->input_string(),
- JSRegExpResult::kInputIndex,
- NONE,
- Representation::Tagged());
+ DataDescriptor input_field(factory()->input_string(),
+ JSRegExpResult::kInputIndex, NONE,
+ Representation::Tagged());
initial_map->AppendDescriptor(&input_field);
}
Handle<AccessorInfo> arguments_iterator =
Accessors::ArgumentsIteratorInfo(isolate(), attribs);
{
- CallbacksDescriptor d(factory()->iterator_symbol(), arguments_iterator,
- attribs);
+ AccessorConstantDescriptor d(factory()->iterator_symbol(),
+ arguments_iterator, attribs);
Handle<Map> map(native_context()->sloppy_arguments_map());
Map::EnsureDescriptorSlack(map, 1);
map->AppendDescriptor(&d);
}
{
- CallbacksDescriptor d(factory()->iterator_symbol(), arguments_iterator,
- attribs);
+ AccessorConstantDescriptor d(factory()->iterator_symbol(),
+ arguments_iterator, attribs);
Handle<Map> map(native_context()->aliased_arguments_map());
Map::EnsureDescriptorSlack(map, 1);
map->AppendDescriptor(&d);
}
{
- CallbacksDescriptor d(factory()->iterator_symbol(), arguments_iterator,
- attribs);
+ AccessorConstantDescriptor d(factory()->iterator_symbol(),
+ arguments_iterator, attribs);
Handle<Map> map(native_context()->strict_arguments_map());
Map::EnsureDescriptorSlack(map, 1);
map->AppendDescriptor(&d);
for (int i = 0; i < from->map()->NumberOfOwnDescriptors(); i++) {
PropertyDetails details = descs->GetDetails(i);
switch (details.type()) {
- case FIELD: {
+ case DATA: {
HandleScope inner(isolate());
Handle<Name> key = Handle<Name>(descs->GetKey(i));
FieldIndex index = FieldIndex::ForDescriptor(from->map(), i);
JSObject::AddProperty(to, key, value, details.attributes());
break;
}
- case CONSTANT: {
+ case DATA_CONSTANT: {
HandleScope inner(isolate());
Handle<Name> key = Handle<Name>(descs->GetKey(i));
Handle<Object> constant(descs->GetConstant(i), isolate());
JSObject::AddProperty(to, key, constant, details.attributes());
break;
}
- case ACCESSOR_FIELD:
+ case ACCESSOR:
UNREACHABLE();
- case CALLBACKS: {
+ case ACCESSOR_CONSTANT: {
Handle<Name> key(descs->GetKey(i));
LookupIterator it(to, key, LookupIterator::OWN_SKIP_INTERCEPTOR);
CHECK_NE(LookupIterator::ACCESS_CHECK, it.state());
DCHECK(!to->HasFastProperties());
// Add to dictionary.
Handle<Object> callbacks(descs->GetCallbacksObject(i), isolate());
- PropertyDetails d(details.attributes(), CALLBACKS, i + 1);
+ PropertyDetails d(details.attributes(), ACCESSOR_CONSTANT, i + 1);
JSObject::SetNormalizedProperty(to, key, callbacks, d);
break;
}
isolate());
}
PropertyDetails details = properties->DetailsAt(i);
- DCHECK_EQ(DATA, details.kind());
+ DCHECK_EQ(kData, details.kind());
JSObject::AddProperty(to, key, value, details.attributes());
}
}
if (entry != SeededNumberDictionary::kNotFound) {
Handle<Object> element(backing_store->ValueAt(entry), isolate);
PropertyDetails details = backing_store->DetailsAt(entry);
- if (details.type() == CALLBACKS) {
+ if (details.type() == ACCESSOR_CONSTANT) {
return JSObject::GetElementWithCallback(
obj, receiver, element, key, obj);
} else {
Handle<SeededNumberDictionary>::cast(store);
int entry = backing_store->FindEntry(key);
if (entry != SeededNumberDictionary::kNotFound &&
- backing_store->DetailsAt(entry).type() == CALLBACKS &&
+ backing_store->DetailsAt(entry).type() == ACCESSOR_CONSTANT &&
backing_store->ValueAt(entry)->IsAccessorPair()) {
return handle(AccessorPair::cast(backing_store->ValueAt(entry)));
}
Handle<DescriptorArray> descs(map->instance_descriptors());
for (int i = 0; i < map->NumberOfOwnDescriptors(); i++) {
PropertyDetails details = descs->GetDetails(i);
- DCHECK(details.type() == CALLBACKS); // Only accessors are expected.
- PropertyDetails d(details.attributes(), CALLBACKS, i + 1);
+ // Only accessors are expected.
+ DCHECK_EQ(ACCESSOR_CONSTANT, details.type());
+ PropertyDetails d(details.attributes(), ACCESSOR_CONSTANT, i + 1);
Handle<Name> name(descs->GetKey(i));
Handle<Object> value(descs->GetCallbacksObject(i), isolate());
Handle<PropertyCell> cell = NewPropertyCell(value);
for (int i = 0; i < real_size; i++) {
PropertyDetails details = descs->GetDetails(i);
switch (details.location()) {
- case IN_OBJECT: {
+ case kField: {
Representation r = details.representation();
if (r.IsSmi() || r.IsDouble()) break;
}
break;
}
- case IN_DESCRIPTOR:
+ case kDescriptor:
SetDataOrAccessorPropertyReference(details.kind(), js_obj, entry,
descs->GetKey(i),
descs->GetValue(i));
PropertyKind kind, JSObject* parent_obj, int parent_entry,
Name* reference_name, Object* child_obj, const char* name_format_string,
int field_offset) {
- if (kind == ACCESSOR) {
+ if (kind == kAccessor) {
ExtractAccessorPairProperty(parent_obj, parent_entry, reference_name,
child_obj, field_offset);
} else {
int limit = boilerplate->map()->NumberOfOwnDescriptors();
for (int i = 0; i < limit; i++) {
PropertyDetails details = descriptors->GetDetails(i);
- if (details.type() != FIELD) continue;
+ if (details.type() != DATA) continue;
if ((*max_properties)-- == 0) return false;
FieldIndex field_index = FieldIndex::ForDescriptor(boilerplate->map(), i);
if (boilerplate->IsUnboxedDoubleField(field_index)) continue;
PropertyAccessInfo info(this, STORE, ToType(map), name);
if (info.CanAccessMonomorphic()) {
HValue* checked_literal = Add<HCheckMaps>(literal, map);
- DCHECK(!info.IsAccessor());
+ DCHECK(!info.IsAccessorConstant());
store = BuildMonomorphicAccess(
&info, literal, checked_literal, value,
BailoutId::None(), BailoutId::None());
// chain.
if (info->has_holder()) return false;
- if (IsAccessor()) {
+ if (IsAccessorConstant()) {
return accessor_.is_identical_to(info->accessor_) &&
api_holder_.is_identical_to(info->api_holder_);
}
- if (IsConstant()) {
+ if (IsDataConstant()) {
return constant_.is_identical_to(info->constant_);
}
- DCHECK(IsField());
- if (!info->IsField()) return false;
+ DCHECK(IsData());
+ if (!info->IsData()) return false;
Representation r = access_.representation();
if (IsLoad()) {
return false;
}
- if (IsField()) {
+ if (IsData()) {
// Construct the object field access.
int index = GetLocalFieldIndexFromMap(map);
access_ = HObjectAccess::ForField(map, index, representation(), name_);
// Load field map for heap objects.
LoadFieldMaps(map);
- } else if (IsAccessor()) {
+ } else if (IsAccessorConstant()) {
Handle<Object> accessors = GetAccessorsFromMap(map);
if (!accessors->IsAccessorPair()) return false;
Object* raw_accessor =
}
}
accessor_ = accessor;
- } else if (IsConstant()) {
+ } else if (IsDataConstant()) {
constant_ = GetConstantFromMap(map);
}
if (!LookupInPrototypes()) return false;
if (IsLoad()) return true;
- if (IsAccessor()) return true;
+ if (IsAccessorConstant()) return true;
Handle<Map> map = this->map();
map->LookupTransition(NULL, *name_, NONE, &lookup_);
- if (lookup_.IsTransitionToField() && map->unused_property_fields() > 0) {
+ if (lookup_.IsTransitionToData() && map->unused_property_fields() > 0) {
// Construct the object field access.
int descriptor = transition()->LastAdded();
int index =
return graph()->GetConstantUndefined();
}
- if (info->IsField()) {
+ if (info->IsData()) {
if (info->IsLoad()) {
return BuildLoadNamedField(info, checked_holder);
} else {
return BuildStoreNamedField(info, checked_object, value);
}
- if (info->IsAccessor()) {
+ if (info->IsAccessorConstant()) {
Push(checked_object);
int argument_count = 1;
if (!info->IsLoad()) {
return BuildCallConstantFunction(info->accessor(), argument_count);
}
- DCHECK(info->IsConstant());
+ DCHECK(info->IsDataConstant());
if (info->IsLoad()) {
return New<HConstant>(info->constant());
} else {
for (i = 0; i < types->length() && ordered_functions < kMaxCallPolymorphism;
++i) {
PropertyAccessInfo info(this, LOAD, ToType(types->at(i)), name);
- if (info.CanAccessMonomorphic() && info.IsConstant() &&
+ if (info.CanAccessMonomorphic() && info.IsDataConstant() &&
info.constant()->IsJSFunction()) {
if (info.type()->Is(Type::String())) {
if (handled_string) continue;
int copied_fields = 0;
for (int i = 0; i < limit; i++) {
PropertyDetails details = descriptors->GetDetails(i);
- if (details.type() != FIELD) continue;
+ if (details.type() != DATA) continue;
copied_fields++;
FieldIndex field_index = FieldIndex::ForDescriptor(*boilerplate_map, i);
bool IsFound() const { return lookup_.IsFound(); }
bool IsProperty() const { return lookup_.IsProperty(); }
- bool IsField() const { return lookup_.IsField(); }
- bool IsConstant() const { return lookup_.IsConstant(); }
- bool IsAccessor() const { return lookup_.IsPropertyCallbacks(); }
+ bool IsData() const { return lookup_.IsData(); }
+ bool IsDataConstant() const { return lookup_.IsDataConstant(); }
+ bool IsAccessorConstant() const { return lookup_.IsAccessorConstant(); }
bool IsTransition() const { return lookup_.IsTransition(); }
bool IsConfigurable() const { return lookup_.IsConfigurable(); }
// Check that the value is a field property.
const int kDetailsOffset =
SeededNumberDictionary::kElementsStartOffset + 2 * kPointerSize;
- DCHECK_EQ(FIELD, 0);
+ DCHECK_EQ(DATA, 0);
test(FieldOperand(elements, r2, times_pointer_size, kDetailsOffset),
Immediate(PropertyDetails::TypeField::kMask << kSmiTagSize));
j(not_zero, miss);
Handle<Code> NamedLoadHandlerCompiler::CompileLoadInterceptor(
LookupIterator* it) {
- // So far the most popular follow ups for interceptor loads are FIELD and
+ // So far the most popular follow ups for interceptor loads are DATA and
// ExecutableAccessorInfo, so inline only them. Other cases may be added
// later.
bool inline_followup = false;
break;
case LookupIterator::DATA:
inline_followup =
- it->property_details().type() == FIELD && !it->is_dictionary_holder();
+ it->property_details().type() == DATA && !it->is_dictionary_holder();
break;
case LookupIterator::ACCESSOR: {
Handle<Object> accessors = it->GetAccessors();
case LookupIterator::TRANSITION:
UNREACHABLE();
case LookupIterator::DATA: {
- DCHECK_EQ(FIELD, it->property_details().type());
+ DCHECK_EQ(DATA, it->property_details().type());
__ Move(receiver(), reg);
LoadFieldStub stub(isolate(), it->GetFieldIndex());
GenerateTailCall(masm(), stub.GetCode());
DCHECK(!transition->is_access_check_needed());
// Call to respective StoreTransitionStub.
- if (details.type() == CONSTANT) {
+ if (details.type() == DATA_CONSTANT) {
GenerateRestoreMap(transition, scratch2(), &miss);
DCHECK(descriptors->GetValue(descriptor)->IsJSFunction());
Register map_reg = StoreTransitionDescriptor::MapRegister();
}
// -------------- Fields --------------
- if (lookup->property_details().type() == FIELD) {
+ if (lookup->property_details().type() == DATA) {
FieldIndex field = lookup->GetFieldIndex();
if (receiver_is_holder) {
return SimpleFieldLoad(field);
}
// -------------- Constant properties --------------
- DCHECK(lookup->property_details().type() == CONSTANT);
+ DCHECK(lookup->property_details().type() == DATA_CONSTANT);
if (receiver_is_holder) {
LoadConstantStub stub(isolate(), lookup->GetConstantIndex());
return stub.GetCode();
}
// -------------- Fields --------------
- if (lookup->property_details().type() == FIELD) {
+ if (lookup->property_details().type() == DATA) {
bool use_stub = true;
if (lookup->representation().IsHeapObject()) {
// Only use a generic stub if no types need to be tracked.
}
// -------------- Constant properties --------------
- DCHECK(lookup->property_details().type() == CONSTANT);
+ DCHECK(lookup->property_details().type() == DATA_CONSTANT);
TRACE_GENERIC_IC(isolate(), "StoreIC", "constant property");
break;
}
Handle<Code> KeyedStoreIC::StoreElementStub(Handle<JSObject> receiver,
KeyedAccessStoreMode store_mode) {
- // Don't handle megamorphic property accesses for INTERCEPTORS or CALLBACKS
+ // Don't handle megamorphic property accesses for INTERCEPTORS or
+ // ACCESSOR_CONSTANT
// via megamorphic stubs, since they don't have a map in their relocation info
// and so the stubs can't be harvested for the object needed for a map check.
if (target()->type() != Code::NORMAL) {
PropertyDetails details = map->instance_descriptors()->GetDetails(i);
if (details.IsDontEnum()) continue;
Handle<Object> property;
- if (details.type() == FIELD && *map == object->map()) {
+ if (details.type() == DATA && *map == object->map()) {
FieldIndex field_index = FieldIndex::ForDescriptor(*map, i);
Isolate* isolate = object->GetIsolate();
if (object->IsUnboxedDoubleField(field_index)) {
bool LayoutDescriptor::InobjectUnboxedField(int inobject_properties,
PropertyDetails details) {
- if (details.type() != FIELD || !details.representation().IsDouble()) {
+ if (details.type() != DATA || !details.representation().IsDouble()) {
return false;
}
// We care only about in-object properties.
}
has_property_ = true;
switch (property_details_.kind()) {
- case v8::internal::DATA:
+ case v8::internal::kData:
return DATA;
- case v8::internal::ACCESSOR:
+ case v8::internal::kAccessor:
return ACCESSOR;
}
case ACCESSOR:
DCHECK(HolderIsReceiverOrHiddenPrototype());
Handle<JSObject> holder = GetHolder<JSObject>();
if (holder_map_->is_dictionary_map()) {
- PropertyDetails details(attributes, FIELD, 0);
+ PropertyDetails details(attributes, v8::internal::DATA, 0);
JSObject::SetNormalizedProperty(holder, name(), value, details);
} else {
holder_map_ = Map::ReconfigureDataProperty(holder_map_, descriptor_number(),
}
// Install the accessor into the dictionary-mode object.
- PropertyDetails details(attributes, CALLBACKS, 0);
+ PropertyDetails details(attributes, ACCESSOR_CONSTANT, 0);
Handle<AccessorPair> pair;
if (state() == ACCESSOR && GetAccessors()->IsAccessorPair()) {
pair = Handle<AccessorPair>::cast(GetAccessors());
if (holder_map_->IsGlobalObjectMap()) {
result = PropertyCell::cast(result)->value();
}
- } else if (property_details_.type() == v8::internal::FIELD) {
+ } else if (property_details_.type() == v8::internal::DATA) {
FieldIndex field_index = FieldIndex::ForDescriptor(*holder_map_, number_);
return JSObject::FastPropertyAt(holder, property_details_.representation(),
field_index);
int LookupIterator::GetConstantIndex() const {
DCHECK(has_property_);
DCHECK(!holder_map_->is_dictionary_map());
- DCHECK_EQ(v8::internal::CONSTANT, property_details_.type());
+ DCHECK_EQ(v8::internal::DATA_CONSTANT, property_details_.type());
return descriptor_number();
}
FieldIndex LookupIterator::GetFieldIndex() const {
DCHECK(has_property_);
DCHECK(!holder_map_->is_dictionary_map());
- DCHECK_EQ(v8::internal::FIELD, property_details_.type());
+ DCHECK_EQ(v8::internal::DATA, property_details_.type());
int index =
holder_map_->instance_descriptors()->GetFieldIndex(descriptor_number());
bool is_double = representation().IsDouble();
Handle<HeapType> LookupIterator::GetFieldType() const {
DCHECK(has_property_);
DCHECK(!holder_map_->is_dictionary_map());
- DCHECK_EQ(v8::internal::FIELD, property_details_.type());
+ DCHECK_EQ(v8::internal::DATA, property_details_.type());
return handle(
holder_map_->instance_descriptors()->GetFieldType(descriptor_number()),
isolate_);
} else {
property_dictionary->ValueAtPut(dictionary_entry(), *value);
}
- } else if (property_details_.type() == v8::internal::FIELD) {
+ } else if (property_details_.type() == v8::internal::DATA) {
holder->WriteToField(descriptor_number(), *value);
} else {
- DCHECK_EQ(v8::internal::CONSTANT, property_details_.type());
+ DCHECK_EQ(v8::internal::DATA_CONSTANT, property_details_.type());
}
return value;
}
Configuration configuration = PROTOTYPE_CHAIN)
: configuration_(ComputeConfiguration(configuration, name)),
state_(NOT_FOUND),
- property_details_(NONE, FIELD, 0),
+ property_details_(NONE, v8::internal::DATA, 0),
isolate_(name->GetIsolate()),
name_(name),
receiver_(receiver),
Configuration configuration = PROTOTYPE_CHAIN)
: configuration_(ComputeConfiguration(configuration, name)),
state_(NOT_FOUND),
- property_details_(NONE, FIELD, 0),
+ property_details_(NONE, v8::internal::DATA, 0),
isolate_(name->GetIsolate()),
name_(name),
holder_map_(holder->map(), isolate_),
const int kDetailsOffset =
SeededNumberDictionary::kElementsStartOffset + 2 * kPointerSize;
lw(reg1, FieldMemOperand(reg2, kDetailsOffset));
- DCHECK_EQ(FIELD, 0);
+ DCHECK_EQ(DATA, 0);
And(at, reg1, Operand(Smi::FromInt(PropertyDetails::TypeField::kMask)));
Branch(miss, ne, at, Operand(zero_reg));
const int kDetailsOffset =
SeededNumberDictionary::kElementsStartOffset + 2 * kPointerSize;
ld(reg1, FieldMemOperand(reg2, kDetailsOffset));
- DCHECK_EQ(FIELD, 0);
+ DCHECK_EQ(DATA, 0);
And(at, reg1, Operand(Smi::FromInt(PropertyDetails::TypeField::kMask)));
Branch(miss, ne, at, Operand(zero_reg));
// A copy of the PropertyType enum from property-details.h
var PropertyType = {};
-PropertyType.Field = 0;
-PropertyType.Constant = 1;
-PropertyType.Callbacks = 3;
+PropertyType.Data = 0;
+PropertyType.DataConstant = 2;
+PropertyType.AccessorConstant = 3;
// Different attributes for a property.
// Skip properties which are defined through assessors.
var property = properties[i];
- if (property.propertyType() != PropertyType.Callbacks) {
+ if (property.propertyType() != PropertyType.AccessorConstant) {
if (%_ObjectEquals(property.value_, value.value_)) {
return property;
}
*/
PropertyMirror.prototype.isNative = function() {
return this.is_interceptor_ ||
- ((this.propertyType() == PropertyType.Callbacks) &&
+ ((this.propertyType() == PropertyType.AccessorConstant) &&
!this.hasGetter() && !this.hasSetter());
};
}
DescriptorArray* descriptors = map()->instance_descriptors();
for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) {
- if (descriptors->GetDetails(i).type() == FIELD) {
+ if (descriptors->GetDetails(i).type() == DATA) {
Representation r = descriptors->GetDetails(i).representation();
FieldIndex index = FieldIndex::ForDescriptor(map(), i);
if (IsUnboxedDoubleField(index)) {
int nof_descriptors = map->NumberOfOwnDescriptors();
for (int i = 0; i < nof_descriptors; i++) {
PropertyDetails details = descriptors->GetDetails(i);
- if (details.type() != FIELD) continue;
+ if (details.type() != DATA) continue;
FieldIndex field_index = FieldIndex::ForDescriptor(map, i);
bool tagged_expected =
!field_index.is_inobject() || !details.representation().IsDouble();
bool TransitionArray::IsSortedNoDuplicates(int valid_entries) {
DCHECK(valid_entries == -1);
Name* prev_key = NULL;
- PropertyKind prev_kind = DATA;
+ PropertyKind prev_kind = kData;
PropertyAttributes prev_attributes = NONE;
uint32_t prev_hash = 0;
for (int i = 0; i < number_of_transitions(); i++) {
Name* key = GetSortedKey(i);
uint32_t hash = key->Hash();
- PropertyKind kind = DATA;
+ PropertyKind kind = kData;
PropertyAttributes attributes = NONE;
if (!IsSpecialTransition(key)) {
Map* target = GetTarget(i);
int PropertyDetails::field_width_in_words() const {
- DCHECK(type() == FIELD);
+ DCHECK(type() == DATA);
if (!FLAG_unbox_double_fields) return 1;
if (kDoubleSize == kPointerSize) return 1;
return representation().IsDouble() ? kDoubleSize / kPointerSize : 1;
int transition = TransitionArray::kSimpleTransitionIndex;
PropertyDetails details = transitions->GetTargetDetails(transition);
Name* name = transitions->GetKey(transition);
- if (details.type() != FIELD) return Handle<String>::null();
+ if (details.type() != DATA) return Handle<String>::null();
if (details.attributes() != NONE) return Handle<String>::null();
if (!name->IsString()) return Handle<String>::null();
return Handle<String>(String::cast(name));
DisallowHeapAllocation no_allocation;
if (!map->HasTransitionArray()) return Handle<Map>::null();
TransitionArray* transitions = map->transitions();
- int transition = transitions->Search(DATA, *key, NONE);
+ int transition = transitions->Search(kData, *key, NONE);
if (transition == TransitionArray::kNotFound) return Handle<Map>::null();
PropertyDetails details = transitions->GetTargetDetails(transition);
- if (details.type() != FIELD) return Handle<Map>::null();
+ if (details.type() != DATA) return Handle<Map>::null();
DCHECK_EQ(NONE, details.attributes());
return Handle<Map>(transitions->GetTarget(transition));
}
void Map::LookupTransition(JSObject* holder, Name* name,
PropertyAttributes attributes,
LookupResult* result) {
- int transition_index = this->SearchTransition(DATA, name, attributes);
+ int transition_index = this->SearchTransition(kData, name, attributes);
if (transition_index == TransitionArray::kNotFound) return result->NotFound();
result->TransitionResult(holder, this->GetTransition(transition_index));
}
int DescriptorArray::GetFieldIndex(int descriptor_number) {
- DCHECK(GetDetails(descriptor_number).type() == FIELD);
+ DCHECK(GetDetails(descriptor_number).type() == DATA);
return GetDetails(descriptor_number).field_index();
}
HeapType* DescriptorArray::GetFieldType(int descriptor_number) {
- DCHECK(GetDetails(descriptor_number).type() == FIELD);
+ DCHECK(GetDetails(descriptor_number).type() == DATA);
return HeapType::cast(GetValue(descriptor_number));
}
Object* DescriptorArray::GetCallbacksObject(int descriptor_number) {
- DCHECK(GetType(descriptor_number) == CALLBACKS);
+ DCHECK(GetType(descriptor_number) == ACCESSOR_CONSTANT);
return GetValue(descriptor_number);
}
AccessorDescriptor* DescriptorArray::GetCallbacks(int descriptor_number) {
- DCHECK(GetType(descriptor_number) == CALLBACKS);
+ DCHECK(GetType(descriptor_number) == ACCESSOR_CONSTANT);
Foreign* p = Foreign::cast(GetCallbacksObject(descriptor_number));
return reinterpret_cast<AccessorDescriptor*>(p->foreign_address());
}
if (details.representation().IsSmi()) return true;
if (details.representation().IsDouble()) return true;
if (details.representation().IsHeapObject()) return true;
- if (details.type() == CONSTANT) return true;
+ if (details.type() == DATA_CONSTANT) return true;
}
return false;
}
// it should never try to (otherwise, layout descriptor must be updated too).
#ifdef DEBUG
PropertyDetails details = desc->GetDetails();
- CHECK(details.type() != FIELD || !details.representation().IsDouble());
+ CHECK(details.type() != DATA || !details.representation().IsDouble());
#endif
}
descs->GetKey(i)->NamePrint(os);
os << ": ";
switch (descs->GetType(i)) {
- case FIELD: {
+ case DATA: {
FieldIndex index = FieldIndex::ForDescriptor(map(), i);
if (IsUnboxedDoubleField(index)) {
os << "<unboxed double> " << RawFastDoublePropertyAt(index);
} else {
os << Brief(RawFastPropertyAt(index));
}
- os << " (field at offset " << index.property_index() << ")\n";
+ os << " (data field at offset " << index.property_index() << ")\n";
break;
}
- case ACCESSOR_FIELD: {
+ case ACCESSOR: {
FieldIndex index = FieldIndex::ForDescriptor(map(), i);
- os << " (accessor at offset " << index.property_index() << ")\n";
+ os << " (accessor field at offset " << index.property_index()
+ << ")\n";
break;
}
- case CONSTANT:
- os << Brief(descs->GetConstant(i)) << " (constant)\n";
+ case DATA_CONSTANT:
+ os << Brief(descs->GetConstant(i)) << " (data constant)\n";
break;
- case CALLBACKS:
- os << Brief(descs->GetCallbacksObject(i)) << " (callbacks)\n";
+ case ACCESSOR_CONSTANT:
+ os << Brief(descs->GetCallbacksObject(i)) << " (accessor constant)\n";
break;
}
}
} else {
PropertyDetails details = GetTargetDetails(key, target);
os << " (transition to ";
- if (details.location() == IN_DESCRIPTOR) {
+ if (details.location() == kDescriptor) {
os << "immutable ";
}
- os << (details.kind() == DATA ? "data" : "accessor");
- if (details.location() == IN_DESCRIPTOR) {
+ os << (details.kind() == kData ? "data" : "accessor");
+ if (details.location() == kDescriptor) {
os << " " << Brief(GetTargetValue(i));
}
os << "), attrs: " << details.attributes();
if (!o_r.Equals(n_r)) {
String::cast(o->GetKey(i))->PrintOn(file);
PrintF(file, ":%s->%s ", o_r.Mnemonic(), n_r.Mnemonic());
- } else if (o->GetDetails(i).type() == CONSTANT &&
- n->GetDetails(i).type() == FIELD) {
+ } else if (o->GetDetails(i).type() == DATA_CONSTANT &&
+ n->GetDetails(i).type() == DATA) {
Name* name = o->GetKey(i);
if (name->IsString()) {
String::cast(name)->PrintOn(file);
type = HeapType::Any(isolate);
}
- FieldDescriptor new_field_desc(name, index, type, attributes, representation);
+ DataDescriptor new_field_desc(name, index, type, attributes, representation);
Handle<Map> new_map = Map::CopyAddDescriptor(map, &new_field_desc, flag);
int unused_property_fields = new_map->unused_property_fields() - 1;
if (unused_property_fields < 0) {
}
// Allocate new instance descriptors with (name, constant) added.
- ConstantDescriptor new_constant_desc(name, constant, attributes);
+ DataConstantDescriptor new_constant_desc(name, constant, attributes);
return Map::CopyAddDescriptor(map, &new_constant_desc, flag);
}
// Assign an enumeration index to the property and update
// SetNextEnumerationIndex.
int index = dict->NextEnumerationIndex();
- PropertyDetails details(attributes, FIELD, index);
+ PropertyDetails details(attributes, DATA, index);
dict->SetNextEnumerationIndex(index + 1);
dict->SetEntry(entry, name, cell, details);
return;
PropertyCell::SetValueInferType(cell, value);
value = cell;
}
- PropertyDetails details(attributes, FIELD, 0);
+ PropertyDetails details(attributes, DATA, 0);
Handle<NameDictionary> result =
NameDictionary::Add(dict, name, value, details);
if (*dict != *result) object->set_properties(*result);
} else {
value = isolate->factory()->uninitialized_value();
}
- DCHECK(details.type() == FIELD);
+ DCHECK(details.type() == DATA);
int target_index = details.field_index() - inobject;
DCHECK(target_index >= 0); // Must be a backing store index.
new_storage->set(target_index, *value);
for (int i = 0; i < old_nof; i++) {
PropertyDetails details = new_descriptors->GetDetails(i);
- if (details.type() != FIELD) continue;
+ if (details.type() != DATA) continue;
PropertyDetails old_details = old_descriptors->GetDetails(i);
- if (old_details.type() == CALLBACKS) {
+ if (old_details.type() == ACCESSOR_CONSTANT) {
DCHECK(details.representation().IsTagged());
continue;
}
Representation old_representation = old_details.representation();
Representation representation = details.representation();
- DCHECK(old_details.type() == CONSTANT ||
- old_details.type() == FIELD);
+ DCHECK(old_details.type() == DATA_CONSTANT || old_details.type() == DATA);
Handle<Object> value;
- if (old_details.type() == CONSTANT) {
+ if (old_details.type() == DATA_CONSTANT) {
value = handle(old_descriptors->GetValue(i), isolate);
DCHECK(!old_representation.IsDouble() && !representation.IsDouble());
} else {
for (int i = old_nof; i < new_nof; i++) {
PropertyDetails details = new_descriptors->GetDetails(i);
- if (details.type() != FIELD) continue;
+ if (details.type() != DATA) continue;
Handle<Object> value;
if (details.representation().IsDouble()) {
value = isolate->factory()->NewHeapNumber(0, MUTABLE);
DescriptorArray* descriptors = instance_descriptors();
int result = 0;
for (int i = 0; i < NumberOfOwnDescriptors(); i++) {
- if (descriptors->GetDetails(i).type() == FIELD) result++;
+ if (descriptors->GetDetails(i).type() == DATA) result++;
}
return result;
}
for (int i = 0; i < number_of_own_descriptors; i++) {
descriptors->SetRepresentation(i, Representation::Tagged());
- if (descriptors->GetDetails(i).type() == FIELD) {
+ if (descriptors->GetDetails(i).type() == DATA) {
descriptors->SetValue(i, HeapType::Any());
}
}
// Unless the instance is being migrated, ensure that modify_index is a field.
PropertyDetails details = descriptors->GetDetails(modify_index);
- if (store_mode == FORCE_IN_OBJECT &&
- (details.type() != FIELD || details.attributes() != attributes)) {
- int field_index = details.type() == FIELD ? details.field_index()
- : new_map->NumberOfFields();
- FieldDescriptor d(handle(descriptors->GetKey(modify_index), isolate),
- field_index, attributes, Representation::Tagged());
+ if (store_mode == FORCE_FIELD &&
+ (details.type() != DATA || details.attributes() != attributes)) {
+ int field_index = details.type() == DATA ? details.field_index()
+ : new_map->NumberOfFields();
+ DataDescriptor d(handle(descriptors->GetKey(modify_index), isolate),
+ field_index, attributes, Representation::Tagged());
descriptors->Replace(modify_index, &d);
- if (details.type() != FIELD) {
+ if (details.type() != DATA) {
int unused_property_fields = new_map->unused_property_fields() - 1;
if (unused_property_fields < 0) {
unused_property_fields += JSObject::kFieldsAdded;
}
if (FLAG_trace_generalization) {
- HeapType* field_type = (details.type() == FIELD)
- ? map->instance_descriptors()->GetFieldType(modify_index)
- : NULL;
+ HeapType* field_type =
+ (details.type() == DATA)
+ ? map->instance_descriptors()->GetFieldType(modify_index)
+ : NULL;
map->PrintGeneralization(
stdout, reason, modify_index, new_map->NumberOfOwnDescriptors(),
new_map->NumberOfOwnDescriptors(),
- details.type() == CONSTANT && store_mode == FORCE_IN_OBJECT,
+ details.type() == DATA_CONSTANT && store_mode == FORCE_FIELD,
details.representation(), Representation::Tagged(), field_type,
HeapType::Any());
}
if (details.type() != next_details.type()) break;
if (details.attributes() != next_details.attributes()) break;
if (!details.representation().Equals(next_details.representation())) break;
- if (next_details.type() == FIELD) {
+ if (next_details.type() == DATA) {
if (!descriptors->GetFieldType(i)->NowIs(
next_descriptors->GetFieldType(i))) break;
} else {
Map* Map::FindFieldOwner(int descriptor) {
DisallowHeapAllocation no_allocation;
- DCHECK_EQ(FIELD, instance_descriptors()->GetDetails(descriptor).type());
+ DCHECK_EQ(DATA, instance_descriptors()->GetDetails(descriptor).type());
Map* result = this;
while (true) {
Object* back = result->GetBackPointer();
Handle<HeapType> new_type) {
DisallowHeapAllocation no_allocation;
PropertyDetails details = instance_descriptors()->GetDetails(descriptor);
- if (details.type() != FIELD) return;
+ if (details.type() != DATA) return;
if (HasTransitionArray()) {
TransitionArray* transitions = this->transitions();
for (int i = 0; i < transitions->number_of_transitions(); ++i) {
// Skip if already updated the shared descriptor.
if (instance_descriptors()->GetFieldType(descriptor) == *new_type) return;
- FieldDescriptor d(name, instance_descriptors()->GetFieldIndex(descriptor),
- new_type, details.attributes(), new_representation);
+ DataDescriptor d(name, instance_descriptors()->GetFieldIndex(descriptor),
+ new_type, details.attributes(), new_representation);
instance_descriptors()->Replace(descriptor, &d);
}
// Doubles, however, would require a box allocation.
if (old_representation.IsNone() && !new_representation.IsNone() &&
!new_representation.IsDouble()) {
- DCHECK(old_details.type() == FIELD);
+ DCHECK(old_details.type() == DATA);
if (FLAG_trace_generalization) {
old_map->PrintGeneralization(
stdout, "uninitialized field",
int root_nof = root_map->NumberOfOwnDescriptors();
if (modify_index < root_nof) {
PropertyDetails old_details = old_descriptors->GetDetails(modify_index);
- if ((old_details.type() != FIELD && store_mode == FORCE_IN_OBJECT) ||
- (old_details.type() == FIELD &&
+ if ((old_details.type() != DATA && store_mode == FORCE_FIELD) ||
+ (old_details.type() == DATA &&
(!new_field_type->NowIs(old_descriptors->GetFieldType(modify_index)) ||
!new_representation.fits_into(old_details.representation())))) {
return CopyGeneralizeAllRepresentations(old_map, modify_index, store_mode,
PropertyType old_type = old_details.type();
PropertyType tmp_type = tmp_details.type();
DCHECK_EQ(old_details.attributes(), tmp_details.attributes());
- if ((tmp_type == CALLBACKS || old_type == CALLBACKS) &&
+ if ((tmp_type == ACCESSOR_CONSTANT || old_type == ACCESSOR_CONSTANT) &&
(tmp_type != old_type ||
tmp_descriptors->GetValue(i) != old_descriptors->GetValue(i))) {
return CopyGeneralizeAllRepresentations(old_map, modify_index, store_mode,
modify_index == i)) {
break;
}
- if (tmp_type == FIELD) {
+ if (tmp_type == DATA) {
// Generalize the field type as necessary.
- Handle<HeapType> old_field_type = (old_type == FIELD)
- ? handle(old_descriptors->GetFieldType(i), isolate)
- : old_descriptors->GetValue(i)->OptimalType(
- isolate, tmp_representation);
+ Handle<HeapType> old_field_type =
+ (old_type == DATA) ? handle(old_descriptors->GetFieldType(i), isolate)
+ : old_descriptors->GetValue(i)
+ ->OptimalType(isolate, tmp_representation);
if (modify_index == i) {
old_field_type = GeneralizeFieldType(
new_field_type, old_field_type, isolate);
}
GeneralizeFieldType(tmp_map, i, tmp_representation, old_field_type);
- } else if (tmp_type == CONSTANT) {
- if (old_type != CONSTANT ||
+ } else if (tmp_type == DATA_CONSTANT) {
+ if (old_type != DATA_CONSTANT ||
old_descriptors->GetConstant(i) != tmp_descriptors->GetConstant(i)) {
break;
}
target_map->instance_descriptors(), isolate);
int target_nof = target_map->NumberOfOwnDescriptors();
if (target_nof == old_nof &&
- (store_mode != FORCE_IN_OBJECT ||
- target_descriptors->GetDetails(modify_index).type() == FIELD)) {
+ (store_mode != FORCE_FIELD ||
+ target_descriptors->GetDetails(modify_index).type() == DATA)) {
DCHECK(modify_index < target_nof);
DCHECK(new_representation.fits_into(
target_descriptors->GetDetails(modify_index).representation()));
- DCHECK(target_descriptors->GetDetails(modify_index).type() != FIELD ||
- new_field_type->NowIs(
- target_descriptors->GetFieldType(modify_index)));
+ DCHECK(
+ target_descriptors->GetDetails(modify_index).type() != DATA ||
+ new_field_type->NowIs(target_descriptors->GetFieldType(modify_index)));
return target_map;
}
// Check if target map is compatible.
PropertyDetails tmp_details = tmp_descriptors->GetDetails(i);
DCHECK_EQ(old_details.attributes(), tmp_details.attributes());
- if ((tmp_details.type() == CALLBACKS || old_details.type() == CALLBACKS) &&
+ if ((tmp_details.type() == ACCESSOR_CONSTANT ||
+ old_details.type() == ACCESSOR_CONSTANT) &&
(tmp_details.type() != old_details.type() ||
tmp_descriptors->GetValue(i) != old_descriptors->GetValue(i))) {
return CopyGeneralizeAllRepresentations(old_map, modify_index, store_mode,
int current_offset = 0;
for (int i = 0; i < root_nof; ++i) {
PropertyDetails old_details = old_descriptors->GetDetails(i);
- if (old_details.type() == FIELD) {
+ if (old_details.type() == DATA) {
current_offset += old_details.field_width_in_words();
}
Descriptor d(handle(old_descriptors->GetKey(i), isolate),
new_representation.generalize(target_details.representation()));
}
DCHECK_EQ(old_details.attributes(), target_details.attributes());
- if (old_details.type() == FIELD || target_details.type() == FIELD ||
- (modify_index == i && store_mode == FORCE_IN_OBJECT) ||
+ if (old_details.type() == DATA || target_details.type() == DATA ||
+ (modify_index == i && store_mode == FORCE_FIELD) ||
(target_descriptors->GetValue(i) != old_descriptors->GetValue(i))) {
- Handle<HeapType> old_field_type = (old_details.type() == FIELD)
- ? handle(old_descriptors->GetFieldType(i), isolate)
- : old_descriptors->GetValue(i)->OptimalType(
- isolate, target_details.representation());
- Handle<HeapType> target_field_type = (target_details.type() == FIELD)
- ? handle(target_descriptors->GetFieldType(i), isolate)
- : target_descriptors->GetValue(i)->OptimalType(
- isolate, target_details.representation());
+ Handle<HeapType> old_field_type =
+ (old_details.type() == DATA)
+ ? handle(old_descriptors->GetFieldType(i), isolate)
+ : old_descriptors->GetValue(i)
+ ->OptimalType(isolate, target_details.representation());
+ Handle<HeapType> target_field_type =
+ (target_details.type() == DATA)
+ ? handle(target_descriptors->GetFieldType(i), isolate)
+ : target_descriptors->GetValue(i)
+ ->OptimalType(isolate, target_details.representation());
target_field_type = GeneralizeFieldType(
target_field_type, old_field_type, isolate);
if (modify_index == i) {
target_field_type = GeneralizeFieldType(
target_field_type, new_field_type, isolate);
}
- FieldDescriptor d(target_key, current_offset, target_field_type,
- target_details.attributes(),
- target_details.representation());
+ DataDescriptor d(target_key, current_offset, target_field_type,
+ target_details.attributes(),
+ target_details.representation());
current_offset += d.GetDetails().field_width_in_words();
new_descriptors->Set(i, &d);
} else {
- DCHECK_NE(FIELD, target_details.type());
+ DCHECK_NE(DATA, target_details.type());
Descriptor d(target_key,
handle(target_descriptors->GetValue(i), isolate),
target_details);
old_details = old_details.CopyWithRepresentation(
new_representation.generalize(old_details.representation()));
}
- if (old_details.type() == FIELD) {
+ if (old_details.type() == DATA) {
Handle<HeapType> old_field_type(
old_descriptors->GetFieldType(i), isolate);
if (modify_index == i) {
old_field_type = GeneralizeFieldType(
old_field_type, new_field_type, isolate);
}
- FieldDescriptor d(old_key, current_offset, old_field_type,
- old_details.attributes(), old_details.representation());
+ DataDescriptor d(old_key, current_offset, old_field_type,
+ old_details.attributes(), old_details.representation());
current_offset += d.GetDetails().field_width_in_words();
new_descriptors->Set(i, &d);
} else {
- DCHECK(old_details.type() == CONSTANT || old_details.type() == CALLBACKS);
- if (modify_index == i && store_mode == FORCE_IN_OBJECT) {
- FieldDescriptor d(
+ DCHECK(old_details.type() == DATA_CONSTANT ||
+ old_details.type() == ACCESSOR_CONSTANT);
+ if (modify_index == i && store_mode == FORCE_FIELD) {
+ DataDescriptor d(
old_key, current_offset,
GeneralizeFieldType(old_descriptors->GetValue(i)->OptimalType(
isolate, old_details.representation()),
current_offset += d.GetDetails().field_width_in_words();
new_descriptors->Set(i, &d);
} else {
- DCHECK_NE(FIELD, old_details.type());
+ DCHECK_NE(DATA, old_details.type());
Descriptor d(old_key,
handle(old_descriptors->GetValue(i), isolate),
old_details);
new_descriptors->Sort();
- DCHECK(store_mode != FORCE_IN_OBJECT ||
- new_descriptors->GetDetails(modify_index).type() == FIELD);
+ DCHECK(store_mode != FORCE_FIELD ||
+ new_descriptors->GetDetails(modify_index).type() == DATA);
Handle<Map> split_map(root_map->FindLastMatchMap(
root_nof, old_nof, *new_descriptors), isolate);
if (FLAG_trace_generalization) {
PropertyDetails old_details = old_descriptors->GetDetails(modify_index);
PropertyDetails new_details = new_descriptors->GetDetails(modify_index);
- Handle<HeapType> old_field_type = (old_details.type() == FIELD)
- ? handle(old_descriptors->GetFieldType(modify_index), isolate)
- : HeapType::Constant(handle(old_descriptors->GetValue(modify_index),
- isolate), isolate);
- Handle<HeapType> new_field_type = (new_details.type() == FIELD)
- ? handle(new_descriptors->GetFieldType(modify_index), isolate)
- : HeapType::Constant(handle(new_descriptors->GetValue(modify_index),
- isolate), isolate);
+ Handle<HeapType> old_field_type =
+ (old_details.type() == DATA)
+ ? handle(old_descriptors->GetFieldType(modify_index), isolate)
+ : HeapType::Constant(
+ handle(old_descriptors->GetValue(modify_index), isolate),
+ isolate);
+ Handle<HeapType> new_field_type =
+ (new_details.type() == DATA)
+ ? handle(new_descriptors->GetFieldType(modify_index), isolate)
+ : HeapType::Constant(
+ handle(new_descriptors->GetValue(modify_index), isolate),
+ isolate);
old_map->PrintGeneralization(
stdout, "", modify_index, split_nof, old_nof,
- old_details.type() == CONSTANT && store_mode == FORCE_IN_OBJECT,
+ old_details.type() == DATA_CONSTANT && store_mode == FORCE_FIELD,
old_details.representation(), new_details.representation(),
*old_field_type, *new_field_type);
}
}
-// Generalize the representation of all FIELD descriptors.
+// Generalize the representation of all DATA descriptors.
Handle<Map> Map::GeneralizeAllFieldRepresentations(
Handle<Map> map) {
Handle<DescriptorArray> descriptors(map->instance_descriptors());
for (int i = 0; i < map->NumberOfOwnDescriptors(); ++i) {
- if (descriptors->GetDetails(i).type() == FIELD) {
+ if (descriptors->GetDetails(i).type() == DATA) {
map = GeneralizeRepresentation(map, i, Representation::Tagged(),
HeapType::Any(map->GetIsolate()),
- FORCE_IN_OBJECT);
+ FORCE_FIELD);
}
}
return map;
Object* new_value = new_descriptors->GetValue(i);
Object* old_value = old_descriptors->GetValue(i);
switch (new_details.type()) {
- case FIELD: {
+ case DATA: {
PropertyType old_type = old_details.type();
- if (old_type == FIELD) {
+ if (old_type == DATA) {
if (!HeapType::cast(old_value)->NowIs(HeapType::cast(new_value))) {
return MaybeHandle<Map>();
}
} else {
- DCHECK(old_type == CONSTANT);
+ DCHECK(old_type == DATA_CONSTANT);
if (!HeapType::cast(new_value)->NowContains(old_value)) {
return MaybeHandle<Map>();
}
}
break;
}
- case ACCESSOR_FIELD:
+ case ACCESSOR:
DCHECK(HeapType::Any()->Is(HeapType::cast(new_value)));
break;
- case CONSTANT:
- case CALLBACKS:
- if (old_details.location() == IN_OBJECT || old_value != new_value) {
+ case DATA_CONSTANT:
+ case ACCESSOR_CONSTANT:
+ if (old_details.location() == kField || old_value != new_value) {
return MaybeHandle<Map>();
}
break;
int entry = dictionary->FindEntry(index);
if (entry != SeededNumberDictionary::kNotFound) {
PropertyDetails details = dictionary->DetailsAt(entry);
- if (details.type() == CALLBACKS) {
+ if (details.type() == ACCESSOR_CONSTANT) {
*found = true;
Handle<Object> structure(dictionary->ValueAt(entry), isolate);
return SetElementWithCallback(object, structure, index, value, js_proto,
int valid_descriptors,
Handle<DescriptorArray> array) {
DisallowHeapAllocation no_gc;
- CallbacksDescriptor desc(key, entry, entry->property_attributes());
+ AccessorConstantDescriptor desc(key, entry, entry->property_attributes());
array->Append(&desc);
}
};
DescriptorArray* desc = map()->instance_descriptors();
PropertyDetails details = desc->GetDetails(descriptor);
- DCHECK(details.type() == FIELD);
+ DCHECK(details.type() == DATA);
FieldIndex index = FieldIndex::ForDescriptor(map(), descriptor);
if (details.representation().IsDouble()) {
PropertyDetails details = descs->GetDetails(i);
Handle<Name> key(descs->GetKey(i));
switch (details.type()) {
- case CONSTANT: {
+ case DATA_CONSTANT: {
Handle<Object> value(descs->GetConstant(i), isolate);
- PropertyDetails d(details.attributes(), FIELD, i + 1);
+ PropertyDetails d(details.attributes(), DATA, i + 1);
dictionary = NameDictionary::Add(dictionary, key, value, d);
break;
}
- case FIELD: {
+ case DATA: {
FieldIndex index = FieldIndex::ForDescriptor(*map, i);
Handle<Object> value;
if (object->IsUnboxedDoubleField(index)) {
value = isolate->factory()->NewHeapNumber(old->value());
}
}
- PropertyDetails d(details.attributes(), FIELD, i + 1);
+ PropertyDetails d(details.attributes(), DATA, i + 1);
dictionary = NameDictionary::Add(dictionary, key, value, d);
break;
}
- case ACCESSOR_FIELD: {
+ case ACCESSOR: {
FieldIndex index = FieldIndex::ForDescriptor(*map, i);
Handle<Object> value(object->RawFastPropertyAt(index), isolate);
- PropertyDetails d(details.attributes(), CALLBACKS, i + 1);
+ PropertyDetails d(details.attributes(), ACCESSOR_CONSTANT, i + 1);
dictionary = NameDictionary::Add(dictionary, key, value, d);
break;
}
- case CALLBACKS: {
+ case ACCESSOR_CONSTANT: {
Handle<Object> value(descs->GetCallbacksObject(i), isolate);
- PropertyDetails d(details.attributes(), CALLBACKS, i + 1);
+ PropertyDetails d(details.attributes(), ACCESSOR_CONSTANT, i + 1);
dictionary = NameDictionary::Add(dictionary, key, value, d);
break;
}
Object* value = dictionary->ValueAt(index);
PropertyType type = dictionary->DetailsAt(index).type();
- if (type == FIELD && !value->IsJSFunction()) {
+ if (type == DATA && !value->IsJSFunction()) {
number_of_fields += 1;
}
}
PropertyType type = details.type();
if (value->IsJSFunction()) {
- ConstantDescriptor d(key, handle(value, isolate), details.attributes());
+ DataConstantDescriptor d(key, handle(value, isolate),
+ details.attributes());
descriptors->Set(enumeration_index - 1, &d);
- } else if (type == FIELD) {
+ } else if (type == DATA) {
if (current_offset < inobject_props) {
object->InObjectPropertyAtPut(current_offset, value,
UPDATE_WRITE_BARRIER);
int offset = current_offset - inobject_props;
fields->set(offset, value);
}
- FieldDescriptor d(key, current_offset, details.attributes(),
- // TODO(verwaest): value->OptimalRepresentation();
- Representation::Tagged());
+ DataDescriptor d(key, current_offset, details.attributes(),
+ // TODO(verwaest): value->OptimalRepresentation();
+ Representation::Tagged());
current_offset += d.GetDetails().field_width_in_words();
descriptors->Set(enumeration_index - 1, &d);
- } else if (type == CALLBACKS) {
- CallbacksDescriptor d(key, handle(value, isolate), details.attributes());
+ } else if (type == ACCESSOR_CONSTANT) {
+ AccessorConstantDescriptor d(key, handle(value, isolate),
+ details.attributes());
descriptors->Set(enumeration_index - 1, &d);
} else {
UNREACHABLE();
value = handle(Handle<FixedArray>::cast(array)->get(i), isolate);
}
if (!value->IsTheHole()) {
- PropertyDetails details(NONE, FIELD, 0);
+ PropertyDetails details(NONE, DATA, 0);
dictionary =
SeededNumberDictionary::AddNumberEntry(dictionary, i, value, details);
}
int sorted_index = descriptors->GetSortedKeyIndex(0);
if (descriptors->GetKey(sorted_index) == GetHeap()->hidden_string() &&
sorted_index < map()->NumberOfOwnDescriptors()) {
- DCHECK(descriptors->GetType(sorted_index) == FIELD);
+ DCHECK(descriptors->GetType(sorted_index) == DATA);
DCHECK(descriptors->GetDetails(sorted_index).representation().
IsCompatibleForLoad(Representation::Tagged()));
FieldIndex index = FieldIndex::ForDescriptor(this->map(),
PropertyDetails details = dictionary->DetailsAt(i);
int attrs = attributes;
// READ_ONLY is an invalid attribute for JS setters/getters.
- if ((attributes & READ_ONLY) && details.type() == CALLBACKS) {
+ if ((attributes & READ_ONLY) && details.type() == ACCESSOR_CONSTANT) {
Object* v = dictionary->ValueAt(i);
if (v->IsPropertyCell()) v = PropertyCell::cast(v)->value();
if (v->IsAccessorPair()) attrs &= ~READ_ONLY;
int limit = copy->map()->NumberOfOwnDescriptors();
for (int i = 0; i < limit; i++) {
PropertyDetails details = descriptors->GetDetails(i);
- if (details.type() != FIELD) continue;
+ if (details.type() != DATA) continue;
FieldIndex index = FieldIndex::ForDescriptor(copy->map(), i);
if (object->IsUnboxedDoubleField(index)) {
if (copying) {
DescriptorArray* descs = instance_descriptors();
for (int i = 0; i < number_of_own_descriptors; i++) {
PropertyDetails details = descs->GetDetails(i);
- if (details.type() == FIELD) {
+ if (details.type() == DATA) {
int candidate = details.field_index() + details.field_width_in_words();
if (candidate > free_index) free_index = candidate;
}
if (!(details.IsDontEnum() || key->IsSymbol())) {
storage->set(index, key);
if (!indices.is_null()) {
- if (details.type() != FIELD) {
+ if (details.type() != DATA) {
indices = Handle<FixedArray>();
} else {
FieldIndex field_index = FieldIndex::ForDescriptor(*map, i);
if (entry != SeededNumberDictionary::kNotFound) {
Object* result = dictionary->ValueAt(entry);
PropertyDetails details = dictionary->DetailsAt(entry);
- if (details.type() == CALLBACKS && result->IsAccessorPair()) {
+ if (details.type() == ACCESSOR_CONSTANT && result->IsAccessorPair()) {
DCHECK(details.IsConfigurable());
if (details.attributes() != attributes) {
dictionary->DetailsAtPut(
- entry,
- PropertyDetails(attributes, CALLBACKS, index));
+ entry, PropertyDetails(attributes, ACCESSOR_CONSTANT, index));
}
AccessorPair::cast(result)->SetComponents(getter, setter);
return true;
Handle<Object> structure,
PropertyAttributes attributes) {
Heap* heap = object->GetHeap();
- PropertyDetails details = PropertyDetails(attributes, CALLBACKS, 0);
+ PropertyDetails details = PropertyDetails(attributes, ACCESSOR_CONSTANT, 0);
// Normalize elements to make this operation simple.
bool had_dictionary_elements = object->HasDictionaryElements();
Handle<SeededNumberDictionary> dictionary = NormalizeElements(object);
DCHECK(object->HasDictionaryElements() ||
object->HasDictionaryArgumentsElements());
- // Update the dictionary with the new CALLBACKS property.
+ // Update the dictionary with the new ACCESSOR_CONSTANT property.
dictionary = SeededNumberDictionary::Set(dictionary, index, structure,
details);
dictionary->set_requires_slow_elements();
Deoptimizer::DeoptimizeGlobalObject(*object);
}
- // Update the dictionary with the new CALLBACKS property.
- PropertyDetails details = PropertyDetails(attributes, CALLBACKS, 0);
+ // Update the dictionary with the new ACCESSOR_CONSTANT property.
+ PropertyDetails details = PropertyDetails(attributes, ACCESSOR_CONSTANT, 0);
SetNormalizedProperty(object, name, structure, details);
ReoptimizeIfPrototype(object);
int entry = dictionary->FindEntry(index);
if (entry != SeededNumberDictionary::kNotFound) {
Object* element = dictionary->ValueAt(entry);
- if (dictionary->DetailsAt(entry).type() == CALLBACKS &&
+ if (dictionary->DetailsAt(entry).type() == ACCESSOR_CONSTANT &&
element->IsAccessorPair()) {
return handle(AccessorPair::cast(element)->GetComponent(component),
isolate);
DescriptorArray* descs = map()->instance_descriptors();
bool value_is_number = value->IsNumber();
for (int i = 0; i < number_of_own_descriptors; i++) {
- if (descs->GetType(i) == FIELD) {
+ if (descs->GetType(i) == DATA) {
FieldIndex field_index = FieldIndex::ForDescriptor(map(), i);
if (IsUnboxedDoubleField(field_index)) {
if (value_is_number) {
return descs->GetKey(i);
}
}
- } else if (descs->GetType(i) == CONSTANT) {
+ } else if (descs->GetType(i) == DATA_CONSTANT) {
if (descs->GetConstant(i) == value) {
return descs->GetKey(i);
}
int length = descriptors->number_of_descriptors();
for (int i = 0; i < length; i++) {
descriptors->SetRepresentation(i, Representation::Tagged());
- if (descriptors->GetDetails(i).type() == FIELD) {
+ if (descriptors->GetDetails(i).type() == DATA) {
descriptors->SetValue(i, HeapType::Any());
}
}
int unused_property_fields = map->unused_property_fields();
PropertyDetails details = descriptors->GetDetails(new_descriptor);
- if (details.type() == FIELD) {
+ if (details.type() == DATA) {
unused_property_fields = map->unused_property_fields() - 1;
if (unused_property_fields < 0) {
unused_property_fields += JSObject::kFieldsAdded;
bool DescriptorArray::CanHoldValue(int descriptor, Object* value) {
PropertyDetails details = GetDetails(descriptor);
switch (details.type()) {
- case FIELD:
+ case DATA:
return value->FitsRepresentation(details.representation()) &&
GetFieldType(descriptor)->NowContains(value);
- case CONSTANT:
+ case DATA_CONSTANT:
DCHECK(GetConstant(descriptor) != value ||
value->FitsRepresentation(details.representation()));
return GetConstant(descriptor) == value;
- case ACCESSOR_FIELD:
- case CALLBACKS:
+ case ACCESSOR:
+ case ACCESSOR_CONSTANT:
return false;
}
Handle<HeapType> type = value->OptimalType(isolate, representation);
return GeneralizeRepresentation(map, descriptor, representation, type,
- FORCE_IN_OBJECT);
+ FORCE_FIELD);
}
// Migrate to the newest map before storing the property.
map = Update(map);
- int index = map->SearchTransition(DATA, *name, attributes);
+ int index = map->SearchTransition(kData, *name, attributes);
if (index != TransitionArray::kNotFound) {
Handle<Map> transition(map->GetTransition(index));
int descriptor = transition->LastAdded();
// For now, give up on transitioning and just create a unique map.
// TODO(verwaest/ishell): Cache transitions with different attributes.
- return CopyGeneralizeAllRepresentations(map, descriptor, FORCE_IN_OBJECT,
- attributes,
- "GenAll_AttributesMismatch");
+ return CopyGeneralizeAllRepresentations(
+ map, descriptor, FORCE_FIELD, attributes, "GenAll_AttributesMismatch");
}
? KEEP_INOBJECT_PROPERTIES
: CLEAR_INOBJECT_PROPERTIES;
- int index = map->SearchTransition(ACCESSOR, *name, attributes);
+ int index = map->SearchTransition(kAccessor, *name, attributes);
if (index != TransitionArray::kNotFound) {
Handle<Map> transition(map->GetTransition(index));
DescriptorArray* descriptors = transition->instance_descriptors();
int descriptor = transition->LastAdded();
DCHECK(descriptors->GetKey(descriptor)->Equals(*name));
- DCHECK_EQ(ACCESSOR, descriptors->GetDetails(descriptor).kind());
+ DCHECK_EQ(kAccessor, descriptors->GetDetails(descriptor).kind());
DCHECK_EQ(attributes, descriptors->GetDetails(descriptor).attributes());
Handle<Object> maybe_pair(descriptors->GetValue(descriptor), isolate);
return Map::Normalize(map, mode, "AccessorsOverwritingNonLast");
}
PropertyDetails old_details = old_descriptors->GetDetails(descriptor);
- if (old_details.type() != CALLBACKS) {
+ if (old_details.type() != ACCESSOR_CONSTANT) {
return Map::Normalize(map, mode, "AccessorsOverwritingNonAccessors");
}
pair->set(component, *accessor);
TransitionFlag flag = INSERT_TRANSITION;
- CallbacksDescriptor new_desc(name, pair, attributes);
+ AccessorConstantDescriptor new_desc(name, pair, attributes);
return Map::CopyInsertDescriptor(map, &new_desc, flag);
}
if (!key->IsSymbol() || !Symbol::cast(key)->is_private()) {
int mask = DONT_DELETE | DONT_ENUM;
// READ_ONLY is an invalid attribute for JS setters/getters.
- if (details.type() != CALLBACKS || !value->IsAccessorPair()) {
+ if (details.type() != ACCESSOR_CONSTANT || !value->IsAccessorPair()) {
mask |= READ_ONLY;
}
details = details.CopyAddAttributes(
if (object->IsGlobalObject()) return;
if (object->IsJSGlobalProxy()) return;
if (mode == FAST_PROTOTYPE && !object->map()->is_prototype_map()) {
- // First normalize to ensure all JSFunctions are CONSTANT.
+ // First normalize to ensure all JSFunctions are DATA_CONSTANT.
JSObject::NormalizeProperties(object, KEEP_INOBJECT_PROPERTIES, 0,
"NormalizeAsPrototype");
}
if (entry != SeededNumberDictionary::kNotFound) {
Handle<Object> element(dictionary->ValueAt(entry), isolate);
PropertyDetails details = dictionary->DetailsAt(entry);
- if (details.type() == CALLBACKS && set_mode == SET_PROPERTY) {
+ if (details.type() == ACCESSOR_CONSTANT && set_mode == SET_PROPERTY) {
return SetElementWithCallback(object, element, index, value, object,
strict_mode);
} else {
// is read-only (a declared const that has not been initialized). If a
// value is being defined we skip attribute checks completely.
if (set_mode == DEFINE_PROPERTY) {
- details =
- PropertyDetails(attributes, FIELD, details.dictionary_index());
+ details = PropertyDetails(attributes, DATA, details.dictionary_index());
dictionary->DetailsAtPut(entry, details);
} else if (details.IsReadOnly() && !element->IsTheHole()) {
if (strict_mode == SLOPPY) {
}
}
- PropertyDetails details(attributes, FIELD, 0);
+ PropertyDetails details(attributes, DATA, 0);
Handle<SeededNumberDictionary> new_dictionary =
SeededNumberDictionary::AddNumberEntry(dictionary, index, value,
details);
HandleScope scope(isolate);
Handle<Object> value(dict->ValueAt(i), isolate);
PropertyDetails details = dict->DetailsAt(i);
- if (details.type() == CALLBACKS || details.IsReadOnly()) {
+ if (details.type() == ACCESSOR_CONSTANT || details.IsReadOnly()) {
// Bail out and do the sorting of undefineds and array holes in JS.
// Also bail out if the element is not supposed to be moved.
return bailout;
}
uint32_t result = pos;
- PropertyDetails no_details(NONE, FIELD, 0);
+ PropertyDetails no_details(NONE, DATA, 0);
while (undefs > 0) {
if (pos > static_cast<uint32_t>(Smi::kMaxValue)) {
// Adding an entry with the key beyond smi-range requires
Isolate* isolate = global->GetIsolate();
Handle<PropertyCell> cell = isolate->factory()->NewPropertyCell(
isolate->factory()->the_hole_value());
- PropertyDetails details(NONE, FIELD, 0);
+ PropertyDetails details(NONE, DATA, 0);
details = details.AsDeleted();
Handle<NameDictionary> dictionary = NameDictionary::Add(
handle(global->property_dictionary()), name, cell, details);
#ifdef DEBUG
USE(Shape::AsHandle(dictionary->GetIsolate(), key));
#endif
- PropertyDetails details(NONE, FIELD, 0);
+ PropertyDetails details(NONE, DATA, 0);
AddEntry(dictionary, key, value, details, dictionary->Hash(key));
return dictionary;
uint32_t key,
Handle<Object> value) {
SLOW_DCHECK(dictionary->FindEntry(key) == kNotFound);
- return Add(dictionary, key, value, PropertyDetails(NONE, FIELD, 0));
+ return Add(dictionary, key, value, PropertyDetails(NONE, DATA, 0));
}
if (DerivedHashTable::IsKey(k) && !FilterKey(k, NONE)) {
PropertyDetails details = DetailsAt(i);
if (details.IsDeleted()) continue;
- if (details.type() == CALLBACKS) return true;
+ if (details.type() == ACCESSOR_CONSTANT) return true;
PropertyAttributes attr = details.attributes();
if (attr & (READ_ONLY | DONT_DELETE | DONT_ENUM)) return true;
}
// Indicates whether a value can be loaded as a constant.
-enum StoreMode { ALLOW_IN_DESCRIPTOR, FORCE_IN_OBJECT };
+enum StoreMode { ALLOW_IN_DESCRIPTOR, FORCE_FIELD };
// PropertyNormalizationMode is used to specify whether to keep
SeededNumberDictionary::kElementsStartOffset + 2 * kPointerSize;
LoadP(t1, FieldMemOperand(t2, kDetailsOffset));
LoadSmiLiteral(ip, Smi::FromInt(PropertyDetails::TypeField::kMask));
- DCHECK_EQ(FIELD, 0);
+ DCHECK_EQ(DATA, 0);
and_(r0, t1, ip, SetRC);
bne(miss, cr0);
// Type of properties.
// Order of kinds is significant.
// Must fit in the BitField PropertyDetails::KindField.
-enum PropertyKind { DATA = 0, ACCESSOR = 1 };
+enum PropertyKind { kData = 0, kAccessor = 1 };
// Order of modes is significant.
// Must fit in the BitField PropertyDetails::StoreModeField.
-enum PropertyLocation { IN_OBJECT = 0, IN_DESCRIPTOR = 1 };
+enum PropertyLocation { kField = 0, kDescriptor = 1 };
// Order of properties is significant.
// Must fit in the BitField PropertyDetails::TypeField.
// A copy of this is in mirror-debugger.js.
enum PropertyType {
- FIELD = (IN_OBJECT << 1) | DATA,
- CONSTANT = (IN_DESCRIPTOR << 1) | DATA,
- ACCESSOR_FIELD = (IN_OBJECT << 1) | ACCESSOR,
- CALLBACKS = (IN_DESCRIPTOR << 1) | ACCESSOR
+ DATA = (kField << 1) | kData,
+ DATA_CONSTANT = (kDescriptor << 1) | kData,
+ ACCESSOR = (kField << 1) | kAccessor,
+ ACCESSOR_CONSTANT = (kDescriptor << 1) | kAccessor
};
// Outputs PropertyDetails as a dictionary details.
std::ostream& operator<<(std::ostream& os, const PropertyDetails& details) {
os << "(";
- if (details.location() == IN_DESCRIPTOR) {
+ if (details.location() == kDescriptor) {
os << "immutable ";
}
- os << (details.kind() == DATA ? "data" : "accessor");
+ os << (details.kind() == kData ? "data" : "accessor");
return os << ", dictionary_index: " << details.dictionary_index()
<< ", attrs: " << details.attributes() << ")";
}
const FastPropertyDetails& details_fast) {
const PropertyDetails& details = details_fast.details;
os << "(";
- if (details.location() == IN_DESCRIPTOR) {
+ if (details.location() == kDescriptor) {
os << "immutable ";
}
- os << (details.kind() == DATA ? "data" : "accessor");
- if (details.location() == IN_OBJECT) {
+ os << (details.kind() == kData ? "data" : "accessor");
+ if (details.location() == kField) {
os << ": " << details.representation().Mnemonic()
<< ", field_index: " << details.field_index();
}
std::ostream& operator<<(std::ostream& os, const Descriptor& d);
-class FieldDescriptor FINAL : public Descriptor {
+class DataDescriptor FINAL : public Descriptor {
public:
- FieldDescriptor(Handle<Name> key,
- int field_index,
- PropertyAttributes attributes,
- Representation representation)
- : Descriptor(key, HeapType::Any(key->GetIsolate()), attributes,
- FIELD, representation, field_index) {}
- FieldDescriptor(Handle<Name> key,
- int field_index,
- Handle<HeapType> field_type,
- PropertyAttributes attributes,
- Representation representation)
- : Descriptor(key, field_type, attributes, FIELD,
- representation, field_index) { }
+ DataDescriptor(Handle<Name> key, int field_index,
+ PropertyAttributes attributes, Representation representation)
+ : Descriptor(key, HeapType::Any(key->GetIsolate()), attributes, DATA,
+ representation, field_index) {}
+ DataDescriptor(Handle<Name> key, int field_index, Handle<HeapType> field_type,
+ PropertyAttributes attributes, Representation representation)
+ : Descriptor(key, field_type, attributes, DATA, representation,
+ field_index) {}
};
-class ConstantDescriptor FINAL : public Descriptor {
+class DataConstantDescriptor FINAL : public Descriptor {
public:
- ConstantDescriptor(Handle<Name> key,
- Handle<Object> value,
- PropertyAttributes attributes)
- : Descriptor(key, value, attributes, CONSTANT,
+ DataConstantDescriptor(Handle<Name> key, Handle<Object> value,
+ PropertyAttributes attributes)
+ : Descriptor(key, value, attributes, DATA_CONSTANT,
value->OptimalRepresentation()) {}
};
-class CallbacksDescriptor FINAL : public Descriptor {
+class AccessorConstantDescriptor FINAL : public Descriptor {
public:
- CallbacksDescriptor(Handle<Name> key,
- Handle<Object> foreign,
- PropertyAttributes attributes)
- : Descriptor(key, foreign, attributes, CALLBACKS,
+ AccessorConstantDescriptor(Handle<Name> key, Handle<Object> foreign,
+ PropertyAttributes attributes)
+ : Descriptor(key, foreign, attributes, ACCESSOR_CONSTANT,
Representation::Tagged()) {}
};
lookup_type_(NOT_FOUND),
holder_(NULL),
transition_(NULL),
- details_(NONE, FIELD, Representation::None()) {
+ details_(NONE, DATA, Representation::None()) {
isolate->set_top_lookup_result(this);
}
void NotFound() {
lookup_type_ = NOT_FOUND;
- details_ = PropertyDetails(NONE, FIELD, 0);
+ details_ = PropertyDetails(NONE, DATA, 0);
holder_ = NULL;
transition_ = NULL;
}
}
// Property callbacks does not include transitions to callbacks.
- bool IsPropertyCallbacks() const {
- return !IsTransition() && details_.type() == CALLBACKS;
+ bool IsAccessorConstant() const {
+ return !IsTransition() && details_.type() == ACCESSOR_CONSTANT;
}
bool IsReadOnly() const {
return details_.IsReadOnly();
}
- bool IsField() const {
- return lookup_type_ == DESCRIPTOR_TYPE && details_.type() == FIELD;
+ bool IsData() const {
+ return lookup_type_ == DESCRIPTOR_TYPE && details_.type() == DATA;
}
- bool IsConstant() const {
- return lookup_type_ == DESCRIPTOR_TYPE && details_.type() == CONSTANT;
+ bool IsDataConstant() const {
+ return lookup_type_ == DESCRIPTOR_TYPE && details_.type() == DATA_CONSTANT;
}
bool IsConfigurable() const { return details_.IsConfigurable(); }
return transition_;
}
- bool IsTransitionToField() const {
- return IsTransition() && details_.type() == FIELD;
+ bool IsTransitionToData() const {
+ return IsTransition() && details_.type() == DATA;
}
int GetLocalFieldIndexFromMap(Map* map) const {
}
Object* GetConstantFromMap(Map* map) const {
- DCHECK(details_.type() == CONSTANT);
+ DCHECK(details_.type() == DATA_CONSTANT);
return GetValueFromMap(map);
}
isolate, element_or_char,
Runtime::GetElementOrCharAt(isolate, obj, index));
details->set(0, *element_or_char);
- details->set(1, PropertyDetails(NONE, FIELD, 0).AsSmi());
+ details->set(1, PropertyDetails(NONE, DATA, 0).AsSmi());
return *isolate->factory()->NewJSArrayWithElements(details);
}
details->set(0, *value);
// TODO(verwaest): Get rid of this random way of handling interceptors.
PropertyDetails d = it.state() == LookupIterator::INTERCEPTOR
- ? PropertyDetails(NONE, FIELD, 0)
+ ? PropertyDetails(NONE, DATA, 0)
: it.property_details();
details->set(1, d.AsSmi());
details->set(
// appropriate.
LookupIterator it(receiver, key, LookupIterator::OWN);
if (it.state() == LookupIterator::DATA &&
- it.property_details().type() == FIELD) {
+ it.property_details().type() == DATA) {
FieldIndex field_index = it.GetFieldIndex();
// Do not track double fields in the keyed lookup cache. Reading
// double values requires boxing.
NameDictionary* dictionary = receiver->property_dictionary();
int entry = dictionary->FindEntry(key);
if ((entry != NameDictionary::kNotFound) &&
- (dictionary->DetailsAt(entry).type() == FIELD)) {
+ (dictionary->DetailsAt(entry).type() == DATA)) {
Object* value = dictionary->ValueAt(entry);
if (!receiver->IsGlobalObject()) return value;
value = PropertyCell::cast(value)->value();
// Check whether we can reconfigure the existing property into a
// function.
PropertyDetails old_details = it.property_details();
- // TODO(verwaest): CALLBACKS invalidly includes ExecutableAccessInfo,
+ // TODO(verwaest): ACCESSOR_CONSTANT invalidly includes
+ // ExecutableAccessInfo,
// which are actually data properties, not accessor properties.
if (old_details.IsReadOnly() || old_details.IsDontEnum() ||
- old_details.type() == CALLBACKS) {
+ old_details.type() == ACCESSOR_CONSTANT) {
return ThrowRedeclarationError(isolate, name);
}
// If the existing property is not configurable, keep its attributes. Do
if (name == NULL) continue;
Handle<NameDictionary> new_dict = NameDictionary::Add(
dict, isolate->factory()->InternalizeUtf8String(name),
- Handle<Smi>(Smi::FromInt(i), isolate), PropertyDetails(NONE, FIELD, 0));
+ Handle<Smi>(Smi::FromInt(i), isolate), PropertyDetails(NONE, DATA, 0));
// The dictionary does not need to grow.
CHECK(new_dict.is_identical_to(dict));
}
DescriptorArray* descs = map->instance_descriptors();
for (int i = 0; i < real_size; i++) {
PropertyDetails details = descs->GetDetails(i);
- if (details.type() == FIELD) {
+ if (details.type() == DATA) {
Object* key = descs->GetKey(i);
if (key->IsString() || key->IsNumber()) {
int len = 3;
bool is_special_transition = flag == SPECIAL_TRANSITION;
DCHECK_EQ(is_special_transition, IsSpecialTransition(*name));
PropertyDetails details = is_special_transition
- ? PropertyDetails(NONE, FIELD, 0)
+ ? PropertyDetails(NONE, DATA, 0)
: GetTargetDetails(*name, *target);
int insertion_index = kNotFound;
// Check that the value is a field property.
const int kDetailsOffset =
SeededNumberDictionary::kElementsStartOffset + 2 * kPointerSize;
- DCHECK_EQ(FIELD, 0);
+ DCHECK_EQ(DATA, 0);
Test(FieldOperand(elements, r2, times_pointer_size, kDetailsOffset),
Smi::FromInt(PropertyDetails::TypeField::kMask));
j(not_zero, miss);
// Check that the value is a field property.
const int kDetailsOffset =
SeededNumberDictionary::kElementsStartOffset + 2 * kPointerSize;
- DCHECK_EQ(FIELD, 0);
+ DCHECK_EQ(DATA, 0);
test(FieldOperand(elements, r2, times_pointer_size, kDetailsOffset),
Immediate(PropertyDetails::TypeField::kMask << kSmiTagSize));
j(not_zero, miss);
Handle<AccessorInfo> foreign = TestAccessorInfo(isolate, attrs);
Map::EnsureDescriptorSlack(map, 1);
- CallbacksDescriptor d(Handle<Name>(Name::cast(foreign->name())),
- foreign, attrs);
+ AccessorConstantDescriptor d(Handle<Name>(Name::cast(foreign->name())),
+ foreign, attrs);
map->AppendDescriptor(&d);
// Add the Foo constructor the global object.
TEST(PropertyDetailsFieldsConsistency) {
- CheckPropertyDetailsFieldsConsistency(FIELD, DATA, IN_OBJECT);
- CheckPropertyDetailsFieldsConsistency(CONSTANT, DATA, IN_DESCRIPTOR);
- CheckPropertyDetailsFieldsConsistency(ACCESSOR_FIELD, ACCESSOR, IN_OBJECT);
- CheckPropertyDetailsFieldsConsistency(CALLBACKS, ACCESSOR, IN_DESCRIPTOR);
+ CheckPropertyDetailsFieldsConsistency(DATA, kData, kField);
+ CheckPropertyDetailsFieldsConsistency(DATA_CONSTANT, kData, kDescriptor);
+ CheckPropertyDetailsFieldsConsistency(ACCESSOR, kAccessor, kField);
+ CheckPropertyDetailsFieldsConsistency(ACCESSOR_CONSTANT, kAccessor,
+ kDescriptor);
}
transitions->Insert(map0, name1, map1, SIMPLE_PROPERTY_TRANSITION);
ConnectTransition(map0, transitions, map1);
CHECK(transitions->IsSimpleTransition());
- transition = transitions->Search(DATA, *name1, attributes);
+ transition = transitions->Search(kData, *name1, attributes);
CHECK_EQ(TransitionArray::kSimpleTransitionIndex, transition);
CHECK_EQ(*name1, transitions->GetKey(transition));
CHECK_EQ(*map1, transitions->GetTarget(transition));
ConnectTransition(map0, transitions, map2);
CHECK(transitions->IsFullTransitionArray());
- transition = transitions->Search(DATA, *name1, attributes);
+ transition = transitions->Search(kData, *name1, attributes);
CHECK_EQ(*name1, transitions->GetKey(transition));
CHECK_EQ(*map1, transitions->GetTarget(transition));
- transition = transitions->Search(DATA, *name2, attributes);
+ transition = transitions->Search(kData, *name2, attributes);
CHECK_EQ(*name2, transitions->GetKey(transition));
CHECK_EQ(*map2, transitions->GetTarget(transition));
transitions = transitions->Insert(map0, name1, map1, PROPERTY_TRANSITION);
ConnectTransition(map0, transitions, map1);
CHECK(transitions->IsFullTransitionArray());
- transition = transitions->Search(DATA, *name1, attributes);
+ transition = transitions->Search(kData, *name1, attributes);
CHECK_EQ(*name1, transitions->GetKey(transition));
CHECK_EQ(*map1, transitions->GetTarget(transition));
ConnectTransition(map0, transitions, map2);
CHECK(transitions->IsFullTransitionArray());
- transition = transitions->Search(DATA, *name1, attributes);
+ transition = transitions->Search(kData, *name1, attributes);
CHECK_EQ(*name1, transitions->GetKey(transition));
CHECK_EQ(*map1, transitions->GetTarget(transition));
- transition = transitions->Search(DATA, *name2, attributes);
+ transition = transitions->Search(kData, *name2, attributes);
CHECK_EQ(*name2, transitions->GetKey(transition));
CHECK_EQ(*map2, transitions->GetTarget(transition));
}
for (int i = 0; i < PROPS_COUNT; i++) {
- int transition = transitions->Search(DATA, *names[i], attributes);
+ int transition = transitions->Search(kData, *names[i], attributes);
CHECK_EQ(*names[i], transitions->GetKey(transition));
CHECK_EQ(*maps[i], transitions->GetTarget(transition));
}
for (int i = 0; i < ATTRS_COUNT; i++) {
PropertyAttributes attributes = static_cast<PropertyAttributes>(i);
- int transition = transitions->Search(DATA, *name, attributes);
+ int transition = transitions->Search(kData, *name, attributes);
CHECK_EQ(*name, transitions->GetKey(transition));
CHECK_EQ(*attr_maps[i], transitions->GetTarget(transition));
}
for (int i = 0; i < ATTRS_COUNT; i++) {
PropertyAttributes attributes = static_cast<PropertyAttributes>(i);
- int transition = transitions->Search(DATA, *name, attributes);
+ int transition = transitions->Search(kData, *name, attributes);
CHECK_EQ(*name, transitions->GetKey(transition));
CHECK_EQ(*attr_maps[i], transitions->GetTarget(transition));
}
// Ensure that info about the other fields still valid.
for (int i = 0; i < PROPS_COUNT; i++) {
- int transition = transitions->Search(DATA, *names[i], NONE);
+ int transition = transitions->Search(kData, *names[i], NONE);
CHECK_EQ(*names[i], transitions->GetKey(transition));
CHECK_EQ(*maps[i], transitions->GetTarget(transition));
}
TestPropertyKind kind = props[i];
if (kind == PROP_CONSTANT) {
- ConstantDescriptor d(name, func, NONE);
+ DataConstantDescriptor d(name, func, NONE);
descriptors->Append(&d);
} else {
- FieldDescriptor f(name, next_field_offset, NONE, representations[kind]);
+ DataDescriptor f(name, next_field_offset, NONE, representations[kind]);
next_field_offset += f.GetDetails().field_width_in_words();
descriptors->Append(&f);
}
CHECK_NE(LayoutDescriptor::FastPointerLayout(), *layout_descriptor);
CHECK(layout_descriptor->IsSlowLayout());
for (int i = 0; i < inobject_properties; i++) {
- // PROP_DOUBLE has index 1 among FIELD properties.
+ // PROP_DOUBLE has index 1 among DATA properties.
const bool tagged = (i % (PROP_KIND_NUMBER - 1)) != 1;
CHECK_EQ(tagged, layout_descriptor->IsTagged(i));
}
Handle<LayoutDescriptor> layout_descriptor;
TestPropertyKind kind = props[i];
if (kind == PROP_CONSTANT) {
- ConstantDescriptor d(name, func, NONE);
+ DataConstantDescriptor d(name, func, NONE);
layout_descriptor = LayoutDescriptor::Append(map, d.GetDetails());
descriptors->Append(&d);
} else {
- FieldDescriptor f(name, next_field_offset, NONE, representations[kind]);
+ DataDescriptor f(name, next_field_offset, NONE, representations[kind]);
int field_width_in_words = f.GetDetails().field_width_in_words();
next_field_offset += field_width_in_words;
layout_descriptor = LayoutDescriptor::Append(map, f.GetDetails());
CHECK_EQ(*full_layout_descriptor, layout_desc);
} else {
CHECK(!switched_to_slow_mode);
- if (details.type() == FIELD) {
+ if (details.type() == DATA) {
nof++;
int field_index = details.field_index();
int field_width_in_words = details.field_width_in_words();
int first_non_tagged_field_offset = end_offset;
for (int i = 0; i < number_of_descriptors; i++) {
PropertyDetails details = descriptors->GetDetails(i);
- if (details.type() != FIELD) continue;
+ if (details.type() != DATA) continue;
FieldIndex index = FieldIndex::ForDescriptor(*map, i);
if (!index.is_inobject()) continue;
all_fields_tagged &= !details.representation().IsDouble();
// a has getter but no setter.
assertTrue(mirror.property('a').hasGetter());
assertFalse(mirror.property('a').hasSetter());
-assertEquals(debug.PropertyType.Callbacks, mirror.property('a').propertyType());
+assertEquals(debug.PropertyType.AccessorConstant, mirror.property('a').propertyType());
assertEquals('function', mirror.property('a').getter().type());
assertEquals('undefined', mirror.property('a').setter().type());
assertEquals('function (){return \'a\';}', mirror.property('a').getter().source());
// b has setter but no getter.
assertFalse(mirror.property('b').hasGetter());
assertTrue(mirror.property('b').hasSetter());
-assertEquals(debug.PropertyType.Callbacks, mirror.property('b').propertyType());
+assertEquals(debug.PropertyType.AccessorConstant, mirror.property('b').propertyType());
assertEquals('undefined', mirror.property('b').getter().type());
assertEquals('function', mirror.property('b').setter().type());
assertEquals('function (){}', mirror.property('b').setter().source());
// c has both getter and setter. The getter throws an exception.
assertTrue(mirror.property('c').hasGetter());
assertTrue(mirror.property('c').hasSetter());
-assertEquals(debug.PropertyType.Callbacks, mirror.property('c').propertyType());
+assertEquals(debug.PropertyType.AccessorConstant, mirror.property('c').propertyType());
assertEquals('function', mirror.property('c').getter().type());
assertEquals('function', mirror.property('c').setter().type());
assertEquals('function (){throw \'c\';}', mirror.property('c').getter().source());
}
});
- // Convert self.copy from CONSTANT to FIELD.
+ // Convert self.copy from DATA_CONSTANT to DATA.
self.copy = function () { };
return self;