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

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

Issue 1021183002: [turbofan] Turn Math.clz32 into an inlinable builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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-intrinsic-lowering.h ('k') | src/compiler/machine-operator.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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-intrinsic-lowering.h" 5 #include "src/compiler/js-intrinsic-lowering.h"
6 6
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/node-properties.h" 9 #include "src/compiler/node-properties.h"
10 10
(...skipping 24 matching lines...) Expand all
35 case Runtime::kInlineJSValueGetValue: 35 case Runtime::kInlineJSValueGetValue:
36 return ReduceInlineJSValueGetValue(node); 36 return ReduceInlineJSValueGetValue(node);
37 case Runtime::kInlineConstructDouble: 37 case Runtime::kInlineConstructDouble:
38 return ReduceInlineConstructDouble(node); 38 return ReduceInlineConstructDouble(node);
39 case Runtime::kInlineDoubleLo: 39 case Runtime::kInlineDoubleLo:
40 return ReduceInlineDoubleLo(node); 40 return ReduceInlineDoubleLo(node);
41 case Runtime::kInlineDoubleHi: 41 case Runtime::kInlineDoubleHi:
42 return ReduceInlineDoubleHi(node); 42 return ReduceInlineDoubleHi(node);
43 case Runtime::kInlineIsRegExp: 43 case Runtime::kInlineIsRegExp:
44 return ReduceInlineIsInstanceType(node, JS_REGEXP_TYPE); 44 return ReduceInlineIsInstanceType(node, JS_REGEXP_TYPE);
45 case Runtime::kInlineMathClz32:
46 return ReduceInlineMathClz32(node);
45 case Runtime::kInlineMathFloor: 47 case Runtime::kInlineMathFloor:
46 return ReduceInlineMathFloor(node); 48 return ReduceInlineMathFloor(node);
47 case Runtime::kInlineMathSqrt: 49 case Runtime::kInlineMathSqrt:
48 return ReduceInlineMathSqrt(node); 50 return ReduceInlineMathSqrt(node);
49 case Runtime::kInlineStringGetLength: 51 case Runtime::kInlineStringGetLength:
50 return ReduceInlineStringGetLength(node); 52 return ReduceInlineStringGetLength(node);
51 case Runtime::kInlineValueOf: 53 case Runtime::kInlineValueOf:
52 return ReduceInlineValueOf(node); 54 return ReduceInlineValueOf(node);
53 default: 55 default:
54 break; 56 break;
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 174
173 // Replace all effect uses of {node} with the {ephi}. 175 // Replace all effect uses of {node} with the {ephi}.
174 Node* ephi = graph()->NewNode(common()->EffectPhi(2), etrue, efalse, merge); 176 Node* ephi = graph()->NewNode(common()->EffectPhi(2), etrue, efalse, merge);
175 NodeProperties::ReplaceWithValue(node, node, ephi); 177 NodeProperties::ReplaceWithValue(node, node, ephi);
176 178
177 // Turn the {node} into a Phi. 179 // Turn the {node} into a Phi.
178 return Change(node, common()->Phi(type, 2), vtrue, vfalse, merge); 180 return Change(node, common()->Phi(type, 2), vtrue, vfalse, merge);
179 } 181 }
180 182
181 183
184 Reduction JSIntrinsicLowering::ReduceInlineMathClz32(Node* node) {
185 return Change(node, machine()->Word32Clz());
186 }
187
188
182 Reduction JSIntrinsicLowering::ReduceInlineMathFloor(Node* node) { 189 Reduction JSIntrinsicLowering::ReduceInlineMathFloor(Node* node) {
183 if (!machine()->HasFloat64RoundDown()) return NoChange(); 190 if (!machine()->HasFloat64RoundDown()) return NoChange();
184 return Change(node, machine()->Float64RoundDown()); 191 return Change(node, machine()->Float64RoundDown());
185 } 192 }
186 193
187 194
188 Reduction JSIntrinsicLowering::ReduceInlineMathSqrt(Node* node) { 195 Reduction JSIntrinsicLowering::ReduceInlineMathSqrt(Node* node) {
189 return Change(node, machine()->Float64Sqrt()); 196 return Change(node, machine()->Float64Sqrt());
190 } 197 }
191 198
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 } 300 }
294 301
295 302
296 MachineOperatorBuilder* JSIntrinsicLowering::machine() const { 303 MachineOperatorBuilder* JSIntrinsicLowering::machine() const {
297 return jsgraph()->machine(); 304 return jsgraph()->machine();
298 } 305 }
299 306
300 } // namespace compiler 307 } // namespace compiler
301 } // namespace internal 308 } // namespace internal
302 } // namespace v8 309 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-intrinsic-lowering.h ('k') | src/compiler/machine-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698