OLD | NEW |
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 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 !object->HasIndexedInterceptor() && | 633 !object->HasIndexedInterceptor() && |
634 !object->HasNamedInterceptor() && | 634 !object->HasNamedInterceptor() && |
635 object->elements()->length() == 0) { | 635 object->elements()->length() == 0) { |
636 Handle<Map> map(object->map()); | 636 Handle<Map> map(object->map()); |
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()) 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->RawFastPropertyAt( | 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 } |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 SerializeString_<false, uint8_t>(object); | 840 SerializeString_<false, uint8_t>(object); |
841 } else { | 841 } else { |
842 SerializeString_<false, uc16>(object); | 842 SerializeString_<false, uc16>(object); |
843 } | 843 } |
844 } | 844 } |
845 } | 845 } |
846 | 846 |
847 } } // namespace v8::internal | 847 } } // namespace v8::internal |
848 | 848 |
849 #endif // V8_JSON_STRINGIFIER_H_ | 849 #endif // V8_JSON_STRINGIFIER_H_ |
OLD | NEW |