OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC_LITHIUM_PPC_H_ | 5 #ifndef V8_PPC_LITHIUM_PPC_H_ |
6 #define V8_PPC_LITHIUM_PPC_H_ | 6 #define V8_PPC_LITHIUM_PPC_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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 | 278 |
279 | 279 |
280 // R = number of result operands (0 or 1). | 280 // R = number of result operands (0 or 1). |
281 template <int R> | 281 template <int R> |
282 class LTemplateResultInstruction : public LInstruction { | 282 class LTemplateResultInstruction : public LInstruction { |
283 public: | 283 public: |
284 // Allow 0 or 1 output operands. | 284 // Allow 0 or 1 output operands. |
285 STATIC_ASSERT(R == 0 || R == 1); | 285 STATIC_ASSERT(R == 0 || R == 1); |
286 bool HasResult() const FINAL { return R != 0 && result() != NULL; } | 286 bool HasResult() const FINAL { return R != 0 && result() != NULL; } |
287 void set_result(LOperand* operand) { results_[0] = operand; } | 287 void set_result(LOperand* operand) { results_[0] = operand; } |
288 LOperand* result() const { return results_[0]; } | 288 LOperand* result() const OVERRIDE { return results_[0]; } |
289 | 289 |
290 protected: | 290 protected: |
291 EmbeddedContainer<LOperand*, R> results_; | 291 EmbeddedContainer<LOperand*, R> results_; |
292 }; | 292 }; |
293 | 293 |
294 | 294 |
295 // R = number of result operands (0 or 1). | 295 // R = number of result operands (0 or 1). |
296 // I = number of input operands. | 296 // I = number of input operands. |
297 // T = number of temporary operands. | 297 // T = number of temporary operands. |
298 template <int R, int I, int T> | 298 template <int R, int I, int T> |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 explicit LCallStub(LOperand* context) { inputs_[0] = context; } | 459 explicit LCallStub(LOperand* context) { inputs_[0] = context; } |
460 | 460 |
461 LOperand* context() { return inputs_[0]; } | 461 LOperand* context() { return inputs_[0]; } |
462 | 462 |
463 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") | 463 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") |
464 DECLARE_HYDROGEN_ACCESSOR(CallStub) | 464 DECLARE_HYDROGEN_ACCESSOR(CallStub) |
465 }; | 465 }; |
466 | 466 |
467 | 467 |
468 class LTailCallThroughMegamorphicCache FINAL | 468 class LTailCallThroughMegamorphicCache FINAL |
469 : public LTemplateInstruction<0, 3, 0> { | 469 : public LTemplateInstruction<0, 5, 0> { |
470 public: | 470 public: |
471 explicit LTailCallThroughMegamorphicCache(LOperand* context, | 471 LTailCallThroughMegamorphicCache(LOperand* context, LOperand* receiver, |
472 LOperand* receiver, | 472 LOperand* name, LOperand* slot, |
473 LOperand* name) { | 473 LOperand* vector) { |
474 inputs_[0] = context; | 474 inputs_[0] = context; |
475 inputs_[1] = receiver; | 475 inputs_[1] = receiver; |
476 inputs_[2] = name; | 476 inputs_[2] = name; |
| 477 inputs_[3] = slot; |
| 478 inputs_[4] = vector; |
477 } | 479 } |
478 | 480 |
479 LOperand* context() { return inputs_[0]; } | 481 LOperand* context() { return inputs_[0]; } |
480 LOperand* receiver() { return inputs_[1]; } | 482 LOperand* receiver() { return inputs_[1]; } |
481 LOperand* name() { return inputs_[2]; } | 483 LOperand* name() { return inputs_[2]; } |
| 484 LOperand* slot() { return inputs_[3]; } |
| 485 LOperand* vector() { return inputs_[4]; } |
482 | 486 |
483 DECLARE_CONCRETE_INSTRUCTION(TailCallThroughMegamorphicCache, | 487 DECLARE_CONCRETE_INSTRUCTION(TailCallThroughMegamorphicCache, |
484 "tail-call-through-megamorphic-cache") | 488 "tail-call-through-megamorphic-cache") |
485 DECLARE_HYDROGEN_ACCESSOR(TailCallThroughMegamorphicCache) | 489 DECLARE_HYDROGEN_ACCESSOR(TailCallThroughMegamorphicCache) |
486 }; | 490 }; |
487 | 491 |
| 492 |
488 class LUnknownOSRValue FINAL : public LTemplateInstruction<1, 0, 0> { | 493 class LUnknownOSRValue FINAL : public LTemplateInstruction<1, 0, 0> { |
489 public: | 494 public: |
490 bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { return false; } | 495 bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { return false; } |
491 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") | 496 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") |
492 }; | 497 }; |
493 | 498 |
494 | 499 |
495 template <int I, int T> | 500 template <int I, int T> |
496 class LControlInstruction : public LTemplateInstruction<0, I, T> { | 501 class LControlInstruction : public LTemplateInstruction<0, I, T> { |
497 public: | 502 public: |
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1302 Smi* value() const { return Smi::FromInt(hydrogen()->Integer32Value()); } | 1307 Smi* value() const { return Smi::FromInt(hydrogen()->Integer32Value()); } |
1303 }; | 1308 }; |
1304 | 1309 |
1305 | 1310 |
1306 class LConstantD FINAL : public LTemplateInstruction<1, 0, 0> { | 1311 class LConstantD FINAL : public LTemplateInstruction<1, 0, 0> { |
1307 public: | 1312 public: |
1308 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d") | 1313 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d") |
1309 DECLARE_HYDROGEN_ACCESSOR(Constant) | 1314 DECLARE_HYDROGEN_ACCESSOR(Constant) |
1310 | 1315 |
1311 double value() const { return hydrogen()->DoubleValue(); } | 1316 double value() const { return hydrogen()->DoubleValue(); } |
| 1317 uint64_t bits() const { return hydrogen()->DoubleValueAsBits(); } |
1312 }; | 1318 }; |
1313 | 1319 |
1314 | 1320 |
1315 class LConstantE FINAL : public LTemplateInstruction<1, 0, 0> { | 1321 class LConstantE FINAL : public LTemplateInstruction<1, 0, 0> { |
1316 public: | 1322 public: |
1317 DECLARE_CONCRETE_INSTRUCTION(ConstantE, "constant-e") | 1323 DECLARE_CONCRETE_INSTRUCTION(ConstantE, "constant-e") |
1318 DECLARE_HYDROGEN_ACCESSOR(Constant) | 1324 DECLARE_HYDROGEN_ACCESSOR(Constant) |
1319 | 1325 |
1320 ExternalReference value() const { | 1326 ExternalReference value() const { |
1321 return hydrogen()->ExternalReferenceValue(); | 1327 return hydrogen()->ExternalReferenceValue(); |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1738 class LStoreCodeEntry FINAL : public LTemplateInstruction<0, 2, 0> { | 1744 class LStoreCodeEntry FINAL : public LTemplateInstruction<0, 2, 0> { |
1739 public: | 1745 public: |
1740 LStoreCodeEntry(LOperand* function, LOperand* code_object) { | 1746 LStoreCodeEntry(LOperand* function, LOperand* code_object) { |
1741 inputs_[0] = function; | 1747 inputs_[0] = function; |
1742 inputs_[1] = code_object; | 1748 inputs_[1] = code_object; |
1743 } | 1749 } |
1744 | 1750 |
1745 LOperand* function() { return inputs_[0]; } | 1751 LOperand* function() { return inputs_[0]; } |
1746 LOperand* code_object() { return inputs_[1]; } | 1752 LOperand* code_object() { return inputs_[1]; } |
1747 | 1753 |
1748 virtual void PrintDataTo(StringStream* stream); | 1754 void PrintDataTo(StringStream* stream) OVERRIDE; |
1749 | 1755 |
1750 DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry, "store-code-entry") | 1756 DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry, "store-code-entry") |
1751 DECLARE_HYDROGEN_ACCESSOR(StoreCodeEntry) | 1757 DECLARE_HYDROGEN_ACCESSOR(StoreCodeEntry) |
1752 }; | 1758 }; |
1753 | 1759 |
1754 | 1760 |
1755 class LInnerAllocatedObject FINAL : public LTemplateInstruction<1, 2, 0> { | 1761 class LInnerAllocatedObject FINAL : public LTemplateInstruction<1, 2, 0> { |
1756 public: | 1762 public: |
1757 LInnerAllocatedObject(LOperand* base_object, LOperand* offset) { | 1763 LInnerAllocatedObject(LOperand* base_object, LOperand* offset) { |
1758 inputs_[0] = base_object; | 1764 inputs_[0] = base_object; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1815 : descriptor_(descriptor), | 1821 : descriptor_(descriptor), |
1816 inputs_(descriptor.GetRegisterParameterCount() + 1, zone) { | 1822 inputs_(descriptor.GetRegisterParameterCount() + 1, zone) { |
1817 DCHECK(descriptor.GetRegisterParameterCount() + 1 == operands.length()); | 1823 DCHECK(descriptor.GetRegisterParameterCount() + 1 == operands.length()); |
1818 inputs_.AddAll(operands, zone); | 1824 inputs_.AddAll(operands, zone); |
1819 } | 1825 } |
1820 | 1826 |
1821 LOperand* target() const { return inputs_[0]; } | 1827 LOperand* target() const { return inputs_[0]; } |
1822 | 1828 |
1823 const CallInterfaceDescriptor descriptor() { return descriptor_; } | 1829 const CallInterfaceDescriptor descriptor() { return descriptor_; } |
1824 | 1830 |
| 1831 DECLARE_HYDROGEN_ACCESSOR(CallWithDescriptor) |
| 1832 |
1825 private: | 1833 private: |
1826 DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor") | 1834 DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor") |
1827 DECLARE_HYDROGEN_ACCESSOR(CallWithDescriptor) | |
1828 | 1835 |
1829 void PrintDataTo(StringStream* stream) OVERRIDE; | 1836 void PrintDataTo(StringStream* stream) OVERRIDE; |
1830 | 1837 |
1831 int arity() const { return hydrogen()->argument_count() - 1; } | 1838 int arity() const { return hydrogen()->argument_count() - 1; } |
1832 | 1839 |
1833 CallInterfaceDescriptor descriptor_; | 1840 CallInterfaceDescriptor descriptor_; |
1834 ZoneList<LOperand*> inputs_; | 1841 ZoneList<LOperand*> inputs_; |
1835 | 1842 |
1836 // Iterator support. | 1843 // Iterator support. |
1837 int InputCount() FINAL { return inputs_.length(); } | 1844 int InputCount() FINAL { return inputs_.length(); } |
(...skipping 16 matching lines...) Expand all Loading... |
1854 | 1861 |
1855 DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function") | 1862 DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function") |
1856 DECLARE_HYDROGEN_ACCESSOR(InvokeFunction) | 1863 DECLARE_HYDROGEN_ACCESSOR(InvokeFunction) |
1857 | 1864 |
1858 void PrintDataTo(StringStream* stream) OVERRIDE; | 1865 void PrintDataTo(StringStream* stream) OVERRIDE; |
1859 | 1866 |
1860 int arity() const { return hydrogen()->argument_count() - 1; } | 1867 int arity() const { return hydrogen()->argument_count() - 1; } |
1861 }; | 1868 }; |
1862 | 1869 |
1863 | 1870 |
1864 class LCallFunction FINAL : public LTemplateInstruction<1, 2, 0> { | 1871 class LCallFunction FINAL : public LTemplateInstruction<1, 2, 2> { |
1865 public: | 1872 public: |
1866 LCallFunction(LOperand* context, LOperand* function) { | 1873 LCallFunction(LOperand* context, LOperand* function, LOperand* slot, |
| 1874 LOperand* vector) { |
1867 inputs_[0] = context; | 1875 inputs_[0] = context; |
1868 inputs_[1] = function; | 1876 inputs_[1] = function; |
| 1877 temps_[0] = slot; |
| 1878 temps_[1] = vector; |
1869 } | 1879 } |
1870 | 1880 |
1871 LOperand* context() { return inputs_[0]; } | 1881 LOperand* context() { return inputs_[0]; } |
1872 LOperand* function() { return inputs_[1]; } | 1882 LOperand* function() { return inputs_[1]; } |
| 1883 LOperand* temp_slot() { return temps_[0]; } |
| 1884 LOperand* temp_vector() { return temps_[1]; } |
1873 | 1885 |
1874 DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function") | 1886 DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function") |
1875 DECLARE_HYDROGEN_ACCESSOR(CallFunction) | 1887 DECLARE_HYDROGEN_ACCESSOR(CallFunction) |
1876 | 1888 |
1877 int arity() const { return hydrogen()->argument_count() - 1; } | 1889 int arity() const { return hydrogen()->argument_count() - 1; } |
| 1890 void PrintDataTo(StringStream* stream) OVERRIDE; |
1878 }; | 1891 }; |
1879 | 1892 |
1880 | 1893 |
1881 class LCallNew FINAL : public LTemplateInstruction<1, 2, 0> { | 1894 class LCallNew FINAL : public LTemplateInstruction<1, 2, 0> { |
1882 public: | 1895 public: |
1883 LCallNew(LOperand* context, LOperand* constructor) { | 1896 LCallNew(LOperand* context, LOperand* constructor) { |
1884 inputs_[0] = context; | 1897 inputs_[0] = context; |
1885 inputs_[1] = constructor; | 1898 inputs_[1] = constructor; |
1886 } | 1899 } |
1887 | 1900 |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2123 LOperand* context() { return inputs_[0]; } | 2136 LOperand* context() { return inputs_[0]; } |
2124 LOperand* object() { return inputs_[1]; } | 2137 LOperand* object() { return inputs_[1]; } |
2125 LOperand* value() { return inputs_[2]; } | 2138 LOperand* value() { return inputs_[2]; } |
2126 | 2139 |
2127 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") | 2140 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") |
2128 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric) | 2141 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric) |
2129 | 2142 |
2130 void PrintDataTo(StringStream* stream) OVERRIDE; | 2143 void PrintDataTo(StringStream* stream) OVERRIDE; |
2131 | 2144 |
2132 Handle<Object> name() const { return hydrogen()->name(); } | 2145 Handle<Object> name() const { return hydrogen()->name(); } |
2133 StrictMode strict_mode() { return hydrogen()->strict_mode(); } | 2146 LanguageMode language_mode() { return hydrogen()->language_mode(); } |
2134 }; | 2147 }; |
2135 | 2148 |
2136 | 2149 |
2137 class LStoreKeyed FINAL : public LTemplateInstruction<0, 3, 0> { | 2150 class LStoreKeyed FINAL : public LTemplateInstruction<0, 3, 0> { |
2138 public: | 2151 public: |
2139 LStoreKeyed(LOperand* object, LOperand* key, LOperand* value) { | 2152 LStoreKeyed(LOperand* object, LOperand* key, LOperand* value) { |
2140 inputs_[0] = object; | 2153 inputs_[0] = object; |
2141 inputs_[1] = key; | 2154 inputs_[1] = key; |
2142 inputs_[2] = value; | 2155 inputs_[2] = value; |
2143 } | 2156 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2182 LOperand* context() { return inputs_[0]; } | 2195 LOperand* context() { return inputs_[0]; } |
2183 LOperand* object() { return inputs_[1]; } | 2196 LOperand* object() { return inputs_[1]; } |
2184 LOperand* key() { return inputs_[2]; } | 2197 LOperand* key() { return inputs_[2]; } |
2185 LOperand* value() { return inputs_[3]; } | 2198 LOperand* value() { return inputs_[3]; } |
2186 | 2199 |
2187 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") | 2200 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") |
2188 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) | 2201 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) |
2189 | 2202 |
2190 void PrintDataTo(StringStream* stream) OVERRIDE; | 2203 void PrintDataTo(StringStream* stream) OVERRIDE; |
2191 | 2204 |
2192 StrictMode strict_mode() { return hydrogen()->strict_mode(); } | 2205 LanguageMode language_mode() { return hydrogen()->language_mode(); } |
2193 }; | 2206 }; |
2194 | 2207 |
2195 | 2208 |
2196 class LTransitionElementsKind FINAL : public LTemplateInstruction<0, 2, 1> { | 2209 class LTransitionElementsKind FINAL : public LTemplateInstruction<0, 2, 1> { |
2197 public: | 2210 public: |
2198 LTransitionElementsKind(LOperand* object, LOperand* context, | 2211 LTransitionElementsKind(LOperand* object, LOperand* context, |
2199 LOperand* new_map_temp) { | 2212 LOperand* new_map_temp) { |
2200 inputs_[0] = object; | 2213 inputs_[0] = object; |
2201 inputs_[1] = context; | 2214 inputs_[1] = context; |
2202 temps_[0] = new_map_temp; | 2215 temps_[0] = new_map_temp; |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2737 | 2750 |
2738 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2751 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2739 }; | 2752 }; |
2740 | 2753 |
2741 #undef DECLARE_HYDROGEN_ACCESSOR | 2754 #undef DECLARE_HYDROGEN_ACCESSOR |
2742 #undef DECLARE_CONCRETE_INSTRUCTION | 2755 #undef DECLARE_CONCRETE_INSTRUCTION |
2743 } | 2756 } |
2744 } // namespace v8::internal | 2757 } // namespace v8::internal |
2745 | 2758 |
2746 #endif // V8_PPC_LITHIUM_PPC_H_ | 2759 #endif // V8_PPC_LITHIUM_PPC_H_ |
OLD | NEW |