| 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_JS_OPERATOR_H_ | 5 #ifndef V8_COMPILER_JS_OPERATOR_H_ |
| 6 #define V8_COMPILER_JS_OPERATOR_H_ | 6 #define V8_COMPILER_JS_OPERATOR_H_ |
| 7 | 7 |
| 8 #include "src/compiler/linkage.h" | 8 #include "src/compiler/linkage.h" |
| 9 #include "src/compiler/opcodes.h" | 9 #include "src/compiler/opcodes.h" |
| 10 #include "src/compiler/operator.h" | 10 #include "src/compiler/operator.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 #undef BINOP | 193 #undef BINOP |
| 194 #undef UNOP | 194 #undef UNOP |
| 195 | 195 |
| 196 private: | 196 private: |
| 197 Zone* zone_; | 197 Zone* zone_; |
| 198 }; | 198 }; |
| 199 | 199 |
| 200 // Specialization for static parameters of type {ContextAccess}. | 200 // Specialization for static parameters of type {ContextAccess}. |
| 201 template <> | 201 template <> |
| 202 struct StaticParameterTraits<ContextAccess> { | 202 struct StaticParameterTraits<ContextAccess> { |
| 203 static OStream& PrintTo(OStream& os, ContextAccess val) { // NOLINT | 203 static std::ostream& PrintTo(std::ostream& os, ContextAccess val) { // NOLINT |
| 204 return os << val.depth() << "," << val.index() | 204 return os << val.depth() << "," << val.index() |
| 205 << (val.immutable() ? ",imm" : ""); | 205 << (val.immutable() ? ",imm" : ""); |
| 206 } | 206 } |
| 207 static int HashCode(ContextAccess val) { | 207 static int HashCode(ContextAccess val) { |
| 208 return (val.depth() << 16) | (val.index() & 0xffff); | 208 return (val.depth() << 16) | (val.index() & 0xffff); |
| 209 } | 209 } |
| 210 static bool Equals(ContextAccess a, ContextAccess b) { | 210 static bool Equals(ContextAccess a, ContextAccess b) { |
| 211 return a.immutable() == b.immutable() && a.depth() == b.depth() && | 211 return a.immutable() == b.immutable() && a.depth() == b.depth() && |
| 212 a.index() == b.index(); | 212 a.index() == b.index(); |
| 213 } | 213 } |
| 214 }; | 214 }; |
| 215 | 215 |
| 216 // Specialization for static parameters of type {Runtime::FunctionId}. | 216 // Specialization for static parameters of type {Runtime::FunctionId}. |
| 217 template <> | 217 template <> |
| 218 struct StaticParameterTraits<Runtime::FunctionId> { | 218 struct StaticParameterTraits<Runtime::FunctionId> { |
| 219 static OStream& PrintTo(OStream& os, Runtime::FunctionId val) { // NOLINT | 219 static std::ostream& PrintTo(std::ostream& os, |
| 220 Runtime::FunctionId val) { // NOLINT |
| 220 const Runtime::Function* f = Runtime::FunctionForId(val); | 221 const Runtime::Function* f = Runtime::FunctionForId(val); |
| 221 return os << (f->name ? f->name : "?Runtime?"); | 222 return os << (f->name ? f->name : "?Runtime?"); |
| 222 } | 223 } |
| 223 static int HashCode(Runtime::FunctionId val) { return static_cast<int>(val); } | 224 static int HashCode(Runtime::FunctionId val) { return static_cast<int>(val); } |
| 224 static bool Equals(Runtime::FunctionId a, Runtime::FunctionId b) { | 225 static bool Equals(Runtime::FunctionId a, Runtime::FunctionId b) { |
| 225 return a == b; | 226 return a == b; |
| 226 } | 227 } |
| 227 }; | 228 }; |
| 228 | 229 |
| 229 } // namespace compiler | 230 } // namespace compiler |
| 230 } // namespace internal | 231 } // namespace internal |
| 231 } // namespace v8 | 232 } // namespace v8 |
| 232 | 233 |
| 233 #endif // V8_COMPILER_JS_OPERATOR_H_ | 234 #endif // V8_COMPILER_JS_OPERATOR_H_ |
| OLD | NEW |