Commit ad9937b4 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[csa][cleanup] Remove ParameterMode/TNodify ToParameterConstant

Bug: v8:9708, v8:6949
Change-Id: If2b95333b5821b91296169714359f095bf8b9bd6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2370636Reviewed-by: 's avatarDan Elphick <delphick@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69539}
parent a6b38d81
......@@ -3776,10 +3776,8 @@ TNode<FixedArrayBase> CodeStubAssembler::AllocateFixedArray(
const intptr_t kMaxLength = IsDoubleElementsKind(kind)
? FixedDoubleArray::kMaxLength
: FixedArray::kMaxLength;
const ParameterMode parameter_mode =
std::is_same<TIndex, Smi>::value ? SMI_PARAMETERS : INTPTR_PARAMETERS;
intptr_t capacity_constant;
if (ToParameterConstant(capacity, &capacity_constant, parameter_mode)) {
if (ToParameterConstant(capacity, &capacity_constant)) {
CHECK_LE(capacity_constant, kMaxLength);
} else {
Label if_out_of_memory(this, Label::kDeferred), next(this);
......
......@@ -351,22 +351,21 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
template <typename TIndex>
TNode<TIndex> TaggedToParameter(TNode<Smi> value);
bool ToParameterConstant(Node* node, intptr_t* out, ParameterMode mode) {
if (mode == ParameterMode::SMI_PARAMETERS) {
Smi constant;
if (ToSmiConstant(node, &constant)) {
*out = static_cast<intptr_t>(constant.value());
return true;
}
} else {
DCHECK_EQ(mode, ParameterMode::INTPTR_PARAMETERS);
intptr_t constant;
if (ToIntPtrConstant(node, &constant)) {
*out = constant;
return true;
}
bool ToParameterConstant(TNode<Smi> node, intptr_t* out) {
Smi constant;
if (ToSmiConstant(node, &constant)) {
*out = static_cast<intptr_t>(constant.value());
return true;
}
return false;
}
bool ToParameterConstant(TNode<IntPtrT> node, intptr_t* out) {
intptr_t constant;
if (ToIntPtrConstant(node, &constant)) {
*out = constant;
return true;
}
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment