aboutsummaryrefslogtreecommitdiff
path: root/src/compiler/int64-lowering.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/int64-lowering.cc')
-rw-r--r--src/compiler/int64-lowering.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/compiler/int64-lowering.cc b/src/compiler/int64-lowering.cc
index 62523ca4..06c92728 100644
--- a/src/compiler/int64-lowering.cc
+++ b/src/compiler/int64-lowering.cc
@@ -12,6 +12,7 @@
#include "src/compiler/node-properties.h"
#include "src/compiler/node.h"
+#include "src/objects-inl.h"
#include "src/wasm/wasm-module.h"
#include "src/zone/zone.h"
@@ -61,7 +62,8 @@ void Int64Lowering::LowerGraph() {
// that they are processed after all other nodes.
PreparePhiReplacement(input);
stack_.push_front({input, 0});
- } else if (input->opcode() == IrOpcode::kEffectPhi) {
+ } else if (input->opcode() == IrOpcode::kEffectPhi ||
+ input->opcode() == IrOpcode::kLoop) {
stack_.push_front({input, 0});
} else {
stack_.push_back({input, 0});
@@ -104,6 +106,9 @@ static int GetReturnCountAfterLowering(
void Int64Lowering::GetIndexNodes(Node* index, Node*& index_low,
Node*& index_high) {
+ if (HasReplacementLow(index)) {
+ index = GetReplacementLow(index);
+ }
#if defined(V8_TARGET_LITTLE_ENDIAN)
index_low = index;
index_high = graph()->NewNode(machine()->Int32Add(), index,
@@ -233,9 +238,7 @@ void Int64Lowering::LowerNode(Node* node) {
NodeProperties::ChangeOp(node, store_op);
ReplaceNode(node, node, high_node);
} else {
- if (HasReplacementLow(node->InputAt(2))) {
- node->ReplaceInput(2, GetReplacementLow(node->InputAt(2)));
- }
+ DefaultLowering(node, true);
}
break;
}
@@ -824,7 +827,7 @@ void Int64Lowering::LowerComparison(Node* node, const Operator* high_word_op,
ReplaceNode(node, replacement, nullptr);
}
-bool Int64Lowering::DefaultLowering(Node* node) {
+bool Int64Lowering::DefaultLowering(Node* node, bool low_word_only) {
bool something_changed = false;
for (int i = NodeProperties::PastValueIndex(node) - 1; i >= 0; i--) {
Node* input = node->InputAt(i);
@@ -832,7 +835,7 @@ bool Int64Lowering::DefaultLowering(Node* node) {
something_changed = true;
node->ReplaceInput(i, GetReplacementLow(input));
}
- if (HasReplacementHigh(input)) {
+ if (!low_word_only && HasReplacementHigh(input)) {
something_changed = true;
node->InsertInput(zone(), i + 1, GetReplacementHigh(input));
}