Index: src/handles.cc |
=================================================================== |
--- src/handles.cc (revision 2423) |
+++ src/handles.cc (working copy) |
@@ -289,10 +289,11 @@ |
// hidden symbols hash code is zero (and no other string has hash |
// code zero) it will always occupy the first entry if present. |
DescriptorArray* descriptors = obj->map()->instance_descriptors(); |
- DescriptorReader r(descriptors, 0); // Explicitly position reader at zero. |
- if (!r.eos() && (r.GetKey() == *key) && r.IsProperty()) { |
- ASSERT(r.type() == FIELD); |
- return Handle<Object>(obj->FastPropertyAt(r.GetFieldIndex())); |
+ if ((descriptors->number_of_descriptors() > 0) && |
+ (descriptors->GetKey(0) == *key) && |
+ descriptors->IsProperty(0)) { |
+ ASSERT(descriptors->GetType(0) == FIELD); |
+ return Handle<Object>(obj->FastPropertyAt(descriptors->GetFieldIndex(0))); |
} |
} |
@@ -588,12 +589,13 @@ |
int num_enum = object->NumberOfEnumProperties(); |
Handle<FixedArray> storage = Factory::NewFixedArray(num_enum); |
Handle<FixedArray> sort_array = Factory::NewFixedArray(num_enum); |
- for (DescriptorReader r(object->map()->instance_descriptors()); |
- !r.eos(); |
- r.advance()) { |
- if (r.IsProperty() && !r.IsDontEnum()) { |
- (*storage)->set(index, r.GetKey()); |
- (*sort_array)->set(index, Smi::FromInt(r.GetDetails().index())); |
+ Handle<DescriptorArray> descs = |
+ Handle<DescriptorArray>(object->map()->instance_descriptors()); |
+ for (int i = 0; i < descs->number_of_descriptors(); i++) { |
+ if (descs->IsProperty(i) && !descs->IsDontEnum(i)) { |
+ (*storage)->set(index, descs->GetKey(i)); |
+ PropertyDetails details(descs->GetDetails(i)); |
+ (*sort_array)->set(index, Smi::FromInt(details.index())); |
index++; |
} |
} |