| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_COMPILER_MACHINE_OPERATOR_H_ | 5 #ifndef V8_COMPILER_MACHINE_OPERATOR_H_ |
| 6 #define V8_COMPILER_MACHINE_OPERATOR_H_ | 6 #define V8_COMPILER_MACHINE_OPERATOR_H_ |
| 7 | 7 |
| 8 #include "src/base/flags.h" | 8 #include "src/base/flags.h" |
| 9 #include "src/compiler/machine-type.h" | 9 #include "src/compiler/machine-type.h" |
| 10 | 10 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 kFloat64Ceil = 1u << 1, | 66 kFloat64Ceil = 1u << 1, |
| 67 kFloat64RoundTruncate = 1u << 2, | 67 kFloat64RoundTruncate = 1u << 2, |
| 68 kFloat64RoundTiesAway = 1u << 3, | 68 kFloat64RoundTiesAway = 1u << 3, |
| 69 kInt32DivIsSafe = 1u << 4, | 69 kInt32DivIsSafe = 1u << 4, |
| 70 kInt32ModIsSafe = 1u << 5, | 70 kInt32ModIsSafe = 1u << 5, |
| 71 kUint32DivIsSafe = 1u << 6, | 71 kUint32DivIsSafe = 1u << 6, |
| 72 kUint32ModIsSafe = 1u << 7 | 72 kUint32ModIsSafe = 1u << 7 |
| 73 }; | 73 }; |
| 74 typedef base::Flags<Flag, unsigned> Flags; | 74 typedef base::Flags<Flag, unsigned> Flags; |
| 75 | 75 |
| 76 explicit MachineOperatorBuilder(MachineType word = kMachPtr, | 76 explicit MachineOperatorBuilder(Zone* zone, MachineType word = kMachPtr, |
| 77 Flags supportedOperators = kNoFlags); | 77 Flags supportedOperators = kNoFlags); |
| 78 | 78 |
| 79 const Operator* Word32And(); | 79 const Operator* Word32And(); |
| 80 const Operator* Word32Or(); | 80 const Operator* Word32Or(); |
| 81 const Operator* Word32Xor(); | 81 const Operator* Word32Xor(); |
| 82 const Operator* Word32Shl(); | 82 const Operator* Word32Shl(); |
| 83 const Operator* Word32Shr(); | 83 const Operator* Word32Shr(); |
| 84 const Operator* Word32Sar(); | 84 const Operator* Word32Sar(); |
| 85 const Operator* Word32Ror(); | 85 const Operator* Word32Ror(); |
| 86 const Operator* Word32Equal(); | 86 const Operator* Word32Equal(); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 V(Uint, Mod) | 204 V(Uint, Mod) |
| 205 #define PSEUDO_OP(Prefix, Suffix) \ | 205 #define PSEUDO_OP(Prefix, Suffix) \ |
| 206 const Operator* Prefix##Suffix() { \ | 206 const Operator* Prefix##Suffix() { \ |
| 207 return Is32() ? Prefix##32##Suffix() : Prefix##64##Suffix(); \ | 207 return Is32() ? Prefix##32##Suffix() : Prefix##64##Suffix(); \ |
| 208 } | 208 } |
| 209 PSEUDO_OP_LIST(PSEUDO_OP) | 209 PSEUDO_OP_LIST(PSEUDO_OP) |
| 210 #undef PSEUDO_OP | 210 #undef PSEUDO_OP |
| 211 #undef PSEUDO_OP_LIST | 211 #undef PSEUDO_OP_LIST |
| 212 | 212 |
| 213 private: | 213 private: |
| 214 Zone* zone_; |
| 214 const MachineOperatorGlobalCache& cache_; | 215 const MachineOperatorGlobalCache& cache_; |
| 215 const MachineType word_; | 216 const MachineType word_; |
| 216 const Flags flags_; | 217 const Flags flags_; |
| 217 DISALLOW_COPY_AND_ASSIGN(MachineOperatorBuilder); | 218 DISALLOW_COPY_AND_ASSIGN(MachineOperatorBuilder); |
| 218 }; | 219 }; |
| 219 | 220 |
| 220 | 221 |
| 221 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) | 222 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) |
| 222 } // namespace compiler | 223 } // namespace compiler |
| 223 } // namespace internal | 224 } // namespace internal |
| 224 } // namespace v8 | 225 } // namespace v8 |
| 225 | 226 |
| 226 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ | 227 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ |
| OLD | NEW |