28 #ifndef V8_SAFEPOINT_TABLE_H_
29 #define V8_SAFEPOINT_TABLE_H_
51 bool Equals(
const SafepointEntry& other)
const {
52 return info_ == other.info_ && bits_ == other.bits_;
62 return DeoptimizationIndexField::decode(info_);
65 static const int kArgumentsFieldBits = 3;
66 static const int kSaveDoublesFieldBits = 1;
67 static const int kDeoptIndexBits =
68 32 - kArgumentsFieldBits - kSaveDoublesFieldBits;
70 public BitField<int, 0, kDeoptIndexBits> {};
74 kArgumentsFieldBits> {};
77 kDeoptIndexBits + kArgumentsFieldBits,
78 kSaveDoublesFieldBits> { };
82 return ArgumentsField::decode(info_);
87 return SaveDoublesField::decode(info_);
95 bool HasRegisters()
const;
96 bool HasRegisterAt(
int reg_index)
const;
106 explicit SafepointTable(Code* code);
110 (length_ * (kPcAndDeoptimizationIndexSize + entry_size_)); }
111 unsigned length()
const {
return length_; }
123 return SafepointEntry(info, bits);
127 SafepointEntry FindEntry(
Address pc)
const;
129 void PrintEntry(
unsigned index)
const;
132 static const uint8_t kNoRegisters = 0xFF;
134 static const int kLengthOffset = 0;
135 static const int kEntrySizeOffset = kLengthOffset +
kIntSize;
136 static const int kHeaderSize = kEntrySizeOffset +
kIntSize;
138 static const int kPcSize =
kIntSize;
139 static const int kDeoptimizationIndexSize =
kIntSize;
140 static const int kPcAndDeoptimizationIndexSize =
141 kPcSize + kDeoptimizationIndexSize;
143 Address GetPcOffsetLocation(
unsigned index)
const {
144 return pc_and_deoptimization_indexes_ +
145 (index * kPcAndDeoptimizationIndexSize);
148 Address GetInfoLocation(
unsigned index)
const {
149 return GetPcOffsetLocation(index) + kPcSize;
152 static void PrintBits(uint8_t
byte,
int digits);
154 AssertNoAllocation no_allocation_;
157 unsigned entry_size_;
159 Address pc_and_deoptimization_indexes_;
162 friend class SafepointTableBuilder;
163 friend class SafepointEntry;
173 kWithRegisters = 1 << 0,
174 kWithDoubles = 1 << 1,
175 kWithRegistersAndDoubles = kWithRegisters | kWithDoubles
183 static const int kNoDeoptimizationIndex =
184 (1 << (SafepointEntry::kDeoptIndexBits)) - 1;
191 indexes_(indexes), registers_(registers) { }
192 ZoneList<int>* indexes_;
193 ZoneList<int>* registers_;
195 friend class SafepointTableBuilder;
202 : deoptimization_info_(32, zone),
203 deopt_index_list_(32, zone),
205 registers_(32, zone),
207 last_lazy_safepoint_(0),
211 unsigned GetCodeOffset()
const;
214 Safepoint DefineSafepoint(
Assembler* assembler,
215 Safepoint::Kind kind,
217 Safepoint::DeoptMode mode);
221 void RecordLazyDeoptimizationIndex(
int index);
225 void Emit(
Assembler* assembler,
int bits_per_entry);
229 struct DeoptimizationInfo {
235 uint32_t EncodeExceptPC(
const DeoptimizationInfo& info,
unsigned index);
237 ZoneList<DeoptimizationInfo> deoptimization_info_;
238 ZoneList<unsigned> deopt_index_list_;
239 ZoneList<ZoneList<int>*> indexes_;
240 ZoneList<ZoneList<int>*> registers_;
244 int last_lazy_safepoint_;
253 #endif // V8_SAFEPOINT_TABLE_H_
unsigned GetPcOffset(unsigned index) const
#define ASSERT(condition)
SafepointEntry GetEntry(unsigned index) const
static uint8_t & uint8_at(Address addr)
unsigned entry_size() const
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
SafepointEntry(unsigned info, uint8_t *bits)
int deoptimization_index() const
void DefinePointerSlot(int index, Zone *zone)
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination trace on stack replacement optimize closures functions with arguments object optimize functions containing for in loops profiler considers IC stability primitive functions trigger their own optimization re try self optimization if it failed insert an interrupt check at function exit execution budget before interrupt is triggered call count before self optimization self_optimization count_based_interrupts weighted_back_edges trace_opt emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 enable use of ARMv7 instructions if enable use of MIPS FPU instructions if NULL
int argument_count() const
static uint32_t & uint32_at(Address addr)
bool Equals(const SafepointEntry &other) const
SafepointTableBuilder(Zone *zone)