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

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

Issue 1123013002: Reduce the size of initial JSON string buffer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | no next file » | 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/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/char-predicates-inl.h" 10 #include "src/char-predicates-inl.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 // Mark that a parsing error has happened at the current token, and 173 // Mark that a parsing error has happened at the current token, and
174 // return a null handle. Primarily for readability. 174 // return a null handle. Primarily for readability.
175 inline Handle<Object> ReportUnexpectedCharacter() { 175 inline Handle<Object> ReportUnexpectedCharacter() {
176 return Handle<Object>::null(); 176 return Handle<Object>::null();
177 } 177 }
178 178
179 inline Isolate* isolate() { return isolate_; } 179 inline Isolate* isolate() { return isolate_; }
180 inline Factory* factory() { return factory_; } 180 inline Factory* factory() { return factory_; }
181 inline Handle<JSFunction> object_constructor() { return object_constructor_; } 181 inline Handle<JSFunction> object_constructor() { return object_constructor_; }
182 182
183 static const int kInitialSpecialStringLength = 1024; 183 static const int kInitialSpecialStringLength = 32;
184 static const int kPretenureTreshold = 100 * 1024; 184 static const int kPretenureTreshold = 100 * 1024;
185 185
186 186
187 private: 187 private:
188 Zone* zone() { return &zone_; } 188 Zone* zone() { return &zone_; }
189 189
190 void CommitStateToJsonObject(Handle<JSObject> json_object, Handle<Map> map, 190 void CommitStateToJsonObject(Handle<JSObject> json_object, Handle<Map> map,
191 ZoneList<Handle<Object> >* properties); 191 ZoneList<Handle<Object> >* properties);
192 192
193 Handle<String> source_; 193 Handle<String> source_;
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 840
841 DCHECK_EQ('"', c0_); 841 DCHECK_EQ('"', c0_);
842 // Advance past the last '"'. 842 // Advance past the last '"'.
843 AdvanceSkipWhitespace(); 843 AdvanceSkipWhitespace();
844 return result; 844 return result;
845 } 845 }
846 846
847 } } // namespace v8::internal 847 } } // namespace v8::internal
848 848
849 #endif // V8_JSON_PARSER_H_ 849 #endif // V8_JSON_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698