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

Side by Side Diff: src/compiler/js-builtin-reducer.cc

Issue 1513543003: [turbofan] Make MachineType a pair of enums. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Moar rebase Created 5 years 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/interpreter-assembler.cc ('k') | src/compiler/js-generic-lowering.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/js-builtin-reducer.h" 5 #include "src/compiler/js-builtin-reducer.h"
6 #include "src/compiler/js-graph.h" 6 #include "src/compiler/js-graph.h"
7 #include "src/compiler/node-matchers.h" 7 #include "src/compiler/node-matchers.h"
8 #include "src/compiler/node-properties.h" 8 #include "src/compiler/node-properties.h"
9 #include "src/compiler/simplified-operator.h" 9 #include "src/compiler/simplified-operator.h"
10 #include "src/objects-inl.h" 10 #include "src/objects-inl.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 if (r.InputsMatchOne(Type::Number())) { 100 if (r.InputsMatchOne(Type::Number())) {
101 // Math.max(a:number) -> a 101 // Math.max(a:number) -> a
102 return Replace(r.left()); 102 return Replace(r.left());
103 } 103 }
104 if (r.InputsMatchAll(Type::Integral32())) { 104 if (r.InputsMatchAll(Type::Integral32())) {
105 // Math.max(a:int32, b:int32, ...) 105 // Math.max(a:int32, b:int32, ...)
106 Node* value = r.GetJSCallInput(0); 106 Node* value = r.GetJSCallInput(0);
107 for (int i = 1; i < r.GetJSCallArity(); i++) { 107 for (int i = 1; i < r.GetJSCallArity(); i++) {
108 Node* const input = r.GetJSCallInput(i); 108 Node* const input = r.GetJSCallInput(i);
109 value = graph()->NewNode( 109 value = graph()->NewNode(
110 common()->Select(kMachNone), 110 common()->Select(MachineRepresentation::kNone),
111 graph()->NewNode(simplified()->NumberLessThan(), input, value), value, 111 graph()->NewNode(simplified()->NumberLessThan(), input, value), value,
112 input); 112 input);
113 } 113 }
114 return Replace(value); 114 return Replace(value);
115 } 115 }
116 return NoChange(); 116 return NoChange();
117 } 117 }
118 118
119 119
120 // ES6 draft 08-24-14, section 20.2.2.19. 120 // ES6 draft 08-24-14, section 20.2.2.19.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 } 186 }
187 187
188 188
189 SimplifiedOperatorBuilder* JSBuiltinReducer::simplified() const { 189 SimplifiedOperatorBuilder* JSBuiltinReducer::simplified() const {
190 return jsgraph()->simplified(); 190 return jsgraph()->simplified();
191 } 191 }
192 192
193 } // namespace compiler 193 } // namespace compiler
194 } // namespace internal 194 } // namespace internal
195 } // namespace v8 195 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/interpreter-assembler.cc ('k') | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698