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