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

Unified Diff: src/handles.cc

Issue 149458: Remove the descriptor stream abstractions.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/factory.cc ('K') | « src/factory.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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++;
}
}
« src/factory.cc ('K') | « src/factory.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698