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

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

Issue 990963003: [turbofan] Unify Math.floor / Math.ceil optimization. (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 22 matching lines...) Expand all
33 case Runtime::kInlineIsFunction: 33 case Runtime::kInlineIsFunction:
34 return ReduceInlineIsInstanceType(node, JS_FUNCTION_TYPE); 34 return ReduceInlineIsInstanceType(node, JS_FUNCTION_TYPE);
35 case Runtime::kInlineConstructDouble: 35 case Runtime::kInlineConstructDouble:
36 return ReduceInlineConstructDouble(node); 36 return ReduceInlineConstructDouble(node);
37 case Runtime::kInlineDoubleLo: 37 case Runtime::kInlineDoubleLo:
38 return ReduceInlineDoubleLo(node); 38 return ReduceInlineDoubleLo(node);
39 case Runtime::kInlineDoubleHi: 39 case Runtime::kInlineDoubleHi:
40 return ReduceInlineDoubleHi(node); 40 return ReduceInlineDoubleHi(node);
41 case Runtime::kInlineIsRegExp: 41 case Runtime::kInlineIsRegExp:
42 return ReduceInlineIsInstanceType(node, JS_REGEXP_TYPE); 42 return ReduceInlineIsInstanceType(node, JS_REGEXP_TYPE);
43 case Runtime::kInlineMathFloor:
44 return ReduceInlineMathFloor(node);
43 case Runtime::kInlineValueOf: 45 case Runtime::kInlineValueOf:
44 return ReduceInlineValueOf(node); 46 return ReduceInlineValueOf(node);
45 default: 47 default:
46 break; 48 break;
47 } 49 }
48 return NoChange(); 50 return NoChange();
49 } 51 }
50 52
51 53
52 Reduction JSIntrinsicLowering::ReduceInlineDeoptimizeNow(Node* node) { 54 Reduction JSIntrinsicLowering::ReduceInlineDeoptimizeNow(Node* node) {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 157
156 // Replace all effect uses of {node} with the {ephi}. 158 // Replace all effect uses of {node} with the {ephi}.
157 Node* ephi = graph()->NewNode(common()->EffectPhi(2), etrue, efalse, merge); 159 Node* ephi = graph()->NewNode(common()->EffectPhi(2), etrue, efalse, merge);
158 NodeProperties::ReplaceWithValue(node, node, ephi); 160 NodeProperties::ReplaceWithValue(node, node, ephi);
159 161
160 // Turn the {node} into a Phi. 162 // Turn the {node} into a Phi.
161 return Change(node, common()->Phi(type, 2), vtrue, vfalse, merge); 163 return Change(node, common()->Phi(type, 2), vtrue, vfalse, merge);
162 } 164 }
163 165
164 166
167 Reduction JSIntrinsicLowering::ReduceInlineMathFloor(Node* node) {
168 if (!machine()->HasFloat64RoundDown()) return NoChange();
169 return Change(node, machine()->Float64RoundDown());
170 }
171
172
165 Reduction JSIntrinsicLowering::ReduceInlineValueOf(Node* node) { 173 Reduction JSIntrinsicLowering::ReduceInlineValueOf(Node* node) {
166 // if (%_IsSmi(value)) { 174 // if (%_IsSmi(value)) {
167 // return value; 175 // return value;
168 // } else if (%_GetInstanceType(%_GetMap(value)) == JS_VALUE_TYPE) { 176 // } else if (%_GetInstanceType(%_GetMap(value)) == JS_VALUE_TYPE) {
169 // return %_GetValue(value); 177 // return %_GetValue(value);
170 // } else { 178 // } else {
171 // return value; 179 // return value;
172 // } 180 // }
173 const Operator* const merge_op = common()->Merge(2); 181 const Operator* const merge_op = common()->Merge(2);
174 const Operator* const ephi_op = common()->EffectPhi(2); 182 const Operator* const ephi_op = common()->EffectPhi(2);
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 } 263 }
256 264
257 265
258 MachineOperatorBuilder* JSIntrinsicLowering::machine() const { 266 MachineOperatorBuilder* JSIntrinsicLowering::machine() const {
259 return jsgraph()->machine(); 267 return jsgraph()->machine();
260 } 268 }
261 269
262 } // namespace compiler 270 } // namespace compiler
263 } // namespace internal 271 } // namespace internal
264 } // namespace v8 272 } // 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