OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 7936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7947 // not always desirable, however (esp. in debugging situations). | 7947 // not always desirable, however (esp. in debugging situations). |
7948 class StringInputBuffer: public unibrow::InputBuffer<String, String*, 1024> { | 7948 class StringInputBuffer: public unibrow::InputBuffer<String, String*, 1024> { |
7949 public: | 7949 public: |
7950 virtual void Seek(unsigned pos); | 7950 virtual void Seek(unsigned pos); |
7951 inline StringInputBuffer(): unibrow::InputBuffer<String, String*, 1024>() {} | 7951 inline StringInputBuffer(): unibrow::InputBuffer<String, String*, 1024>() {} |
7952 explicit inline StringInputBuffer(String* backing): | 7952 explicit inline StringInputBuffer(String* backing): |
7953 unibrow::InputBuffer<String, String*, 1024>(backing) {} | 7953 unibrow::InputBuffer<String, String*, 1024>(backing) {} |
7954 }; | 7954 }; |
7955 | 7955 |
7956 | 7956 |
7957 class SafeStringInputBuffer | |
7958 : public unibrow::InputBuffer<String, String**, 256> { | |
7959 public: | |
7960 virtual void Seek(unsigned pos); | |
7961 inline SafeStringInputBuffer() | |
7962 : unibrow::InputBuffer<String, String**, 256>() {} | |
7963 explicit inline SafeStringInputBuffer(String** backing) | |
7964 : unibrow::InputBuffer<String, String**, 256>(backing) {} | |
7965 }; | |
7966 | |
7967 | |
7968 template <typename T> | 7957 template <typename T> |
7969 class VectorIterator { | 7958 class VectorIterator { |
7970 public: | 7959 public: |
7971 VectorIterator(T* d, int l) : data_(Vector<const T>(d, l)), index_(0) { } | 7960 VectorIterator(T* d, int l) : data_(Vector<const T>(d, l)), index_(0) { } |
7972 explicit VectorIterator(Vector<const T> data) : data_(data), index_(0) { } | 7961 explicit VectorIterator(Vector<const T> data) : data_(data), index_(0) { } |
7973 T GetNext() { return data_[index_++]; } | 7962 T GetNext() { return data_[index_++]; } |
7974 bool has_more() { return index_ < data_.length(); } | 7963 bool has_more() { return index_ < data_.length(); } |
7975 private: | 7964 private: |
7976 Vector<const T> data_; | 7965 Vector<const T> data_; |
7977 int index_; | 7966 int index_; |
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9007 } else { | 8996 } else { |
9008 value &= ~(1 << bit_position); | 8997 value &= ~(1 << bit_position); |
9009 } | 8998 } |
9010 return value; | 8999 return value; |
9011 } | 9000 } |
9012 }; | 9001 }; |
9013 | 9002 |
9014 } } // namespace v8::internal | 9003 } } // namespace v8::internal |
9015 | 9004 |
9016 #endif // V8_OBJECTS_H_ | 9005 #endif // V8_OBJECTS_H_ |
OLD | NEW |