OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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_SAFEPOINT_TABLE_H_ | 5 #ifndef V8_SAFEPOINT_TABLE_H_ |
6 #define V8_SAFEPOINT_TABLE_H_ | 6 #define V8_SAFEPOINT_TABLE_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/heap/heap.h" | 9 #include "src/heap/heap.h" |
10 #include "src/v8memory.h" | 10 #include "src/v8memory.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 SafepointEntry GetEntry(unsigned index) const { | 97 SafepointEntry GetEntry(unsigned index) const { |
98 DCHECK(index < length_); | 98 DCHECK(index < length_); |
99 unsigned info = Memory::uint32_at(GetInfoLocation(index)); | 99 unsigned info = Memory::uint32_at(GetInfoLocation(index)); |
100 uint8_t* bits = &Memory::uint8_at(entries_ + (index * entry_size_)); | 100 uint8_t* bits = &Memory::uint8_at(entries_ + (index * entry_size_)); |
101 return SafepointEntry(info, bits); | 101 return SafepointEntry(info, bits); |
102 } | 102 } |
103 | 103 |
104 // Returns the entry for the given pc. | 104 // Returns the entry for the given pc. |
105 SafepointEntry FindEntry(Address pc) const; | 105 SafepointEntry FindEntry(Address pc) const; |
106 | 106 |
107 void PrintEntry(unsigned index, OStream& os) const; // NOLINT | 107 void PrintEntry(unsigned index, std::ostream& os) const; // NOLINT |
108 | 108 |
109 private: | 109 private: |
110 static const uint8_t kNoRegisters = 0xFF; | 110 static const uint8_t kNoRegisters = 0xFF; |
111 | 111 |
112 static const int kLengthOffset = 0; | 112 static const int kLengthOffset = 0; |
113 static const int kEntrySizeOffset = kLengthOffset + kIntSize; | 113 static const int kEntrySizeOffset = kLengthOffset + kIntSize; |
114 static const int kHeaderSize = kEntrySizeOffset + kIntSize; | 114 static const int kHeaderSize = kEntrySizeOffset + kIntSize; |
115 | 115 |
116 static const int kPcSize = kIntSize; | 116 static const int kPcSize = kIntSize; |
117 static const int kDeoptimizationIndexSize = kIntSize; | 117 static const int kDeoptimizationIndexSize = kIntSize; |
118 static const int kPcAndDeoptimizationIndexSize = | 118 static const int kPcAndDeoptimizationIndexSize = |
119 kPcSize + kDeoptimizationIndexSize; | 119 kPcSize + kDeoptimizationIndexSize; |
120 | 120 |
121 Address GetPcOffsetLocation(unsigned index) const { | 121 Address GetPcOffsetLocation(unsigned index) const { |
122 return pc_and_deoptimization_indexes_ + | 122 return pc_and_deoptimization_indexes_ + |
123 (index * kPcAndDeoptimizationIndexSize); | 123 (index * kPcAndDeoptimizationIndexSize); |
124 } | 124 } |
125 | 125 |
126 Address GetInfoLocation(unsigned index) const { | 126 Address GetInfoLocation(unsigned index) const { |
127 return GetPcOffsetLocation(index) + kPcSize; | 127 return GetPcOffsetLocation(index) + kPcSize; |
128 } | 128 } |
129 | 129 |
130 static void PrintBits(OStream& os, // NOLINT | 130 static void PrintBits(std::ostream& os, // NOLINT |
131 uint8_t byte, int digits); | 131 uint8_t byte, int digits); |
132 | 132 |
133 DisallowHeapAllocation no_allocation_; | 133 DisallowHeapAllocation no_allocation_; |
134 Code* code_; | 134 Code* code_; |
135 unsigned length_; | 135 unsigned length_; |
136 unsigned entry_size_; | 136 unsigned entry_size_; |
137 | 137 |
138 Address pc_and_deoptimization_indexes_; | 138 Address pc_and_deoptimization_indexes_; |
139 Address entries_; | 139 Address entries_; |
140 | 140 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 int last_lazy_safepoint_; | 226 int last_lazy_safepoint_; |
227 | 227 |
228 Zone* zone_; | 228 Zone* zone_; |
229 | 229 |
230 DISALLOW_COPY_AND_ASSIGN(SafepointTableBuilder); | 230 DISALLOW_COPY_AND_ASSIGN(SafepointTableBuilder); |
231 }; | 231 }; |
232 | 232 |
233 } } // namespace v8::internal | 233 } } // namespace v8::internal |
234 | 234 |
235 #endif // V8_SAFEPOINT_TABLE_H_ | 235 #endif // V8_SAFEPOINT_TABLE_H_ |
OLD | NEW |