| OLD | NEW |
| 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 | 9 |
| 10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 EXCEPTION); | 400 EXCEPTION); |
| 401 } | 401 } |
| 402 | 402 |
| 403 if (object->IsSmi()) { | 403 if (object->IsSmi()) { |
| 404 if (deferred_string_key) SerializeDeferredKey(comma, key); | 404 if (deferred_string_key) SerializeDeferredKey(comma, key); |
| 405 return SerializeSmi(Smi::cast(*object)); | 405 return SerializeSmi(Smi::cast(*object)); |
| 406 } | 406 } |
| 407 | 407 |
| 408 switch (HeapObject::cast(*object)->map()->instance_type()) { | 408 switch (HeapObject::cast(*object)->map()->instance_type()) { |
| 409 case HEAP_NUMBER_TYPE: | 409 case HEAP_NUMBER_TYPE: |
| 410 case MUTABLE_HEAP_NUMBER_TYPE: | |
| 411 if (deferred_string_key) SerializeDeferredKey(comma, key); | 410 if (deferred_string_key) SerializeDeferredKey(comma, key); |
| 412 return SerializeHeapNumber(Handle<HeapNumber>::cast(object)); | 411 return SerializeHeapNumber(Handle<HeapNumber>::cast(object)); |
| 413 case ODDBALL_TYPE: | 412 case ODDBALL_TYPE: |
| 414 switch (Oddball::cast(*object)->kind()) { | 413 switch (Oddball::cast(*object)->kind()) { |
| 415 case Oddball::kFalse: | 414 case Oddball::kFalse: |
| 416 if (deferred_string_key) SerializeDeferredKey(comma, key); | 415 if (deferred_string_key) SerializeDeferredKey(comma, key); |
| 417 AppendAscii("false"); | 416 AppendAscii("false"); |
| 418 return SUCCESS; | 417 return SUCCESS; |
| 419 case Oddball::kTrue: | 418 case Oddball::kTrue: |
| 420 if (deferred_string_key) SerializeDeferredKey(comma, key); | 419 if (deferred_string_key) SerializeDeferredKey(comma, key); |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 SerializeString_<false, uint8_t>(object); | 870 SerializeString_<false, uint8_t>(object); |
| 872 } else { | 871 } else { |
| 873 SerializeString_<false, uc16>(object); | 872 SerializeString_<false, uc16>(object); |
| 874 } | 873 } |
| 875 } | 874 } |
| 876 } | 875 } |
| 877 | 876 |
| 878 } } // namespace v8::internal | 877 } } // namespace v8::internal |
| 879 | 878 |
| 880 #endif // V8_JSON_STRINGIFIER_H_ | 879 #endif // V8_JSON_STRINGIFIER_H_ |
| OLD | NEW |