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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 "\374\0 \375\0 \376\0 \377\0 "; | 257 "\374\0 \375\0 \376\0 \377\0 "; |
258 | 258 |
259 | 259 |
260 BasicJsonStringifier::BasicJsonStringifier(Isolate* isolate) | 260 BasicJsonStringifier::BasicJsonStringifier(Isolate* isolate) |
261 : isolate_(isolate), | 261 : isolate_(isolate), |
262 current_index_(0), | 262 current_index_(0), |
263 is_ascii_(true), | 263 is_ascii_(true), |
264 overflowed_(false) { | 264 overflowed_(false) { |
265 factory_ = isolate_->factory(); | 265 factory_ = isolate_->factory(); |
266 accumulator_store_ = Handle<JSValue>::cast( | 266 accumulator_store_ = Handle<JSValue>::cast( |
267 factory_->ToObject(factory_->empty_string())); | 267 Object::ToObject(isolate, factory_->empty_string())); |
268 part_length_ = kInitialPartLength; | 268 part_length_ = kInitialPartLength; |
269 current_part_ = factory_->NewRawOneByteString(part_length_).ToHandleChecked(); | 269 current_part_ = factory_->NewRawOneByteString(part_length_).ToHandleChecked(); |
270 tojson_string_ = factory_->toJSON_string(); | 270 tojson_string_ = factory_->toJSON_string(); |
271 stack_ = factory_->NewJSArray(8); | 271 stack_ = factory_->NewJSArray(8); |
272 } | 272 } |
273 | 273 |
274 | 274 |
275 MaybeObject* BasicJsonStringifier::Stringify(Handle<Object> object) { | 275 MaybeObject* BasicJsonStringifier::Stringify(Handle<Object> object) { |
276 switch (SerializeObject(object)) { | 276 switch (SerializeObject(object)) { |
277 case UNCHANGED: | 277 case UNCHANGED: |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
894 SerializeString_<false, uint8_t>(object); | 894 SerializeString_<false, uint8_t>(object); |
895 } else { | 895 } else { |
896 SerializeString_<false, uc16>(object); | 896 SerializeString_<false, uc16>(object); |
897 } | 897 } |
898 } | 898 } |
899 } | 899 } |
900 | 900 |
901 } } // namespace v8::internal | 901 } } // namespace v8::internal |
902 | 902 |
903 #endif // V8_JSON_STRINGIFIER_H_ | 903 #endif // V8_JSON_STRINGIFIER_H_ |
OLD | NEW |