[wasm] Fix machine type for merges of exceptions

The Merge node for merging exceptions into the catch environment had
type kWord32, which is not a reference type. Because of this the GC does
not visit it and can collect it too early. Change the type to
kTaggedPointer.
Also change the type of ExceptionLocation() from IntPtr to TaggedPointer
for consistency. This one does not affect correctness because the
IfException node is already marked as tagged.

R=clemensb@chromium.org

Bug: v8:12254
Change-Id: I190d48b85f4b889ab083228b8fcedd439090e1de
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3201994
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77232}
This commit is contained in:
Thibaud Michaud 2021-10-04 14:35:41 +02:00 committed by V8 LUCI CQ
parent 8a7ee049b3
commit ee15e13785
2 changed files with 2 additions and 2 deletions

View File

@ -2784,7 +2784,7 @@ namespace {
LinkageLocation ExceptionLocation() {
return LinkageLocation::ForRegister(kReturnRegister0.code(),
MachineType::IntPtr());
MachineType::TaggedPointer());
}
constexpr InstructionCode EncodeCallDescriptorFlags(

View File

@ -1349,7 +1349,7 @@ class WasmGraphBuildingInterface {
} else {
DCHECK_EQ(SsaEnv::kMerged, try_info->catch_env->state);
try_info->exception = builder_->CreateOrMergeIntoPhi(
MachineRepresentation::kWord32, try_info->catch_env->control,
MachineRepresentation::kTaggedPointer, try_info->catch_env->control,
try_info->exception, if_exception);
}