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

Side by Side Diff: src/compiler/loop-variable-optimizer.cc

Issue 2802113003: [turbofan] Introduce a SpeculativeToNumber operator. (Closed)
Patch Set: Paint it green! Created 3 years, 8 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/js-typed-lowering.h ('k') | src/compiler/opcodes.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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/loop-variable-optimizer.h" 5 #include "src/compiler/loop-variable-optimizer.h"
6 6
7 #include "src/compiler/common-operator.h" 7 #include "src/compiler/common-operator.h"
8 #include "src/compiler/graph.h" 8 #include "src/compiler/graph.h"
9 #include "src/compiler/node-marker.h" 9 #include "src/compiler/node-marker.h"
10 #include "src/compiler/node-properties.h" 10 #include "src/compiler/node-properties.h"
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 arithmeticType = InductionVariable::ArithmeticType::kAddition; 310 arithmeticType = InductionVariable::ArithmeticType::kAddition;
311 } else if (arith->opcode() == IrOpcode::kJSSubtract || 311 } else if (arith->opcode() == IrOpcode::kJSSubtract ||
312 arith->opcode() == IrOpcode::kSpeculativeNumberSubtract) { 312 arith->opcode() == IrOpcode::kSpeculativeNumberSubtract) {
313 arithmeticType = InductionVariable::ArithmeticType::kSubtraction; 313 arithmeticType = InductionVariable::ArithmeticType::kSubtraction;
314 } else { 314 } else {
315 return nullptr; 315 return nullptr;
316 } 316 }
317 317
318 // TODO(jarin) Support both sides. 318 // TODO(jarin) Support both sides.
319 if (arith->InputAt(0) != phi) { 319 if (arith->InputAt(0) != phi) {
320 if (arith->InputAt(0)->opcode() != IrOpcode::kJSToNumber || 320 if ((arith->InputAt(0)->opcode() != IrOpcode::kJSToNumber &&
321 arith->InputAt(0)->opcode() != IrOpcode::kSpeculativeToNumber) ||
321 arith->InputAt(0)->InputAt(0) != phi) { 322 arith->InputAt(0)->InputAt(0) != phi) {
322 return nullptr; 323 return nullptr;
323 } 324 }
324 } 325 }
325 Node* incr = arith->InputAt(1); 326 Node* incr = arith->InputAt(1);
326 return new (zone()) 327 return new (zone())
327 InductionVariable(phi, arith, incr, initial, zone(), arithmeticType); 328 InductionVariable(phi, arith, incr, initial, zone(), arithmeticType);
328 } 329 }
329 330
330 void LoopVariableOptimizer::DetectInductionVariables(Node* loop) { 331 void LoopVariableOptimizer::DetectInductionVariables(Node* loop) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 backedge_value, backedge_control); 401 backedge_value, backedge_control);
401 induction_var->phi()->ReplaceInput(1, rename); 402 induction_var->phi()->ReplaceInput(1, rename);
402 } 403 }
403 } 404 }
404 } 405 }
405 } 406 }
406 407
407 } // namespace compiler 408 } // namespace compiler
408 } // namespace internal 409 } // namespace internal
409 } // namespace v8 410 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-typed-lowering.h ('k') | src/compiler/opcodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698