| 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 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1588 public: | 1588 public: |
| 1589 inline intptr_t Length() const; | 1589 inline intptr_t Length() const; |
| 1590 | 1590 |
| 1591 inline Token::Kind KindAt(intptr_t index) const; | 1591 inline Token::Kind KindAt(intptr_t index) const; |
| 1592 | 1592 |
| 1593 void SetTokenAt(intptr_t index, Token::Kind kind, const String& literal); | 1593 void SetTokenAt(intptr_t index, Token::Kind kind, const String& literal); |
| 1594 void SetTokenAt(intptr_t index, const Object& token); | 1594 void SetTokenAt(intptr_t index, const Object& token); |
| 1595 | 1595 |
| 1596 RawObject* TokenAt(intptr_t index) const; | 1596 RawObject* TokenAt(intptr_t index) const; |
| 1597 RawString* LiteralAt(intptr_t index) const; | 1597 RawString* LiteralAt(intptr_t index) const; |
| 1598 RawString* GenerateSource() const; |
| 1598 | 1599 |
| 1599 static intptr_t InstanceSize() { | 1600 static intptr_t InstanceSize() { |
| 1600 ASSERT(sizeof(RawTokenStream) == OFFSET_OF(RawTokenStream, data_)); | 1601 ASSERT(sizeof(RawTokenStream) == OFFSET_OF(RawTokenStream, data_)); |
| 1601 return 0; | 1602 return 0; |
| 1602 } | 1603 } |
| 1603 static intptr_t InstanceSize(intptr_t len) { | 1604 static intptr_t InstanceSize(intptr_t len) { |
| 1604 return RoundedAllocationSize(sizeof(RawTokenStream) + (len * kWordSize)); | 1605 return RoundedAllocationSize(sizeof(RawTokenStream) + (len * kWordSize)); |
| 1605 } | 1606 } |
| 1606 static intptr_t StreamLength(intptr_t len) { | 1607 static intptr_t StreamLength(intptr_t len) { |
| 1607 return len; | 1608 return len; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1623 } | 1624 } |
| 1624 | 1625 |
| 1625 HEAP_OBJECT_IMPLEMENTATION(TokenStream, Object); | 1626 HEAP_OBJECT_IMPLEMENTATION(TokenStream, Object); |
| 1626 friend class Class; | 1627 friend class Class; |
| 1627 }; | 1628 }; |
| 1628 | 1629 |
| 1629 | 1630 |
| 1630 class Script : public Object { | 1631 class Script : public Object { |
| 1631 public: | 1632 public: |
| 1632 RawString* url() const { return raw_ptr()->url_; } | 1633 RawString* url() const { return raw_ptr()->url_; } |
| 1633 RawString* source() const { return raw_ptr()->source_; } | 1634 RawString* source() const; |
| 1634 RawScript::Kind kind() const { return raw_ptr()->kind_; } | 1635 RawScript::Kind kind() const { return raw_ptr()->kind_; } |
| 1635 | 1636 |
| 1636 RawTokenStream* tokens() const { return raw_ptr()->tokens_; } | 1637 RawTokenStream* tokens() const { return raw_ptr()->tokens_; } |
| 1637 | 1638 |
| 1638 void Tokenize(const String& private_key) const; | 1639 void Tokenize(const String& private_key) const; |
| 1639 | 1640 |
| 1640 RawString* GetLine(intptr_t line_number) const; | 1641 RawString* GetLine(intptr_t line_number) const; |
| 1641 | 1642 |
| 1642 RawString* GetSnippet(intptr_t from_line, | 1643 RawString* GetSnippet(intptr_t from_line, |
| 1643 intptr_t from_column, | 1644 intptr_t from_column, |
| (...skipping 3305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4949 } | 4950 } |
| 4950 | 4951 |
| 4951 | 4952 |
| 4952 intptr_t Stackmap::SizeInBits() const { | 4953 intptr_t Stackmap::SizeInBits() const { |
| 4953 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte); | 4954 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte); |
| 4954 } | 4955 } |
| 4955 | 4956 |
| 4956 } // namespace dart | 4957 } // namespace dart |
| 4957 | 4958 |
| 4958 #endif // VM_OBJECT_H_ | 4959 #endif // VM_OBJECT_H_ |
| OLD | NEW |