diff options
Diffstat (limited to 'deps/v8/src/ia32/lithium-ia32.h')
-rw-r--r-- | deps/v8/src/ia32/lithium-ia32.h | 100 |
1 files changed, 54 insertions, 46 deletions
diff --git a/deps/v8/src/ia32/lithium-ia32.h b/deps/v8/src/ia32/lithium-ia32.h index e43672cdd9..e48e881eb5 100644 --- a/deps/v8/src/ia32/lithium-ia32.h +++ b/deps/v8/src/ia32/lithium-ia32.h @@ -44,6 +44,7 @@ class LCodeGen; V(AccessArgumentsAt) \ V(AddI) \ V(Allocate) \ + V(AllocateObject) \ V(ApplyArguments) \ V(ArgumentsElements) \ V(ArgumentsLength) \ @@ -93,7 +94,6 @@ class LCodeGen; V(DoubleToSmi) \ V(DummyUse) \ V(ElementsKind) \ - V(FixedArrayBaseLength) \ V(FunctionLiteral) \ V(GetCachedArrayIndex) \ V(GlobalObject) \ @@ -482,17 +482,44 @@ class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> { template<int I, int T> class LControlInstruction: public LTemplateInstruction<0, I, T> { public: + LControlInstruction() : false_label_(NULL), true_label_(NULL) { } + virtual bool IsControl() const { return true; } int SuccessorCount() { return hydrogen()->SuccessorCount(); } HBasicBlock* SuccessorAt(int i) { return hydrogen()->SuccessorAt(i); } - int true_block_id() { return hydrogen()->SuccessorAt(0)->block_id(); } - int false_block_id() { return hydrogen()->SuccessorAt(1)->block_id(); } + + int TrueDestination(LChunk* chunk) { + return chunk->LookupDestination(true_block_id()); + } + int FalseDestination(LChunk* chunk) { + return chunk->LookupDestination(false_block_id()); + } + + Label* TrueLabel(LChunk* chunk) { + if (true_label_ == NULL) { + true_label_ = chunk->GetAssemblyLabel(TrueDestination(chunk)); + } + return true_label_; + } + Label* FalseLabel(LChunk* chunk) { + if (false_label_ == NULL) { + false_label_ = chunk->GetAssemblyLabel(FalseDestination(chunk)); + } + return false_label_; + } + + protected: + int true_block_id() { return SuccessorAt(0)->block_id(); } + int false_block_id() { return SuccessorAt(1)->block_id(); } private: HControlInstruction* hydrogen() { return HControlInstruction::cast(this->hydrogen_value()); } + + Label* false_label_; + Label* true_label_; }; @@ -867,6 +894,7 @@ class LIsStringAndBranch: public LControlInstruction<1, 1> { LOperand* temp() { return temps_[0]; } DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch") + DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch) virtual void PrintDataTo(StringStream* stream); }; @@ -899,6 +927,7 @@ class LIsUndetectableAndBranch: public LControlInstruction<1, 1> { DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch, "is-undetectable-and-branch") + DECLARE_HYDROGEN_ACCESSOR(IsUndetectableAndBranch) virtual void PrintDataTo(StringStream* stream); }; @@ -1206,7 +1235,7 @@ class LBranch: public LControlInstruction<1, 1> { }; -class LCmpMapAndBranch: public LTemplateInstruction<0, 1, 0> { +class LCmpMapAndBranch: public LControlInstruction<1, 0> { public: explicit LCmpMapAndBranch(LOperand* value) { inputs_[0] = value; @@ -1217,29 +1246,7 @@ class LCmpMapAndBranch: public LTemplateInstruction<0, 1, 0> { DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch") DECLARE_HYDROGEN_ACCESSOR(CompareMap) - virtual bool IsControl() const { return true; } - Handle<Map> map() const { return hydrogen()->map(); } - int true_block_id() const { - return hydrogen()->FirstSuccessor()->block_id(); - } - int false_block_id() const { - return hydrogen()->SecondSuccessor()->block_id(); - } -}; - - -class LFixedArrayBaseLength: public LTemplateInstruction<1, 1, 0> { - public: - explicit LFixedArrayBaseLength(LOperand* value) { - inputs_[0] = value; - } - - LOperand* value() { return inputs_[0]; } - - DECLARE_CONCRETE_INSTRUCTION(FixedArrayBaseLength, - "fixed-array-base-length") - DECLARE_HYDROGEN_ACCESSOR(FixedArrayBaseLength) }; @@ -2048,13 +2055,15 @@ class LNumberTagI: public LTemplateInstruction<1, 1, 0> { }; -class LNumberTagU: public LTemplateInstruction<1, 1, 0> { +class LNumberTagU: public LTemplateInstruction<1, 1, 1> { public: - explicit LNumberTagU(LOperand* value) { + LNumberTagU(LOperand* value, LOperand* temp) { inputs_[0] = value; + temps_[0] = temp; } LOperand* value() { return inputs_[0]; } + LOperand* temp() { return temps_[0]; } DECLARE_CONCRETE_INSTRUCTION(NumberTagU, "number-tag-u") }; @@ -2548,6 +2557,22 @@ class LCheckNonSmi: public LTemplateInstruction<0, 1, 0> { LOperand* value() { return inputs_[0]; } DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi") + DECLARE_HYDROGEN_ACCESSOR(CheckHeapObject) +}; + + +class LAllocateObject: public LTemplateInstruction<1, 1, 1> { + public: + LAllocateObject(LOperand* context, LOperand* temp) { + inputs_[0] = context; + temps_[0] = temp; + } + + LOperand* context() { return inputs_[0]; } + LOperand* temp() { return temps_[0]; } + + DECLARE_CONCRETE_INSTRUCTION(AllocateObject, "allocate-object") + DECLARE_HYDROGEN_ACCESSOR(AllocateObject) }; @@ -2656,26 +2681,10 @@ class LDeleteProperty: public LTemplateInstruction<1, 3, 0> { class LOsrEntry: public LTemplateInstruction<0, 0, 0> { public: - LOsrEntry(); + LOsrEntry() {} virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") - - LOperand** SpilledRegisterArray() { return register_spills_; } - LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; } - - void MarkSpilledRegister(int allocation_index, LOperand* spill_operand); - void MarkSpilledDoubleRegister(int allocation_index, - LOperand* spill_operand); - - private: - // Arrays of spill slot operands for registers with an assigned spill - // slot, i.e., that must also be restored to the spill slot on OSR entry. - // NULL if the register has no assigned spill slot. Indexed by allocation - // index. - LOperand* register_spills_[Register::kMaxNumAllocatableRegisters]; - LOperand* double_register_spills_[ - DoubleRegister::kMaxNumAllocatableRegisters]; }; @@ -2813,7 +2822,6 @@ class LChunkBuilder BASE_EMBEDDED { HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) #undef DECLARE_DO - static HValue* SimplifiedDividendForMathFloorOfDiv(HValue* val); static HValue* SimplifiedDivisorForMathFloorOfDiv(HValue* val); LInstruction* DoMathFloor(HUnaryMathOperation* instr); |