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 14 matching lines...) Expand all Loading... | |
25 } | 25 } |
26 | 26 |
27 static const int kEndOfString = -1; | 27 static const int kEndOfString = -1; |
28 | 28 |
29 private: | 29 private: |
30 explicit JsonParser(Handle<String> source) | 30 explicit JsonParser(Handle<String> source) |
31 : source_(source), | 31 : source_(source), |
32 source_length_(source->length()), | 32 source_length_(source->length()), |
33 isolate_(source->map()->GetHeap()->isolate()), | 33 isolate_(source->map()->GetHeap()->isolate()), |
34 factory_(isolate_->factory()), | 34 factory_(isolate_->factory()), |
35 zone_(isolate_), | 35 zone_(), |
Michael Starzinger
2015/01/23 14:21:11
nit: Explicit initializer call could be dropped.
danno
2015/01/23 14:45:20
Done.
| |
36 object_constructor_(isolate_->native_context()->object_function(), | 36 object_constructor_(isolate_->native_context()->object_function(), |
37 isolate_), | 37 isolate_), |
38 position_(-1) { | 38 position_(-1) { |
39 source_ = String::Flatten(source_); | 39 source_ = String::Flatten(source_); |
40 pretenure_ = (source_length_ >= kPretenureTreshold) ? TENURED : NOT_TENURED; | 40 pretenure_ = (source_length_ >= kPretenureTreshold) ? TENURED : NOT_TENURED; |
41 | 41 |
42 // Optimized fast case where we only have Latin1 characters. | 42 // Optimized fast case where we only have Latin1 characters. |
43 if (seq_one_byte) { | 43 if (seq_one_byte) { |
44 seq_source_ = Handle<SeqOneByteString>::cast(source_); | 44 seq_source_ = Handle<SeqOneByteString>::cast(source_); |
45 } | 45 } |
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
811 | 811 |
812 DCHECK_EQ('"', c0_); | 812 DCHECK_EQ('"', c0_); |
813 // Advance past the last '"'. | 813 // Advance past the last '"'. |
814 AdvanceSkipWhitespace(); | 814 AdvanceSkipWhitespace(); |
815 return result; | 815 return result; |
816 } | 816 } |
817 | 817 |
818 } } // namespace v8::internal | 818 } } // namespace v8::internal |
819 | 819 |
820 #endif // V8_JSON_PARSER_H_ | 820 #endif // V8_JSON_PARSER_H_ |
OLD | NEW |