OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_IA32_LITHIUM_IA32_H_ | 5 #ifndef V8_IA32_LITHIUM_IA32_H_ |
6 #define V8_IA32_LITHIUM_IA32_H_ | 6 #define V8_IA32_LITHIUM_IA32_H_ |
7 | 7 |
8 #include "hydrogen.h" | 8 #include "hydrogen.h" |
9 #include "lithium-allocator.h" | 9 #include "lithium-allocator.h" |
10 #include "lithium.h" | 10 #include "lithium.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 V(CallStub) \ | 39 V(CallStub) \ |
40 V(CheckInstanceType) \ | 40 V(CheckInstanceType) \ |
41 V(CheckMaps) \ | 41 V(CheckMaps) \ |
42 V(CheckMapValue) \ | 42 V(CheckMapValue) \ |
43 V(CheckNonSmi) \ | 43 V(CheckNonSmi) \ |
44 V(CheckSmi) \ | 44 V(CheckSmi) \ |
45 V(CheckValue) \ | 45 V(CheckValue) \ |
46 V(ClampDToUint8) \ | 46 V(ClampDToUint8) \ |
47 V(ClampIToUint8) \ | 47 V(ClampIToUint8) \ |
48 V(ClampTToUint8) \ | 48 V(ClampTToUint8) \ |
49 V(ClampTToUint8NoSSE2) \ | |
50 V(ClassOfTestAndBranch) \ | 49 V(ClassOfTestAndBranch) \ |
51 V(ClobberDoubles) \ | |
52 V(CompareMinusZeroAndBranch) \ | 50 V(CompareMinusZeroAndBranch) \ |
53 V(CompareNumericAndBranch) \ | 51 V(CompareNumericAndBranch) \ |
54 V(CmpObjectEqAndBranch) \ | 52 V(CmpObjectEqAndBranch) \ |
55 V(CmpHoleAndBranch) \ | 53 V(CmpHoleAndBranch) \ |
56 V(CmpMapAndBranch) \ | 54 V(CmpMapAndBranch) \ |
57 V(CmpT) \ | 55 V(CmpT) \ |
58 V(ConstantD) \ | 56 V(ConstantD) \ |
59 V(ConstantE) \ | 57 V(ConstantE) \ |
60 V(ConstantI) \ | 58 V(ConstantI) \ |
61 V(ConstantS) \ | 59 V(ConstantS) \ |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 | 231 |
234 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } | 232 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } |
235 | 233 |
236 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } | 234 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } |
237 bool IsCall() const { return IsCallBits::decode(bit_field_); } | 235 bool IsCall() const { return IsCallBits::decode(bit_field_); } |
238 | 236 |
239 // Interface to the register allocator and iterators. | 237 // Interface to the register allocator and iterators. |
240 bool ClobbersTemps() const { return IsCall(); } | 238 bool ClobbersTemps() const { return IsCall(); } |
241 bool ClobbersRegisters() const { return IsCall(); } | 239 bool ClobbersRegisters() const { return IsCall(); } |
242 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const { | 240 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const { |
243 return IsCall() || | 241 return IsCall(); |
244 // We only have rudimentary X87Stack tracking, thus in general | |
245 // cannot handle phi-nodes. | |
246 (!CpuFeatures::IsSafeForSnapshot(isolate, SSE2) && IsControl()); | |
247 } | 242 } |
248 | 243 |
249 virtual bool HasResult() const = 0; | 244 virtual bool HasResult() const = 0; |
250 virtual LOperand* result() const = 0; | 245 virtual LOperand* result() const = 0; |
251 | 246 |
252 bool HasDoubleRegisterResult(); | 247 bool HasDoubleRegisterResult(); |
253 bool HasDoubleRegisterInput(); | 248 bool HasDoubleRegisterInput(); |
254 bool IsDoubleInput(X87Register reg, LCodeGen* cgen); | |
255 | 249 |
256 LOperand* FirstInput() { return InputAt(0); } | 250 LOperand* FirstInput() { return InputAt(0); } |
257 LOperand* Output() { return HasResult() ? result() : NULL; } | 251 LOperand* Output() { return HasResult() ? result() : NULL; } |
258 | 252 |
259 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } | 253 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } |
260 | 254 |
261 #ifdef DEBUG | 255 #ifdef DEBUG |
262 void VerifyCall(); | 256 void VerifyCall(); |
263 #endif | 257 #endif |
264 | 258 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { } | 363 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { } |
370 | 364 |
371 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE { | 365 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE { |
372 return !IsRedundant(); | 366 return !IsRedundant(); |
373 } | 367 } |
374 | 368 |
375 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") | 369 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") |
376 }; | 370 }; |
377 | 371 |
378 | 372 |
379 class LClobberDoubles V8_FINAL : public LTemplateInstruction<0, 0, 0> { | |
380 public: | |
381 explicit LClobberDoubles(Isolate* isolate) { | |
382 ASSERT(!CpuFeatures::IsSafeForSnapshot(isolate, SSE2)); | |
383 } | |
384 | |
385 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const V8_OVERRIDE { | |
386 return true; | |
387 } | |
388 | |
389 DECLARE_CONCRETE_INSTRUCTION(ClobberDoubles, "clobber-d") | |
390 }; | |
391 | |
392 | |
393 class LGoto V8_FINAL : public LTemplateInstruction<0, 0, 0> { | 373 class LGoto V8_FINAL : public LTemplateInstruction<0, 0, 0> { |
394 public: | 374 public: |
395 explicit LGoto(HBasicBlock* block) : block_(block) { } | 375 explicit LGoto(HBasicBlock* block) : block_(block) { } |
396 | 376 |
397 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE; | 377 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE; |
398 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") | 378 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") |
399 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 379 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
400 virtual bool IsControl() const V8_OVERRIDE { return true; } | 380 virtual bool IsControl() const V8_OVERRIDE { return true; } |
401 | 381 |
402 int block_id() const { return block_->block_id(); } | 382 int block_id() const { return block_->block_id(); } |
(...skipping 2066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2469 temps_[0] = temp_xmm; | 2449 temps_[0] = temp_xmm; |
2470 } | 2450 } |
2471 | 2451 |
2472 LOperand* unclamped() { return inputs_[0]; } | 2452 LOperand* unclamped() { return inputs_[0]; } |
2473 LOperand* temp_xmm() { return temps_[0]; } | 2453 LOperand* temp_xmm() { return temps_[0]; } |
2474 | 2454 |
2475 DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8") | 2455 DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8") |
2476 }; | 2456 }; |
2477 | 2457 |
2478 | 2458 |
2479 // Truncating conversion from a tagged value to an int32. | |
2480 class LClampTToUint8NoSSE2 V8_FINAL : public LTemplateInstruction<1, 1, 3> { | |
2481 public: | |
2482 LClampTToUint8NoSSE2(LOperand* unclamped, | |
2483 LOperand* temp1, | |
2484 LOperand* temp2, | |
2485 LOperand* temp3) { | |
2486 inputs_[0] = unclamped; | |
2487 temps_[0] = temp1; | |
2488 temps_[1] = temp2; | |
2489 temps_[2] = temp3; | |
2490 } | |
2491 | |
2492 LOperand* unclamped() { return inputs_[0]; } | |
2493 LOperand* scratch() { return temps_[0]; } | |
2494 LOperand* scratch2() { return temps_[1]; } | |
2495 LOperand* scratch3() { return temps_[2]; } | |
2496 | |
2497 DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8NoSSE2, | |
2498 "clamp-t-to-uint8-nosse2") | |
2499 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) | |
2500 }; | |
2501 | |
2502 | |
2503 class LCheckNonSmi V8_FINAL : public LTemplateInstruction<0, 1, 0> { | 2459 class LCheckNonSmi V8_FINAL : public LTemplateInstruction<0, 1, 0> { |
2504 public: | 2460 public: |
2505 explicit LCheckNonSmi(LOperand* value) { | 2461 explicit LCheckNonSmi(LOperand* value) { |
2506 inputs_[0] = value; | 2462 inputs_[0] = value; |
2507 } | 2463 } |
2508 | 2464 |
2509 LOperand* value() { return inputs_[0]; } | 2465 LOperand* value() { return inputs_[0]; } |
2510 | 2466 |
2511 DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi") | 2467 DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi") |
2512 DECLARE_HYDROGEN_ACCESSOR(CheckHeapObject) | 2468 DECLARE_HYDROGEN_ACCESSOR(CheckHeapObject) |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2787 bool is_unused() const { return status_ == UNUSED; } | 2743 bool is_unused() const { return status_ == UNUSED; } |
2788 bool is_building() const { return status_ == BUILDING; } | 2744 bool is_building() const { return status_ == BUILDING; } |
2789 bool is_done() const { return status_ == DONE; } | 2745 bool is_done() const { return status_ == DONE; } |
2790 bool is_aborted() const { return status_ == ABORTED; } | 2746 bool is_aborted() const { return status_ == ABORTED; } |
2791 | 2747 |
2792 void Abort(BailoutReason reason); | 2748 void Abort(BailoutReason reason); |
2793 | 2749 |
2794 // Methods for getting operands for Use / Define / Temp. | 2750 // Methods for getting operands for Use / Define / Temp. |
2795 LUnallocated* ToUnallocated(Register reg); | 2751 LUnallocated* ToUnallocated(Register reg); |
2796 LUnallocated* ToUnallocated(XMMRegister reg); | 2752 LUnallocated* ToUnallocated(XMMRegister reg); |
2797 LUnallocated* ToUnallocated(X87Register reg); | |
2798 | 2753 |
2799 // Methods for setting up define-use relationships. | 2754 // Methods for setting up define-use relationships. |
2800 MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand); | 2755 MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand); |
2801 MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register); | 2756 MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register); |
2802 MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value, | 2757 MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value, |
2803 XMMRegister fixed_register); | 2758 XMMRegister fixed_register); |
2804 | 2759 |
2805 // A value that is guaranteed to be allocated to a register. | 2760 // A value that is guaranteed to be allocated to a register. |
2806 // Operand created by UseRegister is guaranteed to be live until the end of | 2761 // Operand created by UseRegister is guaranteed to be live until the end of |
2807 // instruction. This means that register allocator will not reuse it's | 2762 // instruction. This means that register allocator will not reuse it's |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2849 LInstruction* Define(LTemplateResultInstruction<1>* instr, | 2804 LInstruction* Define(LTemplateResultInstruction<1>* instr, |
2850 LUnallocated* result); | 2805 LUnallocated* result); |
2851 LInstruction* DefineAsRegister(LTemplateResultInstruction<1>* instr); | 2806 LInstruction* DefineAsRegister(LTemplateResultInstruction<1>* instr); |
2852 LInstruction* DefineAsSpilled(LTemplateResultInstruction<1>* instr, | 2807 LInstruction* DefineAsSpilled(LTemplateResultInstruction<1>* instr, |
2853 int index); | 2808 int index); |
2854 LInstruction* DefineSameAsFirst(LTemplateResultInstruction<1>* instr); | 2809 LInstruction* DefineSameAsFirst(LTemplateResultInstruction<1>* instr); |
2855 LInstruction* DefineFixed(LTemplateResultInstruction<1>* instr, | 2810 LInstruction* DefineFixed(LTemplateResultInstruction<1>* instr, |
2856 Register reg); | 2811 Register reg); |
2857 LInstruction* DefineFixedDouble(LTemplateResultInstruction<1>* instr, | 2812 LInstruction* DefineFixedDouble(LTemplateResultInstruction<1>* instr, |
2858 XMMRegister reg); | 2813 XMMRegister reg); |
2859 LInstruction* DefineX87TOS(LTemplateResultInstruction<1>* instr); | |
2860 // Assigns an environment to an instruction. An instruction which can | 2814 // Assigns an environment to an instruction. An instruction which can |
2861 // deoptimize must have an environment. | 2815 // deoptimize must have an environment. |
2862 LInstruction* AssignEnvironment(LInstruction* instr); | 2816 LInstruction* AssignEnvironment(LInstruction* instr); |
2863 // Assigns a pointer map to an instruction. An instruction which can | 2817 // Assigns a pointer map to an instruction. An instruction which can |
2864 // trigger a GC or a lazy deoptimization must have a pointer map. | 2818 // trigger a GC or a lazy deoptimization must have a pointer map. |
2865 LInstruction* AssignPointerMap(LInstruction* instr); | 2819 LInstruction* AssignPointerMap(LInstruction* instr); |
2866 | 2820 |
2867 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY }; | 2821 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY }; |
2868 | 2822 |
2869 LOperand* GetSeqStringSetCharOperand(HSeqStringSetChar* instr); | 2823 LOperand* GetSeqStringSetCharOperand(HSeqStringSetChar* instr); |
(...skipping 28 matching lines...) Expand all Loading... |
2898 | 2852 |
2899 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2853 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2900 }; | 2854 }; |
2901 | 2855 |
2902 #undef DECLARE_HYDROGEN_ACCESSOR | 2856 #undef DECLARE_HYDROGEN_ACCESSOR |
2903 #undef DECLARE_CONCRETE_INSTRUCTION | 2857 #undef DECLARE_CONCRETE_INSTRUCTION |
2904 | 2858 |
2905 } } // namespace v8::internal | 2859 } } // namespace v8::internal |
2906 | 2860 |
2907 #endif // V8_IA32_LITHIUM_IA32_H_ | 2861 #endif // V8_IA32_LITHIUM_IA32_H_ |
OLD | NEW |