| 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 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 } | 458 } |
| 459 StackPop(); | 459 StackPop(); |
| 460 return SUCCESS; | 460 return SUCCESS; |
| 461 } | 461 } |
| 462 | 462 |
| 463 BasicJsonStringifier::Result BasicJsonStringifier::SerializeJSReceiverSlow( | 463 BasicJsonStringifier::Result BasicJsonStringifier::SerializeJSReceiverSlow( |
| 464 Handle<JSReceiver> object) { | 464 Handle<JSReceiver> object) { |
| 465 Handle<FixedArray> contents; | 465 Handle<FixedArray> contents; |
| 466 ASSIGN_RETURN_ON_EXCEPTION_VALUE( | 466 ASSIGN_RETURN_ON_EXCEPTION_VALUE( |
| 467 isolate_, contents, | 467 isolate_, contents, |
| 468 JSReceiver::GetKeys(object, OWN_ONLY, ENUMERABLE_STRINGS), EXCEPTION); | 468 KeyAccumulator::GetKeys(object, OWN_ONLY, ENUMERABLE_STRINGS), EXCEPTION); |
| 469 | 469 |
| 470 builder_.AppendCharacter('{'); | 470 builder_.AppendCharacter('{'); |
| 471 Indent(); | 471 Indent(); |
| 472 bool comma = false; | 472 bool comma = false; |
| 473 for (int i = 0; i < contents->length(); i++) { | 473 for (int i = 0; i < contents->length(); i++) { |
| 474 Object* key = contents->get(i); | 474 Object* key = contents->get(i); |
| 475 Handle<String> key_handle; | 475 Handle<String> key_handle; |
| 476 MaybeHandle<Object> maybe_property; | 476 MaybeHandle<Object> maybe_property; |
| 477 if (key->IsString()) { | 477 if (key->IsString()) { |
| 478 key_handle = Handle<String>(String::cast(key), isolate_); | 478 key_handle = Handle<String>(String::cast(key), isolate_); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 if (object->IsOneByteRepresentationUnderneath()) { | 624 if (object->IsOneByteRepresentationUnderneath()) { |
| 625 SerializeString_<uint8_t, uc16>(object); | 625 SerializeString_<uint8_t, uc16>(object); |
| 626 } else { | 626 } else { |
| 627 SerializeString_<uc16, uc16>(object); | 627 SerializeString_<uc16, uc16>(object); |
| 628 } | 628 } |
| 629 } | 629 } |
| 630 } | 630 } |
| 631 | 631 |
| 632 } // namespace internal | 632 } // namespace internal |
| 633 } // namespace v8 | 633 } // namespace v8 |
| OLD | NEW |