| 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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 } | 562 } |
| 563 | 563 |
| 564 Append('{'); | 564 Append('{'); |
| 565 bool comma = false; | 565 bool comma = false; |
| 566 | 566 |
| 567 if (object->HasFastProperties() && | 567 if (object->HasFastProperties() && |
| 568 !object->HasIndexedInterceptor() && | 568 !object->HasIndexedInterceptor() && |
| 569 !object->HasNamedInterceptor() && | 569 !object->HasNamedInterceptor() && |
| 570 object->elements()->length() == 0) { | 570 object->elements()->length() == 0) { |
| 571 Handle<Map> map(object->map()); | 571 Handle<Map> map(object->map()); |
| 572 int num_desc = map->NumberOfOwnDescriptors(); | 572 for (int i = 0; i < map->NumberOfOwnDescriptors(); i++) { |
| 573 for (int i = 0; i < num_desc; i++) { | |
| 574 Handle<String> key(map->instance_descriptors()->GetKey(i), isolate_); | 573 Handle<String> key(map->instance_descriptors()->GetKey(i), isolate_); |
| 575 PropertyDetails details = map->instance_descriptors()->GetDetails(i); | 574 PropertyDetails details = map->instance_descriptors()->GetDetails(i); |
| 576 if (details.IsDontEnum() || details.IsDeleted()) continue; | 575 if (details.IsDontEnum() || details.IsDeleted()) continue; |
| 577 Handle<Object> property; | 576 Handle<Object> property; |
| 578 if (details.type() == FIELD && *map == object->map()) { | 577 if (details.type() == FIELD && *map == object->map()) { |
| 579 property = Handle<Object>( | 578 property = Handle<Object>( |
| 580 object->FastPropertyAt( | 579 object->FastPropertyAt( |
| 581 map->instance_descriptors()->GetFieldIndex(i)), | 580 map->instance_descriptors()->GetFieldIndex(i)), |
| 582 isolate_); | 581 isolate_); |
| 583 } else { | 582 } else { |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 SerializeString_<false, char>(flat.ToAsciiVector(), object); | 792 SerializeString_<false, char>(flat.ToAsciiVector(), object); |
| 794 } else { | 793 } else { |
| 795 SerializeString_<false, uc16>(flat.ToUC16Vector(), object); | 794 SerializeString_<false, uc16>(flat.ToUC16Vector(), object); |
| 796 } | 795 } |
| 797 } | 796 } |
| 798 } | 797 } |
| 799 | 798 |
| 800 } } // namespace v8::internal | 799 } } // namespace v8::internal |
| 801 | 800 |
| 802 #endif // V8_JSON_STRINGIFIER_H_ | 801 #endif // V8_JSON_STRINGIFIER_H_ |
| OLD | NEW |