| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #include "src/json-stringifier.h" | 5 #include "src/json-stringifier.h" |
| 6 | 6 |
| 7 #include "src/conversions.h" | 7 #include "src/conversions.h" |
| 8 #include "src/lookup.h" | 8 #include "src/lookup.h" |
| 9 #include "src/messages.h" | 9 #include "src/messages.h" |
| 10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 Indent(); | 527 Indent(); |
| 528 bool comma = false; | 528 bool comma = false; |
| 529 for (int i = 0; i < map->NumberOfOwnDescriptors(); i++) { | 529 for (int i = 0; i < map->NumberOfOwnDescriptors(); i++) { |
| 530 Handle<Name> name(map->instance_descriptors()->GetKey(i), isolate_); | 530 Handle<Name> name(map->instance_descriptors()->GetKey(i), isolate_); |
| 531 // TODO(rossberg): Should this throw? | 531 // TODO(rossberg): Should this throw? |
| 532 if (!name->IsString()) continue; | 532 if (!name->IsString()) continue; |
| 533 Handle<String> key = Handle<String>::cast(name); | 533 Handle<String> key = Handle<String>::cast(name); |
| 534 PropertyDetails details = map->instance_descriptors()->GetDetails(i); | 534 PropertyDetails details = map->instance_descriptors()->GetDetails(i); |
| 535 if (details.IsDontEnum()) continue; | 535 if (details.IsDontEnum()) continue; |
| 536 Handle<Object> property; | 536 Handle<Object> property; |
| 537 if (details.type() == DATA && *map == js_obj->map()) { | 537 if (details.location() == kField && *map == js_obj->map()) { |
| 538 DCHECK_EQ(kData, details.kind()); |
| 538 FieldIndex field_index = FieldIndex::ForDescriptor(*map, i); | 539 FieldIndex field_index = FieldIndex::ForDescriptor(*map, i); |
| 539 property = JSObject::FastPropertyAt(js_obj, details.representation(), | 540 property = JSObject::FastPropertyAt(js_obj, details.representation(), |
| 540 field_index); | 541 field_index); |
| 541 } else { | 542 } else { |
| 542 ASSIGN_RETURN_ON_EXCEPTION_VALUE( | 543 ASSIGN_RETURN_ON_EXCEPTION_VALUE( |
| 543 isolate_, property, Object::GetPropertyOrElement(js_obj, key), | 544 isolate_, property, Object::GetPropertyOrElement(js_obj, key), |
| 544 EXCEPTION); | 545 EXCEPTION); |
| 545 } | 546 } |
| 546 Result result = SerializeProperty(property, comma, key); | 547 Result result = SerializeProperty(property, comma, key); |
| 547 if (!comma && result == SUCCESS) comma = true; | 548 if (!comma && result == SUCCESS) comma = true; |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 if (object->IsOneByteRepresentationUnderneath()) { | 714 if (object->IsOneByteRepresentationUnderneath()) { |
| 714 SerializeString_<uint8_t, uc16>(object); | 715 SerializeString_<uint8_t, uc16>(object); |
| 715 } else { | 716 } else { |
| 716 SerializeString_<uc16, uc16>(object); | 717 SerializeString_<uc16, uc16>(object); |
| 717 } | 718 } |
| 718 } | 719 } |
| 719 } | 720 } |
| 720 | 721 |
| 721 } // namespace internal | 722 } // namespace internal |
| 722 } // namespace v8 | 723 } // namespace v8 |
| OLD | NEW |