mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1182428 - Recognize more rooted type names, r=jonco
This commit is contained in:
parent
a3a10f1d2f
commit
ea2c66c77c
@ -245,21 +245,6 @@ function ignoreGCFunction(mangled)
|
||||
return false;
|
||||
}
|
||||
|
||||
function isRootedTypeName(name)
|
||||
{
|
||||
if (name == "mozilla::ErrorResult" ||
|
||||
name == "JSErrorResult" ||
|
||||
name == "WrappableJSErrorResult" ||
|
||||
name == "js::frontend::TokenStream" ||
|
||||
name == "js::frontend::TokenStream::Position" ||
|
||||
name == "ModuleCompiler" ||
|
||||
name == "JSAddonId")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function stripUCSAndNamespace(name)
|
||||
{
|
||||
if (name.startsWith('struct '))
|
||||
@ -282,16 +267,36 @@ function stripUCSAndNamespace(name)
|
||||
return name;
|
||||
}
|
||||
|
||||
function isRootedPointerTypeName(name)
|
||||
function isRootedGCTypeName(name)
|
||||
{
|
||||
return (name == "JSAddonId");
|
||||
}
|
||||
|
||||
function isRootedGCPointerTypeName(name)
|
||||
{
|
||||
name = stripUCSAndNamespace(name);
|
||||
|
||||
if (name.startsWith('MaybeRooted<'))
|
||||
return /\(js::AllowGC\)1u>::RootType/.test(name);
|
||||
|
||||
if (name == "ErrorResult" ||
|
||||
name == "JSErrorResult" ||
|
||||
name == "WrappableJSErrorResult" ||
|
||||
name == "frontend::TokenStream" ||
|
||||
name == "frontend::TokenStream::Position" ||
|
||||
name == "ModuleCompiler")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return name.startsWith('Rooted') || name.startsWith('PersistentRooted');
|
||||
}
|
||||
|
||||
function isRootedTypeName(name)
|
||||
{
|
||||
return isRootedGCTypeName(name) || isRootedGCPointerTypeName(name);
|
||||
}
|
||||
|
||||
function isUnsafeStorage(typeName)
|
||||
{
|
||||
typeName = stripUCSAndNamespace(typeName);
|
||||
|
@ -116,9 +116,9 @@ function markGCType(typeName, child, why, typePtrLevel, fieldPtrLevel, indent)
|
||||
if (ptrLevel > 2)
|
||||
return;
|
||||
|
||||
if (ptrLevel == 0 && isRootedTypeName(typeName))
|
||||
if (ptrLevel == 0 && isRootedGCTypeName(typeName))
|
||||
return;
|
||||
if (ptrLevel == 1 && isRootedPointerTypeName(typeName))
|
||||
if (ptrLevel == 1 && isRootedGCPointerTypeName(typeName))
|
||||
return;
|
||||
|
||||
if (ptrLevel == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user