Revision: 14571
Author: [email protected]
Date: Tue May 7 06:09:23 2013
Log: Free up 11 bits in fast-mode PropertyDetails by removing the
enumeration-index.
The descriptors are nowadays ordered in order of addition, so that info was
duplicated.
Review URL: https://chromiumcodereview.appspot.com/14622005
http://code.google.com/p/v8/source/detail?r=14571
Modified:
/branches/bleeding_edge/src/bootstrapper.cc
/branches/bleeding_edge/src/heap-snapshot-generator.cc
/branches/bleeding_edge/src/heap.cc
/branches/bleeding_edge/src/objects-debug.cc
/branches/bleeding_edge/src/objects-inl.h
/branches/bleeding_edge/src/objects.cc
/branches/bleeding_edge/src/property-details.h
/branches/bleeding_edge/src/property.cc
/branches/bleeding_edge/src/property.h
/branches/bleeding_edge/src/runtime.cc
/branches/bleeding_edge/src/string-stream.cc
/branches/bleeding_edge/test/cctest/test-alloc.cc
=======================================
--- /branches/bleeding_edge/src/bootstrapper.cc Tue May 7 01:46:42 2013
+++ /branches/bleeding_edge/src/bootstrapper.cc Tue May 7 06:09:23 2013
@@ -2409,7 +2409,7 @@
if (from->HasFastProperties()) {
Handle<DescriptorArray> descs =
Handle<DescriptorArray>(from->map()->instance_descriptors());
- for (int i = 0; i < descs->number_of_descriptors(); i++) {
+ for (int i = 0; i < from->map()->NumberOfOwnDescriptors(); i++) {
PropertyDetails details = descs->GetDetails(i);
switch (details.type()) {
case FIELD: {
@@ -2443,10 +2443,8 @@
// Add to dictionary.
Handle<Name> key = Handle<Name>(descs->GetKey(i));
Handle<Object> callbacks(descs->GetCallbacksObject(i),
isolate());
- PropertyDetails d = PropertyDetails(details.attributes(),
- CALLBACKS,
- Representation::Tagged(),
- details.descriptor_index());
+ PropertyDetails d = PropertyDetails(
+ details.attributes(), CALLBACKS, i + 1);
JSObject::SetNormalizedProperty(to, key, callbacks, d);
break;
}
=======================================
--- /branches/bleeding_edge/src/heap-snapshot-generator.cc Thu Apr 25
05:08:10 2013
+++ /branches/bleeding_edge/src/heap-snapshot-generator.cc Tue May 7
06:09:23 2013
@@ -1309,8 +1309,7 @@
if (js_obj->HasFastProperties()) {
DescriptorArray* descs = js_obj->map()->instance_descriptors();
int real_size = js_obj->map()->NumberOfOwnDescriptors();
- for (int i = 0; i < descs->number_of_descriptors(); i++) {
- if (descs->GetDetails(i).descriptor_index() > real_size) continue;
+ for (int i = 0; i < real_size; i++) {
switch (descs->GetType(i)) {
case FIELD: {
int index = descs->GetFieldIndex(i);
=======================================
--- /branches/bleeding_edge/src/heap.cc Fri May 3 03:36:16 2013
+++ /branches/bleeding_edge/src/heap.cc Tue May 7 06:09:23 2013
@@ -4160,7 +4160,7 @@
ASSERT(name->IsInternalizedString());
// TODO(verwaest): Since we cannot update the boilerplate's map
yet,
// initialize to the worst case.
- FieldDescriptor field(name, i, NONE, Representation::Tagged(), i +
1);
+ FieldDescriptor field(name, i, NONE, Representation::Tagged());
descriptors->Set(i, &field, witness);
}
descriptors->Sort();
@@ -4589,13 +4589,10 @@
// The global object might be created from an object template with
accessors.
// Fill these accessors into the dictionary.
DescriptorArray* descs = map->instance_descriptors();
- for (int i = 0; i < descs->number_of_descriptors(); i++) {
+ for (int i = 0; i < map->NumberOfOwnDescriptors(); i++) {
PropertyDetails details = descs->GetDetails(i);
ASSERT(details.type() == CALLBACKS); // Only accessors are expected.
- PropertyDetails d = PropertyDetails(details.attributes(),
- CALLBACKS,
- Representation::None(),
- details.descriptor_index());
+ PropertyDetails d = PropertyDetails(details.attributes(), CALLBACKS, i
+ 1);
Object* value = descs->GetCallbacksObject(i);
MaybeObject* maybe_value = AllocateJSGlobalPropertyCell(value);
if (!maybe_value->ToObject(&value)) return maybe_value;
=======================================
--- /branches/bleeding_edge/src/objects-debug.cc Thu Apr 25 03:59:09 2013
+++ /branches/bleeding_edge/src/objects-debug.cc Tue May 7 06:09:23 2013
@@ -323,10 +323,6 @@
instance_size() < HEAP->Capacity()));
VerifyHeapPointer(prototype());
VerifyHeapPointer(instance_descriptors());
- DescriptorArray* descriptors = instance_descriptors();
- for (int i = 0; i < NumberOfOwnDescriptors(); ++i) {
- CHECK_EQ(i, descriptors->GetDetails(i).descriptor_index() - 1);
- }
SLOW_ASSERT(instance_descriptors()->IsSortedNoDuplicates());
if (HasTransitionArray()) {
SLOW_ASSERT(transitions()->IsSortedNoDuplicates());
=======================================
--- /branches/bleeding_edge/src/objects-inl.h Thu May 2 08:40:07 2013
+++ /branches/bleeding_edge/src/objects-inl.h Tue May 7 06:09:23 2013
@@ -58,10 +58,7 @@
Smi* PropertyDetails::AsSmi() {
- // Ensure the upper 2 bits have the same value by sign extending it.
This is
- // necessary to be able to use the 31st bit of the property details.
- int value = value_ << 1;
- return Smi::FromInt(value >> 1);
+ return Smi::FromInt(value_);
}
@@ -2347,9 +2344,6 @@
const WhitenessWitness&) {
// Range check.
ASSERT(descriptor_number < number_of_descriptors());
- ASSERT(desc->GetDetails().descriptor_index() <=
- number_of_descriptors());
- ASSERT(desc->GetDetails().descriptor_index() > 0);
ASSERT(!desc->GetDetails().representation().IsNone());
NoIncrementalWriteBarrierSet(this,
@@ -2367,9 +2361,6 @@
void DescriptorArray::Set(int descriptor_number, Descriptor* desc) {
// Range check.
ASSERT(descriptor_number < number_of_descriptors());
- ASSERT(desc->GetDetails().descriptor_index() <=
- number_of_descriptors());
- ASSERT(desc->GetDetails().descriptor_index() > 0);
ASSERT(!desc->GetDetails().representation().IsNone());
set(ToKeyIndex(descriptor_number), desc->GetKey());
@@ -2381,9 +2372,7 @@
void DescriptorArray::Append(Descriptor* desc,
const WhitenessWitness& witness) {
int descriptor_number = number_of_descriptors();
- int enumeration_index = descriptor_number + 1;
SetNumberOfDescriptors(descriptor_number + 1);
- desc->SetEnumerationIndex(enumeration_index);
Set(descriptor_number, desc, witness);
uint32_t hash = desc->GetKey()->Hash();
@@ -2402,9 +2391,7 @@
void DescriptorArray::Append(Descriptor* desc) {
int descriptor_number = number_of_descriptors();
- int enumeration_index = descriptor_number + 1;
SetNumberOfDescriptors(descriptor_number + 1);
- desc->SetEnumerationIndex(enumeration_index);
Set(descriptor_number, desc);
uint32_t hash = desc->GetKey()->Hash();
@@ -4152,23 +4139,6 @@
void Map::InitializeDescriptors(DescriptorArray* descriptors) {
int len = descriptors->number_of_descriptors();
-#ifdef DEBUG
- ASSERT(len <= DescriptorArray::kMaxNumberOfDescriptors);
-
- bool used_indices[DescriptorArray::kMaxNumberOfDescriptors];
- for (int i = 0; i < len; ++i) used_indices[i] = false;
-
- // Ensure that all enumeration indexes between 1 and length occur
uniquely in
- // the descriptor array.
- for (int i = 0; i < len; ++i) {
- int enum_index = descriptors->GetDetails(i).descriptor_index() -
- PropertyDetails::kInitialIndex;
- ASSERT(0 <= enum_index && enum_index < len);
- ASSERT(!used_indices[enum_index]);
- used_indices[enum_index] = true;
- }
-#endif
-
set_instance_descriptors(descriptors);
SetNumberOfOwnDescriptors(len);
}
=======================================
--- /branches/bleeding_edge/src/objects.cc Thu May 2 08:42:22 2013
+++ /branches/bleeding_edge/src/objects.cc Tue May 7 06:09:23 2013
@@ -657,8 +657,8 @@
ASSERT(enumeration_index > 0);
}
- details = PropertyDetails(details.attributes(), details.type(),
- Representation::None(), enumeration_index);
+ details = PropertyDetails(
+ details.attributes(), details.type(), enumeration_index);
if (IsGlobalObject()) {
JSGlobalPropertyCell* cell =
@@ -1775,7 +1775,7 @@
// Allocate new instance descriptors with (name, index) added
FieldDescriptor new_field(
- name, index, attributes, value->OptimalRepresentation(), 0);
+ name, index, attributes, value->OptimalRepresentation());
ASSERT(index < map()->inobject_properties() ||
(index - map()->inobject_properties()) < properties()->length() ||
@@ -1814,7 +1814,7 @@
JSFunction* function,
PropertyAttributes attributes) {
// Allocate new instance descriptors with (name, function) added
- ConstantFunctionDescriptor d(name, function, attributes, 0);
+ ConstantFunctionDescriptor d(name, function, attributes);
TransitionFlag flag =
// Do not add transitions to global objects.
@@ -1850,8 +1850,7 @@
// Assign an enumeration index to the property and update
// SetNextEnumerationIndex.
int index = dict->NextEnumerationIndex();
- PropertyDetails details = PropertyDetails(
- attributes, NORMAL, Representation::None(), index);
+ PropertyDetails details = PropertyDetails(attributes, NORMAL, index);
dict->SetNextEnumerationIndex(index + 1);
dict->SetEntry(entry, name, store_value, details);
return value;
@@ -1863,8 +1862,7 @@
}
JSGlobalPropertyCell::cast(store_value)->set_value(value);
}
- PropertyDetails details = PropertyDetails(
- attributes, NORMAL, Representation::None());
+ PropertyDetails details = PropertyDetails(attributes, NORMAL, 0);
Object* result;
{ MaybeObject* maybe_result = dict->Add(name, store_value, details);
if (!maybe_result->ToObject(&result)) return maybe_result;
@@ -2005,8 +2003,7 @@
new_enumeration_index =
dictionary->DetailsAt(old_index).dictionary_index();
}
- PropertyDetails new_details(
- attributes, NORMAL, Representation::None(), new_enumeration_index);
+ PropertyDetails new_details(attributes, NORMAL, new_enumeration_index);
return SetNormalizedProperty(name, value, new_details);
}
@@ -2073,7 +2070,7 @@
int index = map()->NextFreePropertyIndex();
FieldDescriptor new_field(
- name, index, attributes, new_value->OptimalRepresentation(), 0);
+ name, index, attributes, new_value->OptimalRepresentation());
// Make a new map for the object.
Map* new_map;
@@ -3758,8 +3755,7 @@
MaybeObject* result = *value;
switch (lookup.type()) {
case NORMAL: {
- PropertyDetails details = PropertyDetails(
- attributes, NORMAL, Representation::None());
+ PropertyDetails details = PropertyDetails(attributes, NORMAL, 0);
result = self->SetNormalizedProperty(*name, *value, details);
break;
}
@@ -4218,10 +4214,8 @@
PropertyDetails details = descs->GetDetails(i);
switch (details.type()) {
case CONSTANT_FUNCTION: {
- PropertyDetails d = PropertyDetails(details.attributes(),
- NORMAL,
- Representation::None(),
- details.descriptor_index());
+ PropertyDetails d = PropertyDetails(
+ details.attributes(), NORMAL, i + 1);
Object* value = descs->GetConstantFunction(i);
MaybeObject* maybe_dictionary =
dictionary->Add(descs->GetKey(i), value, d);
@@ -4229,10 +4223,8 @@
break;
}
case FIELD: {
- PropertyDetails d = PropertyDetails(details.attributes(),
- NORMAL,
- Representation::None(),
- details.descriptor_index());
+ PropertyDetails d = PropertyDetails(
+ details.attributes(), NORMAL, i + 1);
Object* value = FastPropertyAt(descs->GetFieldIndex(i));
MaybeObject* maybe_dictionary =
dictionary->Add(descs->GetKey(i), value, d);
@@ -4241,10 +4233,8 @@
}
case CALLBACKS: {
Object* value = descs->GetCallbacksObject(i);
- PropertyDetails d = PropertyDetails(details.attributes(),
- CALLBACKS,
- Representation::None(),
- details.descriptor_index());
+ PropertyDetails d = PropertyDetails(
+ details.attributes(), CALLBACKS, i + 1);
MaybeObject* maybe_dictionary =
dictionary->Add(descs->GetKey(i), value, d);
if (!maybe_dictionary->To(&dictionary)) return maybe_dictionary;
@@ -4380,8 +4370,7 @@
ASSERT(old_map->has_fast_smi_or_object_elements());
value = FixedArray::cast(array)->get(i);
}
- PropertyDetails details = PropertyDetails(
- NONE, NORMAL, Representation::None());
+ PropertyDetails details = PropertyDetails(NONE, NORMAL, 0);
if (!value->IsTheHole()) {
Object* result;
MaybeObject* maybe_result =
@@ -5452,8 +5441,7 @@
if (details.attributes() != attributes) {
dictionary->DetailsAtPut(
entry,
- PropertyDetails(
- attributes, CALLBACKS, Representation::None(), index));
+ PropertyDetails(attributes, CALLBACKS, index));
}
AccessorPair::cast(result)->SetComponents(getter, setter);
return true;
@@ -5614,8 +5602,7 @@
MaybeObject* JSObject::SetElementCallback(uint32_t index,
Object* structure,
PropertyAttributes attributes) {
- PropertyDetails details = PropertyDetails(
- attributes, CALLBACKS, Representation::None());
+ PropertyDetails details = PropertyDetails(attributes, CALLBACKS, 0);
// Normalize elements to make this operation simple.
SeededNumberDictionary* dictionary;
@@ -5673,8 +5660,7 @@
}
// Update the dictionary with the new CALLBACKS property.
- PropertyDetails details = PropertyDetails(
- attributes, CALLBACKS, Representation::None());
+ PropertyDetails details = PropertyDetails(attributes, CALLBACKS, 0);
maybe_ok = SetNormalizedProperty(name, structure, details);
if (maybe_ok->IsFailure()) return maybe_ok;
@@ -6336,7 +6322,6 @@
int old_size = NumberOfOwnDescriptors();
int new_size = old_size + 1;
- descriptor->SetEnumerationIndex(new_size);
if (flag == INSERT_TRANSITION &&
owns_descriptors() &&
@@ -6421,9 +6406,7 @@
int new_size = NumberOfOwnDescriptors();
ASSERT(0 <= insertion_index && insertion_index < new_size);
- PropertyDetails details = descriptors->GetDetails(insertion_index);
- ASSERT_LE(details.descriptor_index(), new_size);
- descriptor->SetEnumerationIndex(details.descriptor_index());
+ ASSERT_LT(insertion_index, new_size);
DescriptorArray* new_descriptors;
MaybeObject* maybe_descriptors = DescriptorArray::Allocate(new_size);
@@ -7319,8 +7302,7 @@
FieldDescriptor d(key,
current_offset++,
details.attributes(),
- representation,
- descriptor + 1);
+ representation);
result->Set(descriptor, &d, witness);
} else {
result->CopyFrom(descriptor, other, descriptor, witness);
@@ -7335,8 +7317,7 @@
FieldDescriptor d(key,
current_offset++,
details.attributes(),
- details.representation(),
- descriptor + 1);
+ details.representation());
result->Set(descriptor, &d, witness);
} else {
result->CopyFrom(descriptor, other, descriptor, witness);
@@ -11201,8 +11182,8 @@
// 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, NORMAL,
Representation::None(),
- details.dictionary_index());
+ details = PropertyDetails(
+ attributes, NORMAL, details.dictionary_index());
dictionary->DetailsAtPut(entry, details);
} else if (details.IsReadOnly() && !element->IsTheHole()) {
if (strict_mode == kNonStrictMode) {
@@ -11254,8 +11235,7 @@
}
}
FixedArrayBase* new_dictionary;
- PropertyDetails details = PropertyDetails(
- attributes, NORMAL, Representation::None());
+ PropertyDetails details = PropertyDetails(attributes, NORMAL, 0);
MaybeObject* maybe = dictionary->AddNumberEntry(index, *value,
details);
if (!maybe->To(&new_dictionary)) return maybe;
if (*dictionary != SeededNumberDictionary::cast(new_dictionary)) {
@@ -13249,8 +13229,7 @@
}
uint32_t result = pos;
- PropertyDetails no_details = PropertyDetails(
- NONE, NORMAL, Representation::None());
+ PropertyDetails no_details = PropertyDetails(NONE, NORMAL, 0);
Heap* heap = GetHeap();
while (undefs > 0) {
if (pos > static_cast<uint32_t>(Smi::kMaxValue)) {
@@ -13633,7 +13612,7 @@
heap->AllocateJSGlobalPropertyCell(heap->the_hole_value());
if (!maybe_cell->ToObject(&cell)) return maybe_cell;
}
- PropertyDetails details(NONE, NORMAL, Representation::None());
+ PropertyDetails details(NONE, NORMAL, 0);
details = details.AsDeleted();
Object* dictionary;
{ MaybeObject* maybe_dictionary =
@@ -14076,8 +14055,7 @@
int enum_index = Smi::cast(enumeration_order->get(pos++))->value();
PropertyDetails details = DetailsAt(i);
PropertyDetails new_details = PropertyDetails(
- details.attributes(), details.type(),
- Representation::None(), enum_index);
+ details.attributes(), details.type(), enum_index);
DetailsAtPut(i, new_details);
}
}
@@ -14143,8 +14121,7 @@
{ MaybeObject* maybe_k = Shape::AsObject(this->GetHeap(), key);
if (!maybe_k->ToObject(&k)) return maybe_k;
}
- PropertyDetails details = PropertyDetails(
- NONE, NORMAL, Representation::None());
+ PropertyDetails details = PropertyDetails(NONE, NORMAL, 0);
return Dictionary<Shape, Key>::cast(obj)->AddEntry(key, value, details,
Dictionary<Shape, Key>::Hash(key));
@@ -14155,8 +14132,6 @@
MaybeObject* Dictionary<Shape, Key>::Add(Key key,
Object* value,
PropertyDetails details) {
- ASSERT(details.dictionary_index() == details.descriptor_index());
-
// Valdate key is absent.
SLOW_ASSERT((this->FindEntry(key) == Dictionary<Shape, Key>::kNotFound));
// Check whether the dictionary should be extended.
@@ -14190,8 +14165,7 @@
// Assign an enumeration index to the property and update
// SetNextEnumerationIndex.
int index = NextEnumerationIndex();
- details = PropertyDetails(details.attributes(), details.type(),
- Representation::None(), index);
+ details = PropertyDetails(details.attributes(), details.type(), index);
SetNextEnumerationIndex(index + 1);
}
SetEntry(entry, k, value, details);
@@ -14233,7 +14207,7 @@
MaybeObject* UnseededNumberDictionary::AddNumberEntry(uint32_t key,
Object* value) {
SLOW_ASSERT(this->FindEntry(key) == kNotFound);
- return Add(key, value, PropertyDetails(NONE, NORMAL,
Representation::None()));
+ return Add(key, value, PropertyDetails(NONE, NORMAL, 0));
}
@@ -14278,7 +14252,6 @@
// Preserve enumeration index.
details = PropertyDetails(details.attributes(),
details.type(),
- Representation::None(),
DetailsAt(entry).dictionary_index());
MaybeObject* maybe_object_key =
SeededNumberDictionaryShape::AsObject(GetHeap(), key);
@@ -14531,15 +14504,13 @@
}
PropertyDetails details = DetailsAt(i);
- ASSERT(details.descriptor_index() == details.dictionary_index());
- int enumeration_index = details.descriptor_index();
+ int enumeration_index = details.dictionary_index();
PropertyType type = details.type();
if (value->IsJSFunction()) {
ConstantFunctionDescriptor d(key,
JSFunction::cast(value),
- details.attributes(),
- enumeration_index);
+ details.attributes());
descriptors->Set(enumeration_index - 1, &d, witness);
} else if (type == NORMAL) {
if (current_offset < inobject_props) {
@@ -14554,14 +14525,12 @@
current_offset++,
details.attributes(),
// TODO(verwaest):
value->OptimalRepresentation();
- Representation::Tagged(),
- enumeration_index);
+ Representation::Tagged());
descriptors->Set(enumeration_index - 1, &d, witness);
} else if (type == CALLBACKS) {
CallbacksDescriptor d(key,
value,
- details.attributes(),
- enumeration_index);
+ details.attributes());
descriptors->Set(enumeration_index - 1, &d, witness);
} else {
UNREACHABLE();
=======================================
--- /branches/bleeding_edge/src/property-details.h Tue May 7 03:32:23 2013
+++ /branches/bleeding_edge/src/property-details.h Tue May 7 06:09:23 2013
@@ -154,20 +154,21 @@
public:
PropertyDetails(PropertyAttributes attributes,
PropertyType type,
- Representation representation,
- int index = 0) {
+ int index) {
value_ = TypeField::encode(type)
| AttributesField::encode(attributes)
- | RepresentationField::encode(EncodeRepresentation(representation))
| DictionaryStorageField::encode(index);
ASSERT(type == this->type());
ASSERT(attributes == this->attributes());
- if (representation.IsNone()) {
- ASSERT(index == this->dictionary_index());
- } else {
- ASSERT(index == this->descriptor_index());
- }
+ }
+
+ PropertyDetails(PropertyAttributes attributes,
+ PropertyType type,
+ Representation representation) {
+ value_ = TypeField::encode(type)
+ | AttributesField::encode(attributes)
+ |
RepresentationField::encode(EncodeRepresentation(representation));
}
int pointer() { return DescriptorPointer::decode(value_); }
@@ -183,17 +184,10 @@
inline Smi* AsSmi();
static uint8_t EncodeRepresentation(Representation representation) {
- ASSERT(representation.kind() <= Representation::kTagged);
- if (representation.kind() < Representation::kInteger32) {
- return representation.kind();
- } else {
- return representation.kind() - 1;
- }
+ return representation.kind();
}
static Representation DecodeRepresentation(uint32_t bits) {
- ASSERT(bits <= Representation::kTagged);
- if (bits >= Representation::kInteger32) bits += 1;
return
Representation::FromKind(static_cast<Representation::Kind>(bits));
}
@@ -206,10 +200,6 @@
int dictionary_index() {
return DictionaryStorageField::decode(value_);
}
-
- int descriptor_index() {
- return DescriptorStorageField::decode(value_);
- }
Representation representation() {
return DecodeRepresentation(RepresentationField::decode(value_));
@@ -232,9 +222,8 @@
class AttributesField: public BitField<PropertyAttributes, 3,
3> {};
class DeletedField: public BitField<uint32_t, 6,
1> {};
class DictionaryStorageField: public BitField<uint32_t, 7,
24> {};
- class DescriptorStorageField: public BitField<uint32_t, 7,
11> {};
- class DescriptorPointer: public BitField<uint32_t, 18,
11> {};
- class RepresentationField: public BitField<uint32_t, 29,
2> {};
+ class DescriptorPointer: public BitField<uint32_t, 7,
11> {};
+ class RepresentationField: public BitField<uint32_t, 18,
3> {};
static const int kInitialIndex = 1;
=======================================
--- /branches/bleeding_edge/src/property.cc Tue Nov 13 03:07:04 2012
+++ /branches/bleeding_edge/src/property.cc Tue May 7 06:09:23 2013
@@ -112,7 +112,6 @@
GetKey()->ShortPrint(out);
PrintF(out, " @ ");
GetValue()->ShortPrint(out);
- PrintF(out, " %d\n", GetDetails().descriptor_index());
}
=======================================
--- /branches/bleeding_edge/src/property.h Fri Apr 26 08:30:41 2013
+++ /branches/bleeding_edge/src/property.h Tue May 7 06:09:23 2013
@@ -64,11 +64,6 @@
void Print(FILE* out);
#endif
- void SetEnumerationIndex(int index) {
- details_ = PropertyDetails(details_.attributes(), details_.type(),
- details_.representation(), index);
- }
-
void SetSortedKeyIndex(int index) { details_ =
details_.set_pointer(index); }
private:
@@ -94,11 +89,10 @@
Object* value,
PropertyAttributes attributes,
PropertyType type,
- Representation representation,
- int index)
+ Representation representation)
: key_(key),
value_(value),
- details_(attributes, type, representation, index) { }
+ details_(attributes, type, representation) { }
friend class DescriptorArray;
};
@@ -109,10 +103,9 @@
FieldDescriptor(Name* key,
int field_index,
PropertyAttributes attributes,
- Representation representation,
- int index = 0)
+ Representation representation)
: Descriptor(key, Smi::FromInt(field_index), attributes,
- FIELD, representation, index) {}
+ FIELD, representation) {}
};
@@ -120,10 +113,9 @@
public:
ConstantFunctionDescriptor(Name* key,
JSFunction* function,
- PropertyAttributes attributes,
- int index)
- : Descriptor(key, function, attributes,
- CONSTANT_FUNCTION, Representation::Tagged(), index) {}
+ PropertyAttributes attributes)
+ : Descriptor(key, function, attributes, CONSTANT_FUNCTION,
+ Representation::Tagged()) {}
};
@@ -131,10 +123,9 @@
public:
CallbacksDescriptor(Name* key,
Object* foreign,
- PropertyAttributes attributes,
- int index = 0)
+ PropertyAttributes attributes)
: Descriptor(key, foreign, attributes, CALLBACKS,
- Representation::Tagged(), index) {}
+ Representation::Tagged()) {}
};
=======================================
--- /branches/bleeding_edge/src/runtime.cc Tue May 7 03:44:30 2013
+++ /branches/bleeding_edge/src/runtime.cc Tue May 7 06:09:23 2013
@@ -2316,8 +2316,7 @@
CallbacksDescriptor new_desc(name,
instance_desc->GetValue(index),
- static_cast<PropertyAttributes>(details.attributes() | READ_ONLY),
- details.descriptor_index());
+ static_cast<PropertyAttributes>(details.attributes() | READ_ONLY));
// Create a new map featuring the new field descriptors array.
Map* new_map;
@@ -2335,7 +2334,6 @@
PropertyDetails new_details(
static_cast<PropertyAttributes>(details.attributes() | READ_ONLY),
details.type(),
- Representation::None(),
details.dictionary_index());
function->property_dictionary()->DetailsAtPut(entry, new_details);
}
=======================================
--- /branches/bleeding_edge/src/string-stream.cc Tue Apr 16 05:30:51 2013
+++ /branches/bleeding_edge/src/string-stream.cc Tue May 7 06:09:23 2013
@@ -350,9 +350,8 @@
}
int real_size = map->NumberOfOwnDescriptors();
DescriptorArray* descs = map->instance_descriptors();
- for (int i = 0; i < descs->number_of_descriptors(); i++) {
+ for (int i = 0; i < real_size; i++) {
PropertyDetails details = descs->GetDetails(i);
- if (details.descriptor_index() > real_size) continue;
if (details.type() == FIELD) {
Object* key = descs->GetKey(i);
if (key->IsString() || key->IsNumber()) {
=======================================
--- /branches/bleeding_edge/test/cctest/test-alloc.cc Thu May 2 13:18:42
2013
+++ /branches/bleeding_edge/test/cctest/test-alloc.cc Tue May 7 06:09:23
2013
@@ -142,8 +142,7 @@
CallbacksDescriptor d(*name,
*foreign,
- static_cast<PropertyAttributes>(0),
- v8::internal::PropertyDetails::kInitialIndex);
+ static_cast<PropertyAttributes>(0));
map->AppendDescriptor(&d, witness);
// Add the Foo constructor the global object.
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.