28 #ifndef V8_ARM_LITHIUM_CODEGEN_ARM_H_
29 #define V8_ARM_LITHIUM_CODEGEN_ARM_H_
45 class SafepointGenerator;
50 : LCodeGenBase(chunk, assembler, info),
51 deoptimizations_(4, info->zone()),
52 deopt_jump_table_(4, info->zone()),
53 deoptimization_literals_(8, info->zone()),
54 inlined_function_count_(0),
55 scope_(info->scope()),
56 translations_(info->zone()),
57 deferred_(8, info->zone()),
59 frame_is_built_(
false),
60 safepoints_(info->zone()),
62 expected_safepoint_kind_(Safepoint::kSimple) {
63 PopulateDeoptimizationLiteralsWithInlinedFunctions();
68 return chunk()->LookupDestination(block_id);
76 return GetStackSlotCount() > 0 ||
77 info()->is_non_deferred_calling() ||
79 info()->requires_frame();
105 Smi*
ToSmi(LConstantOperand* op)
const;
106 double ToDouble(LConstantOperand* op)
const;
113 bool IsSmi(LConstantOperand* op)
const;
151 bool key_is_constant,
155 int additional_index,
156 int additional_offset);
162 #define DECLARE_DO(type) void Do##type(L##type* node);
169 Scope* scope()
const {
return scope_; }
171 Register scratch0() {
return r9; }
174 LInstruction* GetNextInstruction();
176 void EmitClassOfTest(Label* if_true,
178 Handle<String> class_name,
181 Register temporary2);
183 int GetStackSlotCount()
const {
return chunk()->spill_slot_count(); }
189 void SaveCallerDoubles();
190 void RestoreCallerDoubles();
194 void GenerateBodyInstructionPre(LInstruction* instr)
V8_OVERRIDE;
195 bool GeneratePrologue();
196 bool GenerateDeferredCode();
197 bool GenerateDeoptJumpTable();
198 bool GenerateSafepointTable();
201 void GenerateOsrPrologue();
204 RECORD_SIMPLE_SAFEPOINT,
205 RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS
210 RelocInfo::Mode
mode,
214 void CallCodeGeneric(
216 RelocInfo::Mode
mode,
218 SafepointMode safepoint_mode,
221 void CallRuntime(
const Runtime::Function*
function,
228 LInstruction* instr) {
230 CallRuntime(
function, num_arguments, instr);
233 void LoadContextFromDeferred(LOperand* context);
246 void CallKnownFunction(Handle<JSFunction>
function,
252 void RecordSafepointWithLazyDeopt(LInstruction* instr,
253 SafepointMode safepoint_mode);
255 void RegisterEnvironmentForDeoptimization(
LEnvironment* environment,
256 Safepoint::DeoptMode
mode);
264 Translation* translation,
268 int* object_index_pointer,
269 int* dematerialized_index_pointer);
270 void PopulateDeoptimizationData(Handle<Code> code);
271 int DefineDeoptimizationLiteral(Handle<Object> literal);
273 void PopulateDeoptimizationLiteralsWithInlinedFunctions();
278 MemOperand BuildSeqStringOperand(Register
string,
282 void EmitIntegerMathAbs(LMathAbs* instr);
285 void RecordSafepoint(LPointerMap* pointers,
286 Safepoint::Kind kind,
288 Safepoint::DeoptMode
mode);
289 void RecordSafepoint(LPointerMap* pointers, Safepoint::DeoptMode
mode);
290 void RecordSafepoint(Safepoint::DeoptMode
mode);
291 void RecordSafepointWithRegisters(LPointerMap* pointers,
293 Safepoint::DeoptMode
mode);
294 void RecordSafepointWithRegistersAndDoubles(LPointerMap* pointers,
296 Safepoint::DeoptMode
mode);
298 void RecordAndWritePosition(
int position)
V8_OVERRIDE;
301 void EmitGoto(
int block);
304 template<
class InstrType>
305 void EmitBranch(InstrType instr,
Condition condition);
306 template<
class InstrType>
307 void EmitFalseBranch(InstrType instr,
Condition condition);
308 void EmitNumberUntagD(Register input,
309 DwVfpRegister result,
310 bool allow_undefined_as_nan,
311 bool deoptimize_on_minus_zero,
318 Condition EmitTypeofIs(Label* true_label,
321 Handle<String> type_name);
328 Label* is_not_object,
336 Label* is_not_string,
341 void EmitIsConstructCall(Register temp1, Register temp2);
345 void EmitDeepCopy(Handle<JSObject>
object,
351 void EnsureSpaceForLazyDeopt(
int space_needed)
V8_OVERRIDE;
352 void DoLoadKeyedExternalArray(LLoadKeyed* instr);
353 void DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr);
354 void DoLoadKeyedFixedArray(LLoadKeyed* instr);
355 void DoStoreKeyedExternalArray(LStoreKeyed* instr);
356 void DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr);
357 void DoStoreKeyedFixedArray(LStoreKeyed* instr);
359 ZoneList<LEnvironment*> deoptimizations_;
360 ZoneList<Deoptimizer::JumpTableEntry> deopt_jump_table_;
361 ZoneList<Handle<Object> > deoptimization_literals_;
362 int inlined_function_count_;
364 TranslationBuffer translations_;
365 ZoneList<LDeferredCode*> deferred_;
367 bool frame_is_built_;
371 SafepointTableBuilder safepoints_;
376 Safepoint::Kind expected_safepoint_kind_;
380 PushSafepointRegistersScope(
LCodeGen* codegen,
381 Safepoint::Kind kind)
382 : codegen_(codegen) {
383 ASSERT(codegen_->info()->is_calling());
384 ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple);
385 codegen_->expected_safepoint_kind_ = kind;
387 switch (codegen_->expected_safepoint_kind_) {
388 case Safepoint::kWithRegisters:
389 codegen_->masm_->PushSafepointRegisters();
391 case Safepoint::kWithRegistersAndDoubles:
392 codegen_->masm_->PushSafepointRegistersAndDoubles();
399 ~PushSafepointRegistersScope() {
400 Safepoint::Kind kind = codegen_->expected_safepoint_kind_;
401 ASSERT((kind & Safepoint::kWithRegisters) != 0);
403 case Safepoint::kWithRegisters:
404 codegen_->masm_->PopSafepointRegisters();
406 case Safepoint::kWithRegistersAndDoubles:
407 codegen_->masm_->PopSafepointRegistersAndDoubles();
412 codegen_->expected_safepoint_kind_ = Safepoint::kSimple;
430 external_exit_(
NULL),
431 instruction_index_(codegen->current_instruction_) {
432 codegen->AddDeferredCode(
this);
441 Label*
exit() {
return external_exit_ !=
NULL ? external_exit_ : &exit_; }
452 Label* external_exit_;
453 int instruction_index_;
458 #endif // V8_ARM_LITHIUM_CODEGEN_ARM_H_
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter NULL
void FinishCode(Handle< Code > code)
MemOperand ToHighMemOperand(LOperand *op) const
void DoDeferredStringCharFromCode(LStringCharFromCode *instr)
void DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal *instr, Label *map_check)
void SetExit(Label *exit)
Smi * ToSmi(LConstantOperand *op) const
bool NeedsEagerFrame() const
Register EmitLoadRegister(LOperand *op, Register scratch)
bool IsSmi(LConstantOperand *op) const
LDeferredCode(LCodeGen *codegen)
static const Function * FunctionForId(FunctionId id)
void DoDeferredMathAbsTaggedHeapNumber(LMathAbs *instr)
#define ASSERT(condition)
void DoDeferredStringCharCodeAt(LStringCharCodeAt *instr)
LCodeGen * codegen() const
MacroAssembler * masm() const
int instruction_index() const
#define LITHIUM_CONCRETE_INSTRUCTION_LIST(V)
void DoDeferredStackCheck(LStackCheck *instr)
DwVfpRegister EmitLoadDoubleRegister(LOperand *op, SwVfpRegister flt_scratch, DwVfpRegister dbl_scratch)
int LookupDestination(int block_id) const
Operand ToOperand(LOperand *op)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization 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 VFP3 instructions if available enable use of NEON instructions if 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 d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long mode(MIPS only)") DEFINE_string(expose_natives_as
friend class LEnvironment
void DoDeferredNumberTagD(LNumberTagD *instr)
void check(i::Vector< const uint8_t > string)
#define kScratchDoubleReg
DwVfpRegister ToDoubleRegister(LOperand *op) const
void DoDeferredAllocate(LAllocate *instr)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra code(assertions) for debugging") DEFINE_bool(code_comments
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
int32_t ToInteger32(LConstantOperand *op) const
bool IsInteger32(LConstantOperand *op) const
Handle< Object > ToHandle(LConstantOperand *op) const
void DoDeferredInstanceMigration(LCheckMaps *instr, Register object)
void DoParallelMove(LParallelMove *move)
double ToDouble(LConstantOperand *op) const
bool NeedsDeferredFrame() const
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function info
void WriteTranslation(LEnvironment *environment, Translation *translation)
virtual LInstruction * instr()=0
LinkRegisterStatus GetLinkRegisterState() const
int32_t ToRepresentation(LConstantOperand *op, const Representation &r) const
MemOperand PrepareKeyedOperand(Register key, Register base, bool key_is_constant, int constant_key, int element_size, int shift_size, int additional_index, int additional_offset)
kInstanceClassNameOffset kNeedsAccessCheckBit kRemovePrototypeBit kIsExpressionBit kAllowLazyCompilation kUsesArguments formal_parameter_count
virtual void Generate()=0
Register ToRegister(LOperand *op) const
void DoDeferredTaggedToI(LTaggedToI *instr)
void DoDeferredNumberTagIU(LInstruction *instr, LOperand *value, LOperand *temp1, LOperand *temp2, IntegerSignedness signedness)
MemOperand ToMemOperand(LOperand *op) const
bool IsNextEmittedBlock(int block_id) const
LCodeGen(LChunk *chunk, MacroAssembler *assembler, CompilationInfo *info)
friend class SafepointGenerator
friend class LGapResolver
friend class LDeferredCode