1331452 - jit-test/tests/debug/wasm-06.js failures with CGC builds

1331452 - Keep scope in a slot in WasmFunctionCallObjects.

1331452 - Followup: hazard fix.
This commit is contained in:
win7-7 2025-12-30 01:37:40 +02:00 committed by wuggy
commit 6ec6324056
2 changed files with 10 additions and 3 deletions

View file

@ -633,7 +633,7 @@ const Class WasmFunctionCallObject::class_ = {
};
/* static */ WasmFunctionCallObject*
WasmFunctionCallObject::createHollowForDebug(JSContext* cx, WasmFunctionScope* scope)
WasmFunctionCallObject::createHollowForDebug(JSContext* cx, Handle<WasmFunctionScope*> scope)
{
RootedObjectGroup group(cx, ObjectGroup::defaultNewGroup(cx, &class_, TaggedProto(nullptr)));
if (!group)
@ -652,6 +652,7 @@ WasmFunctionCallObject::createHollowForDebug(JSContext* cx, WasmFunctionScope* s
Rooted<WasmFunctionCallObject*> callobj(cx, &obj->as<WasmFunctionCallObject>());
callobj->initEnclosingEnvironment(&cx->global()->lexicalEnvironment());
callobj->initReservedSlot(SCOPE_SLOT, PrivateGCThingValue(scope));
return callobj;
}

View file

@ -427,13 +427,19 @@ typedef MutableHandle<ModuleEnvironmentObject*> MutableHandleModuleEnvironmentOb
class WasmFunctionCallObject : public EnvironmentObject
{
// Currently WasmFunctionCallObjects do not use their scopes in a
// meaningful way. However, it is an invariant of DebugEnvironments that
// environments kept in those maps have live scopes, thus this strong
// reference.
static const uint32_t SCOPE_SLOT = 1;
public:
static const Class class_;
static const uint32_t RESERVED_SLOTS = 1;
static const uint32_t RESERVED_SLOTS = 2;
static WasmFunctionCallObject* createHollowForDebug(JSContext* cx,
WasmFunctionScope* scope);
Handle<WasmFunctionScope*> scope);
};
class LexicalEnvironmentObject : public EnvironmentObject