diff options
Diffstat (limited to 'deps/v8/src/ia32/lithium-codegen-ia32.h')
-rw-r--r-- | deps/v8/src/ia32/lithium-codegen-ia32.h | 69 |
1 files changed, 16 insertions, 53 deletions
diff --git a/deps/v8/src/ia32/lithium-codegen-ia32.h b/deps/v8/src/ia32/lithium-codegen-ia32.h index 769917f7e..78bc69de9 100644 --- a/deps/v8/src/ia32/lithium-codegen-ia32.h +++ b/deps/v8/src/ia32/lithium-codegen-ia32.h @@ -33,6 +33,7 @@ #include "checks.h" #include "deoptimizer.h" #include "ia32/lithium-gap-resolver-ia32.h" +#include "lithium-codegen.h" #include "safepoint-table.h" #include "scopes.h" #include "v8utils.h" @@ -45,45 +46,28 @@ class LDeferredCode; class LGapNode; class SafepointGenerator; -class LCodeGen V8_FINAL BASE_EMBEDDED { +class LCodeGen: public LCodeGenBase { public: LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info) - : zone_(info->zone()), - chunk_(static_cast<LPlatformChunk*>(chunk)), - masm_(assembler), - info_(info), - current_block_(-1), - current_instruction_(-1), - instructions_(chunk->instructions()), + : LCodeGenBase(chunk, assembler, info), deoptimizations_(4, info->zone()), jump_table_(4, info->zone()), deoptimization_literals_(8, info->zone()), inlined_function_count_(0), scope_(info->scope()), - status_(UNUSED), translations_(info->zone()), deferred_(8, info->zone()), dynamic_frame_alignment_(false), support_aligned_spilled_doubles_(false), osr_pc_offset_(-1), - last_lazy_deopt_pc_(0), frame_is_built_(false), x87_stack_(assembler), safepoints_(info->zone()), resolver_(this), - expected_safepoint_kind_(Safepoint::kSimple), - old_position_(RelocInfo::kNoPosition) { + expected_safepoint_kind_(Safepoint::kSimple) { PopulateDeoptimizationLiteralsWithInlinedFunctions(); } - // Simple accessors. - MacroAssembler* masm() const { return masm_; } - CompilationInfo* info() const { return info_; } - Isolate* isolate() const { return info_->isolate(); } - Factory* factory() const { return isolate()->factory(); } - Heap* heap() const { return isolate()->heap(); } - Zone* zone() const { return zone_; } - int LookupDestination(int block_id) const { return chunk()->LookupDestination(block_id); } @@ -129,12 +113,17 @@ class LCodeGen V8_FINAL BASE_EMBEDDED { X87Register left, X87Register right, X87Register result); void X87LoadForUsage(X87Register reg); + void X87LoadForUsage(X87Register reg1, X87Register reg2); void X87PrepareToWrite(X87Register reg) { x87_stack_.PrepareToWrite(reg); } void X87CommitWrite(X87Register reg) { x87_stack_.CommitWrite(reg); } void X87Fxch(X87Register reg, int other_slot = 0) { x87_stack_.Fxch(reg, other_slot); } + void X87Free(X87Register reg) { + x87_stack_.Free(reg); + } + bool X87StackEmpty() { return x87_stack_.depth() == 0; @@ -188,27 +177,13 @@ class LCodeGen V8_FINAL BASE_EMBEDDED { #undef DECLARE_DO private: - enum Status { - UNUSED, - GENERATING, - DONE, - ABORTED - }; - - bool is_unused() const { return status_ == UNUSED; } - bool is_generating() const { return status_ == GENERATING; } - bool is_done() const { return status_ == DONE; } - bool is_aborted() const { return status_ == ABORTED; } - StrictModeFlag strict_mode_flag() const { return info()->is_classic_mode() ? kNonStrictMode : kStrictMode; } - LPlatformChunk* chunk() const { return chunk_; } Scope* scope() const { return scope_; } - HGraph* graph() const { return chunk()->graph(); } - int GetNextEmittedBlock() const; + XMMRegister double_scratch0() const { return xmm0; } void EmitClassOfTest(Label* if_true, Label* if_false, @@ -220,14 +195,14 @@ class LCodeGen V8_FINAL BASE_EMBEDDED { int GetStackSlotCount() const { return chunk()->spill_slot_count(); } void Abort(BailoutReason reason); - void FPRINTF_CHECKING Comment(const char* format, ...); void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code, zone()); } // Code generation passes. Returns true if code generation should // continue. + void GenerateBodyInstructionPre(LInstruction* instr) V8_OVERRIDE; + void GenerateBodyInstructionPost(LInstruction* instr) V8_OVERRIDE; bool GeneratePrologue(); - bool GenerateBody(); bool GenerateDeferredCode(); bool GenerateJumpTable(); bool GenerateSafepointTable(); @@ -251,7 +226,8 @@ class LCodeGen V8_FINAL BASE_EMBEDDED { void CallRuntime(const Runtime::Function* fun, int argc, - LInstruction* instr); + LInstruction* instr, + SaveFPRegsMode save_doubles = kDontSaveFPRegs); void CallRuntime(Runtime::FunctionId id, int argc, @@ -331,9 +307,8 @@ class LCodeGen V8_FINAL BASE_EMBEDDED { void RecordSafepointWithRegisters(LPointerMap* pointers, int arguments, Safepoint::DeoptMode mode); - void RecordPosition(int position); - void RecordAndUpdatePosition(int position); + void RecordAndWritePosition(int position) V8_OVERRIDE; static Condition TokenToCondition(Token::Value op, bool is_unsigned); void EmitGoto(int block); @@ -395,7 +370,7 @@ class LCodeGen V8_FINAL BASE_EMBEDDED { int* offset, AllocationSiteMode mode); - void EnsureSpaceForLazyDeopt(); + void EnsureSpaceForLazyDeopt(int space_needed) V8_OVERRIDE; void DoLoadKeyedExternalArray(LLoadKeyed* instr); void DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr); void DoLoadKeyedFixedArray(LLoadKeyed* instr); @@ -425,26 +400,16 @@ class LCodeGen V8_FINAL BASE_EMBEDDED { void MakeSureStackPagesMapped(int offset); #endif - Zone* zone_; - LPlatformChunk* const chunk_; - MacroAssembler* const masm_; - CompilationInfo* const info_; - - int current_block_; - int current_instruction_; - const ZoneList<LInstruction*>* instructions_; ZoneList<LEnvironment*> deoptimizations_; ZoneList<Deoptimizer::JumpTableEntry> jump_table_; ZoneList<Handle<Object> > deoptimization_literals_; int inlined_function_count_; Scope* const scope_; - Status status_; TranslationBuffer translations_; ZoneList<LDeferredCode*> deferred_; bool dynamic_frame_alignment_; bool support_aligned_spilled_doubles_; int osr_pc_offset_; - int last_lazy_deopt_pc_; bool frame_is_built_; class X87Stack { @@ -505,8 +470,6 @@ class LCodeGen V8_FINAL BASE_EMBEDDED { Safepoint::Kind expected_safepoint_kind_; - int old_position_; - class PushSafepointRegistersScope V8_FINAL BASE_EMBEDDED { public: explicit PushSafepointRegistersScope(LCodeGen* codegen) |