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

Unified Diff: src/bootstrapper.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 | « no previous file | src/factory.cc » ('j') | src/factory.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
===================================================================
--- src/bootstrapper.cc (revision 2423)
+++ src/bootstrapper.cc (working copy)
@@ -1373,43 +1373,35 @@
if (from->HasFastProperties()) {
Handle<DescriptorArray> descs =
Handle<DescriptorArray>(from->map()->instance_descriptors());
- int offset = 0;
- while (true) {
- // Iterating through the descriptors is not gc safe so we have to
- // store the value in a handle and create a new stream for each entry.
- DescriptorReader stream(*descs, offset);
- if (stream.eos()) break;
- // We have to read out the next offset before we do anything that may
- // cause a gc, since the DescriptorReader is not gc safe.
- offset = stream.next_position();
- PropertyDetails details = stream.GetDetails();
+ for (int i = 0; i < descs->number_of_descriptors(); i++) {
+ PropertyDetails details = PropertyDetails(descs->GetDetails(i));
switch (details.type()) {
case FIELD: {
HandleScope inner;
- Handle<String> key = Handle<String>(stream.GetKey());
- int index = stream.GetFieldIndex();
+ Handle<String> key = Handle<String>(descs->GetKey(i));
+ int index = descs->GetFieldIndex(i);
Handle<Object> value = Handle<Object>(from->FastPropertyAt(index));
SetProperty(to, key, value, details.attributes());
break;
}
case CONSTANT_FUNCTION: {
HandleScope inner;
- Handle<String> key = Handle<String>(stream.GetKey());
+ Handle<String> key = Handle<String>(descs->GetKey(i));
Handle<JSFunction> fun =
- Handle<JSFunction>(stream.GetConstantFunction());
+ Handle<JSFunction>(descs->GetConstantFunction(i));
SetProperty(to, key, fun, details.attributes());
break;
}
case CALLBACKS: {
LookupResult result;
- to->LocalLookup(stream.GetKey(), &result);
+ to->LocalLookup(descs->GetKey(i), &result);
// If the property is already there we skip it
if (result.IsValid()) continue;
HandleScope inner;
Handle<DescriptorArray> inst_descs =
Handle<DescriptorArray>(to->map()->instance_descriptors());
- Handle<String> key = Handle<String>(stream.GetKey());
- Handle<Object> entry = Handle<Object>(stream.GetCallbacksObject());
+ Handle<String> key = Handle<String>(descs->GetKey(i));
+ Handle<Object> entry = Handle<Object>(descs->GetCallbacksObject(i));
inst_descs = Factory::CopyAppendProxyDescriptor(inst_descs,
key,
entry,
« no previous file with comments | « no previous file | src/factory.cc » ('j') | src/factory.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698