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

Side by Side Diff: src/objects.h

Issue 740673002: Do fewer encoding checks in FlatStringReader used in the JSON stringifier. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix windows build Created 6 years, 1 month 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/json-stringifier.h ('k') | src/objects-inl.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 9383 matching lines...) Expand 10 before | Expand all | Expand 10 after
9394 9394
9395 // A flat string reader provides random access to the contents of a 9395 // A flat string reader provides random access to the contents of a
9396 // string independent of the character width of the string. The handle 9396 // string independent of the character width of the string. The handle
9397 // must be valid as long as the reader is being used. 9397 // must be valid as long as the reader is being used.
9398 class FlatStringReader : public Relocatable { 9398 class FlatStringReader : public Relocatable {
9399 public: 9399 public:
9400 FlatStringReader(Isolate* isolate, Handle<String> str); 9400 FlatStringReader(Isolate* isolate, Handle<String> str);
9401 FlatStringReader(Isolate* isolate, Vector<const char> input); 9401 FlatStringReader(Isolate* isolate, Vector<const char> input);
9402 void PostGarbageCollection(); 9402 void PostGarbageCollection();
9403 inline uc32 Get(int index); 9403 inline uc32 Get(int index);
9404 template <typename Char>
9405 inline Char Get(int index);
9404 int length() { return length_; } 9406 int length() { return length_; }
9405 private: 9407 private:
9406 String** str_; 9408 String** str_;
9407 bool is_one_byte_; 9409 bool is_one_byte_;
9408 int length_; 9410 int length_;
9409 const void* start_; 9411 const void* start_;
9410 }; 9412 };
9411 9413
9412 9414
9413 // This maintains an off-stack representation of the stack frames required 9415 // This maintains an off-stack representation of the stack frames required
(...skipping 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after
10972 } else { 10974 } else {
10973 value &= ~(1 << bit_position); 10975 value &= ~(1 << bit_position);
10974 } 10976 }
10975 return value; 10977 return value;
10976 } 10978 }
10977 }; 10979 };
10978 10980
10979 } } // namespace v8::internal 10981 } } // namespace v8::internal
10980 10982
10981 #endif // V8_OBJECTS_H_ 10983 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/json-stringifier.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698