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

Unified Diff: src/json-stringifier.h

Issue 391693002: In-object double fields unboxing (for 64-bit only). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebasing Created 6 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 | « src/hydrogen-instructions.h ('k') | src/layout-descriptor.h » ('j') | 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 f89a19fd4a9b06abf2b1dd4e17a86ef09d38cdd0..1ec6873b1104027cb0396b28fa4129f07068cb05 100644
--- a/src/json-stringifier.h
+++ b/src/json-stringifier.h
@@ -652,8 +652,15 @@ BasicJsonStringifier::Result BasicJsonStringifier::SerializeJSObject(
if (details.IsDontEnum()) continue;
Handle<Object> property;
if (details.type() == FIELD && *map == object->map()) {
- property = Handle<Object>(object->RawFastPropertyAt(
- FieldIndex::ForDescriptor(*map, i)), isolate_);
+ FieldIndex field_index = FieldIndex::ForDescriptor(*map, i);
+ Isolate* isolate = object->GetIsolate();
+ if (object->IsUnboxedDoubleField(field_index)) {
+ double value = object->RawFastDoublePropertyAt(field_index);
+ property = isolate->factory()->NewHeapNumber(value);
+
+ } else {
+ property = handle(object->RawFastPropertyAt(field_index), isolate);
+ }
} else {
ASSIGN_RETURN_ON_EXCEPTION_VALUE(
isolate_, property,
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/layout-descriptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698