| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_OBJECT_H_ | 5 #ifndef VM_OBJECT_H_ |
| 6 #define VM_OBJECT_H_ | 6 #define VM_OBJECT_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "platform/utils.h" | 10 #include "platform/utils.h" |
| (...skipping 1764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1775 ASSERT(sizeof(RawTokenStream) == OFFSET_OF(RawTokenStream, data_)); | 1775 ASSERT(sizeof(RawTokenStream) == OFFSET_OF(RawTokenStream, data_)); |
| 1776 return 0; | 1776 return 0; |
| 1777 } | 1777 } |
| 1778 static intptr_t InstanceSize(intptr_t len) { | 1778 static intptr_t InstanceSize(intptr_t len) { |
| 1779 ASSERT(0 <= len && len <= kMaxElements); | 1779 ASSERT(0 <= len && len <= kMaxElements); |
| 1780 return RoundedAllocationSize( | 1780 return RoundedAllocationSize( |
| 1781 sizeof(RawTokenStream) + (len * kBytesPerElement)); | 1781 sizeof(RawTokenStream) + (len * kBytesPerElement)); |
| 1782 } | 1782 } |
| 1783 | 1783 |
| 1784 static RawTokenStream* New(intptr_t length); | 1784 static RawTokenStream* New(intptr_t length); |
| 1785 static RawTokenStream* New(const Scanner::GrowableTokenStream& tokens); | 1785 static RawTokenStream* New(const Scanner::GrowableTokenStream& tokens, |
| 1786 const String& private_key); |
| 1786 | 1787 |
| 1787 // The class Iterator encapsulates iteration over the tokens | 1788 // The class Iterator encapsulates iteration over the tokens |
| 1788 // in a TokenStream object. | 1789 // in a TokenStream object. |
| 1789 class Iterator : ValueObject { | 1790 class Iterator : ValueObject { |
| 1790 public: | 1791 public: |
| 1791 Iterator(const TokenStream& tokens, intptr_t token_pos); | 1792 Iterator(const TokenStream& tokens, intptr_t token_pos); |
| 1792 | 1793 |
| 1793 bool IsValid() const; | 1794 bool IsValid() const; |
| 1794 | 1795 |
| 1795 inline Token::Kind CurrentTokenKind() const { | 1796 inline Token::Kind CurrentTokenKind() const { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1818 Object& obj_; | 1819 Object& obj_; |
| 1819 intptr_t cur_token_pos_; | 1820 intptr_t cur_token_pos_; |
| 1820 intptr_t stream_token_pos_; | 1821 intptr_t stream_token_pos_; |
| 1821 Token::Kind cur_token_kind_; | 1822 Token::Kind cur_token_kind_; |
| 1822 intptr_t cur_token_obj_index_; | 1823 intptr_t cur_token_obj_index_; |
| 1823 }; | 1824 }; |
| 1824 | 1825 |
| 1825 private: | 1826 private: |
| 1826 void SetLength(intptr_t value) const; | 1827 void SetLength(intptr_t value) const; |
| 1827 | 1828 |
| 1829 RawString* PrivateKey() const; |
| 1830 void SetPrivateKey(const String& value) const; |
| 1831 |
| 1828 uint8_t* EntryAddr(intptr_t token_pos) const { | 1832 uint8_t* EntryAddr(intptr_t token_pos) const { |
| 1829 ASSERT((token_pos >=0) && (token_pos < Length())); | 1833 ASSERT((token_pos >=0) && (token_pos < Length())); |
| 1830 return &raw_ptr()->data_[token_pos]; | 1834 return &raw_ptr()->data_[token_pos]; |
| 1831 } | 1835 } |
| 1832 | 1836 |
| 1833 HEAP_OBJECT_IMPLEMENTATION(TokenStream, Object); | 1837 HEAP_OBJECT_IMPLEMENTATION(TokenStream, Object); |
| 1834 friend class Class; | 1838 friend class Class; |
| 1835 }; | 1839 }; |
| 1836 | 1840 |
| 1837 | 1841 |
| (...skipping 3611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5449 if (this->CharAt(i) != str.CharAt(begin_index + i)) { | 5453 if (this->CharAt(i) != str.CharAt(begin_index + i)) { |
| 5450 return false; | 5454 return false; |
| 5451 } | 5455 } |
| 5452 } | 5456 } |
| 5453 return true; | 5457 return true; |
| 5454 } | 5458 } |
| 5455 | 5459 |
| 5456 } // namespace dart | 5460 } // namespace dart |
| 5457 | 5461 |
| 5458 #endif // VM_OBJECT_H_ | 5462 #endif // VM_OBJECT_H_ |
| OLD | NEW |