Revision f230a1cf deps/v8/src/arm/lithium-codegen-arm.h
deps/v8/src/arm/lithium-codegen-arm.h | ||
---|---|---|
32 | 32 |
|
33 | 33 |
#include "arm/lithium-gap-resolver-arm.h" |
34 | 34 |
#include "deoptimizer.h" |
35 |
#include "lithium-codegen.h" |
|
35 | 36 |
#include "safepoint-table.h" |
36 | 37 |
#include "scopes.h" |
37 | 38 |
#include "v8utils.h" |
... | ... | |
43 | 44 |
class LDeferredCode; |
44 | 45 |
class SafepointGenerator; |
45 | 46 |
|
46 |
class LCodeGen V8_FINAL BASE_EMBEDDED {
|
|
47 |
class LCodeGen: public LCodeGenBase {
|
|
47 | 48 |
public: |
48 | 49 |
LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info) |
49 |
: zone_(info->zone()), |
|
50 |
chunk_(static_cast<LPlatformChunk*>(chunk)), |
|
51 |
masm_(assembler), |
|
52 |
info_(info), |
|
53 |
current_block_(-1), |
|
54 |
current_instruction_(-1), |
|
55 |
instructions_(chunk->instructions()), |
|
50 |
: LCodeGenBase(chunk, assembler, info), |
|
56 | 51 |
deoptimizations_(4, info->zone()), |
57 | 52 |
deopt_jump_table_(4, info->zone()), |
58 | 53 |
deoptimization_literals_(8, info->zone()), |
59 | 54 |
inlined_function_count_(0), |
60 | 55 |
scope_(info->scope()), |
61 |
status_(UNUSED), |
|
62 | 56 |
translations_(info->zone()), |
63 | 57 |
deferred_(8, info->zone()), |
64 | 58 |
osr_pc_offset_(-1), |
65 |
last_lazy_deopt_pc_(0), |
|
66 | 59 |
frame_is_built_(false), |
67 | 60 |
safepoints_(info->zone()), |
68 | 61 |
resolver_(this), |
69 |
expected_safepoint_kind_(Safepoint::kSimple), |
|
70 |
old_position_(RelocInfo::kNoPosition) { |
|
62 |
expected_safepoint_kind_(Safepoint::kSimple) { |
|
71 | 63 |
PopulateDeoptimizationLiteralsWithInlinedFunctions(); |
72 | 64 |
} |
73 | 65 |
|
74 | 66 |
|
75 |
// Simple accessors. |
|
76 |
MacroAssembler* masm() const { return masm_; } |
|
77 |
CompilationInfo* info() const { return info_; } |
|
78 |
Isolate* isolate() const { return info_->isolate(); } |
|
79 |
Factory* factory() const { return isolate()->factory(); } |
|
80 |
Heap* heap() const { return isolate()->heap(); } |
|
81 |
Zone* zone() const { return zone_; } |
|
82 |
|
|
83 | 67 |
int LookupDestination(int block_id) const { |
84 | 68 |
return chunk()->LookupDestination(block_id); |
85 | 69 |
} |
... | ... | |
178 | 162 |
#undef DECLARE_DO |
179 | 163 |
|
180 | 164 |
private: |
181 |
enum Status { |
|
182 |
UNUSED, |
|
183 |
GENERATING, |
|
184 |
DONE, |
|
185 |
ABORTED |
|
186 |
}; |
|
187 |
|
|
188 |
bool is_unused() const { return status_ == UNUSED; } |
|
189 |
bool is_generating() const { return status_ == GENERATING; } |
|
190 |
bool is_done() const { return status_ == DONE; } |
|
191 |
bool is_aborted() const { return status_ == ABORTED; } |
|
192 |
|
|
193 | 165 |
StrictModeFlag strict_mode_flag() const { |
194 | 166 |
return info()->is_classic_mode() ? kNonStrictMode : kStrictMode; |
195 | 167 |
} |
196 | 168 |
|
197 |
LPlatformChunk* chunk() const { return chunk_; } |
|
198 | 169 |
Scope* scope() const { return scope_; } |
199 |
HGraph* graph() const { return chunk()->graph(); } |
|
200 | 170 |
|
201 | 171 |
Register scratch0() { return r9; } |
202 | 172 |
LowDwVfpRegister double_scratch0() { return kScratchDoubleReg; } |
203 | 173 |
|
204 |
int GetNextEmittedBlock() const; |
|
205 | 174 |
LInstruction* GetNextInstruction(); |
206 | 175 |
|
207 | 176 |
void EmitClassOfTest(Label* if_true, |
... | ... | |
214 | 183 |
int GetStackSlotCount() const { return chunk()->spill_slot_count(); } |
215 | 184 |
|
216 | 185 |
void Abort(BailoutReason reason); |
217 |
void FPRINTF_CHECKING Comment(const char* format, ...); |
|
218 | 186 |
|
219 | 187 |
void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code, zone()); } |
220 | 188 |
|
221 | 189 |
// Code generation passes. Returns true if code generation should |
222 | 190 |
// continue. |
223 | 191 |
bool GeneratePrologue(); |
224 |
bool GenerateBody(); |
|
225 | 192 |
bool GenerateDeferredCode(); |
226 | 193 |
bool GenerateDeoptJumpTable(); |
227 | 194 |
bool GenerateSafepointTable(); |
... | ... | |
249 | 216 |
|
250 | 217 |
void CallRuntime(const Runtime::Function* function, |
251 | 218 |
int num_arguments, |
252 |
LInstruction* instr); |
|
219 |
LInstruction* instr, |
|
220 |
SaveFPRegsMode save_doubles = kDontSaveFPRegs); |
|
253 | 221 |
|
254 | 222 |
void CallRuntime(Runtime::FunctionId id, |
255 | 223 |
int num_arguments, |
... | ... | |
258 | 226 |
CallRuntime(function, num_arguments, instr); |
259 | 227 |
} |
260 | 228 |
|
229 |
void LoadContextFromDeferred(LOperand* context); |
|
261 | 230 |
void CallRuntimeFromDeferred(Runtime::FunctionId id, |
262 | 231 |
int argc, |
263 |
LInstruction* instr); |
|
232 |
LInstruction* instr, |
|
233 |
LOperand* context); |
|
264 | 234 |
|
265 | 235 |
enum R1State { |
266 | 236 |
R1_UNINITIALIZED, |
... | ... | |
276 | 246 |
CallKind call_kind, |
277 | 247 |
R1State r1_state); |
278 | 248 |
|
279 |
void LoadHeapObject(Register result, Handle<HeapObject> object); |
|
280 |
|
|
281 | 249 |
void RecordSafepointWithLazyDeopt(LInstruction* instr, |
282 | 250 |
SafepointMode safepoint_mode); |
283 | 251 |
|
... | ... | |
320 | 288 |
void RecordSafepointWithRegistersAndDoubles(LPointerMap* pointers, |
321 | 289 |
int arguments, |
322 | 290 |
Safepoint::DeoptMode mode); |
323 |
void RecordPosition(int position); |
|
324 |
void RecordAndUpdatePosition(int position);
|
|
291 |
|
|
292 |
void RecordAndWritePosition(int position) V8_OVERRIDE;
|
|
325 | 293 |
|
326 | 294 |
static Condition TokenToCondition(Token::Value op, bool is_unsigned); |
327 | 295 |
void EmitGoto(int block); |
... | ... | |
383 | 351 |
Register scratch, |
384 | 352 |
LEnvironment* environment); |
385 | 353 |
|
386 |
void EnsureSpaceForLazyDeopt();
|
|
354 |
void EnsureSpaceForLazyDeopt(int space_needed) V8_OVERRIDE;
|
|
387 | 355 |
void DoLoadKeyedExternalArray(LLoadKeyed* instr); |
388 | 356 |
void DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr); |
389 | 357 |
void DoLoadKeyedFixedArray(LLoadKeyed* instr); |
... | ... | |
391 | 359 |
void DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr); |
392 | 360 |
void DoStoreKeyedFixedArray(LStoreKeyed* instr); |
393 | 361 |
|
394 |
Zone* zone_; |
|
395 |
LPlatformChunk* const chunk_; |
|
396 |
MacroAssembler* const masm_; |
|
397 |
CompilationInfo* const info_; |
|
398 |
|
|
399 |
int current_block_; |
|
400 |
int current_instruction_; |
|
401 |
const ZoneList<LInstruction*>* instructions_; |
|
402 | 362 |
ZoneList<LEnvironment*> deoptimizations_; |
403 | 363 |
ZoneList<Deoptimizer::JumpTableEntry> deopt_jump_table_; |
404 | 364 |
ZoneList<Handle<Object> > deoptimization_literals_; |
405 | 365 |
int inlined_function_count_; |
406 | 366 |
Scope* const scope_; |
407 |
Status status_; |
|
408 | 367 |
TranslationBuffer translations_; |
409 | 368 |
ZoneList<LDeferredCode*> deferred_; |
410 | 369 |
int osr_pc_offset_; |
411 |
int last_lazy_deopt_pc_; |
|
412 | 370 |
bool frame_is_built_; |
413 | 371 |
|
414 | 372 |
// Builder that keeps track of safepoints in the code. The table |
... | ... | |
420 | 378 |
|
421 | 379 |
Safepoint::Kind expected_safepoint_kind_; |
422 | 380 |
|
423 |
int old_position_; |
|
424 |
|
|
425 | 381 |
class PushSafepointRegistersScope V8_FINAL BASE_EMBEDDED { |
426 | 382 |
public: |
427 | 383 |
PushSafepointRegistersScope(LCodeGen* codegen, |
Also available in: Unified diff