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/common-operator.h" | 5 #include "src/compiler/common-operator.h" |
6 | 6 |
7 #include "src/assembler.h" | 7 #include "src/assembler.h" |
8 #include "src/base/lazy-instance.h" | 8 #include "src/base/lazy-instance.h" |
9 #include "src/compiler/linkage.h" | 9 #include "src/compiler/linkage.h" |
10 #include "src/compiler/node.h" | 10 #include "src/compiler/node.h" |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 os << elem; | 300 os << elem; |
301 } | 301 } |
302 return os; | 302 return os; |
303 } | 303 } |
304 | 304 |
305 int OsrValueIndexOf(Operator const* op) { | 305 int OsrValueIndexOf(Operator const* op) { |
306 DCHECK_EQ(IrOpcode::kOsrValue, op->opcode()); | 306 DCHECK_EQ(IrOpcode::kOsrValue, op->opcode()); |
307 return OpParameter<int>(op); | 307 return OpParameter<int>(op); |
308 } | 308 } |
309 | 309 |
310 size_t hash_value(OsrGuardType type) { return static_cast<size_t>(type); } | |
311 | |
312 std::ostream& operator<<(std::ostream& os, OsrGuardType type) { | |
313 switch (type) { | |
314 case OsrGuardType::kUninitialized: | |
315 return os << "Uninitialized"; | |
316 case OsrGuardType::kSignedSmall: | |
317 return os << "SignedSmall"; | |
318 case OsrGuardType::kAny: | |
319 return os << "Any"; | |
320 } | |
321 UNREACHABLE(); | |
322 return os; | |
323 } | |
324 | |
325 OsrGuardType OsrGuardTypeOf(Operator const* op) { | |
326 DCHECK_EQ(IrOpcode::kOsrGuard, op->opcode()); | |
327 return OpParameter<OsrGuardType>(op); | |
328 } | |
329 | |
330 SparseInputMask SparseInputMaskOf(Operator const* op) { | 310 SparseInputMask SparseInputMaskOf(Operator const* op) { |
331 DCHECK(op->opcode() == IrOpcode::kStateValues || | 311 DCHECK(op->opcode() == IrOpcode::kStateValues || |
332 op->opcode() == IrOpcode::kTypedStateValues); | 312 op->opcode() == IrOpcode::kTypedStateValues); |
333 | 313 |
334 if (op->opcode() == IrOpcode::kTypedStateValues) { | 314 if (op->opcode() == IrOpcode::kTypedStateValues) { |
335 return OpParameter<TypedStateValueInfo>(op).sparse_input_mask(); | 315 return OpParameter<TypedStateValueInfo>(op).sparse_input_mask(); |
336 } | 316 } |
337 return OpParameter<SparseInputMask>(op); | 317 return OpParameter<SparseInputMask>(op); |
338 } | 318 } |
339 | 319 |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 } | 983 } |
1004 | 984 |
1005 const Operator* CommonOperatorBuilder::OsrValue(int index) { | 985 const Operator* CommonOperatorBuilder::OsrValue(int index) { |
1006 return new (zone()) Operator1<int>( // -- | 986 return new (zone()) Operator1<int>( // -- |
1007 IrOpcode::kOsrValue, Operator::kNoProperties, // opcode | 987 IrOpcode::kOsrValue, Operator::kNoProperties, // opcode |
1008 "OsrValue", // name | 988 "OsrValue", // name |
1009 0, 0, 1, 1, 0, 0, // counts | 989 0, 0, 1, 1, 0, 0, // counts |
1010 index); // parameter | 990 index); // parameter |
1011 } | 991 } |
1012 | 992 |
1013 const Operator* CommonOperatorBuilder::OsrGuard(OsrGuardType type) { | |
1014 return new (zone()) Operator1<OsrGuardType>( // -- | |
1015 IrOpcode::kOsrGuard, Operator::kNoThrow, // opcode | |
1016 "OsrGuard", // name | |
1017 1, 1, 1, 1, 1, 0, // counts | |
1018 type); // parameter | |
1019 } | |
1020 | |
1021 const Operator* CommonOperatorBuilder::Int32Constant(int32_t value) { | 993 const Operator* CommonOperatorBuilder::Int32Constant(int32_t value) { |
1022 return new (zone()) Operator1<int32_t>( // -- | 994 return new (zone()) Operator1<int32_t>( // -- |
1023 IrOpcode::kInt32Constant, Operator::kPure, // opcode | 995 IrOpcode::kInt32Constant, Operator::kPure, // opcode |
1024 "Int32Constant", // name | 996 "Int32Constant", // name |
1025 0, 0, 0, 1, 0, 0, // counts | 997 0, 0, 0, 1, 0, 0, // counts |
1026 value); // parameter | 998 value); // parameter |
1027 } | 999 } |
1028 | 1000 |
1029 | 1001 |
1030 const Operator* CommonOperatorBuilder::Int64Constant(int64_t value) { | 1002 const Operator* CommonOperatorBuilder::Int64Constant(int64_t value) { |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1361 CommonOperatorBuilder::CreateFrameStateFunctionInfo( | 1333 CommonOperatorBuilder::CreateFrameStateFunctionInfo( |
1362 FrameStateType type, int parameter_count, int local_count, | 1334 FrameStateType type, int parameter_count, int local_count, |
1363 Handle<SharedFunctionInfo> shared_info) { | 1335 Handle<SharedFunctionInfo> shared_info) { |
1364 return new (zone()->New(sizeof(FrameStateFunctionInfo))) | 1336 return new (zone()->New(sizeof(FrameStateFunctionInfo))) |
1365 FrameStateFunctionInfo(type, parameter_count, local_count, shared_info); | 1337 FrameStateFunctionInfo(type, parameter_count, local_count, shared_info); |
1366 } | 1338 } |
1367 | 1339 |
1368 } // namespace compiler | 1340 } // namespace compiler |
1369 } // namespace internal | 1341 } // namespace internal |
1370 } // namespace v8 | 1342 } // namespace v8 |
OLD | NEW |