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

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

Issue 2146293003: [builtins] implement Array.prototype.includes in TurboFan (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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
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 <stack> 7 #include <stack>
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/compiler/access-builder.h" 10 #include "src/compiler/access-builder.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 case Runtime::kInlineToObject: 73 case Runtime::kInlineToObject:
74 return ReduceToObject(node); 74 return ReduceToObject(node);
75 case Runtime::kInlineToString: 75 case Runtime::kInlineToString:
76 return ReduceToString(node); 76 return ReduceToString(node);
77 case Runtime::kInlineCall: 77 case Runtime::kInlineCall:
78 return ReduceCall(node); 78 return ReduceCall(node);
79 case Runtime::kInlineNewObject: 79 case Runtime::kInlineNewObject:
80 return ReduceNewObject(node); 80 return ReduceNewObject(node);
81 case Runtime::kInlineGetSuperConstructor: 81 case Runtime::kInlineGetSuperConstructor:
82 return ReduceGetSuperConstructor(node); 82 return ReduceGetSuperConstructor(node);
83 case Runtime::kInlineSameValueZero:
84 return ReduceSameValueZero(node);
83 default: 85 default:
84 break; 86 break;
85 } 87 }
86 return NoChange(); 88 return NoChange();
87 } 89 }
88 90
89 91
90 Reduction JSIntrinsicLowering::ReduceCreateIterResultObject(Node* node) { 92 Reduction JSIntrinsicLowering::ReduceCreateIterResultObject(Node* node) {
91 Node* const value = NodeProperties::GetValueInput(node, 0); 93 Node* const value = NodeProperties::GetValueInput(node, 0);
92 Node* const done = NodeProperties::GetValueInput(node, 1); 94 Node* const done = NodeProperties::GetValueInput(node, 1);
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 Node* active_function = NodeProperties::GetValueInput(node, 0); 319 Node* active_function = NodeProperties::GetValueInput(node, 0);
318 Node* effect = NodeProperties::GetEffectInput(node); 320 Node* effect = NodeProperties::GetEffectInput(node);
319 Node* control = NodeProperties::GetControlInput(node); 321 Node* control = NodeProperties::GetControlInput(node);
320 Node* active_function_map = effect = 322 Node* active_function_map = effect =
321 graph()->NewNode(simplified()->LoadField(AccessBuilder::ForMap()), 323 graph()->NewNode(simplified()->LoadField(AccessBuilder::ForMap()),
322 active_function, effect, control); 324 active_function, effect, control);
323 return Change(node, simplified()->LoadField(AccessBuilder::ForMapPrototype()), 325 return Change(node, simplified()->LoadField(AccessBuilder::ForMapPrototype()),
324 active_function_map, effect, control); 326 active_function_map, effect, control);
325 } 327 }
326 328
329 Reduction JSIntrinsicLowering::ReduceSameValueZero(Node* node) {
330 NodeProperties::ChangeOp(
331 node, javascript()->SameValueZero(CompareOperationHints()));
332 return Changed(node);
333 }
334
327 Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op, Node* a, 335 Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op, Node* a,
328 Node* b) { 336 Node* b) {
329 RelaxControls(node); 337 RelaxControls(node);
330 node->ReplaceInput(0, a); 338 node->ReplaceInput(0, a);
331 node->ReplaceInput(1, b); 339 node->ReplaceInput(1, b);
332 node->TrimInputCount(2); 340 node->TrimInputCount(2);
333 NodeProperties::ChangeOp(node, op); 341 NodeProperties::ChangeOp(node, op);
334 return Changed(node); 342 return Changed(node);
335 } 343 }
336 344
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 } 400 }
393 401
394 402
395 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { 403 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const {
396 return jsgraph()->simplified(); 404 return jsgraph()->simplified();
397 } 405 }
398 406
399 } // namespace compiler 407 } // namespace compiler
400 } // namespace internal 408 } // namespace internal
401 } // namespace v8 409 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698