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: |
410 if (deferred_string_key) SerializeDeferredKey(comma, key); | 411 if (deferred_string_key) SerializeDeferredKey(comma, key); |
411 return SerializeHeapNumber(Handle<HeapNumber>::cast(object)); | 412 return SerializeHeapNumber(Handle<HeapNumber>::cast(object)); |
412 case ODDBALL_TYPE: | 413 case ODDBALL_TYPE: |
413 switch (Oddball::cast(*object)->kind()) { | 414 switch (Oddball::cast(*object)->kind()) { |
414 case Oddball::kFalse: | 415 case Oddball::kFalse: |
415 if (deferred_string_key) SerializeDeferredKey(comma, key); | 416 if (deferred_string_key) SerializeDeferredKey(comma, key); |
416 AppendAscii("false"); | 417 AppendAscii("false"); |
417 return SUCCESS; | 418 return SUCCESS; |
418 case Oddball::kTrue: | 419 case Oddball::kTrue: |
419 if (deferred_string_key) SerializeDeferredKey(comma, key); | 420 if (deferred_string_key) SerializeDeferredKey(comma, key); |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 SerializeString_<false, uint8_t>(object); | 871 SerializeString_<false, uint8_t>(object); |
871 } else { | 872 } else { |
872 SerializeString_<false, uc16>(object); | 873 SerializeString_<false, uc16>(object); |
873 } | 874 } |
874 } | 875 } |
875 } | 876 } |
876 | 877 |
877 } } // namespace v8::internal | 878 } } // namespace v8::internal |
878 | 879 |
879 #endif // V8_JSON_STRINGIFIER_H_ | 880 #endif // V8_JSON_STRINGIFIER_H_ |
OLD | NEW |