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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 V(ClampDToUint8) \ | 73 V(ClampDToUint8) \ |
74 V(ClampIToUint8) \ | 74 V(ClampIToUint8) \ |
75 V(ClampTToUint8) \ | 75 V(ClampTToUint8) \ |
76 V(ClampTToUint8NoSSE2) \ | 76 V(ClampTToUint8NoSSE2) \ |
77 V(ClassOfTestAndBranch) \ | 77 V(ClassOfTestAndBranch) \ |
78 V(CompareNumericAndBranch) \ | 78 V(CompareNumericAndBranch) \ |
79 V(CmpObjectEqAndBranch) \ | 79 V(CmpObjectEqAndBranch) \ |
80 V(CmpMapAndBranch) \ | 80 V(CmpMapAndBranch) \ |
81 V(CmpT) \ | 81 V(CmpT) \ |
82 V(ConstantD) \ | 82 V(ConstantD) \ |
83 V(ConstantE) \ | |
84 V(ConstantI) \ | 83 V(ConstantI) \ |
85 V(ConstantS) \ | 84 V(ConstantS) \ |
86 V(ConstantT) \ | 85 V(ConstantT) \ |
87 V(Context) \ | 86 V(Context) \ |
88 V(DateField) \ | 87 V(DateField) \ |
89 V(DebugBreak) \ | 88 V(DebugBreak) \ |
90 V(DeclareGlobals) \ | 89 V(DeclareGlobals) \ |
91 V(Deoptimize) \ | 90 V(Deoptimize) \ |
92 V(DivI) \ | 91 V(DivI) \ |
93 V(DoubleToI) \ | 92 V(DoubleToI) \ |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 bool ClobbersRegisters() const { return is_call_; } | 264 bool ClobbersRegisters() const { return is_call_; } |
266 virtual bool ClobbersDoubleRegisters() const { | 265 virtual bool ClobbersDoubleRegisters() const { |
267 return is_call_ || | 266 return is_call_ || |
268 (!CpuFeatures::IsSupported(SSE2) && | 267 (!CpuFeatures::IsSupported(SSE2) && |
269 // We only have rudimentary X87Stack tracking, thus in general | 268 // We only have rudimentary X87Stack tracking, thus in general |
270 // cannot handle deoptimization nor phi-nodes. | 269 // cannot handle deoptimization nor phi-nodes. |
271 (HasEnvironment() || IsControl())); | 270 (HasEnvironment() || IsControl())); |
272 } | 271 } |
273 | 272 |
274 virtual bool HasResult() const = 0; | 273 virtual bool HasResult() const = 0; |
275 virtual LOperand* result() const = 0; | 274 virtual LOperand* result() = 0; |
276 | 275 |
277 bool HasDoubleRegisterResult(); | 276 bool HasDoubleRegisterResult(); |
278 bool HasDoubleRegisterInput(); | 277 bool HasDoubleRegisterInput(); |
279 bool IsDoubleInput(X87Register reg, LCodeGen* cgen); | 278 bool IsDoubleInput(X87Register reg, LCodeGen* cgen); |
280 | 279 |
281 LOperand* FirstInput() { return InputAt(0); } | 280 LOperand* FirstInput() { return InputAt(0); } |
282 LOperand* Output() { return HasResult() ? result() : NULL; } | 281 LOperand* Output() { return HasResult() ? result() : NULL; } |
283 | 282 |
284 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } | 283 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } |
285 | 284 |
(...skipping 19 matching lines...) Expand all Loading... |
305 | 304 |
306 | 305 |
307 // R = number of result operands (0 or 1). | 306 // R = number of result operands (0 or 1). |
308 // I = number of input operands. | 307 // I = number of input operands. |
309 // T = number of temporary operands. | 308 // T = number of temporary operands. |
310 template<int R, int I, int T> | 309 template<int R, int I, int T> |
311 class LTemplateInstruction: public LInstruction { | 310 class LTemplateInstruction: public LInstruction { |
312 public: | 311 public: |
313 // Allow 0 or 1 output operands. | 312 // Allow 0 or 1 output operands. |
314 STATIC_ASSERT(R == 0 || R == 1); | 313 STATIC_ASSERT(R == 0 || R == 1); |
315 virtual bool HasResult() const { return R != 0 && result() != NULL; } | 314 virtual bool HasResult() const { return R != 0; } |
316 void set_result(LOperand* operand) { results_[0] = operand; } | 315 void set_result(LOperand* operand) { results_[0] = operand; } |
317 LOperand* result() const { return results_[0]; } | 316 LOperand* result() { return results_[0]; } |
318 | 317 |
319 protected: | 318 protected: |
320 EmbeddedContainer<LOperand*, R> results_; | 319 EmbeddedContainer<LOperand*, R> results_; |
321 EmbeddedContainer<LOperand*, I> inputs_; | 320 EmbeddedContainer<LOperand*, I> inputs_; |
322 EmbeddedContainer<LOperand*, T> temps_; | 321 EmbeddedContainer<LOperand*, T> temps_; |
323 | 322 |
324 private: | 323 private: |
325 // Iterator support. | 324 // Iterator support. |
326 virtual int InputCount() { return I; } | 325 virtual int InputCount() { return I; } |
327 virtual LOperand* InputAt(int i) { return inputs_[i]; } | 326 virtual LOperand* InputAt(int i) { return inputs_[i]; } |
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1202 | 1201 |
1203 LOperand* temp() { return temps_[0]; } | 1202 LOperand* temp() { return temps_[0]; } |
1204 | 1203 |
1205 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d") | 1204 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d") |
1206 DECLARE_HYDROGEN_ACCESSOR(Constant) | 1205 DECLARE_HYDROGEN_ACCESSOR(Constant) |
1207 | 1206 |
1208 double value() const { return hydrogen()->DoubleValue(); } | 1207 double value() const { return hydrogen()->DoubleValue(); } |
1209 }; | 1208 }; |
1210 | 1209 |
1211 | 1210 |
1212 class LConstantE: public LTemplateInstruction<1, 0, 0> { | |
1213 public: | |
1214 DECLARE_CONCRETE_INSTRUCTION(ConstantE, "constant-e") | |
1215 DECLARE_HYDROGEN_ACCESSOR(Constant) | |
1216 | |
1217 ExternalReference value() const { | |
1218 return hydrogen()->ExternalReferenceValue(); | |
1219 } | |
1220 }; | |
1221 | |
1222 | |
1223 class LConstantT: public LTemplateInstruction<1, 0, 0> { | 1211 class LConstantT: public LTemplateInstruction<1, 0, 0> { |
1224 public: | 1212 public: |
1225 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") | 1213 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") |
1226 DECLARE_HYDROGEN_ACCESSOR(Constant) | 1214 DECLARE_HYDROGEN_ACCESSOR(Constant) |
1227 | 1215 |
1228 Handle<Object> value() const { return hydrogen()->handle(); } | 1216 Handle<Object> value() const { return hydrogen()->handle(); } |
1229 }; | 1217 }; |
1230 | 1218 |
1231 | 1219 |
1232 class LBranch: public LControlInstruction<1, 1> { | 1220 class LBranch: public LControlInstruction<1, 1> { |
(...skipping 1719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2952 | 2940 |
2953 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2941 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2954 }; | 2942 }; |
2955 | 2943 |
2956 #undef DECLARE_HYDROGEN_ACCESSOR | 2944 #undef DECLARE_HYDROGEN_ACCESSOR |
2957 #undef DECLARE_CONCRETE_INSTRUCTION | 2945 #undef DECLARE_CONCRETE_INSTRUCTION |
2958 | 2946 |
2959 } } // namespace v8::internal | 2947 } } // namespace v8::internal |
2960 | 2948 |
2961 #endif // V8_IA32_LITHIUM_IA32_H_ | 2949 #endif // V8_IA32_LITHIUM_IA32_H_ |
OLD | NEW |