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 js2c | 6 import js2c |
7 import os | 7 import os |
8 import re | 8 import re |
9 import sys | 9 import sys |
10 | 10 |
11 FILENAME = "src/runtime/runtime.h" | 11 FILENAME = "src/runtime/runtime.h" |
12 LISTHEAD = re.compile(r"#define\s+(\w+LIST\w*)\((\w+)\)") | 12 LISTHEAD = re.compile(r"#define\s+(\w+LIST\w*)\((\w+)\)") |
13 LISTBODY = re.compile(r".*\\$") | 13 LISTBODY = re.compile(r".*\\$") |
14 BLACKLIST = ['INLINE_FUNCTION_LIST'] | 14 BLACKLIST = ['INLINE_FUNCTION_LIST', 'INLINE_OPTIMIZED_FUNCTION_LIST'] |
15 | 15 |
16 | 16 |
17 class Function(object): | 17 class Function(object): |
18 def __init__(self, match): | 18 def __init__(self, match): |
19 self.name = match.group(1).strip() | 19 self.name = match.group(1).strip() |
20 | 20 |
21 def ListMacroRe(list): | 21 def ListMacroRe(list): |
22 macro = LISTHEAD.match(list[0]).group(2) | 22 macro = LISTHEAD.match(list[0]).group(2) |
23 re_string = "\s*%s\((\w+)" % macro | 23 re_string = "\s*%s\((\w+)" % macro |
24 return re.compile(re_string) | 24 return re.compile(re_string) |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 110 |
111 if errors > 0: | 111 if errors > 0: |
112 return 1 | 112 return 1 |
113 print("Runtime/Natives name clashes: checked %d/%d functions, all good." % | 113 print("Runtime/Natives name clashes: checked %d/%d functions, all good." % |
114 (len(functions), len(natives))) | 114 (len(functions), len(natives))) |
115 return 0 | 115 return 0 |
116 | 116 |
117 | 117 |
118 if __name__ == "__main__": | 118 if __name__ == "__main__": |
119 sys.exit(Main()) | 119 sys.exit(Main()) |
OLD | NEW |