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

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

Issue 640603003: [turbofan] Properly emit bounds checks for typed array element loads. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add another test. Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | src/compiler/simplified-lowering.h » ('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 <sstream> 8 #include <sstream>
9 9
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 } 150 }
151 // int32 -> float64 -> float32 151 // int32 -> float64 -> float32
152 node = jsgraph()->graph()->NewNode(op, node); 152 node = jsgraph()->graph()->NewNode(op, node);
153 op = machine()->TruncateFloat64ToFloat32(); 153 op = machine()->TruncateFloat64ToFloat32();
154 } else if (output_type & kRepTagged) { 154 } else if (output_type & kRepTagged) {
155 op = simplified() 155 op = simplified()
156 ->ChangeTaggedToFloat64(); // tagged -> float64 -> float32 156 ->ChangeTaggedToFloat64(); // tagged -> float64 -> float32
157 node = jsgraph()->graph()->NewNode(op, node); 157 node = jsgraph()->graph()->NewNode(op, node);
158 op = machine()->TruncateFloat64ToFloat32(); 158 op = machine()->TruncateFloat64ToFloat32();
159 } else if (output_type & kRepFloat64) { 159 } else if (output_type & kRepFloat64) {
160 op = machine()->ChangeFloat32ToFloat64(); 160 op = machine()->TruncateFloat64ToFloat32();
161 } else { 161 } else {
162 return TypeError(node, output_type, kRepFloat32); 162 return TypeError(node, output_type, kRepFloat32);
163 } 163 }
164 return jsgraph()->graph()->NewNode(op, node); 164 return jsgraph()->graph()->NewNode(op, node);
165 } 165 }
166 166
167 Node* GetFloat64RepresentationFor(Node* node, MachineTypeUnion output_type) { 167 Node* GetFloat64RepresentationFor(Node* node, MachineTypeUnion output_type) {
168 // Eagerly fold representation changes for constants. 168 // Eagerly fold representation changes for constants.
169 switch (node->opcode()) { 169 switch (node->opcode()) {
170 case IrOpcode::kNumberConstant: 170 case IrOpcode::kNumberConstant:
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 Isolate* isolate() { return isolate_; } 425 Isolate* isolate() { return isolate_; }
426 SimplifiedOperatorBuilder* simplified() { return simplified_; } 426 SimplifiedOperatorBuilder* simplified() { return simplified_; }
427 MachineOperatorBuilder* machine() { return jsgraph()->machine(); } 427 MachineOperatorBuilder* machine() { return jsgraph()->machine(); }
428 }; 428 };
429 429
430 } // namespace compiler 430 } // namespace compiler
431 } // namespace internal 431 } // namespace internal
432 } // namespace v8 432 } // namespace v8
433 433
434 #endif // V8_COMPILER_REPRESENTATION_CHANGE_H_ 434 #endif // V8_COMPILER_REPRESENTATION_CHANGE_H_
OLDNEW
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | src/compiler/simplified-lowering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698