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

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

Issue 300283002: Introduce FieldIndex to unify and abstract property/field offset (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix mutable boxed double runtime function Created 6 years, 6 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 // 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 #include "src/conversions.h" 9 #include "src/conversions.h"
10 #include "src/utils.h" 10 #include "src/utils.h"
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 Handle<Map> map(object->map()); 650 Handle<Map> map(object->map());
651 for (int i = 0; i < map->NumberOfOwnDescriptors(); i++) { 651 for (int i = 0; i < map->NumberOfOwnDescriptors(); i++) {
652 Handle<Name> name(map->instance_descriptors()->GetKey(i), isolate_); 652 Handle<Name> name(map->instance_descriptors()->GetKey(i), isolate_);
653 // TODO(rossberg): Should this throw? 653 // TODO(rossberg): Should this throw?
654 if (!name->IsString()) continue; 654 if (!name->IsString()) continue;
655 Handle<String> key = Handle<String>::cast(name); 655 Handle<String> key = Handle<String>::cast(name);
656 PropertyDetails details = map->instance_descriptors()->GetDetails(i); 656 PropertyDetails details = map->instance_descriptors()->GetDetails(i);
657 if (details.IsDontEnum()) continue; 657 if (details.IsDontEnum()) continue;
658 Handle<Object> property; 658 Handle<Object> property;
659 if (details.type() == FIELD && *map == object->map()) { 659 if (details.type() == FIELD && *map == object->map()) {
660 property = Handle<Object>( 660 property = Handle<Object>(object->RawFastPropertyAt(
661 object->RawFastPropertyAt( 661 FieldIndex::ForDescriptor(*map, i)), isolate_);
662 map->instance_descriptors()->GetFieldIndex(i)),
663 isolate_);
664 } else { 662 } else {
665 ASSIGN_RETURN_ON_EXCEPTION_VALUE( 663 ASSIGN_RETURN_ON_EXCEPTION_VALUE(
666 isolate_, property, 664 isolate_, property,
667 Object::GetPropertyOrElement(object, key), 665 Object::GetPropertyOrElement(object, key),
668 EXCEPTION); 666 EXCEPTION);
669 } 667 }
670 Result result = SerializeProperty(property, comma, key); 668 Result result = SerializeProperty(property, comma, key);
671 if (!comma && result == SUCCESS) comma = true; 669 if (!comma && result == SUCCESS) comma = true;
672 if (result == EXCEPTION) return result; 670 if (result == EXCEPTION) return result;
673 } 671 }
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 SerializeString_<false, uint8_t>(object); 875 SerializeString_<false, uint8_t>(object);
878 } else { 876 } else {
879 SerializeString_<false, uc16>(object); 877 SerializeString_<false, uc16>(object);
880 } 878 }
881 } 879 }
882 } 880 }
883 881
884 } } // namespace v8::internal 882 } } // namespace v8::internal
885 883
886 #endif // V8_JSON_STRINGIFIER_H_ 884 #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