Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(467)

Side by Side Diff: src/json-parser.h

Issue 1704353002: [runtime] Force internalize names used before lookup in in DescriptorArray and TransitionArray (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/heap-inl.h ('k') | src/lookup.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/char-predicates.h" 8 #include "src/char-predicates.h"
9 #include "src/conversions.h" 9 #include "src/conversions.h"
10 #include "src/debug/debug.h" 10 #include "src/debug/debug.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 position_ = position_ + length + 1; 121 position_ = position_ + length + 1;
122 AdvanceSkipWhitespace(); 122 AdvanceSkipWhitespace();
123 return true; 123 return true;
124 } 124 }
125 } 125 }
126 } 126 }
127 return false; 127 return false;
128 } 128 }
129 129
130 Handle<String> ParseJsonInternalizedString() { 130 Handle<String> ParseJsonInternalizedString() {
131 return ScanJsonString<true>(); 131 Handle<String> result = ScanJsonString<true>();
132 if (result.is_null()) return result;
133 return factory()->InternalizeString(result);
132 } 134 }
133 135
134 template <bool is_internalized> 136 template <bool is_internalized>
135 Handle<String> ScanJsonString(); 137 Handle<String> ScanJsonString();
136 // Creates a new string and copies prefix[start..end] into the beginning 138 // Creates a new string and copies prefix[start..end] into the beginning
137 // of it. Then scans the rest of the string, adding characters after the 139 // of it. Then scans the rest of the string, adding characters after the
138 // prefix. Called by ScanJsonString when reaching a '\' or non-Latin1 char. 140 // prefix. Called by ScanJsonString when reaching a '\' or non-Latin1 char.
139 template <typename StringType, typename SinkChar> 141 template <typename StringType, typename SinkChar>
140 Handle<String> SlowScanJsonString(Handle<String> prefix, int start, int end); 142 Handle<String> SlowScanJsonString(Handle<String> prefix, int start, int end);
141 143
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 DCHECK_EQ('"', c0_); 837 DCHECK_EQ('"', c0_);
836 // Advance past the last '"'. 838 // Advance past the last '"'.
837 AdvanceSkipWhitespace(); 839 AdvanceSkipWhitespace();
838 return result; 840 return result;
839 } 841 }
840 842
841 } // namespace internal 843 } // namespace internal
842 } // namespace v8 844 } // namespace v8
843 845
844 #endif // V8_JSON_PARSER_H_ 846 #endif // V8_JSON_PARSER_H_
OLDNEW
« no previous file with comments | « src/heap/heap-inl.h ('k') | src/lookup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698