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_X64_LITHIUM_X64_H_ | 5 #ifndef V8_X64_LITHIUM_X64_H_ |
6 #define V8_X64_LITHIUM_X64_H_ | 6 #define V8_X64_LITHIUM_X64_H_ |
7 | 7 |
8 #include "src/hydrogen.h" | 8 #include "src/hydrogen.h" |
9 #include "src/lithium.h" | 9 #include "src/lithium.h" |
10 #include "src/lithium-allocator.h" | 10 #include "src/lithium-allocator.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 164 |
165 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ | 165 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ |
166 virtual Opcode opcode() const V8_FINAL V8_OVERRIDE { \ | 166 virtual Opcode opcode() const V8_FINAL V8_OVERRIDE { \ |
167 return LInstruction::k##type; \ | 167 return LInstruction::k##type; \ |
168 } \ | 168 } \ |
169 virtual void CompileToNative(LCodeGen* generator) V8_FINAL V8_OVERRIDE; \ | 169 virtual void CompileToNative(LCodeGen* generator) V8_FINAL V8_OVERRIDE; \ |
170 virtual const char* Mnemonic() const V8_FINAL V8_OVERRIDE { \ | 170 virtual const char* Mnemonic() const V8_FINAL V8_OVERRIDE { \ |
171 return mnemonic; \ | 171 return mnemonic; \ |
172 } \ | 172 } \ |
173 static L##type* cast(LInstruction* instr) { \ | 173 static L##type* cast(LInstruction* instr) { \ |
174 ASSERT(instr->Is##type()); \ | 174 DCHECK(instr->Is##type()); \ |
175 return reinterpret_cast<L##type*>(instr); \ | 175 return reinterpret_cast<L##type*>(instr); \ |
176 } | 176 } |
177 | 177 |
178 | 178 |
179 #define DECLARE_HYDROGEN_ACCESSOR(type) \ | 179 #define DECLARE_HYDROGEN_ACCESSOR(type) \ |
180 H##type* hydrogen() const { \ | 180 H##type* hydrogen() const { \ |
181 return H##type::cast(hydrogen_value()); \ | 181 return H##type::cast(hydrogen_value()); \ |
182 } | 182 } |
183 | 183 |
184 | 184 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 parallel_moves_[BEFORE] = NULL; | 331 parallel_moves_[BEFORE] = NULL; |
332 parallel_moves_[START] = NULL; | 332 parallel_moves_[START] = NULL; |
333 parallel_moves_[END] = NULL; | 333 parallel_moves_[END] = NULL; |
334 parallel_moves_[AFTER] = NULL; | 334 parallel_moves_[AFTER] = NULL; |
335 } | 335 } |
336 | 336 |
337 // Can't use the DECLARE-macro here because of sub-classes. | 337 // Can't use the DECLARE-macro here because of sub-classes. |
338 virtual bool IsGap() const V8_FINAL V8_OVERRIDE { return true; } | 338 virtual bool IsGap() const V8_FINAL V8_OVERRIDE { return true; } |
339 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 339 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
340 static LGap* cast(LInstruction* instr) { | 340 static LGap* cast(LInstruction* instr) { |
341 ASSERT(instr->IsGap()); | 341 DCHECK(instr->IsGap()); |
342 return reinterpret_cast<LGap*>(instr); | 342 return reinterpret_cast<LGap*>(instr); |
343 } | 343 } |
344 | 344 |
345 bool IsRedundant() const; | 345 bool IsRedundant() const; |
346 | 346 |
347 HBasicBlock* block() const { return block_; } | 347 HBasicBlock* block() const { return block_; } |
348 | 348 |
349 enum InnerPosition { | 349 enum InnerPosition { |
350 BEFORE, | 350 BEFORE, |
351 START, | 351 START, |
(...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1555 inputs_[2] = parameter_count; | 1555 inputs_[2] = parameter_count; |
1556 } | 1556 } |
1557 | 1557 |
1558 LOperand* value() { return inputs_[0]; } | 1558 LOperand* value() { return inputs_[0]; } |
1559 LOperand* context() { return inputs_[1]; } | 1559 LOperand* context() { return inputs_[1]; } |
1560 | 1560 |
1561 bool has_constant_parameter_count() { | 1561 bool has_constant_parameter_count() { |
1562 return parameter_count()->IsConstantOperand(); | 1562 return parameter_count()->IsConstantOperand(); |
1563 } | 1563 } |
1564 LConstantOperand* constant_parameter_count() { | 1564 LConstantOperand* constant_parameter_count() { |
1565 ASSERT(has_constant_parameter_count()); | 1565 DCHECK(has_constant_parameter_count()); |
1566 return LConstantOperand::cast(parameter_count()); | 1566 return LConstantOperand::cast(parameter_count()); |
1567 } | 1567 } |
1568 LOperand* parameter_count() { return inputs_[2]; } | 1568 LOperand* parameter_count() { return inputs_[2]; } |
1569 | 1569 |
1570 DECLARE_CONCRETE_INSTRUCTION(Return, "return") | 1570 DECLARE_CONCRETE_INSTRUCTION(Return, "return") |
1571 DECLARE_HYDROGEN_ACCESSOR(Return) | 1571 DECLARE_HYDROGEN_ACCESSOR(Return) |
1572 }; | 1572 }; |
1573 | 1573 |
1574 | 1574 |
1575 class LLoadNamedField V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 1575 class LLoadNamedField V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1874 int arity() const { return hydrogen()->argument_count() - 1; } | 1874 int arity() const { return hydrogen()->argument_count() - 1; } |
1875 }; | 1875 }; |
1876 | 1876 |
1877 | 1877 |
1878 class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> { | 1878 class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> { |
1879 public: | 1879 public: |
1880 LCallWithDescriptor(const InterfaceDescriptor* descriptor, | 1880 LCallWithDescriptor(const InterfaceDescriptor* descriptor, |
1881 const ZoneList<LOperand*>& operands, | 1881 const ZoneList<LOperand*>& operands, |
1882 Zone* zone) | 1882 Zone* zone) |
1883 : inputs_(descriptor->GetRegisterParameterCount() + 1, zone) { | 1883 : inputs_(descriptor->GetRegisterParameterCount() + 1, zone) { |
1884 ASSERT(descriptor->GetRegisterParameterCount() + 1 == operands.length()); | 1884 DCHECK(descriptor->GetRegisterParameterCount() + 1 == operands.length()); |
1885 inputs_.AddAll(operands, zone); | 1885 inputs_.AddAll(operands, zone); |
1886 } | 1886 } |
1887 | 1887 |
1888 LOperand* target() const { return inputs_[0]; } | 1888 LOperand* target() const { return inputs_[0]; } |
1889 | 1889 |
1890 private: | 1890 private: |
1891 DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor") | 1891 DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor") |
1892 DECLARE_HYDROGEN_ACCESSOR(CallWithDescriptor) | 1892 DECLARE_HYDROGEN_ACCESSOR(CallWithDescriptor) |
1893 | 1893 |
1894 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1894 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2887 | 2887 |
2888 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2888 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2889 }; | 2889 }; |
2890 | 2890 |
2891 #undef DECLARE_HYDROGEN_ACCESSOR | 2891 #undef DECLARE_HYDROGEN_ACCESSOR |
2892 #undef DECLARE_CONCRETE_INSTRUCTION | 2892 #undef DECLARE_CONCRETE_INSTRUCTION |
2893 | 2893 |
2894 } } // namespace v8::int | 2894 } } // namespace v8::int |
2895 | 2895 |
2896 #endif // V8_X64_LITHIUM_X64_H_ | 2896 #endif // V8_X64_LITHIUM_X64_H_ |
OLD | NEW |