diff options
author | Myles Borins <mylesborins@google.com> | 2019-09-24 11:56:38 -0400 |
---|---|---|
committer | Myles Borins <myles.borins@gmail.com> | 2019-10-07 03:19:23 -0400 |
commit | f7f6c928c1c9c136b7926f892b8a2fda11d8b4b2 (patch) | |
tree | f5edbccb3ffda2573d70a6e291e7157f290e0ae0 /deps/v8/src/compiler/int64-lowering.cc | |
parent | ffd22e81983056d09c064c59343a0e488236272d (diff) | |
download | node-new-f7f6c928c1c9c136b7926f892b8a2fda11d8b4b2.tar.gz |
deps: update V8 to 7.8.279.9
PR-URL: https://github.com/nodejs/node/pull/29694
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Diffstat (limited to 'deps/v8/src/compiler/int64-lowering.cc')
-rw-r--r-- | deps/v8/src/compiler/int64-lowering.cc | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/deps/v8/src/compiler/int64-lowering.cc b/deps/v8/src/compiler/int64-lowering.cc index eda866e5f2..45b49757fb 100644 --- a/deps/v8/src/compiler/int64-lowering.cc +++ b/deps/v8/src/compiler/int64-lowering.cc @@ -21,9 +21,11 @@ namespace v8 { namespace internal { namespace compiler { -Int64Lowering::Int64Lowering(Graph* graph, MachineOperatorBuilder* machine, - CommonOperatorBuilder* common, Zone* zone, - Signature<MachineRepresentation>* signature) +Int64Lowering::Int64Lowering( + Graph* graph, MachineOperatorBuilder* machine, + CommonOperatorBuilder* common, Zone* zone, + Signature<MachineRepresentation>* signature, + std::unique_ptr<Int64LoweringSpecialCase> special_case) : zone_(zone), graph_(graph), machine_(machine), @@ -32,8 +34,9 @@ Int64Lowering::Int64Lowering(Graph* graph, MachineOperatorBuilder* machine, stack_(zone), replacements_(nullptr), signature_(signature), - placeholder_(graph->NewNode(common->Parameter(-2, "placeholder"), - graph->start())) { + placeholder_( + graph->NewNode(common->Parameter(-2, "placeholder"), graph->start())), + special_case_(std::move(special_case)) { DCHECK_NOT_NULL(graph); DCHECK_NOT_NULL(graph->end()); replacements_ = zone->NewArray<Replacement>(graph->NodeCount()); @@ -77,7 +80,7 @@ void Int64Lowering::LowerGraph() { namespace { -int GetReturnIndexAfterLowering(CallDescriptor* call_descriptor, +int GetReturnIndexAfterLowering(const CallDescriptor* call_descriptor, int old_index) { int result = old_index; for (int i = 0; i < old_index; i++) { @@ -89,7 +92,7 @@ int GetReturnIndexAfterLowering(CallDescriptor* call_descriptor, return result; } -int GetReturnCountAfterLowering(CallDescriptor* call_descriptor) { +int GetReturnCountAfterLowering(const CallDescriptor* call_descriptor) { return GetReturnIndexAfterLowering( call_descriptor, static_cast<int>(call_descriptor->ReturnCount())); } @@ -336,21 +339,21 @@ void Int64Lowering::LowerNode(Node* node) { if (DefaultLowering(node) || returns_require_lowering) { // Tail calls do not have return values, so adjusting the call // descriptor is enough. - auto new_descriptor = GetI32WasmCallDescriptor(zone(), call_descriptor); - NodeProperties::ChangeOp(node, common()->TailCall(new_descriptor)); + NodeProperties::ChangeOp( + node, common()->TailCall(LowerCallDescriptor(call_descriptor))); } break; } case IrOpcode::kCall: { - auto call_descriptor = - const_cast<CallDescriptor*>(CallDescriptorOf(node->op())); + auto call_descriptor = CallDescriptorOf(node->op()); + bool returns_require_lowering = GetReturnCountAfterLowering(call_descriptor) != static_cast<int>(call_descriptor->ReturnCount()); if (DefaultLowering(node) || returns_require_lowering) { // We have to adjust the call descriptor. - NodeProperties::ChangeOp(node, common()->Call(GetI32WasmCallDescriptor( - zone(), call_descriptor))); + NodeProperties::ChangeOp( + node, common()->Call(LowerCallDescriptor(call_descriptor))); } if (returns_require_lowering) { size_t return_arity = call_descriptor->ReturnCount(); @@ -994,6 +997,19 @@ bool Int64Lowering::DefaultLowering(Node* node, bool low_word_only) { return something_changed; } +CallDescriptor* Int64Lowering::LowerCallDescriptor( + const CallDescriptor* call_descriptor) { + if (special_case_) { + if (call_descriptor == special_case_->bigint_to_i64_call_descriptor) { + return special_case_->bigint_to_i32_pair_call_descriptor; + } + if (call_descriptor == special_case_->i64_to_bigint_call_descriptor) { + return special_case_->i32_pair_to_bigint_call_descriptor; + } + } + return GetI32WasmCallDescriptor(zone(), call_descriptor); +} + void Int64Lowering::ReplaceNode(Node* old, Node* new_low, Node* new_high) { // if new_low == nullptr, then also new_high == nullptr. DCHECK(new_low != nullptr || new_high == nullptr); |