summaryrefslogtreecommitdiff
path: root/deps/v8/tools/gcmole
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2016-12-23 16:30:57 +0100
committerMichaël Zasso <targos@protonmail.com>2017-01-26 22:46:17 +0100
commit2739185b790e040c3b044c577327f5d44bffad4a (patch)
tree29a466999212f4c85958379d9d400eec8a185ba5 /deps/v8/tools/gcmole
parenta67a04d7654faaa04c8da00e42981ebc9fd0911c (diff)
downloadandroid-node-v8-2739185b790e040c3b044c577327f5d44bffad4a.tar.gz
android-node-v8-2739185b790e040c3b044c577327f5d44bffad4a.tar.bz2
android-node-v8-2739185b790e040c3b044c577327f5d44bffad4a.zip
deps: update V8 to 5.5.372.40
PR-URL: https://github.com/nodejs/node/pull/9618 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'deps/v8/tools/gcmole')
-rw-r--r--deps/v8/tools/gcmole/gcmole.lua64
-rw-r--r--deps/v8/tools/gcmole/run-gcmole.isolate1
2 files changed, 60 insertions, 5 deletions
diff --git a/deps/v8/tools/gcmole/gcmole.lua b/deps/v8/tools/gcmole/gcmole.lua
index bdbdf36a41..42cb2e370b 100644
--- a/deps/v8/tools/gcmole/gcmole.lua
+++ b/deps/v8/tools/gcmole/gcmole.lua
@@ -183,6 +183,7 @@ end
-------------------------------------------------------------------------------
-- GYP file parsing
+-- TODO(machenbach): Remove this when deprecating gyp.
local function ParseGYPFile()
local result = {}
local gyp_files = {
@@ -209,6 +210,32 @@ local function ParseGYPFile()
return result
end
+local function ParseGNFile()
+ local result = {}
+ local gn_files = {
+ { "BUILD.gn", '"([^"]-%.cc)"', "" },
+ { "test/cctest/BUILD.gn", '"(test-[^"]-%.cc)"', "test/cctest/" }
+ }
+
+ for i = 1, #gn_files do
+ local filename = gn_files[i][1]
+ local pattern = gn_files[i][2]
+ local prefix = gn_files[i][3]
+ local gn_file = assert(io.open(filename), "failed to open GN file")
+ local gn = gn_file:read('*a')
+ for condition, sources in
+ gn:gmatch "### gcmole%((.-)%) ###(.-)%]" do
+ if result[condition] == nil then result[condition] = {} end
+ for file in sources:gmatch(pattern) do
+ table.insert(result[condition], prefix .. file)
+ end
+ end
+ gn_file:close()
+ end
+
+ return result
+end
+
local function EvaluateCondition(cond, props)
if cond == 'all' then return true end
@@ -230,13 +257,40 @@ local function BuildFileList(sources, props)
return list
end
-local sources = ParseGYPFile()
+
+local gyp_sources = ParseGYPFile()
+local gn_sources = ParseGNFile()
+
+-- TODO(machenbach): Remove this comparison logic when deprecating gyp.
+local function CompareSources(sources1, sources2, what)
+ for condition, files1 in pairs(sources1) do
+ local files2 = sources2[condition]
+ assert(
+ files2 ~= nil,
+ "Missing gcmole condition in " .. what .. ": " .. condition)
+
+ -- Turn into set for speed.
+ files2_set = {}
+ for i, file in pairs(files2) do files2_set[file] = true end
+
+ for i, file in pairs(files1) do
+ assert(
+ files2_set[file] ~= nil,
+ "Missing file " .. file .. " in " .. what .. " for condition " ..
+ condition)
+ end
+ end
+end
+
+CompareSources(gyp_sources, gn_sources, "GN")
+CompareSources(gn_sources, gyp_sources, "GYP")
+
local function FilesForArch(arch)
- return BuildFileList(sources, { os = 'linux',
- arch = arch,
- mode = 'debug',
- simulator = ''})
+ return BuildFileList(gn_sources, { os = 'linux',
+ arch = arch,
+ mode = 'debug',
+ simulator = ''})
end
local mtConfig = {}
diff --git a/deps/v8/tools/gcmole/run-gcmole.isolate b/deps/v8/tools/gcmole/run-gcmole.isolate
index caa4f993fc..0fba2a12c1 100644
--- a/deps/v8/tools/gcmole/run-gcmole.isolate
+++ b/deps/v8/tools/gcmole/run-gcmole.isolate
@@ -12,6 +12,7 @@
'parallel.py',
'run-gcmole.py',
# The following contains all relevant source and gyp files.
+ '../../BUILD.gn',
'../../base/',
'../../include/',
'../../src/',