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

Side by Side Diff: src/compiler/representation-change.h

Issue 2362173003: [turbofan] Improve representation selection for Smi checking. (Closed)
Patch Set: Address comments Created 4 years, 3 months 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/redundancy-elimination.cc ('k') | src/compiler/representation-change.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 #ifndef V8_COMPILER_REPRESENTATION_CHANGE_H_ 5 #ifndef V8_COMPILER_REPRESENTATION_CHANGE_H_
6 #define V8_COMPILER_REPRESENTATION_CHANGE_H_ 6 #define V8_COMPILER_REPRESENTATION_CHANGE_H_
7 7
8 #include "src/compiler/js-graph.h" 8 #include "src/compiler/js-graph.h"
9 #include "src/compiler/simplified-operator.h" 9 #include "src/compiler/simplified-operator.h"
10 10
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 return UseInfo(MachineRepresentation::kTagged, Truncation::Any()); 143 return UseInfo(MachineRepresentation::kTagged, Truncation::Any());
144 } 144 }
145 static UseInfo TaggedSigned() { 145 static UseInfo TaggedSigned() {
146 return UseInfo(MachineRepresentation::kTaggedSigned, Truncation::Any()); 146 return UseInfo(MachineRepresentation::kTaggedSigned, Truncation::Any());
147 } 147 }
148 static UseInfo TaggedPointer() { 148 static UseInfo TaggedPointer() {
149 return UseInfo(MachineRepresentation::kTaggedPointer, Truncation::Any()); 149 return UseInfo(MachineRepresentation::kTaggedPointer, Truncation::Any());
150 } 150 }
151 151
152 // Possibly deoptimizing conversions. 152 // Possibly deoptimizing conversions.
153 static UseInfo CheckedSignedSmallAsTaggedSigned() {
154 return UseInfo(MachineRepresentation::kTaggedSigned, Truncation::Any(),
155 TypeCheckKind::kSignedSmall);
156 }
153 static UseInfo CheckedSignedSmallAsWord32() { 157 static UseInfo CheckedSignedSmallAsWord32() {
154 return UseInfo(MachineRepresentation::kWord32, Truncation::Any(), 158 return UseInfo(MachineRepresentation::kWord32, Truncation::Any(),
155 TypeCheckKind::kSignedSmall); 159 TypeCheckKind::kSignedSmall);
156 } 160 }
157 static UseInfo CheckedSigned32AsWord32() { 161 static UseInfo CheckedSigned32AsWord32() {
158 return UseInfo(MachineRepresentation::kWord32, Truncation::Any(), 162 return UseInfo(MachineRepresentation::kWord32, Truncation::Any(),
159 TypeCheckKind::kSigned32); 163 TypeCheckKind::kSigned32);
160 } 164 }
161 static UseInfo CheckedNumberAsFloat64() { 165 static UseInfo CheckedNumberAsFloat64() {
162 return UseInfo(MachineRepresentation::kFloat64, Truncation::Float64(), 166 return UseInfo(MachineRepresentation::kFloat64, Truncation::Float64(),
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 JSGraph* jsgraph_; 240 JSGraph* jsgraph_;
237 Isolate* isolate_; 241 Isolate* isolate_;
238 242
239 friend class RepresentationChangerTester; // accesses the below fields. 243 friend class RepresentationChangerTester; // accesses the below fields.
240 244
241 bool testing_type_errors_; // If {true}, don't abort on a type error. 245 bool testing_type_errors_; // If {true}, don't abort on a type error.
242 bool type_error_; // Set when a type error is detected. 246 bool type_error_; // Set when a type error is detected.
243 247
244 Node* GetTaggedSignedRepresentationFor(Node* node, 248 Node* GetTaggedSignedRepresentationFor(Node* node,
245 MachineRepresentation output_rep, 249 MachineRepresentation output_rep,
246 Type* output_type); 250 Type* output_type, Node* use_node,
251 UseInfo use_info);
247 Node* GetTaggedPointerRepresentationFor(Node* node, 252 Node* GetTaggedPointerRepresentationFor(Node* node,
248 MachineRepresentation output_rep, 253 MachineRepresentation output_rep,
249 Type* output_type); 254 Type* output_type);
250 Node* GetTaggedRepresentationFor(Node* node, MachineRepresentation output_rep, 255 Node* GetTaggedRepresentationFor(Node* node, MachineRepresentation output_rep,
251 Type* output_type, Truncation truncation); 256 Type* output_type, Truncation truncation);
252 Node* GetFloat32RepresentationFor(Node* node, 257 Node* GetFloat32RepresentationFor(Node* node,
253 MachineRepresentation output_rep, 258 MachineRepresentation output_rep,
254 Type* output_type, Truncation truncation); 259 Type* output_type, Truncation truncation);
255 Node* GetFloat64RepresentationFor(Node* node, 260 Node* GetFloat64RepresentationFor(Node* node,
256 MachineRepresentation output_rep, 261 MachineRepresentation output_rep,
257 Type* output_type, Node* use_node, 262 Type* output_type, Node* use_node,
258 UseInfo use_info); 263 UseInfo use_info);
259 Node* GetWord32RepresentationFor(Node* node, MachineRepresentation output_rep, 264 Node* GetWord32RepresentationFor(Node* node, MachineRepresentation output_rep,
260 Type* output_type, Node* use_node, 265 Type* output_type, Node* use_node,
261 UseInfo use_info); 266 UseInfo use_info);
262 Node* GetBitRepresentationFor(Node* node, MachineRepresentation output_rep, 267 Node* GetBitRepresentationFor(Node* node, MachineRepresentation output_rep,
263 Type* output_type); 268 Type* output_type);
264 Node* GetWord64RepresentationFor(Node* node, MachineRepresentation output_rep, 269 Node* GetWord64RepresentationFor(Node* node, MachineRepresentation output_rep,
265 Type* output_type); 270 Type* output_type);
266 Node* TypeError(Node* node, MachineRepresentation output_rep, 271 Node* TypeError(Node* node, MachineRepresentation output_rep,
267 Type* output_type, MachineRepresentation use); 272 Type* output_type, MachineRepresentation use);
268 Node* MakeTruncatedInt32Constant(double value); 273 Node* MakeTruncatedInt32Constant(double value);
274 Node* InsertChangeBitToTagged(Node* node);
269 Node* InsertChangeFloat32ToFloat64(Node* node); 275 Node* InsertChangeFloat32ToFloat64(Node* node);
270 Node* InsertChangeFloat64ToInt32(Node* node); 276 Node* InsertChangeFloat64ToInt32(Node* node);
271 Node* InsertChangeFloat64ToUint32(Node* node); 277 Node* InsertChangeFloat64ToUint32(Node* node);
272 Node* InsertChangeTaggedSignedToInt32(Node* node); 278 Node* InsertChangeTaggedSignedToInt32(Node* node);
273 Node* InsertChangeTaggedToFloat64(Node* node); 279 Node* InsertChangeTaggedToFloat64(Node* node);
274 280
275 Node* InsertConversion(Node* node, const Operator* op, Node* use_node); 281 Node* InsertConversion(Node* node, const Operator* op, Node* use_node);
276 282
277 JSGraph* jsgraph() const { return jsgraph_; } 283 JSGraph* jsgraph() const { return jsgraph_; }
278 Isolate* isolate() const { return isolate_; } 284 Isolate* isolate() const { return isolate_; }
279 Factory* factory() const { return isolate()->factory(); } 285 Factory* factory() const { return isolate()->factory(); }
280 SimplifiedOperatorBuilder* simplified() { return jsgraph()->simplified(); } 286 SimplifiedOperatorBuilder* simplified() { return jsgraph()->simplified(); }
281 MachineOperatorBuilder* machine() { return jsgraph()->machine(); } 287 MachineOperatorBuilder* machine() { return jsgraph()->machine(); }
282 }; 288 };
283 289
284 } // namespace compiler 290 } // namespace compiler
285 } // namespace internal 291 } // namespace internal
286 } // namespace v8 292 } // namespace v8
287 293
288 #endif // V8_COMPILER_REPRESENTATION_CHANGE_H_ 294 #endif // V8_COMPILER_REPRESENTATION_CHANGE_H_
OLDNEW
« no previous file with comments | « src/compiler/redundancy-elimination.cc ('k') | src/compiler/representation-change.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698