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

Side by Side Diff: src/compiler/js-typed-lowering.cc

Issue 1898733002: [turbofan] Remove mutual recursion in typed-lowering of JSToNumber input. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 | « no previous file | no next file » | 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/code-factory.h" 5 #include "src/code-factory.h"
6 #include "src/compilation-dependencies.h" 6 #include "src/compilation-dependencies.h"
7 #include "src/compiler/access-builder.h" 7 #include "src/compiler/access-builder.h"
8 #include "src/compiler/js-graph.h" 8 #include "src/compiler/js-graph.h"
9 #include "src/compiler/js-typed-lowering.h" 9 #include "src/compiler/js-typed-lowering.h"
10 #include "src/compiler/linkage.h" 10 #include "src/compiler/linkage.h"
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 NodeProperties::SetType(input, input_type); 710 NodeProperties::SetType(input, input_type);
711 } 711 }
712 } 712 }
713 ReplaceWithValue(node, input); 713 ReplaceWithValue(node, input);
714 return Replace(input); 714 return Replace(input);
715 } 715 }
716 return NoChange(); 716 return NoChange();
717 } 717 }
718 718
719 Reduction JSTypedLowering::ReduceJSToNumberInput(Node* input) { 719 Reduction JSTypedLowering::ReduceJSToNumberInput(Node* input) {
720 if (input->opcode() == IrOpcode::kJSToNumber) {
721 // Recursively try to reduce the input first.
722 Reduction result = ReduceJSToNumber(input);
723 if (result.Changed()) return result;
724 return Changed(input); // JSToNumber(JSToNumber(x)) => JSToNumber(x)
725 }
726 // Check for ToNumber truncation of signaling NaN to undefined mapping. 720 // Check for ToNumber truncation of signaling NaN to undefined mapping.
727 if (input->opcode() == IrOpcode::kSelect) { 721 if (input->opcode() == IrOpcode::kSelect) {
728 Node* check = NodeProperties::GetValueInput(input, 0); 722 Node* check = NodeProperties::GetValueInput(input, 0);
729 Node* vtrue = NodeProperties::GetValueInput(input, 1); 723 Node* vtrue = NodeProperties::GetValueInput(input, 1);
730 Type* vtrue_type = NodeProperties::GetType(vtrue); 724 Type* vtrue_type = NodeProperties::GetType(vtrue);
731 Node* vfalse = NodeProperties::GetValueInput(input, 2); 725 Node* vfalse = NodeProperties::GetValueInput(input, 2);
732 Type* vfalse_type = NodeProperties::GetType(vfalse); 726 Type* vfalse_type = NodeProperties::GetType(vfalse);
733 if (vtrue_type->Is(Type::Undefined()) && vfalse_type->Is(Type::Number())) { 727 if (vtrue_type->Is(Type::Undefined()) && vfalse_type->Is(Type::Number())) {
734 if (check->opcode() == IrOpcode::kNumberIsHoleNaN && 728 if (check->opcode() == IrOpcode::kNumberIsHoleNaN &&
735 check->InputAt(0) == vfalse) { 729 check->InputAt(0) == vfalse) {
(...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after
1833 } 1827 }
1834 1828
1835 1829
1836 CompilationDependencies* JSTypedLowering::dependencies() const { 1830 CompilationDependencies* JSTypedLowering::dependencies() const {
1837 return dependencies_; 1831 return dependencies_;
1838 } 1832 }
1839 1833
1840 } // namespace compiler 1834 } // namespace compiler
1841 } // namespace internal 1835 } // namespace internal
1842 } // namespace v8 1836 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698