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_X87_LITHIUM_X87_H_ |
6 #define V8_IA32_LITHIUM_IA32_H_ | 6 #define V8_X87_LITHIUM_X87_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" |
11 #include "safepoint-table.h" | 11 #include "safepoint-table.h" |
12 #include "utils.h" | 12 #include "utils.h" |
13 | 13 |
14 namespace v8 { | 14 namespace v8 { |
15 namespace internal { | 15 namespace internal { |
16 | 16 |
(...skipping 21 matching lines...) Expand all Loading... |
38 V(CallRuntime) \ | 38 V(CallRuntime) \ |
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(ClampTToUint8NoSSE2) \ |
49 V(ClassOfTestAndBranch) \ | 49 V(ClassOfTestAndBranch) \ |
| 50 V(ClobberDoubles) \ |
50 V(CompareMinusZeroAndBranch) \ | 51 V(CompareMinusZeroAndBranch) \ |
51 V(CompareNumericAndBranch) \ | 52 V(CompareNumericAndBranch) \ |
52 V(CmpObjectEqAndBranch) \ | 53 V(CmpObjectEqAndBranch) \ |
53 V(CmpHoleAndBranch) \ | 54 V(CmpHoleAndBranch) \ |
54 V(CmpMapAndBranch) \ | 55 V(CmpMapAndBranch) \ |
55 V(CmpT) \ | 56 V(CmpT) \ |
56 V(ConstantD) \ | 57 V(ConstantD) \ |
57 V(ConstantE) \ | 58 V(ConstantE) \ |
58 V(ConstantI) \ | 59 V(ConstantI) \ |
59 V(ConstantS) \ | 60 V(ConstantS) \ |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 | 232 |
232 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } | 233 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } |
233 | 234 |
234 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } | 235 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } |
235 bool IsCall() const { return IsCallBits::decode(bit_field_); } | 236 bool IsCall() const { return IsCallBits::decode(bit_field_); } |
236 | 237 |
237 // Interface to the register allocator and iterators. | 238 // Interface to the register allocator and iterators. |
238 bool ClobbersTemps() const { return IsCall(); } | 239 bool ClobbersTemps() const { return IsCall(); } |
239 bool ClobbersRegisters() const { return IsCall(); } | 240 bool ClobbersRegisters() const { return IsCall(); } |
240 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const { | 241 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const { |
241 return IsCall(); | 242 return IsCall() || |
| 243 // We only have rudimentary X87Stack tracking, thus in general |
| 244 // cannot handle phi-nodes. |
| 245 (IsControl()); |
242 } | 246 } |
243 | 247 |
244 virtual bool HasResult() const = 0; | 248 virtual bool HasResult() const = 0; |
245 virtual LOperand* result() const = 0; | 249 virtual LOperand* result() const = 0; |
246 | 250 |
247 bool HasDoubleRegisterResult(); | 251 bool HasDoubleRegisterResult(); |
248 bool HasDoubleRegisterInput(); | 252 bool HasDoubleRegisterInput(); |
| 253 bool IsDoubleInput(X87Register reg, LCodeGen* cgen); |
249 | 254 |
250 LOperand* FirstInput() { return InputAt(0); } | 255 LOperand* FirstInput() { return InputAt(0); } |
251 LOperand* Output() { return HasResult() ? result() : NULL; } | 256 LOperand* Output() { return HasResult() ? result() : NULL; } |
252 | 257 |
253 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } | 258 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } |
254 | 259 |
255 #ifdef DEBUG | 260 #ifdef DEBUG |
256 void VerifyCall(); | 261 void VerifyCall(); |
257 #endif | 262 #endif |
258 | 263 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { } | 368 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { } |
364 | 369 |
365 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE { | 370 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE { |
366 return !IsRedundant(); | 371 return !IsRedundant(); |
367 } | 372 } |
368 | 373 |
369 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") | 374 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") |
370 }; | 375 }; |
371 | 376 |
372 | 377 |
| 378 class LClobberDoubles V8_FINAL : public LTemplateInstruction<0, 0, 0> { |
| 379 public: |
| 380 explicit LClobberDoubles(Isolate* isolate) { } |
| 381 |
| 382 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const V8_OVERRIDE { |
| 383 return true; |
| 384 } |
| 385 |
| 386 DECLARE_CONCRETE_INSTRUCTION(ClobberDoubles, "clobber-d") |
| 387 }; |
| 388 |
| 389 |
373 class LGoto V8_FINAL : public LTemplateInstruction<0, 0, 0> { | 390 class LGoto V8_FINAL : public LTemplateInstruction<0, 0, 0> { |
374 public: | 391 public: |
375 explicit LGoto(HBasicBlock* block) : block_(block) { } | 392 explicit LGoto(HBasicBlock* block) : block_(block) { } |
376 | 393 |
377 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE; | 394 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE; |
378 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") | 395 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") |
379 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 396 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
380 virtual bool IsControl() const V8_OVERRIDE { return true; } | 397 virtual bool IsControl() const V8_OVERRIDE { return true; } |
381 | 398 |
382 int block_id() const { return block_->block_id(); } | 399 int block_id() const { return block_->block_id(); } |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 inputs_[0] = value; | 851 inputs_[0] = value; |
835 } | 852 } |
836 | 853 |
837 LOperand* value() { return inputs_[0]; } | 854 LOperand* value() { return inputs_[0]; } |
838 | 855 |
839 DECLARE_CONCRETE_INSTRUCTION(MathFloor, "math-floor") | 856 DECLARE_CONCRETE_INSTRUCTION(MathFloor, "math-floor") |
840 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) | 857 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
841 }; | 858 }; |
842 | 859 |
843 | 860 |
844 class LMathRound V8_FINAL : public LTemplateInstruction<1, 1, 1> { | 861 class LMathRound V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
845 public: | 862 public: |
846 LMathRound(LOperand* value, LOperand* temp) { | 863 explicit LMathRound(LOperand* value) { |
847 inputs_[0] = value; | 864 inputs_[0] = value; |
848 temps_[0] = temp; | |
849 } | 865 } |
850 | 866 |
851 LOperand* value() { return inputs_[0]; } | 867 LOperand* value() { return inputs_[0]; } |
852 LOperand* temp() { return temps_[0]; } | |
853 | 868 |
854 DECLARE_CONCRETE_INSTRUCTION(MathRound, "math-round") | 869 DECLARE_CONCRETE_INSTRUCTION(MathRound, "math-round") |
855 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) | 870 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
856 }; | 871 }; |
857 | 872 |
858 | 873 |
859 class LMathAbs V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 874 class LMathAbs V8_FINAL : public LTemplateInstruction<1, 2, 0> { |
860 public: | 875 public: |
861 LMathAbs(LOperand* context, LOperand* value) { | 876 LMathAbs(LOperand* context, LOperand* value) { |
862 inputs_[1] = context; | 877 inputs_[1] = context; |
(...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1969 explicit LCallRuntime(LOperand* context) { | 1984 explicit LCallRuntime(LOperand* context) { |
1970 inputs_[0] = context; | 1985 inputs_[0] = context; |
1971 } | 1986 } |
1972 | 1987 |
1973 LOperand* context() { return inputs_[0]; } | 1988 LOperand* context() { return inputs_[0]; } |
1974 | 1989 |
1975 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") | 1990 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") |
1976 DECLARE_HYDROGEN_ACCESSOR(CallRuntime) | 1991 DECLARE_HYDROGEN_ACCESSOR(CallRuntime) |
1977 | 1992 |
1978 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const V8_OVERRIDE { | 1993 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const V8_OVERRIDE { |
1979 return save_doubles() == kDontSaveFPRegs; | 1994 return true; |
1980 } | 1995 } |
1981 | 1996 |
1982 const Runtime::Function* function() const { return hydrogen()->function(); } | 1997 const Runtime::Function* function() const { return hydrogen()->function(); } |
1983 int arity() const { return hydrogen()->argument_count(); } | 1998 int arity() const { return hydrogen()->argument_count(); } |
1984 SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); } | |
1985 }; | 1999 }; |
1986 | 2000 |
1987 | 2001 |
1988 class LInteger32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2002 class LInteger32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
1989 public: | 2003 public: |
1990 explicit LInteger32ToDouble(LOperand* value) { | 2004 explicit LInteger32ToDouble(LOperand* value) { |
1991 inputs_[0] = value; | 2005 inputs_[0] = value; |
1992 } | 2006 } |
1993 | 2007 |
1994 LOperand* value() { return inputs_[0]; } | 2008 LOperand* value() { return inputs_[0]; } |
1995 | 2009 |
1996 DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double") | 2010 DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double") |
1997 }; | 2011 }; |
1998 | 2012 |
1999 | 2013 |
2000 class LUint32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 1> { | 2014 class LUint32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 1> { |
2001 public: | 2015 public: |
2002 explicit LUint32ToDouble(LOperand* value, LOperand* temp) { | 2016 explicit LUint32ToDouble(LOperand* value) { |
2003 inputs_[0] = value; | 2017 inputs_[0] = value; |
2004 temps_[0] = temp; | |
2005 } | 2018 } |
2006 | 2019 |
2007 LOperand* value() { return inputs_[0]; } | 2020 LOperand* value() { return inputs_[0]; } |
2008 LOperand* temp() { return temps_[0]; } | |
2009 | 2021 |
2010 DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double") | 2022 DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double") |
2011 }; | 2023 }; |
2012 | 2024 |
2013 | 2025 |
2014 class LNumberTagI V8_FINAL : public LTemplateInstruction<1, 1, 1> { | 2026 class LNumberTagI V8_FINAL : public LTemplateInstruction<1, 1, 1> { |
2015 public: | 2027 public: |
2016 LNumberTagI(LOperand* value, LOperand* temp) { | 2028 LNumberTagI(LOperand* value, LOperand* temp) { |
2017 inputs_[0] = value; | 2029 inputs_[0] = value; |
2018 temps_[0] = temp; | 2030 temps_[0] = temp; |
2019 } | 2031 } |
2020 | 2032 |
2021 LOperand* value() { return inputs_[0]; } | 2033 LOperand* value() { return inputs_[0]; } |
2022 LOperand* temp() { return temps_[0]; } | 2034 LOperand* temp() { return temps_[0]; } |
2023 | 2035 |
2024 DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i") | 2036 DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i") |
2025 }; | 2037 }; |
2026 | 2038 |
2027 | 2039 |
2028 class LNumberTagU V8_FINAL : public LTemplateInstruction<1, 1, 2> { | 2040 class LNumberTagU V8_FINAL : public LTemplateInstruction<1, 1, 1> { |
2029 public: | 2041 public: |
2030 LNumberTagU(LOperand* value, LOperand* temp1, LOperand* temp2) { | 2042 LNumberTagU(LOperand* value, LOperand* temp) { |
2031 inputs_[0] = value; | 2043 inputs_[0] = value; |
2032 temps_[0] = temp1; | 2044 temps_[0] = temp; |
2033 temps_[1] = temp2; | |
2034 } | 2045 } |
2035 | 2046 |
2036 LOperand* value() { return inputs_[0]; } | 2047 LOperand* value() { return inputs_[0]; } |
2037 LOperand* temp1() { return temps_[0]; } | 2048 LOperand* temp() { return temps_[0]; } |
2038 LOperand* temp2() { return temps_[1]; } | |
2039 | 2049 |
2040 DECLARE_CONCRETE_INSTRUCTION(NumberTagU, "number-tag-u") | 2050 DECLARE_CONCRETE_INSTRUCTION(NumberTagU, "number-tag-u") |
2041 }; | 2051 }; |
2042 | 2052 |
2043 | 2053 |
2044 class LNumberTagD V8_FINAL : public LTemplateInstruction<1, 1, 1> { | 2054 class LNumberTagD V8_FINAL : public LTemplateInstruction<1, 1, 1> { |
2045 public: | 2055 public: |
2046 LNumberTagD(LOperand* value, LOperand* temp) { | 2056 LNumberTagD(LOperand* value, LOperand* temp) { |
2047 inputs_[0] = value; | 2057 inputs_[0] = value; |
2048 temps_[0] = temp; | 2058 temps_[0] = temp; |
2049 } | 2059 } |
2050 | 2060 |
2051 LOperand* value() { return inputs_[0]; } | 2061 LOperand* value() { return inputs_[0]; } |
2052 LOperand* temp() { return temps_[0]; } | 2062 LOperand* temp() { return temps_[0]; } |
2053 | 2063 |
2054 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") | 2064 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") |
2055 DECLARE_HYDROGEN_ACCESSOR(Change) | 2065 DECLARE_HYDROGEN_ACCESSOR(Change) |
2056 }; | 2066 }; |
2057 | 2067 |
2058 | 2068 |
2059 // Sometimes truncating conversion from a tagged value to an int32. | 2069 // Sometimes truncating conversion from a tagged value to an int32. |
2060 class LDoubleToI V8_FINAL : public LTemplateInstruction<1, 1, 1> { | 2070 class LDoubleToI V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
2061 public: | 2071 public: |
2062 LDoubleToI(LOperand* value, LOperand* temp) { | 2072 explicit LDoubleToI(LOperand* value) { |
2063 inputs_[0] = value; | 2073 inputs_[0] = value; |
2064 temps_[0] = temp; | |
2065 } | 2074 } |
2066 | 2075 |
2067 LOperand* value() { return inputs_[0]; } | 2076 LOperand* value() { return inputs_[0]; } |
2068 LOperand* temp() { return temps_[0]; } | |
2069 | 2077 |
2070 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i") | 2078 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i") |
2071 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) | 2079 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) |
2072 | 2080 |
2073 bool truncating() { return hydrogen()->CanTruncateToInt32(); } | 2081 bool truncating() { return hydrogen()->CanTruncateToInt32(); } |
2074 }; | 2082 }; |
2075 | 2083 |
2076 | 2084 |
2077 class LDoubleToSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2085 class LDoubleToSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
2078 public: | 2086 public: |
2079 explicit LDoubleToSmi(LOperand* value) { | 2087 explicit LDoubleToSmi(LOperand* value) { |
2080 inputs_[0] = value; | 2088 inputs_[0] = value; |
2081 } | 2089 } |
2082 | 2090 |
2083 LOperand* value() { return inputs_[0]; } | 2091 LOperand* value() { return inputs_[0]; } |
2084 | 2092 |
2085 DECLARE_CONCRETE_INSTRUCTION(DoubleToSmi, "double-to-smi") | 2093 DECLARE_CONCRETE_INSTRUCTION(DoubleToSmi, "double-to-smi") |
2086 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) | 2094 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) |
2087 }; | 2095 }; |
2088 | 2096 |
2089 | 2097 |
2090 // Truncating conversion from a tagged value to an int32. | 2098 // Truncating conversion from a tagged value to an int32. |
2091 class LTaggedToI V8_FINAL : public LTemplateInstruction<1, 1, 1> { | 2099 class LTaggedToI V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
2092 public: | 2100 public: |
2093 LTaggedToI(LOperand* value, LOperand* temp) { | 2101 explicit LTaggedToI(LOperand* value) { |
2094 inputs_[0] = value; | 2102 inputs_[0] = value; |
2095 temps_[0] = temp; | |
2096 } | 2103 } |
2097 | 2104 |
2098 LOperand* value() { return inputs_[0]; } | 2105 LOperand* value() { return inputs_[0]; } |
2099 LOperand* temp() { return temps_[0]; } | |
2100 | 2106 |
2101 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") | 2107 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") |
2102 DECLARE_HYDROGEN_ACCESSOR(Change) | 2108 DECLARE_HYDROGEN_ACCESSOR(Change) |
2103 | 2109 |
2104 bool truncating() { return hydrogen()->CanTruncateToInt32(); } | 2110 bool truncating() { return hydrogen()->CanTruncateToInt32(); } |
2105 }; | 2111 }; |
2106 | 2112 |
2107 | 2113 |
2108 class LSmiTag V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2114 class LSmiTag V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
2109 public: | 2115 public: |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2435 explicit LClampIToUint8(LOperand* value) { | 2441 explicit LClampIToUint8(LOperand* value) { |
2436 inputs_[0] = value; | 2442 inputs_[0] = value; |
2437 } | 2443 } |
2438 | 2444 |
2439 LOperand* unclamped() { return inputs_[0]; } | 2445 LOperand* unclamped() { return inputs_[0]; } |
2440 | 2446 |
2441 DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8") | 2447 DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8") |
2442 }; | 2448 }; |
2443 | 2449 |
2444 | 2450 |
2445 class LClampTToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 1> { | 2451 // Truncating conversion from a tagged value to an int32. |
| 2452 class LClampTToUint8NoSSE2 V8_FINAL : public LTemplateInstruction<1, 1, 3> { |
2446 public: | 2453 public: |
2447 LClampTToUint8(LOperand* value, LOperand* temp_xmm) { | 2454 LClampTToUint8NoSSE2(LOperand* unclamped, |
2448 inputs_[0] = value; | 2455 LOperand* temp1, |
2449 temps_[0] = temp_xmm; | 2456 LOperand* temp2, |
| 2457 LOperand* temp3) { |
| 2458 inputs_[0] = unclamped; |
| 2459 temps_[0] = temp1; |
| 2460 temps_[1] = temp2; |
| 2461 temps_[2] = temp3; |
2450 } | 2462 } |
2451 | 2463 |
2452 LOperand* unclamped() { return inputs_[0]; } | 2464 LOperand* unclamped() { return inputs_[0]; } |
2453 LOperand* temp_xmm() { return temps_[0]; } | 2465 LOperand* scratch() { return temps_[0]; } |
| 2466 LOperand* scratch2() { return temps_[1]; } |
| 2467 LOperand* scratch3() { return temps_[2]; } |
2454 | 2468 |
2455 DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8") | 2469 DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8NoSSE2, |
| 2470 "clamp-t-to-uint8-nosse2") |
| 2471 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) |
2456 }; | 2472 }; |
2457 | 2473 |
2458 | 2474 |
2459 class LCheckNonSmi V8_FINAL : public LTemplateInstruction<0, 1, 0> { | 2475 class LCheckNonSmi V8_FINAL : public LTemplateInstruction<0, 1, 0> { |
2460 public: | 2476 public: |
2461 explicit LCheckNonSmi(LOperand* value) { | 2477 explicit LCheckNonSmi(LOperand* value) { |
2462 inputs_[0] = value; | 2478 inputs_[0] = value; |
2463 } | 2479 } |
2464 | 2480 |
2465 LOperand* value() { return inputs_[0]; } | 2481 LOperand* value() { return inputs_[0]; } |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2742 | 2758 |
2743 bool is_unused() const { return status_ == UNUSED; } | 2759 bool is_unused() const { return status_ == UNUSED; } |
2744 bool is_building() const { return status_ == BUILDING; } | 2760 bool is_building() const { return status_ == BUILDING; } |
2745 bool is_done() const { return status_ == DONE; } | 2761 bool is_done() const { return status_ == DONE; } |
2746 bool is_aborted() const { return status_ == ABORTED; } | 2762 bool is_aborted() const { return status_ == ABORTED; } |
2747 | 2763 |
2748 void Abort(BailoutReason reason); | 2764 void Abort(BailoutReason reason); |
2749 | 2765 |
2750 // Methods for getting operands for Use / Define / Temp. | 2766 // Methods for getting operands for Use / Define / Temp. |
2751 LUnallocated* ToUnallocated(Register reg); | 2767 LUnallocated* ToUnallocated(Register reg); |
2752 LUnallocated* ToUnallocated(XMMRegister reg); | 2768 LUnallocated* ToUnallocated(X87Register reg); |
2753 | 2769 |
2754 // Methods for setting up define-use relationships. | 2770 // Methods for setting up define-use relationships. |
2755 MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand); | 2771 MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand); |
2756 MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register); | 2772 MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register); |
2757 MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value, | |
2758 XMMRegister fixed_register); | |
2759 | 2773 |
2760 // A value that is guaranteed to be allocated to a register. | 2774 // A value that is guaranteed to be allocated to a register. |
2761 // Operand created by UseRegister is guaranteed to be live until the end of | 2775 // Operand created by UseRegister is guaranteed to be live until the end of |
2762 // instruction. This means that register allocator will not reuse it's | 2776 // instruction. This means that register allocator will not reuse it's |
2763 // register for any other operand inside instruction. | 2777 // register for any other operand inside instruction. |
2764 // Operand created by UseRegisterAtStart is guaranteed to be live only at | 2778 // Operand created by UseRegisterAtStart is guaranteed to be live only at |
2765 // instruction start. Register allocator is free to assign the same register | 2779 // instruction start. Register allocator is free to assign the same register |
2766 // to some other operand used inside instruction (i.e. temporary or | 2780 // to some other operand used inside instruction (i.e. temporary or |
2767 // output). | 2781 // output). |
2768 MUST_USE_RESULT LOperand* UseRegister(HValue* value); | 2782 MUST_USE_RESULT LOperand* UseRegister(HValue* value); |
(...skipping 21 matching lines...) Expand all Loading... |
2790 // An input operand in a constant operand. | 2804 // An input operand in a constant operand. |
2791 MUST_USE_RESULT LOperand* UseConstant(HValue* value); | 2805 MUST_USE_RESULT LOperand* UseConstant(HValue* value); |
2792 | 2806 |
2793 // An input operand in register, stack slot or a constant operand. | 2807 // An input operand in register, stack slot or a constant operand. |
2794 // Will not be moved to a register even if one is freely available. | 2808 // Will not be moved to a register even if one is freely available. |
2795 virtual MUST_USE_RESULT LOperand* UseAny(HValue* value) V8_OVERRIDE; | 2809 virtual MUST_USE_RESULT LOperand* UseAny(HValue* value) V8_OVERRIDE; |
2796 | 2810 |
2797 // Temporary operand that must be in a register. | 2811 // Temporary operand that must be in a register. |
2798 MUST_USE_RESULT LUnallocated* TempRegister(); | 2812 MUST_USE_RESULT LUnallocated* TempRegister(); |
2799 MUST_USE_RESULT LOperand* FixedTemp(Register reg); | 2813 MUST_USE_RESULT LOperand* FixedTemp(Register reg); |
2800 MUST_USE_RESULT LOperand* FixedTemp(XMMRegister reg); | |
2801 | 2814 |
2802 // Methods for setting up define-use relationships. | 2815 // Methods for setting up define-use relationships. |
2803 // Return the same instruction that they are passed. | 2816 // Return the same instruction that they are passed. |
2804 LInstruction* Define(LTemplateResultInstruction<1>* instr, | 2817 LInstruction* Define(LTemplateResultInstruction<1>* instr, |
2805 LUnallocated* result); | 2818 LUnallocated* result); |
2806 LInstruction* DefineAsRegister(LTemplateResultInstruction<1>* instr); | 2819 LInstruction* DefineAsRegister(LTemplateResultInstruction<1>* instr); |
2807 LInstruction* DefineAsSpilled(LTemplateResultInstruction<1>* instr, | 2820 LInstruction* DefineAsSpilled(LTemplateResultInstruction<1>* instr, |
2808 int index); | 2821 int index); |
2809 LInstruction* DefineSameAsFirst(LTemplateResultInstruction<1>* instr); | 2822 LInstruction* DefineSameAsFirst(LTemplateResultInstruction<1>* instr); |
2810 LInstruction* DefineFixed(LTemplateResultInstruction<1>* instr, | 2823 LInstruction* DefineFixed(LTemplateResultInstruction<1>* instr, |
2811 Register reg); | 2824 Register reg); |
2812 LInstruction* DefineFixedDouble(LTemplateResultInstruction<1>* instr, | 2825 LInstruction* DefineX87TOS(LTemplateResultInstruction<1>* instr); |
2813 XMMRegister reg); | |
2814 // Assigns an environment to an instruction. An instruction which can | 2826 // Assigns an environment to an instruction. An instruction which can |
2815 // deoptimize must have an environment. | 2827 // deoptimize must have an environment. |
2816 LInstruction* AssignEnvironment(LInstruction* instr); | 2828 LInstruction* AssignEnvironment(LInstruction* instr); |
2817 // Assigns a pointer map to an instruction. An instruction which can | 2829 // Assigns a pointer map to an instruction. An instruction which can |
2818 // trigger a GC or a lazy deoptimization must have a pointer map. | 2830 // trigger a GC or a lazy deoptimization must have a pointer map. |
2819 LInstruction* AssignPointerMap(LInstruction* instr); | 2831 LInstruction* AssignPointerMap(LInstruction* instr); |
2820 | 2832 |
2821 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY }; | 2833 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY }; |
2822 | 2834 |
2823 LOperand* GetSeqStringSetCharOperand(HSeqStringSetChar* instr); | 2835 LOperand* GetSeqStringSetCharOperand(HSeqStringSetChar* instr); |
(...skipping 28 matching lines...) Expand all Loading... |
2852 LAllocator* allocator_; | 2864 LAllocator* allocator_; |
2853 | 2865 |
2854 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2866 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2855 }; | 2867 }; |
2856 | 2868 |
2857 #undef DECLARE_HYDROGEN_ACCESSOR | 2869 #undef DECLARE_HYDROGEN_ACCESSOR |
2858 #undef DECLARE_CONCRETE_INSTRUCTION | 2870 #undef DECLARE_CONCRETE_INSTRUCTION |
2859 | 2871 |
2860 } } // namespace v8::internal | 2872 } } // namespace v8::internal |
2861 | 2873 |
2862 #endif // V8_IA32_LITHIUM_IA32_H_ | 2874 #endif // V8_X87_LITHIUM_X87_H_ |
OLD | NEW |