Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: src/compiler/common-operator.cc

Issue 2488623002: [turbofan] Introduce TypedObjectState common operator. (Closed)
Patch Set: Make MSVC happy. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/common-operator.h ('k') | src/compiler/escape-analysis.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/opcodes.h" 10 #include "src/compiler/opcodes.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 } 228 }
229 UNREACHABLE(); 229 UNREACHABLE();
230 return os; 230 return os;
231 } 231 }
232 232
233 OsrGuardType OsrGuardTypeOf(Operator const* op) { 233 OsrGuardType OsrGuardTypeOf(Operator const* op) {
234 DCHECK_EQ(IrOpcode::kOsrGuard, op->opcode()); 234 DCHECK_EQ(IrOpcode::kOsrGuard, op->opcode());
235 return OpParameter<OsrGuardType>(op); 235 return OpParameter<OsrGuardType>(op);
236 } 236 }
237 237
238 ZoneVector<MachineType> const* MachineTypesOf(Operator const* op) {
239 DCHECK(op->opcode() == IrOpcode::kTypedObjectState ||
240 op->opcode() == IrOpcode::kTypedStateValues);
241 return OpParameter<const ZoneVector<MachineType>*>(op);
242 }
243
238 #define CACHED_OP_LIST(V) \ 244 #define CACHED_OP_LIST(V) \
239 V(Dead, Operator::kFoldable, 0, 0, 0, 1, 1, 1) \ 245 V(Dead, Operator::kFoldable, 0, 0, 0, 1, 1, 1) \
240 V(IfTrue, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \ 246 V(IfTrue, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \
241 V(IfFalse, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \ 247 V(IfFalse, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \
242 V(IfSuccess, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \ 248 V(IfSuccess, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \
243 V(IfException, Operator::kKontrol, 0, 1, 1, 1, 1, 1) \ 249 V(IfException, Operator::kKontrol, 0, 1, 1, 1, 1, 1) \
244 V(IfDefault, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \ 250 V(IfDefault, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \
245 V(Throw, Operator::kKontrol, 1, 1, 1, 0, 0, 1) \ 251 V(Throw, Operator::kKontrol, 1, 1, 1, 0, 0, 1) \
246 V(Terminate, Operator::kKontrol, 0, 1, 1, 0, 0, 1) \ 252 V(Terminate, Operator::kKontrol, 0, 1, 1, 0, 0, 1) \
247 V(OsrNormalEntry, Operator::kFoldable, 0, 1, 1, 0, 1, 1) \ 253 V(OsrNormalEntry, Operator::kFoldable, 0, 1, 1, 0, 1, 1) \
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
997 default: 1003 default:
998 break; 1004 break;
999 } 1005 }
1000 // Uncached. 1006 // Uncached.
1001 return new (zone()) Operator( // -- 1007 return new (zone()) Operator( // --
1002 IrOpcode::kStateValues, Operator::kPure, // opcode 1008 IrOpcode::kStateValues, Operator::kPure, // opcode
1003 "StateValues", // name 1009 "StateValues", // name
1004 arguments, 0, 0, 1, 0, 0); // counts 1010 arguments, 0, 0, 1, 0, 0); // counts
1005 } 1011 }
1006 1012
1007
1008 const Operator* CommonOperatorBuilder::ObjectState(int pointer_slots, int id) {
1009 return new (zone()) Operator1<int>( // --
1010 IrOpcode::kObjectState, Operator::kPure, // opcode
1011 "ObjectState", // name
1012 pointer_slots, 0, 0, 1, 0, 0, id); // counts
1013 }
1014
1015
1016 const Operator* CommonOperatorBuilder::TypedStateValues( 1013 const Operator* CommonOperatorBuilder::TypedStateValues(
1017 const ZoneVector<MachineType>* types) { 1014 const ZoneVector<MachineType>* types) {
1018 return new (zone()) Operator1<const ZoneVector<MachineType>*>( // -- 1015 return new (zone()) Operator1<const ZoneVector<MachineType>*>( // --
1019 IrOpcode::kTypedStateValues, Operator::kPure, // opcode 1016 IrOpcode::kTypedStateValues, Operator::kPure, // opcode
1020 "TypedStateValues", // name 1017 "TypedStateValues", // name
1021 static_cast<int>(types->size()), 0, 0, 1, 0, 0, types); // counts 1018 static_cast<int>(types->size()), 0, 0, 1, 0, 0, // counts
1019 types); // parameter
1022 } 1020 }
1023 1021
1022 const Operator* CommonOperatorBuilder::ObjectState(int pointer_slots) {
1023 return new (zone()) Operator1<int>( // --
1024 IrOpcode::kObjectState, Operator::kPure, // opcode
1025 "ObjectState", // name
1026 pointer_slots, 0, 0, 1, 0, 0, // counts
1027 pointer_slots); // parameter
Tobias Tebbi 2016/11/08 13:41:40 Why put pointer_slots in this apparently unused pa
Benedikt Meurer 2016/11/08 13:42:43 We need to distinguish the operators for hashing a
1028 }
1029
1030 const Operator* CommonOperatorBuilder::TypedObjectState(
1031 const ZoneVector<MachineType>* types) {
1032 return new (zone()) Operator1<const ZoneVector<MachineType>*>( // --
1033 IrOpcode::kTypedObjectState, Operator::kPure, // opcode
1034 "TypedObjectState", // name
1035 static_cast<int>(types->size()), 0, 0, 1, 0, 0, // counts
1036 types); // parameter
1037 }
1024 1038
1025 const Operator* CommonOperatorBuilder::FrameState( 1039 const Operator* CommonOperatorBuilder::FrameState(
1026 BailoutId bailout_id, OutputFrameStateCombine state_combine, 1040 BailoutId bailout_id, OutputFrameStateCombine state_combine,
1027 const FrameStateFunctionInfo* function_info) { 1041 const FrameStateFunctionInfo* function_info) {
1028 FrameStateInfo state_info(bailout_id, state_combine, function_info); 1042 FrameStateInfo state_info(bailout_id, state_combine, function_info);
1029 return new (zone()) Operator1<FrameStateInfo>( // -- 1043 return new (zone()) Operator1<FrameStateInfo>( // --
1030 IrOpcode::kFrameState, Operator::kPure, // opcode 1044 IrOpcode::kFrameState, Operator::kPure, // opcode
1031 "FrameState", // name 1045 "FrameState", // name
1032 5, 0, 0, 1, 0, 0, // counts 1046 5, 0, 0, 1, 0, 0, // counts
1033 state_info); // parameter 1047 state_info); // parameter
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 CommonOperatorBuilder::CreateFrameStateFunctionInfo( 1129 CommonOperatorBuilder::CreateFrameStateFunctionInfo(
1116 FrameStateType type, int parameter_count, int local_count, 1130 FrameStateType type, int parameter_count, int local_count,
1117 Handle<SharedFunctionInfo> shared_info) { 1131 Handle<SharedFunctionInfo> shared_info) {
1118 return new (zone()->New(sizeof(FrameStateFunctionInfo))) 1132 return new (zone()->New(sizeof(FrameStateFunctionInfo)))
1119 FrameStateFunctionInfo(type, parameter_count, local_count, shared_info); 1133 FrameStateFunctionInfo(type, parameter_count, local_count, shared_info);
1120 } 1134 }
1121 1135
1122 } // namespace compiler 1136 } // namespace compiler
1123 } // namespace internal 1137 } // namespace internal
1124 } // namespace v8 1138 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/common-operator.h ('k') | src/compiler/escape-analysis.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698