OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #include "src/json-parser.h" | 5 #include "src/json-parser.h" |
6 | 6 |
7 #include "src/char-predicates-inl.h" | 7 #include "src/char-predicates-inl.h" |
8 #include "src/conversions.h" | 8 #include "src/conversions.h" |
9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
10 #include "src/factory.h" | 10 #include "src/factory.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 MAYBE_RETURN(change_result, false); | 97 MAYBE_RETURN(change_result, false); |
98 return true; | 98 return true; |
99 } | 99 } |
100 | 100 |
101 template <bool seq_one_byte> | 101 template <bool seq_one_byte> |
102 JsonParser<seq_one_byte>::JsonParser(Isolate* isolate, Handle<String> source) | 102 JsonParser<seq_one_byte>::JsonParser(Isolate* isolate, Handle<String> source) |
103 : source_(source), | 103 : source_(source), |
104 source_length_(source->length()), | 104 source_length_(source->length()), |
105 isolate_(isolate), | 105 isolate_(isolate), |
106 factory_(isolate_->factory()), | 106 factory_(isolate_->factory()), |
107 zone_(isolate_->allocator()), | 107 zone_(isolate_->allocator(), ZONE_NAME), |
108 object_constructor_(isolate_->native_context()->object_function(), | 108 object_constructor_(isolate_->native_context()->object_function(), |
109 isolate_), | 109 isolate_), |
110 position_(-1) { | 110 position_(-1) { |
111 source_ = String::Flatten(source_); | 111 source_ = String::Flatten(source_); |
112 pretenure_ = (source_length_ >= kPretenureTreshold) ? TENURED : NOT_TENURED; | 112 pretenure_ = (source_length_ >= kPretenureTreshold) ? TENURED : NOT_TENURED; |
113 | 113 |
114 // Optimized fast case where we only have Latin1 characters. | 114 // Optimized fast case where we only have Latin1 characters. |
115 if (seq_one_byte) { | 115 if (seq_one_byte) { |
116 seq_source_ = Handle<SeqOneByteString>::cast(source_); | 116 seq_source_ = Handle<SeqOneByteString>::cast(source_); |
117 } | 117 } |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 AdvanceSkipWhitespace(); | 803 AdvanceSkipWhitespace(); |
804 return result; | 804 return result; |
805 } | 805 } |
806 | 806 |
807 // Explicit instantiation. | 807 // Explicit instantiation. |
808 template class JsonParser<true>; | 808 template class JsonParser<true>; |
809 template class JsonParser<false>; | 809 template class JsonParser<false>; |
810 | 810 |
811 } // namespace internal | 811 } // namespace internal |
812 } // namespace v8 | 812 } // namespace v8 |
OLD | NEW |