Merge pull request #10298 from aibaars/suppress-require

Ruby: exclude 'require' and 'require_relative' definitions from call graph
This commit is contained in:
Arthur Baars
2022-09-05 20:58:38 +02:00
committed by GitHub

View File

@@ -137,7 +137,14 @@ private module Cached {
}
cached
Method lookupMethod(Module m, string name) { TMethod(result) = lookupMethodOrConst(m, name) }
Method lookupMethod(Module m, string name) {
// The syntax_suggest library redefines Kernel.require/require_relative.
// Somehow this causes performance issues on ruby/ruby. As a workaround
// we exclude 'require' and 'require_relative'.
// TODO: find the actual cause of the slowdown and fix things properly.
not name = ["require", "require_relative"] and
TMethod(result) = lookupMethodOrConst(m, name)
}
cached
Expr lookupConst(Module m, string name) {