OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 the V8 project authors. All rights reserved. | 2 # Copyright 2014 the V8 project authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import re | 6 import re |
7 import os | 7 import os |
8 import sys | 8 import sys |
9 | 9 |
10 DECLARE_FILE = "src/assembler.h" | 10 DECLARE_FILE = "src/assembler.h" |
11 REGISTER_FILE = "src/serialize.cc" | 11 REGISTER_FILE = "src/snapshot/serialize.cc" |
12 DECLARE_RE = re.compile("\s*static ExternalReference ([^(]+)\(") | 12 DECLARE_RE = re.compile("\s*static ExternalReference ([^(]+)\(") |
13 REGISTER_RE = re.compile("\s*Add\(ExternalReference::([^(]+)\(") | 13 REGISTER_RE = re.compile("\s*Add\(ExternalReference::([^(]+)\(") |
14 | 14 |
15 WORKSPACE = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "..")) | 15 WORKSPACE = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "..")) |
16 | 16 |
17 # Ignore those. | 17 # Ignore those. |
18 BLACKLISTED = [ | 18 BLACKLISTED = [ |
19 "page_flags", | 19 "page_flags", |
20 "math_exp_constants", | 20 "math_exp_constants", |
21 "math_exp_log_table", | 21 "math_exp_log_table", |
(...skipping 12 matching lines...) Expand all Loading... |
34 def Main(): | 34 def Main(): |
35 declarations = Find(DECLARE_FILE, DECLARE_RE) | 35 declarations = Find(DECLARE_FILE, DECLARE_RE) |
36 registrations = Find(REGISTER_FILE, REGISTER_RE) | 36 registrations = Find(REGISTER_FILE, REGISTER_RE) |
37 difference = list(set(declarations) - set(registrations) - set(BLACKLISTED)) | 37 difference = list(set(declarations) - set(registrations) - set(BLACKLISTED)) |
38 for reference in difference: | 38 for reference in difference: |
39 print("Declared but not registered: ExternalReference::%s" % reference) | 39 print("Declared but not registered: ExternalReference::%s" % reference) |
40 return len(difference) > 0 | 40 return len(difference) > 0 |
41 | 41 |
42 if __name__ == "__main__": | 42 if __name__ == "__main__": |
43 sys.exit(Main()) | 43 sys.exit(Main()) |
OLD | NEW |