Commit 38e7b6b3 authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[gcmole] Update whitelist for src/heap

Most dead variable warnings in GCMole are false positives, either from
failing to detect that TryEvacuateObject returning false means it didn't
allocate, or a regex error thinking that GarbageCollectionReasonToString
causes garbage collection (because the mangled version is something like
GarbageCollectionReasonToString[...]GarbageCollectionReason, and that
matches /Collect.*Garbage/).

Update the whitelist and fix the "Collect.*Garbage" regex to only look
at the function name.

Bug: v8:9985
Change-Id: I62284e97e4975a6a87616d1d535b2ac7958d17bb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1989829
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65622}
parent 3e8c4918
...@@ -292,22 +292,27 @@ local ARCHITECTURES = { ...@@ -292,22 +292,27 @@ local ARCHITECTURES = {
local gc, gc_caused, funcs local gc, gc_caused, funcs
-- Note that the gcsuspects file lists functions in the form:
-- mangled_name,unmangled_function_name
--
-- This means that we can match just the function name by matching only
-- after a comma.
local WHITELIST = { local WHITELIST = {
-- The following functions call CEntryStub which is always present. -- The following functions call CEntryStub which is always present.
"MacroAssembler.*CallRuntime", "MacroAssembler.*,CallRuntime",
"CompileCallLoadPropertyWithInterceptor", "CompileCallLoadPropertyWithInterceptor",
"CallIC.*GenerateMiss", "CallIC.*,GenerateMiss",
-- DirectCEntryStub is a special stub used on ARM. -- DirectCEntryStub is a special stub used on ARM.
-- It is pinned and always present. -- It is pinned and always present.
"DirectCEntryStub.*GenerateCall", "DirectCEntryStub.*,GenerateCall",
-- TODO GCMole currently is sensitive enough to understand that certain -- TODO GCMole currently is sensitive enough to understand that certain
-- functions only cause GC and return Failure simulataneously. -- functions only cause GC and return Failure simulataneously.
-- Callsites of such functions are safe as long as they are properly -- Callsites of such functions are safe as long as they are properly
-- check return value and propagate the Failure to the caller. -- check return value and propagate the Failure to the caller.
-- It should be possible to extend GCMole to understand this. -- It should be possible to extend GCMole to understand this.
"Heap.*AllocateFunctionPrototype", "Heap.*,TryEvacuateObject",
-- Ignore all StateTag methods. -- Ignore all StateTag methods.
"StateTag", "StateTag",
...@@ -335,7 +340,7 @@ local function resolve(name) ...@@ -335,7 +340,7 @@ local function resolve(name)
f = {} f = {}
funcs[name] = f funcs[name] = f
if name:match "Collect.*Garbage" then if name:match ",.*Collect.*Garbage" then
gc[name] = true gc[name] = true
AddCause(name, "<GC>") AddCause(name, "<GC>")
end end
......
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