[maglev] Load SFI::length as int16

Bug: v8:7700
Change-Id: I853ef2c81d180a98a0c97322832f4b35789baeb2
Fixed: chromium:1408956
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4183487
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85418}
This commit is contained in:
Leszek Swirski 2023-01-20 12:08:50 +01:00 committed by V8 LUCI CQ
parent b06b015d7a
commit d236b0ebb7
3 changed files with 7 additions and 4 deletions

View File

@ -2493,8 +2493,9 @@ void FunctionLength::GenerateCode(MaglevAssembler* masm,
Register shared = temps.AcquireX();
__ LoadTaggedPointerField(
shared, FieldMemOperand(object, JSFunction::kSharedFunctionInfoOffset));
__ Ldr(ToRegister(result()).W(),
FieldMemOperand(shared, SharedFunctionInfo::kLengthOffset));
__ LoadSignedField(ToRegister(result()).W(),
FieldMemOperand(shared, SharedFunctionInfo::kLengthOffset),
2);
}
void TestUndetectable::SetValueLocationConstraints() {

View File

@ -451,6 +451,7 @@ MaybeHandle<Code> MaglevCompiler::GenerateCode(
if (v8_flags.print_maglev_code) {
code->Print();
code->instruction_stream().Print();
}
return code;

View File

@ -1342,8 +1342,9 @@ void FunctionLength::GenerateCode(MaglevAssembler* masm,
__ LoadTaggedPointerField(
kScratchRegister,
FieldOperand(object, JSFunction::kSharedFunctionInfoOffset));
__ movl(ToRegister(result()),
FieldOperand(kScratchRegister, SharedFunctionInfo::kLengthOffset));
__ LoadSignedField(
ToRegister(result()),
FieldMemOperand(kScratchRegister, SharedFunctionInfo::kLengthOffset), 2);
}
void Int32AddWithOverflow::SetValueLocationConstraints() {