| 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 itertools | 6 import itertools |
| 7 import js2c | 7 import js2c |
| 8 import multiprocessing | 8 import multiprocessing |
| 9 import optparse | 9 import optparse |
| 10 import os | 10 import os |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 # functions they define are so trivial that it's unclear how much benefit | 40 # functions they define are so trivial that it's unclear how much benefit |
| 41 # that would provide: | 41 # that would provide: |
| 42 # ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION | 42 # ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION |
| 43 # FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION | 43 # FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION |
| 44 # TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION | 44 # TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION |
| 45 | 45 |
| 46 # Counts of functions in each detection state. These are used to assert | 46 # Counts of functions in each detection state. These are used to assert |
| 47 # that the parser doesn't bit-rot. Change the values as needed when you add, | 47 # that the parser doesn't bit-rot. Change the values as needed when you add, |
| 48 # remove or change runtime functions, but make sure we don't lose our ability | 48 # remove or change runtime functions, but make sure we don't lose our ability |
| 49 # to parse them! | 49 # to parse them! |
| 50 EXPECTED_FUNCTION_COUNT = 358 | 50 EXPECTED_FUNCTION_COUNT = 357 |
| 51 EXPECTED_FUZZABLE_COUNT = 326 | 51 EXPECTED_FUZZABLE_COUNT = 325 |
| 52 EXPECTED_CCTEST_COUNT = 6 | 52 EXPECTED_CCTEST_COUNT = 6 |
| 53 EXPECTED_UNKNOWN_COUNT = 4 | 53 EXPECTED_UNKNOWN_COUNT = 4 |
| 54 EXPECTED_BUILTINS_COUNT = 798 | 54 EXPECTED_BUILTINS_COUNT = 798 |
| 55 | 55 |
| 56 | 56 |
| 57 # Don't call these at all. | 57 # Don't call these at all. |
| 58 BLACKLISTED = [ | 58 BLACKLISTED = [ |
| 59 "Abort", # Kills the process. | 59 "Abort", # Kills the process. |
| 60 "AbortJS", # Kills the process. | 60 "AbortJS", # Kills the process. |
| 61 "CompileForOnStackReplacement", # Riddled with ASSERTs. | 61 "CompileForOnStackReplacement", # Riddled with ASSERTs. |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 _DATETIME_FORMAT = ( | 120 _DATETIME_FORMAT = ( |
| 121 "%GetImplFromInitializedIntlObject(new Intl.DateTimeFormat('en-US'))") | 121 "%GetImplFromInitializedIntlObject(new Intl.DateTimeFormat('en-US'))") |
| 122 _NUMBER_FORMAT = ( | 122 _NUMBER_FORMAT = ( |
| 123 "%GetImplFromInitializedIntlObject(new Intl.NumberFormat('en-US'))") | 123 "%GetImplFromInitializedIntlObject(new Intl.NumberFormat('en-US'))") |
| 124 | 124 |
| 125 | 125 |
| 126 # Custom definitions for function input that does not throw. | 126 # Custom definitions for function input that does not throw. |
| 127 # Format: "FunctionName": ["arg0", "arg1", ..., argslength]. | 127 # Format: "FunctionName": ["arg0", "arg1", ..., argslength]. |
| 128 # None means "fall back to autodetected value". | 128 # None means "fall back to autodetected value". |
| 129 CUSTOM_KNOWN_GOOD_INPUT = { | 129 CUSTOM_KNOWN_GOOD_INPUT = { |
| 130 "AddProperty": [None, 10, None, None, None], |
| 130 "Apply": ["function() {}", None, None, None, None, None], | 131 "Apply": ["function() {}", None, None, None, None, None], |
| 131 "ArrayBufferSliceImpl": [None, None, 0, None], | 132 "ArrayBufferSliceImpl": [None, None, 0, None], |
| 132 "ArrayConcat": ["[1, 'a']", None], | 133 "ArrayConcat": ["[1, 'a']", None], |
| 133 "BreakIteratorAdoptText": [_BREAK_ITERATOR, None, None], | 134 "BreakIteratorAdoptText": [_BREAK_ITERATOR, None, None], |
| 134 "BreakIteratorBreakType": [_BREAK_ITERATOR, None], | 135 "BreakIteratorBreakType": [_BREAK_ITERATOR, None], |
| 135 "BreakIteratorCurrent": [_BREAK_ITERATOR, None], | 136 "BreakIteratorCurrent": [_BREAK_ITERATOR, None], |
| 136 "BreakIteratorFirst": [_BREAK_ITERATOR, None], | 137 "BreakIteratorFirst": [_BREAK_ITERATOR, None], |
| 137 "BreakIteratorNext": [_BREAK_ITERATOR, None], | 138 "BreakIteratorNext": [_BREAK_ITERATOR, None], |
| 138 "CompileString": [None, "false", None], | 139 "CompileString": [None, "false", None], |
| 139 "CreateBreakIterator": ["'en-US'", "{type: 'string'}", None, None], | 140 "CreateBreakIterator": ["'en-US'", "{type: 'string'}", None, None], |
| 140 "CreateJSFunctionProxy": [None, "function() {}", None, None, None], | 141 "CreateJSFunctionProxy": [None, "function() {}", None, None, None], |
| 141 "CreatePrivateSymbol": ["\"foo\"", None], | 142 "CreatePrivateSymbol": ["\"foo\"", None], |
| 142 "CreateSymbol": ["\"foo\"", None], | 143 "CreateSymbol": ["\"foo\"", None], |
| 143 "DateParseString": [None, "new Array(8)", None], | 144 "DateParseString": [None, "new Array(8)", None], |
| 144 "DefineOrRedefineAccessorProperty": [None, None, "function() {}", | 145 "DefineAccessorPropertyUnchecked": [None, None, "function() {}", |
| 145 "function() {}", 2, None], | 146 "function() {}", 2, None], |
| 146 "FunctionBindArguments": [None, None, "undefined", None, None], | 147 "FunctionBindArguments": [None, None, "undefined", None, None], |
| 147 "GetBreakLocations": [None, 0, None], | 148 "GetBreakLocations": [None, 0, None], |
| 148 "GetDefaultReceiver": ["function() {}", None], | 149 "GetDefaultReceiver": ["function() {}", None], |
| 149 "GetImplFromInitializedIntlObject": ["new Intl.NumberFormat('en-US')", None], | 150 "GetImplFromInitializedIntlObject": ["new Intl.NumberFormat('en-US')", None], |
| 150 "InternalCompare": [_COLLATOR, None, None, None], | 151 "InternalCompare": [_COLLATOR, None, None, None], |
| 151 "InternalDateFormat": [_DATETIME_FORMAT, None, None], | 152 "InternalDateFormat": [_DATETIME_FORMAT, None, None], |
| 152 "InternalDateParse": [_DATETIME_FORMAT, None, None], | 153 "InternalDateParse": [_DATETIME_FORMAT, None, None], |
| 153 "InternalNumberFormat": [_NUMBER_FORMAT, None, None], | 154 "InternalNumberFormat": [_NUMBER_FORMAT, None, None], |
| 154 "InternalNumberParse": [_NUMBER_FORMAT, None, None], | 155 "InternalNumberParse": [_NUMBER_FORMAT, None, None], |
| 155 "IsSloppyModeFunction": ["function() {}", None], | 156 "IsSloppyModeFunction": ["function() {}", None], |
| 156 "LoadMutableDouble": ["{foo: 1.2}", None, None], | 157 "LoadMutableDouble": ["{foo: 1.2}", None, None], |
| 157 "NewObjectFromBound": ["(function() {}).bind({})", None], | 158 "NewObjectFromBound": ["(function() {}).bind({})", None], |
| 158 "NumberToRadixString": [None, "2", None], | 159 "NumberToRadixString": [None, "2", None], |
| 159 "ParseJson": ["\"{}\"", 1], | 160 "ParseJson": ["\"{}\"", 1], |
| 160 "RegExpExecMultiple": [None, None, "['a']", "['a']", None], | 161 "RegExpExecMultiple": [None, None, "['a']", "['a']", None], |
| 161 "SetAccessorProperty": [None, None, "undefined", "undefined", None, None], | 162 "DefineAccessorProperty": [None, None, "undefined", "undefined", None, None], |
| 162 "SetIteratorInitialize": [None, None, "2", None], | 163 "SetIteratorInitialize": [None, None, "2", None], |
| 163 "SetDebugEventListener": ["undefined", None, None], | 164 "SetDebugEventListener": ["undefined", None, None], |
| 164 "SetFunctionBreakPoint": [None, 200, None, None], | 165 "SetFunctionBreakPoint": [None, 200, None, None], |
| 165 "StringBuilderConcat": ["[1, 2, 3]", 3, None, None], | 166 "StringBuilderConcat": ["[1, 2, 3]", 3, None, None], |
| 166 "StringBuilderJoin": ["['a', 'b']", 4, None, None], | 167 "StringBuilderJoin": ["['a', 'b']", 4, None, None], |
| 167 "StringMatch": [None, None, "['a', 'b']", None], | 168 "StringMatch": [None, None, "['a', 'b']", None], |
| 168 "StringNormalize": [None, 2, None], | 169 "StringNormalize": [None, 2, None], |
| 169 "StringReplaceGlobalRegExpWithString": [None, None, None, "['a']", None], | 170 "StringReplaceGlobalRegExpWithString": [None, None, None, "['a']", None], |
| 170 "TypedArrayInitialize": [None, 6, "new ArrayBuffer(8)", None, 4, None], | 171 "TypedArrayInitialize": [None, 6, "new ArrayBuffer(8)", None, 4, None], |
| 171 "TypedArrayInitializeFromArrayLike": [None, 6, None, None, None], | 172 "TypedArrayInitializeFromArrayLike": [None, 6, None, None, None], |
| (...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1313 for i in range(len(processes)): | 1314 for i in range(len(processes)): |
| 1314 processes[i].join() | 1315 processes[i].join() |
| 1315 except KeyboardInterrupt: | 1316 except KeyboardInterrupt: |
| 1316 stop_running.set() | 1317 stop_running.set() |
| 1317 for i in range(len(processes)): | 1318 for i in range(len(processes)): |
| 1318 processes[i].join() | 1319 processes[i].join() |
| 1319 return 0 | 1320 return 0 |
| 1320 | 1321 |
| 1321 if __name__ == "__main__": | 1322 if __name__ == "__main__": |
| 1322 sys.exit(Main()) | 1323 sys.exit(Main()) |
| OLD | NEW |