Commit 3669ecd6 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[csa][cleanup] Remove Sloppy-ness for even more classes

Remove for:
 * Word32T
 * String
 * SharedFunctionInfo
 * MaybeObject

Bug: v8:6949, v8:11074
Change-Id: I6facf1692697a4776a88ceae8a817f57af40c351
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2523322Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71051}
parent 66cb4dcc
......@@ -1296,7 +1296,6 @@ TNode<BoolT> RegExpBuiltinsAssembler::FlagGetter(TNode<Context> context,
TNode<Number> RegExpBuiltinsAssembler::AdvanceStringIndex(
TNode<String> string, TNode<Number> index, TNode<BoolT> is_unicode,
bool is_fastpath) {
CSA_ASSERT(this, IsString(string));
CSA_ASSERT(this, IsNumberNormalized(index));
if (is_fastpath) CSA_ASSERT(this, TaggedIsPositiveSmi(index));
......
......@@ -85,7 +85,7 @@ void CodeStubAssembler::Assert(const NodeGenerator<BoolT>& condition_body,
#endif
}
void CodeStubAssembler::Assert(SloppyTNode<Word32T> condition_node,
void CodeStubAssembler::Assert(TNode<Word32T> condition_node,
const char* message, const char* file, int line,
std::initializer_list<ExtraNode> extra_nodes) {
#if defined(DEBUG)
......@@ -129,7 +129,7 @@ void CodeStubAssembler::Check(const NodeGenerator<BoolT>& condition_body,
Check(branch, message, file, line, extra_nodes);
}
void CodeStubAssembler::Check(SloppyTNode<Word32T> condition_node,
void CodeStubAssembler::Check(TNode<Word32T> condition_node,
const char* message, const char* file, int line,
std::initializer_list<ExtraNode> extra_nodes) {
BranchGenerator branch = [=](Label* ok, Label* not_ok) {
......@@ -1006,7 +1006,7 @@ TNode<Int32T> CodeStubAssembler::TruncateIntPtrToInt32(
return ReinterpretCast<Int32T>(value);
}
TNode<BoolT> CodeStubAssembler::TaggedIsSmi(SloppyTNode<MaybeObject> a) {
TNode<BoolT> CodeStubAssembler::TaggedIsSmi(TNode<MaybeObject> a) {
STATIC_ASSERT(kSmiTagMask < kMaxUInt32);
return Word32Equal(
Word32And(TruncateIntPtrToInt32(BitcastTaggedToWordForTagAndSmiBits(a)),
......@@ -1014,7 +1014,7 @@ TNode<BoolT> CodeStubAssembler::TaggedIsSmi(SloppyTNode<MaybeObject> a) {
Int32Constant(0));
}
TNode<BoolT> CodeStubAssembler::TaggedIsNotSmi(SloppyTNode<MaybeObject> a) {
TNode<BoolT> CodeStubAssembler::TaggedIsNotSmi(TNode<MaybeObject> a) {
return Word32BinaryNot(TaggedIsSmi(a));
}
......@@ -1835,14 +1835,12 @@ TNode<Smi> CodeStubAssembler::LoadStringLengthAsSmi(TNode<String> string) {
return SmiFromIntPtr(LoadStringLengthAsWord(string));
}
TNode<IntPtrT> CodeStubAssembler::LoadStringLengthAsWord(
SloppyTNode<String> string) {
TNode<IntPtrT> CodeStubAssembler::LoadStringLengthAsWord(TNode<String> string) {
return Signed(ChangeUint32ToWord(LoadStringLengthAsWord32(string)));
}
TNode<Uint32T> CodeStubAssembler::LoadStringLengthAsWord32(
SloppyTNode<String> string) {
CSA_ASSERT(this, IsString(string));
TNode<String> string) {
return LoadObjectField<Uint32T>(string, String::kLengthOffset);
}
......@@ -2696,7 +2694,7 @@ TNode<HeapObject> CodeStubAssembler::LoadJSFunctionPrototype(
}
TNode<BytecodeArray> CodeStubAssembler::LoadSharedFunctionInfoBytecodeArray(
SloppyTNode<SharedFunctionInfo> shared) {
TNode<SharedFunctionInfo> shared) {
TNode<HeapObject> function_data = LoadObjectField<HeapObject>(
shared, SharedFunctionInfo::kFunctionDataOffset);
......@@ -7297,7 +7295,7 @@ TNode<Object> CodeStubAssembler::OrdinaryToPrimitive(
return CallStub(callable, context, input);
}
TNode<Uint32T> CodeStubAssembler::DecodeWord32(SloppyTNode<Word32T> word32,
TNode<Uint32T> CodeStubAssembler::DecodeWord32(TNode<Word32T> word32,
uint32_t shift, uint32_t mask) {
DCHECK_EQ((mask >> shift) << shift, mask);
return Unsigned(Word32And(Word32Shr(word32, static_cast<int>(shift)),
......@@ -7490,7 +7488,7 @@ void CodeStubAssembler::TryToName(SloppyTNode<Object> key, Label* if_keyisindex,
}
void CodeStubAssembler::TryInternalizeString(
SloppyTNode<String> string, Label* if_index, TVariable<IntPtrT>* var_index,
TNode<String> string, Label* if_index, TVariable<IntPtrT>* var_index,
Label* if_internalized, TVariable<Name>* var_internalized,
Label* if_not_internalized, Label* if_bailout) {
TNode<ExternalReference> function = ExternalConstant(
......@@ -12979,7 +12977,7 @@ TNode<Code> CodeStubAssembler::LoadBuiltin(TNode<Smi> builtin_id) {
}
TNode<Code> CodeStubAssembler::GetSharedFunctionInfoCode(
SloppyTNode<SharedFunctionInfo> shared_info, Label* if_compile_lazy) {
TNode<SharedFunctionInfo> shared_info, Label* if_compile_lazy) {
TNode<Object> sfi_data =
LoadObjectField(shared_info, SharedFunctionInfo::kFunctionDataOffset);
......@@ -13212,7 +13210,7 @@ void CodeStubAssembler::Print(const char* s) {
}
void CodeStubAssembler::Print(const char* prefix,
SloppyTNode<MaybeObject> tagged_value) {
TNode<MaybeObject> tagged_value) {
if (prefix != nullptr) {
std::string formatted(prefix);
formatted += ": ";
......
......@@ -756,7 +756,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
void Assert(const NodeGenerator<BoolT>& condition_body, const char* message,
const char* file, int line,
std::initializer_list<ExtraNode> extra_nodes = {});
void Assert(SloppyTNode<Word32T> condition_node, const char* message,
void Assert(TNode<Word32T> condition_node, const char* message,
const char* file, int line,
std::initializer_list<ExtraNode> extra_nodes = {});
void Check(const BranchGenerator& branch, const char* message,
......@@ -765,7 +765,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
void Check(const NodeGenerator<BoolT>& condition_body, const char* message,
const char* file, int line,
std::initializer_list<ExtraNode> extra_nodes = {});
void Check(SloppyTNode<Word32T> condition_node, const char* message,
void Check(TNode<Word32T> condition_node, const char* message,
const char* file, int line,
std::initializer_list<ExtraNode> extra_nodes = {});
void FailAssert(const char* message,
......@@ -891,8 +891,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
TNode<Int32T> TruncateIntPtrToInt32(SloppyTNode<IntPtrT> value);
// Check a value for smi-ness
TNode<BoolT> TaggedIsSmi(SloppyTNode<MaybeObject> a);
TNode<BoolT> TaggedIsNotSmi(SloppyTNode<MaybeObject> a);
TNode<BoolT> TaggedIsSmi(TNode<MaybeObject> a);
TNode<BoolT> TaggedIsNotSmi(TNode<MaybeObject> a);
// Check that the value is a non-negative smi.
TNode<BoolT> TaggedIsPositiveSmi(SloppyTNode<Object> a);
......@@ -1274,9 +1274,9 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
// Load length field of a String object as Smi value.
TNode<Smi> LoadStringLengthAsSmi(TNode<String> string);
// Load length field of a String object as intptr_t value.
TNode<IntPtrT> LoadStringLengthAsWord(SloppyTNode<String> string);
TNode<IntPtrT> LoadStringLengthAsWord(TNode<String> string);
// Load length field of a String object as uint32_t value.
TNode<Uint32T> LoadStringLengthAsWord32(SloppyTNode<String> string);
TNode<Uint32T> LoadStringLengthAsWord32(TNode<String> string);
// Load value field of a JSPrimitiveWrapper object.
TNode<Object> LoadJSPrimitiveWrapperValue(TNode<JSPrimitiveWrapper> object);
......@@ -1490,7 +1490,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
Label* if_bailout);
TNode<BytecodeArray> LoadSharedFunctionInfoBytecodeArray(
SloppyTNode<SharedFunctionInfo> shared);
TNode<SharedFunctionInfo> shared);
void StoreObjectByteNoWriteBarrier(TNode<HeapObject> object, int offset,
TNode<Word32T> value);
......@@ -2566,7 +2566,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
// Returns a node that contains a decoded (unsigned!) value of a bit
// field |BitField| in |word32|. Returns result as an uint32 node.
template <typename BitField>
TNode<Uint32T> DecodeWord32(SloppyTNode<Word32T> word32) {
TNode<Uint32T> DecodeWord32(TNode<Word32T> word32) {
return DecodeWord32(word32, BitField::kShift, BitField::kMask);
}
......@@ -2580,7 +2580,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
// Returns a node that contains a decoded (unsigned!) value of a bit
// field |BitField| in |word32|. Returns result as a word-size node.
template <typename BitField>
TNode<UintPtrT> DecodeWordFromWord32(SloppyTNode<Word32T> word32) {
TNode<UintPtrT> DecodeWordFromWord32(TNode<Word32T> word32) {
return DecodeWord<BitField>(ChangeUint32ToWord(word32));
}
......@@ -2593,7 +2593,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
}
// Decodes an unsigned (!) value from |word32| to an uint32 node.
TNode<Uint32T> DecodeWord32(SloppyTNode<Word32T> word32, uint32_t shift,
TNode<Uint32T> DecodeWord32(TNode<Word32T> word32, uint32_t shift,
uint32_t mask);
// Decodes an unsigned (!) value from |word| to a word-size node.
......@@ -2647,24 +2647,24 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
// Returns true if any of the |T|'s bits in given |word32| are set.
template <typename T>
TNode<BoolT> IsSetWord32(SloppyTNode<Word32T> word32) {
TNode<BoolT> IsSetWord32(TNode<Word32T> word32) {
return IsSetWord32(word32, T::kMask);
}
// Returns true if any of the mask's bits in given |word32| are set.
TNode<BoolT> IsSetWord32(SloppyTNode<Word32T> word32, uint32_t mask) {
TNode<BoolT> IsSetWord32(TNode<Word32T> word32, uint32_t mask) {
return Word32NotEqual(Word32And(word32, Int32Constant(mask)),
Int32Constant(0));
}
// Returns true if none of the mask's bits in given |word32| are set.
TNode<BoolT> IsNotSetWord32(SloppyTNode<Word32T> word32, uint32_t mask) {
TNode<BoolT> IsNotSetWord32(TNode<Word32T> word32, uint32_t mask) {
return Word32Equal(Word32And(word32, Int32Constant(mask)),
Int32Constant(0));
}
// Returns true if all of the mask's bits in a given |word32| are set.
TNode<BoolT> IsAllSetWord32(SloppyTNode<Word32T> word32, uint32_t mask) {
TNode<BoolT> IsAllSetWord32(TNode<Word32T> word32, uint32_t mask) {
TNode<Int32T> const_mask = Int32Constant(mask);
return Word32Equal(Word32And(word32, const_mask), const_mask);
}
......@@ -2701,12 +2701,12 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
// Returns true if all of the |T|'s bits in given |word32| are clear.
template <typename T>
TNode<BoolT> IsClearWord32(SloppyTNode<Word32T> word32) {
TNode<BoolT> IsClearWord32(TNode<Word32T> word32) {
return IsClearWord32(word32, T::kMask);
}
// Returns true if all of the mask's bits in given |word32| are clear.
TNode<BoolT> IsClearWord32(SloppyTNode<Word32T> word32, uint32_t mask) {
TNode<BoolT> IsClearWord32(TNode<Word32T> word32, uint32_t mask) {
return Word32Equal(Word32And(word32, Int32Constant(mask)),
Int32Constant(0));
}
......@@ -2759,7 +2759,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
// - |if_not_internalized| if the string is not in the string table (but
// does not add it).
// - |if_bailout| for unsupported cases (e.g. uncachable array index).
void TryInternalizeString(SloppyTNode<String> string, Label* if_index,
void TryInternalizeString(TNode<String> string, Label* if_index,
TVariable<IntPtrT>* var_index,
Label* if_internalized,
TVariable<Name>* var_internalized,
......@@ -3419,8 +3419,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
// Figure out the SFI's code object using its data field.
// If |if_compile_lazy| is provided then the execution will go to the given
// label in case of an CompileLazy code object.
TNode<Code> GetSharedFunctionInfoCode(
SloppyTNode<SharedFunctionInfo> shared_info,
TNode<Code> GetSharedFunctionInfoCode(TNode<SharedFunctionInfo> shared_info,
Label* if_compile_lazy = nullptr);
TNode<JSFunction> AllocateFunctionWithMapAndContext(
......@@ -3448,8 +3447,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
// Support for printf-style debugging
void Print(const char* s);
void Print(const char* prefix, SloppyTNode<MaybeObject> tagged_value);
void Print(SloppyTNode<MaybeObject> tagged_value) {
void Print(const char* prefix, TNode<MaybeObject> tagged_value);
void Print(TNode<MaybeObject> tagged_value) {
return Print(nullptr, tagged_value);
}
......
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