OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 V(ConstantD) \ | 82 V(ConstantD) \ |
83 V(ConstantE) \ | 83 V(ConstantE) \ |
84 V(ConstantI) \ | 84 V(ConstantI) \ |
85 V(ConstantS) \ | 85 V(ConstantS) \ |
86 V(ConstantT) \ | 86 V(ConstantT) \ |
87 V(Context) \ | 87 V(Context) \ |
88 V(DateField) \ | 88 V(DateField) \ |
89 V(DebugBreak) \ | 89 V(DebugBreak) \ |
90 V(DeclareGlobals) \ | 90 V(DeclareGlobals) \ |
91 V(Deoptimize) \ | 91 V(Deoptimize) \ |
92 V(DivByConstI) \ | |
93 V(DivByPowerOf2I) \ | 92 V(DivByPowerOf2I) \ |
94 V(DivI) \ | 93 V(DivI) \ |
95 V(DoubleToIntOrSmi) \ | 94 V(DoubleToIntOrSmi) \ |
96 V(Drop) \ | 95 V(Drop) \ |
97 V(Dummy) \ | 96 V(Dummy) \ |
98 V(DummyUse) \ | 97 V(DummyUse) \ |
99 V(FlooringDivByConstI) \ | |
100 V(FlooringDivByPowerOf2I) \ | 98 V(FlooringDivByPowerOf2I) \ |
101 V(FlooringDivI) \ | 99 V(FlooringDivI) \ |
102 V(ForInCacheArray) \ | 100 V(ForInCacheArray) \ |
103 V(ForInPrepareMap) \ | 101 V(ForInPrepareMap) \ |
104 V(FunctionLiteral) \ | 102 V(FunctionLiteral) \ |
105 V(GetCachedArrayIndex) \ | 103 V(GetCachedArrayIndex) \ |
106 V(Goto) \ | 104 V(Goto) \ |
107 V(HasCachedArrayIndexAndBranch) \ | 105 V(HasCachedArrayIndexAndBranch) \ |
108 V(HasInstanceTypeAndBranch) \ | 106 V(HasInstanceTypeAndBranch) \ |
109 V(InnerAllocatedObject) \ | 107 V(InnerAllocatedObject) \ |
(...skipping 26 matching lines...) Expand all Loading... |
136 V(MathAbs) \ | 134 V(MathAbs) \ |
137 V(MathAbsTagged) \ | 135 V(MathAbsTagged) \ |
138 V(MathClz32) \ | 136 V(MathClz32) \ |
139 V(MathExp) \ | 137 V(MathExp) \ |
140 V(MathFloor) \ | 138 V(MathFloor) \ |
141 V(MathLog) \ | 139 V(MathLog) \ |
142 V(MathMinMax) \ | 140 V(MathMinMax) \ |
143 V(MathPowHalf) \ | 141 V(MathPowHalf) \ |
144 V(MathRound) \ | 142 V(MathRound) \ |
145 V(MathSqrt) \ | 143 V(MathSqrt) \ |
146 V(ModByConstI) \ | |
147 V(ModByPowerOf2I) \ | 144 V(ModByPowerOf2I) \ |
148 V(ModI) \ | 145 V(ModI) \ |
149 V(MulConstIS) \ | 146 V(MulConstIS) \ |
150 V(MulI) \ | 147 V(MulI) \ |
151 V(MulS) \ | 148 V(MulS) \ |
152 V(NumberTagD) \ | 149 V(NumberTagD) \ |
153 V(NumberTagU) \ | 150 V(NumberTagU) \ |
154 V(NumberUntagD) \ | 151 V(NumberUntagD) \ |
155 V(OsrEntry) \ | 152 V(OsrEntry) \ |
156 V(Parameter) \ | 153 V(Parameter) \ |
(...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1265 int32_t divisor() const { return divisor_; } | 1262 int32_t divisor() const { return divisor_; } |
1266 | 1263 |
1267 DECLARE_CONCRETE_INSTRUCTION(DivByPowerOf2I, "div-by-power-of-2-i") | 1264 DECLARE_CONCRETE_INSTRUCTION(DivByPowerOf2I, "div-by-power-of-2-i") |
1268 DECLARE_HYDROGEN_ACCESSOR(Div) | 1265 DECLARE_HYDROGEN_ACCESSOR(Div) |
1269 | 1266 |
1270 private: | 1267 private: |
1271 int32_t divisor_; | 1268 int32_t divisor_; |
1272 }; | 1269 }; |
1273 | 1270 |
1274 | 1271 |
1275 class LDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 1> { | |
1276 public: | |
1277 LDivByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) { | |
1278 inputs_[0] = dividend; | |
1279 divisor_ = divisor; | |
1280 temps_[0] = temp; | |
1281 } | |
1282 | |
1283 LOperand* dividend() { return inputs_[0]; } | |
1284 int32_t divisor() const { return divisor_; } | |
1285 LOperand* temp() { return temps_[0]; } | |
1286 | |
1287 DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i") | |
1288 DECLARE_HYDROGEN_ACCESSOR(Div) | |
1289 | |
1290 private: | |
1291 int32_t divisor_; | |
1292 }; | |
1293 | |
1294 | |
1295 class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> { | 1272 class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> { |
1296 public: | 1273 public: |
1297 LDivI(LOperand* left, LOperand* right, LOperand* temp) { | 1274 LDivI(LOperand* left, LOperand* right, LOperand* temp) { |
1298 inputs_[0] = left; | 1275 inputs_[0] = left; |
1299 inputs_[1] = right; | 1276 inputs_[1] = right; |
1300 temps_[0] = temp; | 1277 temps_[0] = temp; |
1301 } | 1278 } |
1302 | 1279 |
1303 LOperand* left() { return inputs_[0]; } | 1280 LOperand* left() { return inputs_[0]; } |
1304 LOperand* right() { return inputs_[1]; } | 1281 LOperand* right() { return inputs_[1]; } |
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1934 | 1911 |
1935 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I, | 1912 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I, |
1936 "flooring-div-by-power-of-2-i") | 1913 "flooring-div-by-power-of-2-i") |
1937 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) | 1914 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) |
1938 | 1915 |
1939 private: | 1916 private: |
1940 int32_t divisor_; | 1917 int32_t divisor_; |
1941 }; | 1918 }; |
1942 | 1919 |
1943 | 1920 |
1944 class LFlooringDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 0> { | |
1945 public: | |
1946 LFlooringDivByConstI(LOperand* dividend, int32_t divisor) { | |
1947 inputs_[0] = dividend; | |
1948 divisor_ = divisor; | |
1949 } | |
1950 | |
1951 LOperand* dividend() { return inputs_[0]; } | |
1952 int32_t divisor() const { return divisor_; } | |
1953 LOperand* temp1() { return temps_[0]; } | |
1954 | |
1955 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i") | |
1956 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) | |
1957 | |
1958 private: | |
1959 int32_t divisor_; | |
1960 }; | |
1961 | |
1962 | |
1963 class LFlooringDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> { | 1921 class LFlooringDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> { |
1964 public: | 1922 public: |
1965 LFlooringDivI(LOperand* dividend, LOperand* divisor, LOperand* temp) { | 1923 LFlooringDivI(LOperand* dividend, LOperand* divisor, LOperand* temp) { |
1966 inputs_[0] = dividend; | 1924 inputs_[0] = dividend; |
1967 inputs_[1] = divisor; | 1925 inputs_[1] = divisor; |
1968 temps_[0] = temp; | 1926 temps_[0] = temp; |
1969 } | 1927 } |
1970 | 1928 |
1971 LOperand* dividend() { return inputs_[0]; } | 1929 LOperand* dividend() { return inputs_[0]; } |
1972 LOperand* divisor() { return inputs_[1]; } | 1930 LOperand* divisor() { return inputs_[1]; } |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2044 int32_t divisor() const { return divisor_; } | 2002 int32_t divisor() const { return divisor_; } |
2045 | 2003 |
2046 DECLARE_CONCRETE_INSTRUCTION(ModByPowerOf2I, "mod-by-power-of-2-i") | 2004 DECLARE_CONCRETE_INSTRUCTION(ModByPowerOf2I, "mod-by-power-of-2-i") |
2047 DECLARE_HYDROGEN_ACCESSOR(Mod) | 2005 DECLARE_HYDROGEN_ACCESSOR(Mod) |
2048 | 2006 |
2049 private: | 2007 private: |
2050 int32_t divisor_; | 2008 int32_t divisor_; |
2051 }; | 2009 }; |
2052 | 2010 |
2053 | 2011 |
2054 class LModByConstI V8_FINAL : public LTemplateInstruction<1, 1, 1> { | |
2055 public: | |
2056 LModByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) { | |
2057 inputs_[0] = dividend; | |
2058 divisor_ = divisor; | |
2059 temps_[0] = temp; | |
2060 } | |
2061 | |
2062 LOperand* dividend() { return inputs_[0]; } | |
2063 int32_t divisor() const { return divisor_; } | |
2064 LOperand* temp() { return temps_[0]; } | |
2065 | |
2066 DECLARE_CONCRETE_INSTRUCTION(ModByConstI, "mod-by-const-i") | |
2067 DECLARE_HYDROGEN_ACCESSOR(Mod) | |
2068 | |
2069 private: | |
2070 int32_t divisor_; | |
2071 }; | |
2072 | |
2073 | |
2074 class LModI V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 2012 class LModI V8_FINAL : public LTemplateInstruction<1, 2, 0> { |
2075 public: | 2013 public: |
2076 LModI(LOperand* left, LOperand* right) { | 2014 LModI(LOperand* left, LOperand* right) { |
2077 inputs_[0] = left; | 2015 inputs_[0] = left; |
2078 inputs_[1] = right; | 2016 inputs_[1] = right; |
2079 } | 2017 } |
2080 | 2018 |
2081 LOperand* left() { return inputs_[0]; } | 2019 LOperand* left() { return inputs_[0]; } |
2082 LOperand* right() { return inputs_[1]; } | 2020 LOperand* right() { return inputs_[1]; } |
2083 | 2021 |
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2955 LPlatformChunk* Build(); | 2893 LPlatformChunk* Build(); |
2956 | 2894 |
2957 LInstruction* CheckElideControlInstruction(HControlInstruction* instr); | 2895 LInstruction* CheckElideControlInstruction(HControlInstruction* instr); |
2958 | 2896 |
2959 // Declare methods that deal with the individual node types. | 2897 // Declare methods that deal with the individual node types. |
2960 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); | 2898 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); |
2961 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) | 2899 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) |
2962 #undef DECLARE_DO | 2900 #undef DECLARE_DO |
2963 | 2901 |
2964 LInstruction* DoDivByPowerOf2I(HDiv* instr); | 2902 LInstruction* DoDivByPowerOf2I(HDiv* instr); |
2965 LInstruction* DoDivByConstI(HDiv* instr); | |
2966 LInstruction* DoDivI(HBinaryOperation* instr); | 2903 LInstruction* DoDivI(HBinaryOperation* instr); |
2967 LInstruction* DoModByPowerOf2I(HMod* instr); | 2904 LInstruction* DoModByPowerOf2I(HMod* instr); |
2968 LInstruction* DoModByConstI(HMod* instr); | |
2969 LInstruction* DoModI(HMod* instr); | 2905 LInstruction* DoModI(HMod* instr); |
2970 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr); | 2906 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr); |
2971 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr); | |
2972 LInstruction* DoFlooringDivI(HMathFloorOfDiv* instr); | 2907 LInstruction* DoFlooringDivI(HMathFloorOfDiv* instr); |
2973 | 2908 |
2974 static bool HasMagicNumberForDivision(int32_t divisor); | 2909 static bool HasMagicNumberForDivision(int32_t divisor); |
2975 | 2910 |
2976 private: | 2911 private: |
2977 enum Status { | 2912 enum Status { |
2978 UNUSED, | 2913 UNUSED, |
2979 BUILDING, | 2914 BUILDING, |
2980 DONE, | 2915 DONE, |
2981 ABORTED | 2916 ABORTED |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3091 | 3026 |
3092 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 3027 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
3093 }; | 3028 }; |
3094 | 3029 |
3095 #undef DECLARE_HYDROGEN_ACCESSOR | 3030 #undef DECLARE_HYDROGEN_ACCESSOR |
3096 #undef DECLARE_CONCRETE_INSTRUCTION | 3031 #undef DECLARE_CONCRETE_INSTRUCTION |
3097 | 3032 |
3098 } } // namespace v8::internal | 3033 } } // namespace v8::internal |
3099 | 3034 |
3100 #endif // V8_A64_LITHIUM_A64_H_ | 3035 #endif // V8_A64_LITHIUM_A64_H_ |
OLD | NEW |