OLD | NEW |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |