OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 | 256 |
257 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } | 257 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } |
258 | 258 |
259 void MarkAsCall() { is_call_ = true; } | 259 void MarkAsCall() { is_call_ = true; } |
260 | 260 |
261 // Interface to the register allocator and iterators. | 261 // Interface to the register allocator and iterators. |
262 bool ClobbersTemps() const { return is_call_; } | 262 bool ClobbersTemps() const { return is_call_; } |
263 bool ClobbersRegisters() const { return is_call_; } | 263 bool ClobbersRegisters() const { return is_call_; } |
264 virtual bool ClobbersDoubleRegisters() const { | 264 virtual bool ClobbersDoubleRegisters() const { |
265 return is_call_ || | 265 return is_call_ || |
266 (!CpuFeatures::IsSupported(SSE2) && | 266 // We only have rudimentary X87Stack tracking, thus in general |
267 // We only have rudimentary X87Stack tracking, thus in general | 267 // cannot handle phi-nodes. |
268 // cannot handle deoptimization nor phi-nodes. | 268 (!CpuFeatures::IsSafeForSnapshot(SSE2) && IsControl()); |
269 (HasEnvironment() || IsControl())); | |
270 } | 269 } |
271 | 270 |
272 virtual bool HasResult() const = 0; | 271 virtual bool HasResult() const = 0; |
273 virtual LOperand* result() const = 0; | 272 virtual LOperand* result() const = 0; |
274 | 273 |
275 bool HasDoubleRegisterResult(); | 274 bool HasDoubleRegisterResult(); |
276 bool HasDoubleRegisterInput(); | 275 bool HasDoubleRegisterInput(); |
277 bool IsDoubleInput(X87Register reg, LCodeGen* cgen); | 276 bool IsDoubleInput(X87Register reg, LCodeGen* cgen); |
278 | 277 |
279 LOperand* FirstInput() { return InputAt(0); } | 278 LOperand* FirstInput() { return InputAt(0); } |
(...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1504 DECLARE_HYDROGEN_ACCESSOR(Return) | 1503 DECLARE_HYDROGEN_ACCESSOR(Return) |
1505 }; | 1504 }; |
1506 | 1505 |
1507 | 1506 |
1508 class LLoadNamedField: public LTemplateInstruction<1, 1, 0> { | 1507 class LLoadNamedField: public LTemplateInstruction<1, 1, 0> { |
1509 public: | 1508 public: |
1510 explicit LLoadNamedField(LOperand* object) { | 1509 explicit LLoadNamedField(LOperand* object) { |
1511 inputs_[0] = object; | 1510 inputs_[0] = object; |
1512 } | 1511 } |
1513 | 1512 |
1514 virtual bool ClobbersDoubleRegisters() const { | |
1515 return !CpuFeatures::IsSupported(SSE2) && | |
1516 !hydrogen()->representation().IsDouble(); | |
1517 } | |
1518 | |
1519 LOperand* object() { return inputs_[0]; } | 1513 LOperand* object() { return inputs_[0]; } |
1520 | 1514 |
1521 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field") | 1515 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field") |
1522 DECLARE_HYDROGEN_ACCESSOR(LoadNamedField) | 1516 DECLARE_HYDROGEN_ACCESSOR(LoadNamedField) |
1523 }; | 1517 }; |
1524 | 1518 |
1525 | 1519 |
1526 class LLoadNamedFieldPolymorphic: public LTemplateInstruction<1, 2, 0> { | 1520 class LLoadNamedFieldPolymorphic: public LTemplateInstruction<1, 2, 0> { |
1527 public: | 1521 public: |
1528 LLoadNamedFieldPolymorphic(LOperand* context, LOperand* object) { | 1522 LLoadNamedFieldPolymorphic(LOperand* context, LOperand* object) { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1591 } | 1585 } |
1592 LOperand* elements() { return inputs_[0]; } | 1586 LOperand* elements() { return inputs_[0]; } |
1593 LOperand* key() { return inputs_[1]; } | 1587 LOperand* key() { return inputs_[1]; } |
1594 ElementsKind elements_kind() const { | 1588 ElementsKind elements_kind() const { |
1595 return hydrogen()->elements_kind(); | 1589 return hydrogen()->elements_kind(); |
1596 } | 1590 } |
1597 bool is_external() const { | 1591 bool is_external() const { |
1598 return hydrogen()->is_external(); | 1592 return hydrogen()->is_external(); |
1599 } | 1593 } |
1600 | 1594 |
1601 virtual bool ClobbersDoubleRegisters() const { | |
1602 return !CpuFeatures::IsSupported(SSE2) && | |
1603 !IsDoubleOrFloatElementsKind(hydrogen()->elements_kind()); | |
1604 } | |
1605 | |
1606 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") | 1595 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") |
1607 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) | 1596 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) |
1608 | 1597 |
1609 virtual void PrintDataTo(StringStream* stream); | 1598 virtual void PrintDataTo(StringStream* stream); |
1610 uint32_t additional_index() const { return hydrogen()->index_offset(); } | 1599 uint32_t additional_index() const { return hydrogen()->index_offset(); } |
1611 bool key_is_smi() { | 1600 bool key_is_smi() { |
1612 return hydrogen()->key()->representation().IsTagged(); | 1601 return hydrogen()->key()->representation().IsTagged(); |
1613 } | 1602 } |
1614 }; | 1603 }; |
1615 | 1604 |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2182 class LNumberUntagD: public LTemplateInstruction<1, 1, 1> { | 2171 class LNumberUntagD: public LTemplateInstruction<1, 1, 1> { |
2183 public: | 2172 public: |
2184 explicit LNumberUntagD(LOperand* value, LOperand* temp) { | 2173 explicit LNumberUntagD(LOperand* value, LOperand* temp) { |
2185 inputs_[0] = value; | 2174 inputs_[0] = value; |
2186 temps_[0] = temp; | 2175 temps_[0] = temp; |
2187 } | 2176 } |
2188 | 2177 |
2189 LOperand* value() { return inputs_[0]; } | 2178 LOperand* value() { return inputs_[0]; } |
2190 LOperand* temp() { return temps_[0]; } | 2179 LOperand* temp() { return temps_[0]; } |
2191 | 2180 |
2192 virtual bool ClobbersDoubleRegisters() const { return false; } | |
2193 | |
2194 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag") | 2181 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag") |
2195 DECLARE_HYDROGEN_ACCESSOR(Change); | 2182 DECLARE_HYDROGEN_ACCESSOR(Change); |
2196 }; | 2183 }; |
2197 | 2184 |
2198 | 2185 |
2199 class LSmiUntag: public LTemplateInstruction<1, 1, 0> { | 2186 class LSmiUntag: public LTemplateInstruction<1, 1, 0> { |
2200 public: | 2187 public: |
2201 LSmiUntag(LOperand* value, bool needs_check) | 2188 LSmiUntag(LOperand* value, bool needs_check) |
2202 : needs_check_(needs_check) { | 2189 : needs_check_(needs_check) { |
2203 inputs_[0] = value; | 2190 inputs_[0] = value; |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2918 | 2905 |
2919 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2906 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2920 }; | 2907 }; |
2921 | 2908 |
2922 #undef DECLARE_HYDROGEN_ACCESSOR | 2909 #undef DECLARE_HYDROGEN_ACCESSOR |
2923 #undef DECLARE_CONCRETE_INSTRUCTION | 2910 #undef DECLARE_CONCRETE_INSTRUCTION |
2924 | 2911 |
2925 } } // namespace v8::internal | 2912 } } // namespace v8::internal |
2926 | 2913 |
2927 #endif // V8_IA32_LITHIUM_IA32_H_ | 2914 #endif // V8_IA32_LITHIUM_IA32_H_ |
OLD | NEW |