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 os | 6 import os |
7 import re | 7 import re |
8 import shutil | 8 import shutil |
9 import sys | 9 import sys |
10 | 10 |
11 # TODO(jkummerow): Support DATA_VIEW_{G,S}ETTER in runtime.cc | 11 # TODO(jkummerow): Support DATA_VIEW_{G,S}ETTER in runtime.cc |
12 | 12 |
13 FILENAME = "src/runtime.cc" | 13 FILENAME = "src/runtime.cc" |
14 HEADERFILENAME = "src/runtime.h" | 14 HEADERFILENAME = "src/runtime.h" |
15 FUNCTION = re.compile("^RUNTIME_FUNCTION\(Runtime_(\w+)") | 15 FUNCTION = re.compile("^RUNTIME_FUNCTION\(Runtime_(\w+)") |
16 ARGSLENGTH = re.compile(".*ASSERT\(.*args\.length\(\) == (\d+)\);") | 16 ARGSLENGTH = re.compile(".*ASSERT\(.*args\.length\(\) == (\d+)\);") |
17 FUNCTIONEND = "}\n" | 17 FUNCTIONEND = "}\n" |
18 | 18 |
19 WORKSPACE = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "..")) | 19 WORKSPACE = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "..")) |
20 BASEPATH = os.path.join(WORKSPACE, "test", "mjsunit", "runtime-gen") | 20 BASEPATH = os.path.join(WORKSPACE, "test", "mjsunit", "runtime-gen") |
21 THIS_SCRIPT = os.path.relpath(sys.argv[0]) | 21 THIS_SCRIPT = os.path.relpath(sys.argv[0]) |
22 | 22 |
23 # Counts of functions in each detection state. These are used to assert | 23 # Counts of functions in each detection state. These are used to assert |
24 # that the parser doesn't bit-rot. Change the values as needed when you add, | 24 # that the parser doesn't bit-rot. Change the values as needed when you add, |
25 # remove or change runtime functions, but make sure we don't lose our ability | 25 # remove or change runtime functions, but make sure we don't lose our ability |
26 # to parse them! | 26 # to parse them! |
27 EXPECTED_FUNCTION_COUNT = 339 | 27 EXPECTED_FUNCTION_COUNT = 338 |
28 EXPECTED_FUZZABLE_COUNT = 316 | 28 EXPECTED_FUZZABLE_COUNT = 315 |
29 EXPECTED_CCTEST_COUNT = 6 | 29 EXPECTED_CCTEST_COUNT = 6 |
30 EXPECTED_UNKNOWN_COUNT = 5 | 30 EXPECTED_UNKNOWN_COUNT = 5 |
31 | 31 |
32 | 32 |
33 # Don't call these at all. | 33 # Don't call these at all. |
34 BLACKLISTED = [ | 34 BLACKLISTED = [ |
35 "Abort", # Kills the process. | 35 "Abort", # Kills the process. |
36 "AbortJS", # Kills the process. | 36 "AbortJS", # Kills the process. |
37 "CompileForOnStackReplacement", # Riddled with ASSERTs. | 37 "CompileForOnStackReplacement", # Riddled with ASSERTs. |
38 "IS_VAR", # Not implemented in the runtime. | 38 "IS_VAR", # Not implemented in the runtime. |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 CheckTestcasesExisting(js_fuzzable_functions) | 500 CheckTestcasesExisting(js_fuzzable_functions) |
501 | 501 |
502 if error: | 502 if error: |
503 sys.exit(1) | 503 sys.exit(1) |
504 print("Generated runtime tests: all good.") | 504 print("Generated runtime tests: all good.") |
505 sys.exit(0) | 505 sys.exit(0) |
506 | 506 |
507 if action == "generate": | 507 if action == "generate": |
508 GenerateTestcases(js_fuzzable_functions) | 508 GenerateTestcases(js_fuzzable_functions) |
509 sys.exit(0) | 509 sys.exit(0) |
OLD | NEW |