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

Unified Diff: src/factory.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
« no previous file with comments | « src/bootstrapper.cc ('k') | src/handles.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
===================================================================
--- src/factory.cc (revision 2423)
+++ src/factory.cc (working copy)
@@ -570,13 +570,9 @@
int descriptor_count = 0;
// Copy the descriptors from the array.
- {
- DescriptorWriter w(*result);
- for (DescriptorReader r(*array); !r.eos(); r.advance()) {
- if (!r.IsNullDescriptor()) {
- w.WriteFrom(&r);
- }
- descriptor_count++;
+ for (int i = 0; i < array->number_of_descriptors(); i++) {
+ if (array->GetType(i) != NULL_DESCRIPTOR) {
+ result->SetFrom(descriptor_count++, *array, i);
iposva 2009/07/10 16:36:15 This would probably be more readable if SetFrom wa
Mads Ager (chromium) 2009/07/10 19:21:08 I agree. Thanks.
}
}
@@ -609,13 +605,11 @@
// If duplicates were detected, allocate a result of the right size
// and transfer the elements.
if (duplicates > 0) {
+ int number_of_descriptors = result->number_of_descriptors() - duplicates;
Handle<DescriptorArray> new_result =
- NewDescriptorArray(result->number_of_descriptors() - duplicates);
- DescriptorWriter w(*new_result);
- DescriptorReader r(*result);
- while (!w.eos()) {
- w.WriteFrom(&r);
- r.advance();
+ NewDescriptorArray(number_of_descriptors);
+ for (int i = 0; i < number_of_descriptors; i++) {
+ new_result->SetFrom(i, *result, i);
}
result = new_result;
}
« no previous file with comments | « src/bootstrapper.cc ('k') | src/handles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698