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

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

Issue 14850006: Use mutable heapnumbers to store doubles in fields. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Ported to ARM and x64 Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/json-parser.h ('k') | src/objects.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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 for (int i = 0; i < map->NumberOfOwnDescriptors(); i++) { 637 for (int i = 0; i < map->NumberOfOwnDescriptors(); i++) {
638 Handle<Name> name(map->instance_descriptors()->GetKey(i), isolate_); 638 Handle<Name> name(map->instance_descriptors()->GetKey(i), isolate_);
639 // TODO(rossberg): Should this throw? 639 // TODO(rossberg): Should this throw?
640 if (!name->IsString()) continue; 640 if (!name->IsString()) continue;
641 Handle<String> key = Handle<String>::cast(name); 641 Handle<String> key = Handle<String>::cast(name);
642 PropertyDetails details = map->instance_descriptors()->GetDetails(i); 642 PropertyDetails details = map->instance_descriptors()->GetDetails(i);
643 if (details.IsDontEnum() || details.IsDeleted()) continue; 643 if (details.IsDontEnum() || details.IsDeleted()) continue;
644 Handle<Object> property; 644 Handle<Object> property;
645 if (details.type() == FIELD && *map == object->map()) { 645 if (details.type() == FIELD && *map == object->map()) {
646 property = Handle<Object>( 646 property = Handle<Object>(
647 object->FastPropertyAt( 647 object->RawFastPropertyAt(
648 map->instance_descriptors()->GetFieldIndex(i)), 648 map->instance_descriptors()->GetFieldIndex(i)),
649 isolate_); 649 isolate_);
650 } else { 650 } else {
651 property = GetProperty(isolate_, object, key); 651 property = GetProperty(isolate_, object, key);
652 if (property.is_null()) return EXCEPTION; 652 if (property.is_null()) return EXCEPTION;
653 } 653 }
654 Result result = SerializeProperty(property, comma, key); 654 Result result = SerializeProperty(property, comma, key);
655 if (!comma && result == SUCCESS) comma = true; 655 if (!comma && result == SUCCESS) comma = true;
656 if (result >= EXCEPTION) return result; 656 if (result >= EXCEPTION) return result;
657 } 657 }
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 SerializeString_<false, uint8_t>(object); 839 SerializeString_<false, uint8_t>(object);
840 } else { 840 } else {
841 SerializeString_<false, uc16>(object); 841 SerializeString_<false, uc16>(object);
842 } 842 }
843 } 843 }
844 } 844 }
845 845
846 } } // namespace v8::internal 846 } } // namespace v8::internal
847 847
848 #endif // V8_JSON_STRINGIFIER_H_ 848 #endif // V8_JSON_STRINGIFIER_H_
OLDNEW
« no previous file with comments | « src/json-parser.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698