OLD | NEW |
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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 node->ReplaceInput(0, a); | 459 node->ReplaceInput(0, a); |
460 node->ReplaceInput(1, b); | 460 node->ReplaceInput(1, b); |
461 node->ReplaceInput(2, c); | 461 node->ReplaceInput(2, c); |
462 node->ReplaceInput(3, d); | 462 node->ReplaceInput(3, d); |
463 node->TrimInputCount(4); | 463 node->TrimInputCount(4); |
464 NodeProperties::ChangeOp(node, op); | 464 NodeProperties::ChangeOp(node, op); |
465 return Changed(node); | 465 return Changed(node); |
466 } | 466 } |
467 | 467 |
468 | 468 |
469 Reduction JSIntrinsicLowering::ChangeToUndefined(Node* node, Node* effect) { | |
470 ReplaceWithValue(node, jsgraph()->UndefinedConstant(), effect); | |
471 return Changed(node); | |
472 } | |
473 | |
474 | |
475 Reduction JSIntrinsicLowering::Change(Node* node, Callable const& callable, | 469 Reduction JSIntrinsicLowering::Change(Node* node, Callable const& callable, |
476 int stack_parameter_count) { | 470 int stack_parameter_count) { |
477 CallDescriptor const* const desc = Linkage::GetStubCallDescriptor( | 471 CallDescriptor const* const desc = Linkage::GetStubCallDescriptor( |
478 isolate(), graph()->zone(), callable.descriptor(), stack_parameter_count, | 472 isolate(), graph()->zone(), callable.descriptor(), stack_parameter_count, |
479 CallDescriptor::kNeedsFrameState, node->op()->properties()); | 473 CallDescriptor::kNeedsFrameState, node->op()->properties()); |
480 node->InsertInput(graph()->zone(), 0, | 474 node->InsertInput(graph()->zone(), 0, |
481 jsgraph()->HeapConstant(callable.code())); | 475 jsgraph()->HeapConstant(callable.code())); |
482 NodeProperties::ChangeOp(node, common()->Call(desc)); | 476 NodeProperties::ChangeOp(node, common()->Call(desc)); |
483 return Changed(node); | 477 return Changed(node); |
484 } | 478 } |
(...skipping 19 matching lines...) Expand all Loading... |
504 } | 498 } |
505 | 499 |
506 | 500 |
507 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { | 501 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { |
508 return jsgraph()->simplified(); | 502 return jsgraph()->simplified(); |
509 } | 503 } |
510 | 504 |
511 } // namespace compiler | 505 } // namespace compiler |
512 } // namespace internal | 506 } // namespace internal |
513 } // namespace v8 | 507 } // namespace v8 |
OLD | NEW |