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

[cleanup] TNodify and remove sloppyness in Goto and Branch methods

Bug: v8:6949, v8:10155
Change-Id: Iafd6b8172a67fa1b778d163259fe8d1400b004f3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2056847Reviewed-by: 's avatarDan Elphick <delphick@chromium.org>
Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66282}
parent ad3c4e3d
......@@ -116,8 +116,7 @@ void CodeStubAssembler::Check(const NodeGenerator<BoolT>& condition_body,
const char* message, const char* file, int line,
std::initializer_list<ExtraNode> extra_nodes) {
BranchGenerator branch = [=](Label* ok, Label* not_ok) {
Node* condition = condition_body();
DCHECK_NOT_NULL(condition);
TNode<BoolT> condition = condition_body();
Branch(condition, ok, not_ok);
};
......@@ -6430,9 +6429,8 @@ TNode<BoolT> CodeStubAssembler::IsNumberArrayIndex(TNode<Number> number) {
[=] { return IsHeapNumberUint32(CAST(number)); });
}
Node* CodeStubAssembler::FixedArraySizeDoesntFitInNewSpace(Node* element_count,
int base_size,
ParameterMode mode) {
TNode<BoolT> CodeStubAssembler::FixedArraySizeDoesntFitInNewSpace(
Node* element_count, int base_size, ParameterMode mode) {
int max_newspace_elements =
(kMaxRegularHeapObjectSize - base_size) / kTaggedSize;
return IntPtrOrSmiGreaterThan(
......@@ -9965,7 +9963,7 @@ Node* CodeStubAssembler::CheckForCapacityGrow(
Label grow_case(this), no_grow_case(this), done(this),
grow_bailout(this, Label::kDeferred);
Node* condition;
TNode<BoolT> condition;
if (IsHoleyElementsKind(kind)) {
condition = UintPtrGreaterThanOrEqual(key, length);
} else {
......
......@@ -2641,7 +2641,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
// [0, 2^32-1).
TNode<BoolT> IsNumberArrayIndex(TNode<Number> number);
Node* FixedArraySizeDoesntFitInNewSpace(
TNode<BoolT> FixedArraySizeDoesntFitInNewSpace(
Node* element_count, int base_size = FixedArray::kHeaderSize,
ParameterMode mode = INTPTR_PARAMETERS);
......
......@@ -451,7 +451,7 @@ void CodeAssembler::PopAndReturn(Node* pop, Node* value) {
return raw_assembler()->PopAndReturn(pop, value);
}
void CodeAssembler::ReturnIf(Node* condition, TNode<Object> value) {
void CodeAssembler::ReturnIf(TNode<BoolT> condition, TNode<Object> value) {
Label if_return(this), if_continue(this);
Branch(condition, &if_return, &if_continue);
Bind(&if_return);
......@@ -1116,21 +1116,19 @@ void CodeAssembler::Goto(Label* label) {
raw_assembler()->Goto(label->label_);
}
void CodeAssembler::GotoIf(SloppyTNode<IntegralT> condition,
Label* true_label) {
void CodeAssembler::GotoIf(TNode<IntegralT> condition, Label* true_label) {
Label false_label(this);
Branch(condition, true_label, &false_label);
Bind(&false_label);
}
void CodeAssembler::GotoIfNot(SloppyTNode<IntegralT> condition,
Label* false_label) {
void CodeAssembler::GotoIfNot(TNode<IntegralT> condition, Label* false_label) {
Label true_label(this);
Branch(condition, &true_label, false_label);
Bind(&true_label);
}
void CodeAssembler::Branch(SloppyTNode<IntegralT> condition, Label* true_label,
void CodeAssembler::Branch(TNode<IntegralT> condition, Label* true_label,
Label* false_label) {
int32_t constant;
if (ToInt32Constant(condition, &constant)) {
......
......@@ -575,7 +575,7 @@ class V8_EXPORT_PRIVATE CodeAssembler {
void Return(TNode<WordT> value1, TNode<WordT> value2);
void PopAndReturn(Node* pop, Node* value);
void ReturnIf(Node* condition, TNode<Object> value);
void ReturnIf(TNode<BoolT> condition, TNode<Object> value);
void AbortCSAAssert(Node* message);
void DebugBreak();
......@@ -602,9 +602,9 @@ class V8_EXPORT_PRIVATE CodeAssembler {
void Bind(Label* label, AssemblerDebugInfo debug_info);
#endif // DEBUG
void Goto(Label* label);
void GotoIf(SloppyTNode<IntegralT> condition, Label* true_label);
void GotoIfNot(SloppyTNode<IntegralT> condition, Label* false_label);
void Branch(SloppyTNode<IntegralT> condition, Label* true_label,
void GotoIf(TNode<IntegralT> condition, Label* true_label);
void GotoIfNot(TNode<IntegralT> condition, Label* false_label);
void Branch(TNode<IntegralT> condition, Label* true_label,
Label* false_label);
template <class T>
......
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