| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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_PARSER_H_ | 5 #ifndef V8_JSON_PARSER_H_ |
| 6 #define V8_JSON_PARSER_H_ | 6 #define V8_JSON_PARSER_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/char-predicates-inl.h" | 10 #include "src/char-predicates-inl.h" |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 // Parse any JSON value. | 255 // Parse any JSON value. |
| 256 template <bool seq_one_byte> | 256 template <bool seq_one_byte> |
| 257 Handle<Object> JsonParser<seq_one_byte>::ParseJsonValue() { | 257 Handle<Object> JsonParser<seq_one_byte>::ParseJsonValue() { |
| 258 StackLimitCheck stack_check(isolate_); | 258 StackLimitCheck stack_check(isolate_); |
| 259 if (stack_check.HasOverflowed()) { | 259 if (stack_check.HasOverflowed()) { |
| 260 isolate_->StackOverflow(); | 260 isolate_->StackOverflow(); |
| 261 return Handle<Object>::null(); | 261 return Handle<Object>::null(); |
| 262 } | 262 } |
| 263 | 263 |
| 264 if (isolate_->stack_guard()->InterruptRequested()) { | 264 if (isolate_->stack_guard()->InterruptRequested()) { |
| 265 ExecutionAccess access(isolate_); |
| 265 // Avoid blocking GC in long running parser (v8:3974). | 266 // Avoid blocking GC in long running parser (v8:3974). |
| 266 isolate_->stack_guard()->CheckAndHandleGCInterrupt(); | 267 isolate_->stack_guard()->CheckAndHandleGCInterrupt(); |
| 267 } | 268 } |
| 268 | 269 |
| 269 if (c0_ == '"') return ParseJsonString(); | 270 if (c0_ == '"') return ParseJsonString(); |
| 270 if ((c0_ >= '0' && c0_ <= '9') || c0_ == '-') return ParseJsonNumber(); | 271 if ((c0_ >= '0' && c0_ <= '9') || c0_ == '-') return ParseJsonNumber(); |
| 271 if (c0_ == '{') return ParseJsonObject(); | 272 if (c0_ == '{') return ParseJsonObject(); |
| 272 if (c0_ == '[') return ParseJsonArray(); | 273 if (c0_ == '[') return ParseJsonArray(); |
| 273 if (c0_ == 'f') { | 274 if (c0_ == 'f') { |
| 274 if (AdvanceGetChar() == 'a' && AdvanceGetChar() == 'l' && | 275 if (AdvanceGetChar() == 'a' && AdvanceGetChar() == 'l' && |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 | 793 |
| 793 DCHECK_EQ('"', c0_); | 794 DCHECK_EQ('"', c0_); |
| 794 // Advance past the last '"'. | 795 // Advance past the last '"'. |
| 795 AdvanceSkipWhitespace(); | 796 AdvanceSkipWhitespace(); |
| 796 return result; | 797 return result; |
| 797 } | 798 } |
| 798 | 799 |
| 799 } } // namespace v8::internal | 800 } } // namespace v8::internal |
| 800 | 801 |
| 801 #endif // V8_JSON_PARSER_H_ | 802 #endif // V8_JSON_PARSER_H_ |
| OLD | NEW |