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

Unified Diff: src/json-stringifier.h

Issue 11366087: Reduce stack frame size in JSON.stringify. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/json-stringifier.h
diff --git a/src/json-stringifier.h b/src/json-stringifier.h
index f083ff4916856f820ed8048ffb132ca7803b11d2..1aa72b71b4e08a3f519696488cb2efe2ed3fd0d4 100644
--- a/src/json-stringifier.h
+++ b/src/json-stringifier.h
@@ -567,28 +567,26 @@ BasicJsonStringifier::Result BasicJsonStringifier::SerializeJSObject(
if (object->HasFastProperties() &&
!object->HasIndexedInterceptor() &&
!object->HasNamedInterceptor() &&
- object->elements() == isolate_->heap()->empty_fixed_array()) {
- Handle<DescriptorArray> descs(
- object->map()->instance_descriptors(), isolate_);
- int num_desc = object->map()->NumberOfOwnDescriptors();
+ object->elements()->length() == 0) {
Handle<Map> map(object->map());
- bool map_changed = false;
+ int num_desc = map->NumberOfOwnDescriptors();
for (int i = 0; i < num_desc; i++) {
- Handle<String> key(descs->GetKey(i), isolate_);
- PropertyDetails details = descs->GetDetails(i);
+ Handle<String> key(map->instance_descriptors()->GetKey(i), isolate_);
+ PropertyDetails details = map->instance_descriptors()->GetDetails(i);
if (details.IsDontEnum() || details.IsDeleted()) continue;
Handle<Object> property;
- if (details.type() == FIELD && !map_changed) {
+ if (details.type() == FIELD && *map == object->map()) {
property = Handle<Object>(
- object->FastPropertyAt(descs->GetFieldIndex(i)), isolate_);
+ object->FastPropertyAt(
+ map->instance_descriptors()->GetFieldIndex(i)),
+ isolate_);
} else {
property = GetProperty(object, key);
+ if (property.is_null()) return EXCEPTION;
}
- if (property.is_null()) return EXCEPTION;
Result result = SerializeProperty(property, comma, key);
if (!comma && result == SUCCESS) comma = true;
if (result >= EXCEPTION) return result;
- if (*map != object->map()) map_changed = true;
}
} else {
bool has_exception = false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698