OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #include "src/compiler/operator.h" | 5 #include "src/compiler/operator.h" |
6 | 6 |
7 #include "src/assembler.h" | |
8 | |
9 namespace v8 { | 7 namespace v8 { |
10 namespace internal { | 8 namespace internal { |
11 namespace compiler { | 9 namespace compiler { |
12 | 10 |
13 Operator::~Operator() {} | 11 Operator::~Operator() {} |
14 | 12 |
15 | 13 |
16 SimpleOperator::SimpleOperator(Opcode opcode, Properties properties, | 14 SimpleOperator::SimpleOperator(Opcode opcode, Properties properties, |
17 int input_count, int output_count, | 15 int input_count, int output_count, |
18 const char* mnemonic) | 16 const char* mnemonic) |
19 : Operator(opcode, properties, mnemonic), | 17 : Operator(opcode, properties, mnemonic), |
20 input_count_(input_count), | 18 input_count_(input_count), |
21 output_count_(output_count) {} | 19 output_count_(output_count) {} |
22 | 20 |
23 | 21 |
24 SimpleOperator::~SimpleOperator() {} | 22 SimpleOperator::~SimpleOperator() {} |
25 | 23 |
26 | |
27 // static | |
28 OStream& StaticParameterTraits<ExternalReference>::PrintTo( | |
29 OStream& os, ExternalReference reference) { | |
30 os << reference.address(); | |
31 // TODO(bmeurer): Move to operator<<(os, ExternalReference) | |
32 const Runtime::Function* function = | |
33 Runtime::FunctionForEntry(reference.address()); | |
34 if (function) { | |
35 os << " <" << function->name << ".entry>"; | |
36 } | |
37 return os; | |
38 } | |
39 | |
40 | |
41 // static | |
42 int StaticParameterTraits<ExternalReference>::HashCode( | |
43 ExternalReference reference) { | |
44 return reinterpret_cast<intptr_t>(reference.address()) & 0xFFFFFFFF; | |
45 } | |
46 | |
47 | |
48 // static | |
49 bool StaticParameterTraits<ExternalReference>::Equals(ExternalReference lhs, | |
50 ExternalReference rhs) { | |
51 return lhs == rhs; | |
52 } | |
53 | |
54 } // namespace compiler | 24 } // namespace compiler |
55 } // namespace internal | 25 } // namespace internal |
56 } // namespace v8 | 26 } // namespace v8 |
OLD | NEW |