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

[cleanup] Remove Sloppy-ness from poison methods and ChangeUint32ToWord

Bug: v8:6949, v8:10155
Change-Id: Id170bafa2a5085bee6ff5b3cff8084254c67e113
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2056846Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Reviewed-by: 's avatarDan Elphick <delphick@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66275}
parent 5258f822
......@@ -3569,9 +3569,9 @@ void CodeStubAssembler::InitializeJSObjectBodyWithSlackTracking(
// The object still has in-object slack therefore the |unsed_or_unused|
// field contain the "used" value.
TNode<IntPtrT> used_size = Signed(TimesTaggedSize(ChangeUint32ToWord(
LoadObjectField(map, Map::kUsedOrUnusedInstanceSizeInWordsOffset,
MachineType::Uint8()))));
TNode<IntPtrT> used_size =
Signed(TimesTaggedSize(ChangeUint32ToWord(LoadObjectField<Uint8T>(
map, Map::kUsedOrUnusedInstanceSizeInWordsOffset))));
Comment("iInitialize filler fields");
InitializeFieldsWithRoot(object, used_size, instance_size,
......
......@@ -499,13 +499,12 @@ TNode<RawPtrT> CodeAssembler::LoadParentFramePointer() {
return UncheckedCast<RawPtrT>(raw_assembler()->LoadParentFramePointer());
}
TNode<Object> CodeAssembler::TaggedPoisonOnSpeculation(
SloppyTNode<Object> value) {
TNode<Object> CodeAssembler::TaggedPoisonOnSpeculation(TNode<Object> value) {
return UncheckedCast<Object>(
raw_assembler()->TaggedPoisonOnSpeculation(value));
}
TNode<WordT> CodeAssembler::WordPoisonOnSpeculation(SloppyTNode<WordT> value) {
TNode<WordT> CodeAssembler::WordPoisonOnSpeculation(TNode<WordT> value) {
return UncheckedCast<WordT>(raw_assembler()->WordPoisonOnSpeculation(value));
}
......@@ -555,7 +554,7 @@ CODE_ASSEMBLER_COMPARE(Word64Equal, Word64T, int64_t, ToInt64Constant, ==)
CODE_ASSEMBLER_COMPARE(Word64NotEqual, Word64T, int64_t, ToInt64Constant, !=)
#undef CODE_ASSEMBLER_COMPARE
TNode<UintPtrT> CodeAssembler::ChangeUint32ToWord(SloppyTNode<Word32T> value) {
TNode<UintPtrT> CodeAssembler::ChangeUint32ToWord(TNode<Word32T> value) {
if (raw_assembler()->machine()->Is64()) {
return UncheckedCast<UintPtrT>(
raw_assembler()->ChangeUint32ToUint64(value));
......
......@@ -657,8 +657,8 @@ class V8_EXPORT_PRIVATE CodeAssembler {
TNode<RawPtrT> LoadParentFramePointer();
// Poison |value| on speculative paths.
TNode<Object> TaggedPoisonOnSpeculation(SloppyTNode<Object> value);
TNode<WordT> WordPoisonOnSpeculation(SloppyTNode<WordT> value);
TNode<Object> TaggedPoisonOnSpeculation(TNode<Object> value);
TNode<WordT> WordPoisonOnSpeculation(TNode<WordT> value);
// Load raw memory location.
Node* Load(MachineType type, Node* base,
......@@ -929,7 +929,7 @@ class V8_EXPORT_PRIVATE CodeAssembler {
// rounds on 64-bit (which doesn't affect valid element indices).
Node* RoundIntPtrToFloat64(Node* value);
// No-op on 32-bit, otherwise zero extend.
TNode<UintPtrT> ChangeUint32ToWord(SloppyTNode<Word32T> value);
TNode<UintPtrT> ChangeUint32ToWord(TNode<Word32T> value);
// No-op on 32-bit, otherwise sign extend.
TNode<IntPtrT> ChangeInt32ToIntPtr(SloppyTNode<Word32T> value);
......@@ -953,7 +953,7 @@ class V8_EXPORT_PRIVATE CodeAssembler {
TNode<Object> CallRuntime(Runtime::FunctionId function,
SloppyTNode<Object> context, TArgs... args) {
return CallRuntimeImpl(function, context,
{implicit_cast<SloppyTNode<Object>>(args)...});
{implicit_cast<TNode<Object>>(args)...});
}
template <class... TArgs>
......@@ -962,14 +962,14 @@ class V8_EXPORT_PRIVATE CodeAssembler {
int argc = static_cast<int>(sizeof...(args));
TNode<Int32T> arity = Int32Constant(argc);
return TailCallRuntimeImpl(function, arity, context,
{implicit_cast<SloppyTNode<Object>>(args)...});
{implicit_cast<TNode<Object>>(args)...});
}
template <class... TArgs>
void TailCallRuntime(Runtime::FunctionId function, TNode<Int32T> arity,
SloppyTNode<Object> context, TArgs... args) {
return TailCallRuntimeImpl(function, arity, context,
{implicit_cast<SloppyTNode<Object>>(args)...});
{implicit_cast<TNode<Object>>(args)...});
}
//
......
......@@ -87,7 +87,7 @@ TEST(SimpleCallRuntime1Arg) {
CodeAssembler m(asm_tester.state());
TNode<Context> context =
m.HeapConstant(Handle<Context>(isolate->native_context()));
Node* b = SmiTag(&m, m.Int32Constant(0));
TNode<Smi> b = SmiTag(&m, m.Int32Constant(0));
m.Return(m.CallRuntime(Runtime::kIsSmi, context, b));
FunctionTester ft(asm_tester.GenerateCode());
CHECK(ft.CallChecked<Oddball>().is_identical_to(
......@@ -100,7 +100,7 @@ TEST(SimpleTailCallRuntime1Arg) {
CodeAssembler m(asm_tester.state());
TNode<Context> context =
m.HeapConstant(Handle<Context>(isolate->native_context()));
Node* b = SmiTag(&m, m.Int32Constant(0));
TNode<Smi> b = SmiTag(&m, m.Int32Constant(0));
m.TailCallRuntime(Runtime::kIsSmi, context, b);
FunctionTester ft(asm_tester.GenerateCode());
CHECK(ft.CallChecked<Oddball>().is_identical_to(
......@@ -113,8 +113,8 @@ TEST(SimpleCallRuntime2Arg) {
CodeAssembler m(asm_tester.state());
TNode<Context> context =
m.HeapConstant(Handle<Context>(isolate->native_context()));
Node* a = SmiTag(&m, m.Int32Constant(2));
Node* b = SmiTag(&m, m.Int32Constant(4));
TNode<Smi> a = SmiTag(&m, m.Int32Constant(2));
TNode<Smi> b = SmiTag(&m, m.Int32Constant(4));
m.Return(m.CallRuntime(Runtime::kAdd, context, a, b));
FunctionTester ft(asm_tester.GenerateCode());
CHECK_EQ(6, ft.CallChecked<Smi>()->value());
......@@ -126,8 +126,8 @@ TEST(SimpleTailCallRuntime2Arg) {
CodeAssembler m(asm_tester.state());
TNode<Context> context =
m.HeapConstant(Handle<Context>(isolate->native_context()));
Node* a = SmiTag(&m, m.Int32Constant(2));
Node* b = SmiTag(&m, m.Int32Constant(4));
TNode<Smi> a = SmiTag(&m, m.Int32Constant(2));
TNode<Smi> b = SmiTag(&m, m.Int32Constant(4));
m.TailCallRuntime(Runtime::kAdd, context, a, b);
FunctionTester ft(asm_tester.GenerateCode());
CHECK_EQ(6, ft.CallChecked<Smi>()->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