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

Side by Side Diff: src/json-stringifier.h

Issue 711313002: Reland "In-object double fields unboxing (for 64-bit only)." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: The fix 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/layout-descriptor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_JSON_STRINGIFIER_H_ 5 #ifndef V8_JSON_STRINGIFIER_H_
6 #define V8_JSON_STRINGIFIER_H_ 6 #define V8_JSON_STRINGIFIER_H_
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/conversions.h" 10 #include "src/conversions.h"
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 Handle<Map> map(object->map()); 645 Handle<Map> map(object->map());
646 for (int i = 0; i < map->NumberOfOwnDescriptors(); i++) { 646 for (int i = 0; i < map->NumberOfOwnDescriptors(); i++) {
647 Handle<Name> name(map->instance_descriptors()->GetKey(i), isolate_); 647 Handle<Name> name(map->instance_descriptors()->GetKey(i), isolate_);
648 // TODO(rossberg): Should this throw? 648 // TODO(rossberg): Should this throw?
649 if (!name->IsString()) continue; 649 if (!name->IsString()) continue;
650 Handle<String> key = Handle<String>::cast(name); 650 Handle<String> key = Handle<String>::cast(name);
651 PropertyDetails details = map->instance_descriptors()->GetDetails(i); 651 PropertyDetails details = map->instance_descriptors()->GetDetails(i);
652 if (details.IsDontEnum()) continue; 652 if (details.IsDontEnum()) continue;
653 Handle<Object> property; 653 Handle<Object> property;
654 if (details.type() == FIELD && *map == object->map()) { 654 if (details.type() == FIELD && *map == object->map()) {
655 property = Handle<Object>(object->RawFastPropertyAt( 655 FieldIndex field_index = FieldIndex::ForDescriptor(*map, i);
656 FieldIndex::ForDescriptor(*map, i)), isolate_); 656 Isolate* isolate = object->GetIsolate();
657 if (object->IsUnboxedDoubleField(field_index)) {
658 double value = object->RawFastDoublePropertyAt(field_index);
659 property = isolate->factory()->NewHeapNumber(value);
660
661 } else {
662 property = handle(object->RawFastPropertyAt(field_index), isolate);
663 }
657 } else { 664 } else {
658 ASSIGN_RETURN_ON_EXCEPTION_VALUE( 665 ASSIGN_RETURN_ON_EXCEPTION_VALUE(
659 isolate_, property, 666 isolate_, property,
660 Object::GetPropertyOrElement(object, key), 667 Object::GetPropertyOrElement(object, key),
661 EXCEPTION); 668 EXCEPTION);
662 } 669 }
663 Result result = SerializeProperty(property, comma, key); 670 Result result = SerializeProperty(property, comma, key);
664 if (!comma && result == SUCCESS) comma = true; 671 if (!comma && result == SUCCESS) comma = true;
665 if (result == EXCEPTION) return result; 672 if (result == EXCEPTION) return result;
666 } 673 }
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 SerializeString_<false, uint8_t>(object); 877 SerializeString_<false, uint8_t>(object);
871 } else { 878 } else {
872 SerializeString_<false, uc16>(object); 879 SerializeString_<false, uc16>(object);
873 } 880 }
874 } 881 }
875 } 882 }
876 883
877 } } // namespace v8::internal 884 } } // namespace v8::internal
878 885
879 #endif // V8_JSON_STRINGIFIER_H_ 886 #endif // V8_JSON_STRINGIFIER_H_
OLDNEW
« 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