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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(ConstructDouble) \ | 87 V(ConstructDouble) \ |
88 V(Context) \ | 88 V(Context) \ |
89 V(DateField) \ | 89 V(DateField) \ |
90 V(DebugBreak) \ | 90 V(DebugBreak) \ |
91 V(DeclareGlobals) \ | 91 V(DeclareGlobals) \ |
92 V(Deoptimize) \ | 92 V(Deoptimize) \ |
| 93 V(DivByConstI) \ |
93 V(DivByPowerOf2I) \ | 94 V(DivByPowerOf2I) \ |
94 V(DivI) \ | 95 V(DivI) \ |
95 V(DoubleBits) \ | 96 V(DoubleBits) \ |
96 V(DoubleToIntOrSmi) \ | 97 V(DoubleToIntOrSmi) \ |
97 V(Drop) \ | 98 V(Drop) \ |
98 V(Dummy) \ | 99 V(Dummy) \ |
99 V(DummyUse) \ | 100 V(DummyUse) \ |
| 101 V(FlooringDivByConstI) \ |
100 V(FlooringDivByPowerOf2I) \ | 102 V(FlooringDivByPowerOf2I) \ |
101 V(FlooringDivI) \ | 103 V(FlooringDivI) \ |
102 V(ForInCacheArray) \ | 104 V(ForInCacheArray) \ |
103 V(ForInPrepareMap) \ | 105 V(ForInPrepareMap) \ |
104 V(FunctionLiteral) \ | 106 V(FunctionLiteral) \ |
105 V(GetCachedArrayIndex) \ | 107 V(GetCachedArrayIndex) \ |
106 V(Goto) \ | 108 V(Goto) \ |
107 V(HasCachedArrayIndexAndBranch) \ | 109 V(HasCachedArrayIndexAndBranch) \ |
108 V(HasInstanceTypeAndBranch) \ | 110 V(HasInstanceTypeAndBranch) \ |
109 V(InnerAllocatedObject) \ | 111 V(InnerAllocatedObject) \ |
(...skipping 26 matching lines...) Expand all Loading... |
136 V(MathAbs) \ | 138 V(MathAbs) \ |
137 V(MathAbsTagged) \ | 139 V(MathAbsTagged) \ |
138 V(MathClz32) \ | 140 V(MathClz32) \ |
139 V(MathExp) \ | 141 V(MathExp) \ |
140 V(MathFloor) \ | 142 V(MathFloor) \ |
141 V(MathLog) \ | 143 V(MathLog) \ |
142 V(MathMinMax) \ | 144 V(MathMinMax) \ |
143 V(MathPowHalf) \ | 145 V(MathPowHalf) \ |
144 V(MathRound) \ | 146 V(MathRound) \ |
145 V(MathSqrt) \ | 147 V(MathSqrt) \ |
| 148 V(ModByConstI) \ |
146 V(ModByPowerOf2I) \ | 149 V(ModByPowerOf2I) \ |
147 V(ModI) \ | 150 V(ModI) \ |
148 V(MulConstIS) \ | 151 V(MulConstIS) \ |
149 V(MulI) \ | 152 V(MulI) \ |
150 V(MulS) \ | 153 V(MulS) \ |
151 V(NumberTagD) \ | 154 V(NumberTagD) \ |
152 V(NumberTagU) \ | 155 V(NumberTagU) \ |
153 V(NumberUntagD) \ | 156 V(NumberUntagD) \ |
154 V(OsrEntry) \ | 157 V(OsrEntry) \ |
155 V(Parameter) \ | 158 V(Parameter) \ |
(...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1293 int32_t divisor() const { return divisor_; } | 1296 int32_t divisor() const { return divisor_; } |
1294 | 1297 |
1295 DECLARE_CONCRETE_INSTRUCTION(DivByPowerOf2I, "div-by-power-of-2-i") | 1298 DECLARE_CONCRETE_INSTRUCTION(DivByPowerOf2I, "div-by-power-of-2-i") |
1296 DECLARE_HYDROGEN_ACCESSOR(Div) | 1299 DECLARE_HYDROGEN_ACCESSOR(Div) |
1297 | 1300 |
1298 private: | 1301 private: |
1299 int32_t divisor_; | 1302 int32_t divisor_; |
1300 }; | 1303 }; |
1301 | 1304 |
1302 | 1305 |
| 1306 class LDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 1> { |
| 1307 public: |
| 1308 LDivByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) { |
| 1309 inputs_[0] = dividend; |
| 1310 divisor_ = divisor; |
| 1311 temps_[0] = temp; |
| 1312 } |
| 1313 |
| 1314 LOperand* dividend() { return inputs_[0]; } |
| 1315 int32_t divisor() const { return divisor_; } |
| 1316 LOperand* temp() { return temps_[0]; } |
| 1317 |
| 1318 DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i") |
| 1319 DECLARE_HYDROGEN_ACCESSOR(Div) |
| 1320 |
| 1321 private: |
| 1322 int32_t divisor_; |
| 1323 }; |
| 1324 |
| 1325 |
1303 class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> { | 1326 class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> { |
1304 public: | 1327 public: |
1305 LDivI(LOperand* left, LOperand* right, LOperand* temp) { | 1328 LDivI(LOperand* left, LOperand* right, LOperand* temp) { |
1306 inputs_[0] = left; | 1329 inputs_[0] = left; |
1307 inputs_[1] = right; | 1330 inputs_[1] = right; |
1308 temps_[0] = temp; | 1331 temps_[0] = temp; |
1309 } | 1332 } |
1310 | 1333 |
1311 LOperand* left() { return inputs_[0]; } | 1334 LOperand* left() { return inputs_[0]; } |
1312 LOperand* right() { return inputs_[1]; } | 1335 LOperand* right() { return inputs_[1]; } |
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1942 | 1965 |
1943 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I, | 1966 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I, |
1944 "flooring-div-by-power-of-2-i") | 1967 "flooring-div-by-power-of-2-i") |
1945 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) | 1968 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) |
1946 | 1969 |
1947 private: | 1970 private: |
1948 int32_t divisor_; | 1971 int32_t divisor_; |
1949 }; | 1972 }; |
1950 | 1973 |
1951 | 1974 |
| 1975 class LFlooringDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1976 public: |
| 1977 LFlooringDivByConstI(LOperand* dividend, int32_t divisor) { |
| 1978 inputs_[0] = dividend; |
| 1979 divisor_ = divisor; |
| 1980 } |
| 1981 |
| 1982 LOperand* dividend() { return inputs_[0]; } |
| 1983 int32_t divisor() const { return divisor_; } |
| 1984 LOperand* temp1() { return temps_[0]; } |
| 1985 |
| 1986 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i") |
| 1987 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) |
| 1988 |
| 1989 private: |
| 1990 int32_t divisor_; |
| 1991 }; |
| 1992 |
| 1993 |
1952 class LFlooringDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> { | 1994 class LFlooringDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> { |
1953 public: | 1995 public: |
1954 LFlooringDivI(LOperand* dividend, LOperand* divisor, LOperand* temp) { | 1996 LFlooringDivI(LOperand* dividend, LOperand* divisor, LOperand* temp) { |
1955 inputs_[0] = dividend; | 1997 inputs_[0] = dividend; |
1956 inputs_[1] = divisor; | 1998 inputs_[1] = divisor; |
1957 temps_[0] = temp; | 1999 temps_[0] = temp; |
1958 } | 2000 } |
1959 | 2001 |
1960 LOperand* dividend() { return inputs_[0]; } | 2002 LOperand* dividend() { return inputs_[0]; } |
1961 LOperand* divisor() { return inputs_[1]; } | 2003 LOperand* divisor() { return inputs_[1]; } |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2033 int32_t divisor() const { return divisor_; } | 2075 int32_t divisor() const { return divisor_; } |
2034 | 2076 |
2035 DECLARE_CONCRETE_INSTRUCTION(ModByPowerOf2I, "mod-by-power-of-2-i") | 2077 DECLARE_CONCRETE_INSTRUCTION(ModByPowerOf2I, "mod-by-power-of-2-i") |
2036 DECLARE_HYDROGEN_ACCESSOR(Mod) | 2078 DECLARE_HYDROGEN_ACCESSOR(Mod) |
2037 | 2079 |
2038 private: | 2080 private: |
2039 int32_t divisor_; | 2081 int32_t divisor_; |
2040 }; | 2082 }; |
2041 | 2083 |
2042 | 2084 |
| 2085 class LModByConstI V8_FINAL : public LTemplateInstruction<1, 1, 1> { |
| 2086 public: |
| 2087 LModByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) { |
| 2088 inputs_[0] = dividend; |
| 2089 divisor_ = divisor; |
| 2090 temps_[0] = temp; |
| 2091 } |
| 2092 |
| 2093 LOperand* dividend() { return inputs_[0]; } |
| 2094 int32_t divisor() const { return divisor_; } |
| 2095 LOperand* temp() { return temps_[0]; } |
| 2096 |
| 2097 DECLARE_CONCRETE_INSTRUCTION(ModByConstI, "mod-by-const-i") |
| 2098 DECLARE_HYDROGEN_ACCESSOR(Mod) |
| 2099 |
| 2100 private: |
| 2101 int32_t divisor_; |
| 2102 }; |
| 2103 |
| 2104 |
2043 class LModI V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 2105 class LModI V8_FINAL : public LTemplateInstruction<1, 2, 0> { |
2044 public: | 2106 public: |
2045 LModI(LOperand* left, LOperand* right) { | 2107 LModI(LOperand* left, LOperand* right) { |
2046 inputs_[0] = left; | 2108 inputs_[0] = left; |
2047 inputs_[1] = right; | 2109 inputs_[1] = right; |
2048 } | 2110 } |
2049 | 2111 |
2050 LOperand* left() { return inputs_[0]; } | 2112 LOperand* left() { return inputs_[0]; } |
2051 LOperand* right() { return inputs_[1]; } | 2113 LOperand* right() { return inputs_[1]; } |
2052 | 2114 |
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2924 LPlatformChunk* Build(); | 2986 LPlatformChunk* Build(); |
2925 | 2987 |
2926 LInstruction* CheckElideControlInstruction(HControlInstruction* instr); | 2988 LInstruction* CheckElideControlInstruction(HControlInstruction* instr); |
2927 | 2989 |
2928 // Declare methods that deal with the individual node types. | 2990 // Declare methods that deal with the individual node types. |
2929 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); | 2991 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); |
2930 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) | 2992 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) |
2931 #undef DECLARE_DO | 2993 #undef DECLARE_DO |
2932 | 2994 |
2933 LInstruction* DoDivByPowerOf2I(HDiv* instr); | 2995 LInstruction* DoDivByPowerOf2I(HDiv* instr); |
| 2996 LInstruction* DoDivByConstI(HDiv* instr); |
2934 LInstruction* DoDivI(HBinaryOperation* instr); | 2997 LInstruction* DoDivI(HBinaryOperation* instr); |
2935 LInstruction* DoModByPowerOf2I(HMod* instr); | 2998 LInstruction* DoModByPowerOf2I(HMod* instr); |
| 2999 LInstruction* DoModByConstI(HMod* instr); |
2936 LInstruction* DoModI(HMod* instr); | 3000 LInstruction* DoModI(HMod* instr); |
2937 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr); | 3001 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr); |
| 3002 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr); |
2938 LInstruction* DoFlooringDivI(HMathFloorOfDiv* instr); | 3003 LInstruction* DoFlooringDivI(HMathFloorOfDiv* instr); |
2939 | 3004 |
2940 static bool HasMagicNumberForDivision(int32_t divisor); | 3005 static bool HasMagicNumberForDivision(int32_t divisor); |
2941 | 3006 |
2942 private: | 3007 private: |
2943 enum Status { | 3008 enum Status { |
2944 UNUSED, | 3009 UNUSED, |
2945 BUILDING, | 3010 BUILDING, |
2946 DONE, | 3011 DONE, |
2947 ABORTED | 3012 ABORTED |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3057 | 3122 |
3058 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 3123 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
3059 }; | 3124 }; |
3060 | 3125 |
3061 #undef DECLARE_HYDROGEN_ACCESSOR | 3126 #undef DECLARE_HYDROGEN_ACCESSOR |
3062 #undef DECLARE_CONCRETE_INSTRUCTION | 3127 #undef DECLARE_CONCRETE_INSTRUCTION |
3063 | 3128 |
3064 } } // namespace v8::internal | 3129 } } // namespace v8::internal |
3065 | 3130 |
3066 #endif // V8_A64_LITHIUM_A64_H_ | 3131 #endif // V8_A64_LITHIUM_A64_H_ |
OLD | NEW |