summaryrefslogtreecommitdiff
path: root/deps/v8/src/compiler/int64-lowering.cc
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2017-12-05 16:41:55 +0100
committerMichaël Zasso <targos@protonmail.com>2017-12-06 12:52:07 +0100
commit1854ba04e9a68f062beb299dd6e1479279b26363 (patch)
treed5b2df9b8c1deb6388f7a728fca8e1c98c779abe /deps/v8/src/compiler/int64-lowering.cc
parentb52c23b75f96e1c9d2c7b3a7e5619170d0a0d8e1 (diff)
downloadnode-new-1854ba04e9a68f062beb299dd6e1479279b26363.tar.gz
deps: update V8 to 6.3.292.46
PR-URL: https://github.com/nodejs/node/pull/16271 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'deps/v8/src/compiler/int64-lowering.cc')
-rw-r--r--deps/v8/src/compiler/int64-lowering.cc64
1 files changed, 36 insertions, 28 deletions
diff --git a/deps/v8/src/compiler/int64-lowering.cc b/deps/v8/src/compiler/int64-lowering.cc
index 19db874ca6..4710f35dcc 100644
--- a/deps/v8/src/compiler/int64-lowering.cc
+++ b/deps/v8/src/compiler/int64-lowering.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "src/compiler/int64-lowering.h"
+
#include "src/compiler/common-operator.h"
#include "src/compiler/diamond.h"
#include "src/compiler/graph.h"
@@ -10,11 +11,8 @@
#include "src/compiler/machine-operator.h"
#include "src/compiler/node-matchers.h"
#include "src/compiler/node-properties.h"
-
#include "src/compiler/node.h"
#include "src/compiler/wasm-compiler.h"
-#include "src/objects-inl.h"
-#include "src/wasm/wasm-module.h"
#include "src/zone/zone.h"
namespace v8 {
@@ -148,7 +146,7 @@ void Int64Lowering::LowerNode(Node* node) {
if (node->opcode() == IrOpcode::kLoad) {
rep = LoadRepresentationOf(node->op()).representation();
} else {
- DCHECK(node->opcode() == IrOpcode::kUnalignedLoad);
+ DCHECK_EQ(IrOpcode::kUnalignedLoad, node->opcode());
rep = UnalignedLoadRepresentationOf(node->op()).representation();
}
@@ -163,7 +161,7 @@ void Int64Lowering::LowerNode(Node* node) {
if (node->opcode() == IrOpcode::kLoad) {
load_op = machine()->Load(MachineType::Int32());
} else {
- DCHECK(node->opcode() == IrOpcode::kUnalignedLoad);
+ DCHECK_EQ(IrOpcode::kUnalignedLoad, node->opcode());
load_op = machine()->UnalignedLoad(MachineType::Int32());
}
@@ -193,7 +191,7 @@ void Int64Lowering::LowerNode(Node* node) {
if (node->opcode() == IrOpcode::kStore) {
rep = StoreRepresentationOf(node->op()).representation();
} else {
- DCHECK(node->opcode() == IrOpcode::kUnalignedStore);
+ DCHECK_EQ(IrOpcode::kUnalignedStore, node->opcode());
rep = UnalignedStoreRepresentationOf(node->op());
}
@@ -218,7 +216,7 @@ void Int64Lowering::LowerNode(Node* node) {
store_op = machine()->Store(StoreRepresentation(
MachineRepresentation::kWord32, write_barrier_kind));
} else {
- DCHECK(node->opcode() == IrOpcode::kUnalignedStore);
+ DCHECK_EQ(IrOpcode::kUnalignedStore, node->opcode());
store_op = machine()->UnalignedStore(MachineRepresentation::kWord32);
}
@@ -257,7 +255,7 @@ void Int64Lowering::LowerNode(Node* node) {
break;
}
case IrOpcode::kParameter: {
- DCHECK(node->InputCount() == 1);
+ DCHECK_EQ(1, node->InputCount());
// Only exchange the node if the parameter count actually changed. We do
// not even have to do the default lowering because the the start node,
// the only input of a parameter node, only changes if the parameter count
@@ -265,7 +263,17 @@ void Int64Lowering::LowerNode(Node* node) {
if (GetParameterCountAfterLowering(signature()) !=
static_cast<int>(signature()->parameter_count())) {
int old_index = ParameterIndexOf(node->op());
+ // TODO(wasm): Make this part not wasm specific.
+ // Prevent special lowering of the WasmContext parameter.
+ if (old_index == kWasmContextParameterIndex) {
+ DefaultLowering(node);
+ break;
+ }
+ // Adjust old_index to be compliant with the signature.
+ --old_index;
int new_index = GetParameterIndexAfterLowering(signature(), old_index);
+ // Adjust new_index to consider the WasmContext parameter.
+ ++new_index;
NodeProperties::ChangeOp(node, common()->Parameter(new_index));
Node* high_node = nullptr;
@@ -313,7 +321,7 @@ void Int64Lowering::LowerNode(Node* node) {
break;
}
case IrOpcode::kWord64And: {
- DCHECK(node->InputCount() == 2);
+ DCHECK_EQ(2, node->InputCount());
Node* left = node->InputAt(0);
Node* right = node->InputAt(1);
@@ -327,14 +335,14 @@ void Int64Lowering::LowerNode(Node* node) {
break;
}
case IrOpcode::kTruncateInt64ToInt32: {
- DCHECK(node->InputCount() == 1);
+ DCHECK_EQ(1, node->InputCount());
Node* input = node->InputAt(0);
ReplaceNode(node, GetReplacementLow(input), nullptr);
node->NullAllInputs();
break;
}
case IrOpcode::kInt64Add: {
- DCHECK(node->InputCount() == 2);
+ DCHECK_EQ(2, node->InputCount());
Node* right = node->InputAt(1);
node->ReplaceInput(1, GetReplacementLow(right));
@@ -354,7 +362,7 @@ void Int64Lowering::LowerNode(Node* node) {
break;
}
case IrOpcode::kInt64Sub: {
- DCHECK(node->InputCount() == 2);
+ DCHECK_EQ(2, node->InputCount());
Node* right = node->InputAt(1);
node->ReplaceInput(1, GetReplacementLow(right));
@@ -374,7 +382,7 @@ void Int64Lowering::LowerNode(Node* node) {
break;
}
case IrOpcode::kInt64Mul: {
- DCHECK(node->InputCount() == 2);
+ DCHECK_EQ(2, node->InputCount());
Node* right = node->InputAt(1);
node->ReplaceInput(1, GetReplacementLow(right));
@@ -394,7 +402,7 @@ void Int64Lowering::LowerNode(Node* node) {
break;
}
case IrOpcode::kWord64Or: {
- DCHECK(node->InputCount() == 2);
+ DCHECK_EQ(2, node->InputCount());
Node* left = node->InputAt(0);
Node* right = node->InputAt(1);
@@ -408,7 +416,7 @@ void Int64Lowering::LowerNode(Node* node) {
break;
}
case IrOpcode::kWord64Xor: {
- DCHECK(node->InputCount() == 2);
+ DCHECK_EQ(2, node->InputCount());
Node* left = node->InputAt(0);
Node* right = node->InputAt(1);
@@ -424,7 +432,7 @@ void Int64Lowering::LowerNode(Node* node) {
case IrOpcode::kWord64Shl: {
// TODO(turbofan): if the shift count >= 32, then we can set the low word
// of the output to 0 and just calculate the high word.
- DCHECK(node->InputCount() == 2);
+ DCHECK_EQ(2, node->InputCount());
Node* shift = node->InputAt(1);
if (HasReplacementLow(shift)) {
// We do not have to care about the high word replacement, because
@@ -448,7 +456,7 @@ void Int64Lowering::LowerNode(Node* node) {
case IrOpcode::kWord64Shr: {
// TODO(turbofan): if the shift count >= 32, then we can set the low word
// of the output to 0 and just calculate the high word.
- DCHECK(node->InputCount() == 2);
+ DCHECK_EQ(2, node->InputCount());
Node* shift = node->InputAt(1);
if (HasReplacementLow(shift)) {
// We do not have to care about the high word replacement, because
@@ -472,7 +480,7 @@ void Int64Lowering::LowerNode(Node* node) {
case IrOpcode::kWord64Sar: {
// TODO(turbofan): if the shift count >= 32, then we can set the low word
// of the output to 0 and just calculate the high word.
- DCHECK(node->InputCount() == 2);
+ DCHECK_EQ(2, node->InputCount());
Node* shift = node->InputAt(1);
if (HasReplacementLow(shift)) {
// We do not have to care about the high word replacement, because
@@ -494,7 +502,7 @@ void Int64Lowering::LowerNode(Node* node) {
break;
}
case IrOpcode::kWord64Equal: {
- DCHECK(node->InputCount() == 2);
+ DCHECK_EQ(2, node->InputCount());
Node* left = node->InputAt(0);
Node* right = node->InputAt(1);
@@ -533,7 +541,7 @@ void Int64Lowering::LowerNode(Node* node) {
break;
}
case IrOpcode::kChangeInt32ToInt64: {
- DCHECK(node->InputCount() == 1);
+ DCHECK_EQ(1, node->InputCount());
Node* input = node->InputAt(0);
if (HasReplacementLow(input)) {
input = GetReplacementLow(input);
@@ -547,7 +555,7 @@ void Int64Lowering::LowerNode(Node* node) {
break;
}
case IrOpcode::kChangeUint32ToUint64: {
- DCHECK(node->InputCount() == 1);
+ DCHECK_EQ(1, node->InputCount());
Node* input = node->InputAt(0);
if (HasReplacementLow(input)) {
input = GetReplacementLow(input);
@@ -557,7 +565,7 @@ void Int64Lowering::LowerNode(Node* node) {
break;
}
case IrOpcode::kBitcastInt64ToFloat64: {
- DCHECK(node->InputCount() == 1);
+ DCHECK_EQ(1, node->InputCount());
Node* input = node->InputAt(0);
Node* stack_slot = graph()->NewNode(
machine()->StackSlot(MachineRepresentation::kWord64));
@@ -589,7 +597,7 @@ void Int64Lowering::LowerNode(Node* node) {
break;
}
case IrOpcode::kBitcastFloat64ToInt64: {
- DCHECK(node->InputCount() == 1);
+ DCHECK_EQ(1, node->InputCount());
Node* input = node->InputAt(0);
if (HasReplacementLow(input)) {
input = GetReplacementLow(input);
@@ -618,7 +626,7 @@ void Int64Lowering::LowerNode(Node* node) {
break;
}
case IrOpcode::kWord64Ror: {
- DCHECK(node->InputCount() == 2);
+ DCHECK_EQ(2, node->InputCount());
Node* input = node->InputAt(0);
Node* shift = HasReplacementLow(node->InputAt(1))
? GetReplacementLow(node->InputAt(1))
@@ -726,7 +734,7 @@ void Int64Lowering::LowerNode(Node* node) {
break;
}
case IrOpcode::kWord64Clz: {
- DCHECK(node->InputCount() == 1);
+ DCHECK_EQ(1, node->InputCount());
Node* input = node->InputAt(0);
Diamond d(
graph(), common(),
@@ -744,7 +752,7 @@ void Int64Lowering::LowerNode(Node* node) {
break;
}
case IrOpcode::kWord64Ctz: {
- DCHECK(node->InputCount() == 1);
+ DCHECK_EQ(1, node->InputCount());
DCHECK(machine()->Word32Ctz().IsSupported());
Node* input = node->InputAt(0);
Diamond d(
@@ -763,7 +771,7 @@ void Int64Lowering::LowerNode(Node* node) {
break;
}
case IrOpcode::kWord64Popcnt: {
- DCHECK(node->InputCount() == 1);
+ DCHECK_EQ(1, node->InputCount());
Node* input = node->InputAt(0);
// We assume that a Word64Popcnt node only has been created if
// Word32Popcnt is actually supported.
@@ -820,7 +828,7 @@ void Int64Lowering::LowerNode(Node* node) {
void Int64Lowering::LowerComparison(Node* node, const Operator* high_word_op,
const Operator* low_word_op) {
- DCHECK(node->InputCount() == 2);
+ DCHECK_EQ(2, node->InputCount());
Node* left = node->InputAt(0);
Node* right = node->InputAt(1);
Node* replacement = graph()->NewNode(