5 #ifndef V8_JSON_PARSER_H_ 6 #define V8_JSON_PARSER_H_ 8 #include "src/heap/factory.h" 9 #include "src/isolate.h" 10 #include "src/objects.h" 11 #include "src/zone/zone-containers.h" 16 enum ParseElementResult { kElementFound, kElementNotFound, kNullHandle };
26 : isolate_(isolate), reviver_(reviver) {}
38 template <
bool seq_one_byte>
44 ASSIGN_RETURN_ON_EXCEPTION(isolate, result,
46 if (reviver->IsCallable()) {
47 return JsonParseInternalizer::Internalize(isolate, result, reviver);
52 static const int kEndOfString = -1;
60 V8_INLINE
void Advance();
66 V8_INLINE
void AdvanceSkipWhitespace();
67 V8_INLINE
void SkipWhitespace();
68 V8_INLINE uc32 AdvanceGetChar();
72 V8_INLINE
bool MatchSkipWhiteSpace(uc32 c);
82 if (result.is_null())
return result;
83 return factory()->InternalizeString(result);
90 template <
typename StringType,
typename SinkChar>
132 inline Isolate* isolate() {
return isolate_; }
133 inline Factory* factory() {
return isolate_->factory(); }
136 static const int kInitialSpecialStringLength = 32;
137 static const int kPretenureTreshold = 100 * 1024;
140 Zone* zone() {
return &zone_; }
149 PretenureFlag pretenure_;
163 #endif // V8_JSON_PARSER_H_