| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 "vm/assert.h" | 8 #include "vm/assert.h" |
| 9 #include "vm/dart.h" | 9 #include "vm/dart.h" |
| 10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
| (...skipping 1713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1724 public: | 1724 public: |
| 1725 enum Kind { | 1725 enum Kind { |
| 1726 kDeopt = 0, // Deoptimization cotinuation point. | 1726 kDeopt = 0, // Deoptimization cotinuation point. |
| 1727 kPatchCode, // Buffer for patching code entry. | 1727 kPatchCode, // Buffer for patching code entry. |
| 1728 kIcCall, // IC call. | 1728 kIcCall, // IC call. |
| 1729 kOther | 1729 kOther |
| 1730 }; | 1730 }; |
| 1731 | 1731 |
| 1732 intptr_t Length() const; | 1732 intptr_t Length() const; |
| 1733 | 1733 |
| 1734 intptr_t PC(intptr_t index) const; | 1734 uword PC(intptr_t index) const; |
| 1735 PcDescriptors::Kind DescriptorKind(intptr_t index) const; | 1735 PcDescriptors::Kind DescriptorKind(intptr_t index) const; |
| 1736 const char* KindAsStr(intptr_t index) const; | 1736 const char* KindAsStr(intptr_t index) const; |
| 1737 intptr_t NodeId(intptr_t index) const; | 1737 intptr_t NodeId(intptr_t index) const; |
| 1738 intptr_t TokenIndex(intptr_t index) const; | 1738 intptr_t TokenIndex(intptr_t index) const; |
| 1739 intptr_t TryIndex(intptr_t index) const; | 1739 intptr_t TryIndex(intptr_t index) const; |
| 1740 | 1740 |
| 1741 void AddDescriptor(intptr_t index, | 1741 void AddDescriptor(intptr_t index, |
| 1742 intptr_t pc, | 1742 uword pc, |
| 1743 PcDescriptors::Kind kind, | 1743 PcDescriptors::Kind kind, |
| 1744 intptr_t node_id, | 1744 intptr_t node_id, |
| 1745 intptr_t token_index, | 1745 intptr_t token_index, |
| 1746 intptr_t try_index) const { | 1746 intptr_t try_index) const { |
| 1747 SetPC(index, pc); | 1747 SetPC(index, pc); |
| 1748 SetKind(index, kind); | 1748 SetKind(index, kind); |
| 1749 SetNodeId(index, node_id); | 1749 SetNodeId(index, node_id); |
| 1750 SetTokenIndex(index, token_index); | 1750 SetTokenIndex(index, token_index); |
| 1751 SetTryIndex(index, try_index); | 1751 SetTryIndex(index, try_index); |
| 1752 } | 1752 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1771 kPcEntry = 0, // PC value of the descriptor, unique. | 1771 kPcEntry = 0, // PC value of the descriptor, unique. |
| 1772 kKindEntry, | 1772 kKindEntry, |
| 1773 kNodeIdEntry, // AST node id. | 1773 kNodeIdEntry, // AST node id. |
| 1774 kTokenIndexEntry, // Token position in source of PC. | 1774 kTokenIndexEntry, // Token position in source of PC. |
| 1775 kTryIndexEntry, // Try block index of PC. | 1775 kTryIndexEntry, // Try block index of PC. |
| 1776 // We would potentially be adding other objects here like | 1776 // We would potentially be adding other objects here like |
| 1777 // pointer maps for optimized functions, local variables information etc. | 1777 // pointer maps for optimized functions, local variables information etc. |
| 1778 kNumberOfEntries | 1778 kNumberOfEntries |
| 1779 }; | 1779 }; |
| 1780 | 1780 |
| 1781 void SetPC(intptr_t index, intptr_t value) const; | 1781 void SetPC(intptr_t index, uword value) const; |
| 1782 void SetKind(intptr_t index, PcDescriptors::Kind kind) const; | 1782 void SetKind(intptr_t index, PcDescriptors::Kind kind) const; |
| 1783 void SetNodeId(intptr_t index, intptr_t value) const; | 1783 void SetNodeId(intptr_t index, intptr_t value) const; |
| 1784 void SetTokenIndex(intptr_t index, intptr_t value) const; | 1784 void SetTokenIndex(intptr_t index, intptr_t value) const; |
| 1785 void SetTryIndex(intptr_t index, intptr_t value) const; | 1785 void SetTryIndex(intptr_t index, intptr_t value) const; |
| 1786 | 1786 |
| 1787 void SetLength(intptr_t value) const; | 1787 void SetLength(intptr_t value) const; |
| 1788 | 1788 |
| 1789 intptr_t* EntryAddr(intptr_t index, intptr_t entry_offset) const { | 1789 intptr_t* EntryAddr(intptr_t index, intptr_t entry_offset) const { |
| 1790 ASSERT((index >=0) && (index < Length())); | 1790 ASSERT((index >=0) && (index < Length())); |
| 1791 intptr_t data_index = (index * kNumberOfEntries) + entry_offset; | 1791 intptr_t data_index = (index * kNumberOfEntries) + entry_offset; |
| (...skipping 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3268 } | 3268 } |
| 3269 | 3269 |
| 3270 | 3270 |
| 3271 void Context::SetAt(intptr_t index, const Instance& value) const { | 3271 void Context::SetAt(intptr_t index, const Instance& value) const { |
| 3272 StorePointer(InstanceAddr(index), value.raw()); | 3272 StorePointer(InstanceAddr(index), value.raw()); |
| 3273 } | 3273 } |
| 3274 | 3274 |
| 3275 } // namespace dart | 3275 } // namespace dart |
| 3276 | 3276 |
| 3277 #endif // VM_OBJECT_H_ | 3277 #endif // VM_OBJECT_H_ |
| OLD | NEW |