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
activate correct semantics for inheriting readonliness false
void DefinePointerSlot(int index, Zone *zone)
int argument_count() const
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 use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra 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 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if NULL
static uint32_t & uint32_at(Address addr)
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 use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra code(assertions) for debugging") DEFINE_bool(code_comments
bool Equals(const SafepointEntry &other) const
SafepointTableBuilder(Zone *zone)