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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 V(CheckSmi) \ | 72 V(CheckSmi) \ |
73 V(ClampDToUint8) \ | 73 V(ClampDToUint8) \ |
74 V(ClampIToUint8) \ | 74 V(ClampIToUint8) \ |
75 V(ClampTToUint8) \ | 75 V(ClampTToUint8) \ |
76 V(ClassOfTestAndBranch) \ | 76 V(ClassOfTestAndBranch) \ |
77 V(CompareNumericAndBranch) \ | 77 V(CompareNumericAndBranch) \ |
78 V(CmpObjectEqAndBranch) \ | 78 V(CmpObjectEqAndBranch) \ |
79 V(CmpMapAndBranch) \ | 79 V(CmpMapAndBranch) \ |
80 V(CmpT) \ | 80 V(CmpT) \ |
81 V(ConstantD) \ | 81 V(ConstantD) \ |
82 V(ConstantE) \ | |
83 V(ConstantI) \ | 82 V(ConstantI) \ |
84 V(ConstantS) \ | 83 V(ConstantS) \ |
85 V(ConstantT) \ | 84 V(ConstantT) \ |
86 V(Context) \ | 85 V(Context) \ |
87 V(DateField) \ | 86 V(DateField) \ |
88 V(DebugBreak) \ | 87 V(DebugBreak) \ |
89 V(DeclareGlobals) \ | 88 V(DeclareGlobals) \ |
90 V(Deoptimize) \ | 89 V(Deoptimize) \ |
91 V(DivI) \ | 90 V(DivI) \ |
92 V(DoubleToI) \ | 91 V(DoubleToI) \ |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 bool ClobbersTemps() const { return is_call_; } | 259 bool ClobbersTemps() const { return is_call_; } |
261 bool ClobbersRegisters() const { return is_call_; } | 260 bool ClobbersRegisters() const { return is_call_; } |
262 bool ClobbersDoubleRegisters() const { return is_call_; } | 261 bool ClobbersDoubleRegisters() const { return is_call_; } |
263 | 262 |
264 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } | 263 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } |
265 | 264 |
266 // Interface to the register allocator and iterators. | 265 // Interface to the register allocator and iterators. |
267 bool IsMarkedAsCall() const { return is_call_; } | 266 bool IsMarkedAsCall() const { return is_call_; } |
268 | 267 |
269 virtual bool HasResult() const = 0; | 268 virtual bool HasResult() const = 0; |
270 virtual LOperand* result() const = 0; | 269 virtual LOperand* result() = 0; |
271 | 270 |
272 LOperand* FirstInput() { return InputAt(0); } | 271 LOperand* FirstInput() { return InputAt(0); } |
273 LOperand* Output() { return HasResult() ? result() : NULL; } | 272 LOperand* Output() { return HasResult() ? result() : NULL; } |
274 | 273 |
275 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } | 274 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } |
276 | 275 |
277 #ifdef DEBUG | 276 #ifdef DEBUG |
278 void VerifyCall(); | 277 void VerifyCall(); |
279 #endif | 278 #endif |
280 | 279 |
(...skipping 15 matching lines...) Expand all Loading... |
296 | 295 |
297 | 296 |
298 // R = number of result operands (0 or 1). | 297 // R = number of result operands (0 or 1). |
299 // I = number of input operands. | 298 // I = number of input operands. |
300 // T = number of temporary operands. | 299 // T = number of temporary operands. |
301 template<int R, int I, int T> | 300 template<int R, int I, int T> |
302 class LTemplateInstruction: public LInstruction { | 301 class LTemplateInstruction: public LInstruction { |
303 public: | 302 public: |
304 // Allow 0 or 1 output operands. | 303 // Allow 0 or 1 output operands. |
305 STATIC_ASSERT(R == 0 || R == 1); | 304 STATIC_ASSERT(R == 0 || R == 1); |
306 virtual bool HasResult() const { return R != 0 && result() != NULL; } | 305 virtual bool HasResult() const { return R != 0; } |
307 void set_result(LOperand* operand) { results_[0] = operand; } | 306 void set_result(LOperand* operand) { results_[0] = operand; } |
308 LOperand* result() const { return results_[0]; } | 307 LOperand* result() { return results_[0]; } |
309 | 308 |
310 protected: | 309 protected: |
311 EmbeddedContainer<LOperand*, R> results_; | 310 EmbeddedContainer<LOperand*, R> results_; |
312 EmbeddedContainer<LOperand*, I> inputs_; | 311 EmbeddedContainer<LOperand*, I> inputs_; |
313 EmbeddedContainer<LOperand*, T> temps_; | 312 EmbeddedContainer<LOperand*, T> temps_; |
314 | 313 |
315 private: | 314 private: |
316 // Iterator support. | 315 // Iterator support. |
317 virtual int InputCount() { return I; } | 316 virtual int InputCount() { return I; } |
318 virtual LOperand* InputAt(int i) { return inputs_[i]; } | 317 virtual LOperand* InputAt(int i) { return inputs_[i]; } |
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1160 | 1159 |
1161 LOperand* temp() { return temps_[0]; } | 1160 LOperand* temp() { return temps_[0]; } |
1162 | 1161 |
1163 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d") | 1162 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d") |
1164 DECLARE_HYDROGEN_ACCESSOR(Constant) | 1163 DECLARE_HYDROGEN_ACCESSOR(Constant) |
1165 | 1164 |
1166 double value() const { return hydrogen()->DoubleValue(); } | 1165 double value() const { return hydrogen()->DoubleValue(); } |
1167 }; | 1166 }; |
1168 | 1167 |
1169 | 1168 |
1170 class LConstantE: public LTemplateInstruction<1, 0, 0> { | |
1171 public: | |
1172 DECLARE_CONCRETE_INSTRUCTION(ConstantE, "constant-e") | |
1173 DECLARE_HYDROGEN_ACCESSOR(Constant) | |
1174 | |
1175 ExternalReference value() const { | |
1176 return hydrogen()->ExternalReferenceValue(); | |
1177 } | |
1178 }; | |
1179 | |
1180 | |
1181 class LConstantT: public LTemplateInstruction<1, 0, 0> { | 1169 class LConstantT: public LTemplateInstruction<1, 0, 0> { |
1182 public: | 1170 public: |
1183 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") | 1171 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") |
1184 DECLARE_HYDROGEN_ACCESSOR(Constant) | 1172 DECLARE_HYDROGEN_ACCESSOR(Constant) |
1185 | 1173 |
1186 Handle<Object> value() const { return hydrogen()->handle(); } | 1174 Handle<Object> value() const { return hydrogen()->handle(); } |
1187 }; | 1175 }; |
1188 | 1176 |
1189 | 1177 |
1190 class LBranch: public LControlInstruction<1, 0> { | 1178 class LBranch: public LControlInstruction<1, 0> { |
(...skipping 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2718 | 2706 |
2719 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2707 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2720 }; | 2708 }; |
2721 | 2709 |
2722 #undef DECLARE_HYDROGEN_ACCESSOR | 2710 #undef DECLARE_HYDROGEN_ACCESSOR |
2723 #undef DECLARE_CONCRETE_INSTRUCTION | 2711 #undef DECLARE_CONCRETE_INSTRUCTION |
2724 | 2712 |
2725 } } // namespace v8::int | 2713 } } // namespace v8::int |
2726 | 2714 |
2727 #endif // V8_X64_LITHIUM_X64_H_ | 2715 #endif // V8_X64_LITHIUM_X64_H_ |
OLD | NEW |