| 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 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 namespace v8 { | 37 namespace v8 { |
| 38 namespace internal { | 38 namespace internal { |
| 39 | 39 |
| 40 // Forward declarations. | 40 // Forward declarations. |
| 41 class LCodeGen; | 41 class LCodeGen; |
| 42 | 42 |
| 43 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \ | 43 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \ |
| 44 V(AccessArgumentsAt) \ | 44 V(AccessArgumentsAt) \ |
| 45 V(AddI) \ | 45 V(AddI) \ |
| 46 V(Allocate) \ |
| 46 V(AllocateObject) \ | 47 V(AllocateObject) \ |
| 47 V(ApplyArguments) \ | 48 V(ApplyArguments) \ |
| 48 V(ArgumentsElements) \ | 49 V(ArgumentsElements) \ |
| 49 V(ArgumentsLength) \ | 50 V(ArgumentsLength) \ |
| 50 V(ArithmeticD) \ | 51 V(ArithmeticD) \ |
| 51 V(ArithmeticT) \ | 52 V(ArithmeticT) \ |
| 52 V(ArrayLiteral) \ | 53 V(ArrayLiteral) \ |
| 53 V(BitI) \ | 54 V(BitI) \ |
| 54 V(BitNotI) \ | 55 V(BitNotI) \ |
| 55 V(BoundsCheck) \ | 56 V(BoundsCheck) \ |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 V(StringCharCodeAt) \ | 162 V(StringCharCodeAt) \ |
| 162 V(StringCharFromCode) \ | 163 V(StringCharFromCode) \ |
| 163 V(StringCompareAndBranch) \ | 164 V(StringCompareAndBranch) \ |
| 164 V(StringLength) \ | 165 V(StringLength) \ |
| 165 V(SubI) \ | 166 V(SubI) \ |
| 166 V(TaggedToI) \ | 167 V(TaggedToI) \ |
| 167 V(ThisFunction) \ | 168 V(ThisFunction) \ |
| 168 V(Throw) \ | 169 V(Throw) \ |
| 169 V(ToFastProperties) \ | 170 V(ToFastProperties) \ |
| 170 V(TransitionElementsKind) \ | 171 V(TransitionElementsKind) \ |
| 172 V(TrapAllocationMemento) \ |
| 171 V(Typeof) \ | 173 V(Typeof) \ |
| 172 V(TypeofIsAndBranch) \ | 174 V(TypeofIsAndBranch) \ |
| 173 V(UnaryMathOperation) \ | 175 V(UnaryMathOperation) \ |
| 174 V(UnknownOSRValue) \ | 176 V(UnknownOSRValue) \ |
| 175 V(ValueOf) \ | 177 V(ValueOf) \ |
| 176 V(ForInPrepareMap) \ | 178 V(ForInPrepareMap) \ |
| 177 V(ForInCacheArray) \ | 179 V(ForInCacheArray) \ |
| 178 V(CheckMapValue) \ | 180 V(CheckMapValue) \ |
| 179 V(LoadFieldByIndex) \ | 181 V(LoadFieldByIndex) \ |
| 180 V(DateField) \ | 182 V(DateField) \ |
| (...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1459 LOperand* elements() { return inputs_[0]; } | 1461 LOperand* elements() { return inputs_[0]; } |
| 1460 LOperand* key() { return inputs_[1]; } | 1462 LOperand* key() { return inputs_[1]; } |
| 1461 ElementsKind elements_kind() const { | 1463 ElementsKind elements_kind() const { |
| 1462 return hydrogen()->elements_kind(); | 1464 return hydrogen()->elements_kind(); |
| 1463 } | 1465 } |
| 1464 bool is_external() const { | 1466 bool is_external() const { |
| 1465 return hydrogen()->is_external(); | 1467 return hydrogen()->is_external(); |
| 1466 } | 1468 } |
| 1467 | 1469 |
| 1468 virtual bool ClobbersDoubleRegisters() const { | 1470 virtual bool ClobbersDoubleRegisters() const { |
| 1469 return !IsDoubleOrFloatElementsKind(hydrogen()->elements_kind()); | 1471 return !CpuFeatures::IsSupported(SSE2) && |
| 1472 !IsDoubleOrFloatElementsKind(hydrogen()->elements_kind()); |
| 1470 } | 1473 } |
| 1471 | 1474 |
| 1472 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") | 1475 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") |
| 1473 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) | 1476 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) |
| 1474 | 1477 |
| 1475 virtual void PrintDataTo(StringStream* stream); | 1478 virtual void PrintDataTo(StringStream* stream); |
| 1476 uint32_t additional_index() const { return hydrogen()->index_offset(); } | 1479 uint32_t additional_index() const { return hydrogen()->index_offset(); } |
| 1477 bool key_is_smi() { | 1480 bool key_is_smi() { |
| 1478 return hydrogen()->key()->representation().IsTagged(); | 1481 return hydrogen()->key()->representation().IsTagged(); |
| 1479 } | 1482 } |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1635 class LThisFunction: public LTemplateInstruction<1, 0, 0> { | 1638 class LThisFunction: public LTemplateInstruction<1, 0, 0> { |
| 1636 public: | 1639 public: |
| 1637 DECLARE_CONCRETE_INSTRUCTION(ThisFunction, "this-function") | 1640 DECLARE_CONCRETE_INSTRUCTION(ThisFunction, "this-function") |
| 1638 DECLARE_HYDROGEN_ACCESSOR(ThisFunction) | 1641 DECLARE_HYDROGEN_ACCESSOR(ThisFunction) |
| 1639 }; | 1642 }; |
| 1640 | 1643 |
| 1641 | 1644 |
| 1642 class LContext: public LTemplateInstruction<1, 0, 0> { | 1645 class LContext: public LTemplateInstruction<1, 0, 0> { |
| 1643 public: | 1646 public: |
| 1644 DECLARE_CONCRETE_INSTRUCTION(Context, "context") | 1647 DECLARE_CONCRETE_INSTRUCTION(Context, "context") |
| 1648 DECLARE_HYDROGEN_ACCESSOR(Context) |
| 1645 }; | 1649 }; |
| 1646 | 1650 |
| 1647 | 1651 |
| 1648 class LOuterContext: public LTemplateInstruction<1, 1, 0> { | 1652 class LOuterContext: public LTemplateInstruction<1, 1, 0> { |
| 1649 public: | 1653 public: |
| 1650 explicit LOuterContext(LOperand* context) { | 1654 explicit LOuterContext(LOperand* context) { |
| 1651 inputs_[0] = context; | 1655 inputs_[0] = context; |
| 1652 } | 1656 } |
| 1653 | 1657 |
| 1654 LOperand* context() { return inputs_[0]; } | 1658 LOperand* context() { return inputs_[0]; } |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1899 public: | 1903 public: |
| 1900 LNumberTagD(LOperand* value, LOperand* temp) { | 1904 LNumberTagD(LOperand* value, LOperand* temp) { |
| 1901 inputs_[0] = value; | 1905 inputs_[0] = value; |
| 1902 temps_[0] = temp; | 1906 temps_[0] = temp; |
| 1903 } | 1907 } |
| 1904 | 1908 |
| 1905 LOperand* value() { return inputs_[0]; } | 1909 LOperand* value() { return inputs_[0]; } |
| 1906 LOperand* temp() { return temps_[0]; } | 1910 LOperand* temp() { return temps_[0]; } |
| 1907 | 1911 |
| 1908 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") | 1912 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") |
| 1913 DECLARE_HYDROGEN_ACCESSOR(Change) |
| 1909 }; | 1914 }; |
| 1910 | 1915 |
| 1911 | 1916 |
| 1912 // Sometimes truncating conversion from a tagged value to an int32. | 1917 // Sometimes truncating conversion from a tagged value to an int32. |
| 1913 class LDoubleToI: public LTemplateInstruction<1, 1, 1> { | 1918 class LDoubleToI: public LTemplateInstruction<1, 1, 1> { |
| 1914 public: | 1919 public: |
| 1915 LDoubleToI(LOperand* value, LOperand* temp) { | 1920 LDoubleToI(LOperand* value, LOperand* temp) { |
| 1916 inputs_[0] = value; | 1921 inputs_[0] = value; |
| 1917 temps_[0] = temp; | 1922 temps_[0] = temp; |
| 1918 } | 1923 } |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2084 | 2089 |
| 2085 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") | 2090 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") |
| 2086 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) | 2091 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) |
| 2087 | 2092 |
| 2088 virtual void PrintDataTo(StringStream* stream); | 2093 virtual void PrintDataTo(StringStream* stream); |
| 2089 | 2094 |
| 2090 StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); } | 2095 StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); } |
| 2091 }; | 2096 }; |
| 2092 | 2097 |
| 2093 | 2098 |
| 2094 class LTransitionElementsKind: public LTemplateInstruction<1, 1, 2> { | 2099 class LTransitionElementsKind: public LTemplateInstruction<0, 2, 2> { |
| 2095 public: | 2100 public: |
| 2096 LTransitionElementsKind(LOperand* object, | 2101 LTransitionElementsKind(LOperand* object, |
| 2102 LOperand* context, |
| 2097 LOperand* new_map_temp, | 2103 LOperand* new_map_temp, |
| 2098 LOperand* temp) { | 2104 LOperand* temp) { |
| 2099 inputs_[0] = object; | 2105 inputs_[0] = object; |
| 2106 inputs_[1] = context; |
| 2100 temps_[0] = new_map_temp; | 2107 temps_[0] = new_map_temp; |
| 2101 temps_[1] = temp; | 2108 temps_[1] = temp; |
| 2102 } | 2109 } |
| 2103 | 2110 |
| 2111 LOperand* context() { return inputs_[1]; } |
| 2104 LOperand* object() { return inputs_[0]; } | 2112 LOperand* object() { return inputs_[0]; } |
| 2105 LOperand* new_map_temp() { return temps_[0]; } | 2113 LOperand* new_map_temp() { return temps_[0]; } |
| 2106 LOperand* temp() { return temps_[1]; } | 2114 LOperand* temp() { return temps_[1]; } |
| 2107 | 2115 |
| 2108 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind, | 2116 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind, |
| 2109 "transition-elements-kind") | 2117 "transition-elements-kind") |
| 2110 DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind) | 2118 DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind) |
| 2111 | 2119 |
| 2112 virtual void PrintDataTo(StringStream* stream); | 2120 virtual void PrintDataTo(StringStream* stream); |
| 2113 | 2121 |
| 2114 Handle<Map> original_map() { return hydrogen()->original_map(); } | 2122 Handle<Map> original_map() { return hydrogen()->original_map(); } |
| 2115 Handle<Map> transitioned_map() { return hydrogen()->transitioned_map(); } | 2123 Handle<Map> transitioned_map() { return hydrogen()->transitioned_map(); } |
| 2116 ElementsKind from_kind() { return hydrogen()->from_kind(); } | 2124 ElementsKind from_kind() { return hydrogen()->from_kind(); } |
| 2117 ElementsKind to_kind() { return hydrogen()->to_kind(); } | 2125 ElementsKind to_kind() { return hydrogen()->to_kind(); } |
| 2118 }; | 2126 }; |
| 2119 | 2127 |
| 2120 | 2128 |
| 2129 class LTrapAllocationMemento : public LTemplateInstruction<0, 1, 1> { |
| 2130 public: |
| 2131 LTrapAllocationMemento(LOperand* object, |
| 2132 LOperand* temp) { |
| 2133 inputs_[0] = object; |
| 2134 temps_[0] = temp; |
| 2135 } |
| 2136 |
| 2137 LOperand* object() { return inputs_[0]; } |
| 2138 LOperand* temp() { return temps_[0]; } |
| 2139 |
| 2140 DECLARE_CONCRETE_INSTRUCTION(TrapAllocationMemento, |
| 2141 "trap-allocation-memento") |
| 2142 }; |
| 2143 |
| 2144 |
| 2121 class LStringAdd: public LTemplateInstruction<1, 3, 0> { | 2145 class LStringAdd: public LTemplateInstruction<1, 3, 0> { |
| 2122 public: | 2146 public: |
| 2123 LStringAdd(LOperand* context, LOperand* left, LOperand* right) { | 2147 LStringAdd(LOperand* context, LOperand* left, LOperand* right) { |
| 2124 inputs_[0] = context; | 2148 inputs_[0] = context; |
| 2125 inputs_[1] = left; | 2149 inputs_[1] = left; |
| 2126 inputs_[2] = right; | 2150 inputs_[2] = right; |
| 2127 } | 2151 } |
| 2128 | 2152 |
| 2129 LOperand* context() { return inputs_[0]; } | 2153 LOperand* context() { return inputs_[0]; } |
| 2130 LOperand* left() { return inputs_[1]; } | 2154 LOperand* left() { return inputs_[1]; } |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2308 } | 2332 } |
| 2309 | 2333 |
| 2310 LOperand* context() { return inputs_[0]; } | 2334 LOperand* context() { return inputs_[0]; } |
| 2311 LOperand* temp() { return temps_[0]; } | 2335 LOperand* temp() { return temps_[0]; } |
| 2312 | 2336 |
| 2313 DECLARE_CONCRETE_INSTRUCTION(AllocateObject, "allocate-object") | 2337 DECLARE_CONCRETE_INSTRUCTION(AllocateObject, "allocate-object") |
| 2314 DECLARE_HYDROGEN_ACCESSOR(AllocateObject) | 2338 DECLARE_HYDROGEN_ACCESSOR(AllocateObject) |
| 2315 }; | 2339 }; |
| 2316 | 2340 |
| 2317 | 2341 |
| 2342 class LAllocate: public LTemplateInstruction<1, 2, 1> { |
| 2343 public: |
| 2344 LAllocate(LOperand* context, LOperand* size, LOperand* temp) { |
| 2345 inputs_[0] = context; |
| 2346 inputs_[1] = size; |
| 2347 temps_[0] = temp; |
| 2348 } |
| 2349 |
| 2350 LOperand* context() { return inputs_[0]; } |
| 2351 LOperand* size() { return inputs_[1]; } |
| 2352 LOperand* temp() { return temps_[0]; } |
| 2353 |
| 2354 DECLARE_CONCRETE_INSTRUCTION(Allocate, "allocate") |
| 2355 DECLARE_HYDROGEN_ACCESSOR(Allocate) |
| 2356 }; |
| 2357 |
| 2358 |
| 2318 class LFastLiteral: public LTemplateInstruction<1, 1, 0> { | 2359 class LFastLiteral: public LTemplateInstruction<1, 1, 0> { |
| 2319 public: | 2360 public: |
| 2320 explicit LFastLiteral(LOperand* context) { | 2361 explicit LFastLiteral(LOperand* context) { |
| 2321 inputs_[0] = context; | 2362 inputs_[0] = context; |
| 2322 } | 2363 } |
| 2323 | 2364 |
| 2324 LOperand* context() { return inputs_[0]; } | 2365 LOperand* context() { return inputs_[0]; } |
| 2325 | 2366 |
| 2326 DECLARE_CONCRETE_INSTRUCTION(FastLiteral, "fast-literal") | 2367 DECLARE_CONCRETE_INSTRUCTION(FastLiteral, "fast-literal") |
| 2327 DECLARE_HYDROGEN_ACCESSOR(FastLiteral) | 2368 DECLARE_HYDROGEN_ACCESSOR(FastLiteral) |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2734 | 2775 |
| 2735 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2776 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 2736 }; | 2777 }; |
| 2737 | 2778 |
| 2738 #undef DECLARE_HYDROGEN_ACCESSOR | 2779 #undef DECLARE_HYDROGEN_ACCESSOR |
| 2739 #undef DECLARE_CONCRETE_INSTRUCTION | 2780 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2740 | 2781 |
| 2741 } } // namespace v8::internal | 2782 } } // namespace v8::internal |
| 2742 | 2783 |
| 2743 #endif // V8_IA32_LITHIUM_IA32_H_ | 2784 #endif // V8_IA32_LITHIUM_IA32_H_ |
| OLD | NEW |