FILENAME = "src/runtime.cc"
HEADERFILENAME = "src/runtime.h"
FUNCTION = re.compile("^RUNTIME_FUNCTION\(Runtime_(\w+)")
-ARGSLENGTH = re.compile(".*ASSERT\(.*args\.length\(\) == (\d+)\);")
+ARGSLENGTH = re.compile(".*DCHECK\(.*args\.length\(\) == (\d+)\);")
FUNCTIONEND = "}\n"
MACRO = re.compile(r"^#define ([^ ]+)\(([^)]*)\) *([^\\]*)\\?\n$")
FIRST_WORD = re.compile("^\s*(.*?)[\s({\[]")
# that the parser doesn't bit-rot. Change the values as needed when you add,
# remove or change runtime functions, but make sure we don't lose our ability
# to parse them!
-EXPECTED_FUNCTION_COUNT = 373
-EXPECTED_FUZZABLE_COUNT = 335
-EXPECTED_CCTEST_COUNT = 6
-EXPECTED_UNKNOWN_COUNT = 10
-EXPECTED_BUILTINS_COUNT = 918
+EXPECTED_FUNCTION_COUNT = 428
+EXPECTED_FUZZABLE_COUNT = 331
+EXPECTED_CCTEST_COUNT = 7
+EXPECTED_UNKNOWN_COUNT = 16
+EXPECTED_BUILTINS_COUNT = 809
# Don't call these at all.
BLACKLISTED = [
"Abort", # Kills the process.
"AbortJS", # Kills the process.
- "CompileForOnStackReplacement", # Riddled with ASSERTs.
+ "CompileForOnStackReplacement", # Riddled with DCHECK.
"IS_VAR", # Not implemented in the runtime.
"ListNatives", # Not available in Release mode.
"SetAllocationTimeout", # Too slow for fuzzing.
# TODO(jkummerow): Fix these and un-blacklist them!
"CreateDateTimeFormat",
"CreateNumberFormat",
+
+ # TODO(danno): Fix these internal function that are only callable form stubs
+ # and un-blacklist them!
+ "NumberToString",
+ "RxegExpConstructResult",
+ "RegExpExec",
+ "StringAdd",
+ "SubString",
+ "StringCompare",
+ "StringCharCodeAt",
+ "GetFromCache",
+
+ # Compilation
+ "CompileUnoptimized",
+ "CompileOptimized",
+ "TryInstallOptimizedCode",
+ "NotifyDeoptimized",
+ "NotifyStubFailure",
+
+ # Utilities
+ "AllocateInNewSpace",
+ "AllocateInTargetSpace",
+ "AllocateHeapNumber",
+ "NumberToSmi",
+ "NumberToStringSkipCache",
+
+ "NewSloppyArguments",
+ "NewStrictArguments",
+
+ # Harmony
+ "CreateJSGeneratorObject",
+ "SuspendJSGeneratorObject",
+ "ResumeJSGeneratorObject",
+ "ThrowGeneratorStateError",
+
+ # Arrays
+ "ArrayConstructor",
+ "InternalArrayConstructor",
+ "NormalizeElements",
+
+ # Literals
+ "MaterializeRegExpLiteral",
+ "CreateObjectLiteral",
+ "CreateArrayLiteral",
+ "CreateArrayLiteralStubBailout",
+
+ # Statements
+ "NewClosure",
+ "NewClosureFromStubFailure",
+ "NewObject",
+ "NewObjectWithAllocationSite",
+ "FinalizeInstanceSize",
+ "Throw",
+ "ReThrow",
+ "ThrowReferenceError",
+ "ThrowNotDateError",
+ "StackGuard",
+ "Interrupt",
+ "PromoteScheduledException",
+
+ # Contexts
+ "NewGlobalContext",
+ "NewFunctionContext",
+ "PushWithContext",
+ "PushCatchContext",
+ "PushBlockContext",
+ "PushModuleContext",
+ "DeleteLookupSlot",
+ "LoadLookupSlot",
+ "LoadLookupSlotNoReferenceError",
+ "StoreLookupSlot",
+
+ # Declarations
+ "DeclareGlobals",
+ "DeclareModules",
+ "DeclareContextSlot",
+ "InitializeConstGlobal",
+ "InitializeConstContextSlot",
+
+ # Eval
+ "ResolvePossiblyDirectEval",
+
+ # Maths
+ "MathPowSlow",
+ "MathPowRT"
]
# Format: "FunctionName": ["arg0", "arg1", ..., argslength].
# None means "fall back to autodetected value".
CUSTOM_KNOWN_GOOD_INPUT = {
+ "AddNamedProperty": [None, "\"bla\"", None, None, None],
+ "AddPropertyForTemplate": [None, 10, None, None, None],
"Apply": ["function() {}", None, None, None, None, None],
"ArrayBufferSliceImpl": [None, None, 0, None],
"ArrayConcat": ["[1, 'a']", None],
"CreatePrivateSymbol": ["\"foo\"", None],
"CreateSymbol": ["\"foo\"", None],
"DateParseString": [None, "new Array(8)", None],
- "DefineOrRedefineAccessorProperty": [None, None, "function() {}",
- "function() {}", 2, None],
+ "DefineAccessorPropertyUnchecked": [None, None, "function() {}",
+ "function() {}", 2, None],
"FunctionBindArguments": [None, None, "undefined", None, None],
"GetBreakLocations": [None, 0, None],
"GetDefaultReceiver": ["function() {}", None],
"NumberToRadixString": [None, "2", None],
"ParseJson": ["\"{}\"", 1],
"RegExpExecMultiple": [None, None, "['a']", "['a']", None],
- "SetAccessorProperty": [None, None, "undefined", "undefined", None, None,
- None],
+ "DefineApiAccessorProperty": [None, None, "undefined", "undefined", None, None],
"SetIteratorInitialize": [None, None, "2", None],
"SetDebugEventListener": ["undefined", None, None],
- "SetFunctionBreakPoint": [None, 200, None, None],
+ "SetFunctionBreakPoint": [None, 218, None, None],
"StringBuilderConcat": ["[1, 2, 3]", 3, None, None],
"StringBuilderJoin": ["['a', 'b']", 4, None, None],
"StringMatch": [None, None, "['a', 'b']", None],
"TypedArrayInitialize": [None, 6, "new ArrayBuffer(8)", None, 4, None],
"TypedArrayInitializeFromArrayLike": [None, 6, None, None, None],
"TypedArraySetFastCases": [None, None, "0", None],
+ "FunctionIsArrow": ["() => null", None],
}
fallback="new DataView(new ArrayBuffer(8))")
return result
- def _Float32x4(self, name, recursion_budget):
- x = random.random()
- y = random.random()
- z = random.random()
- w = random.random()
- return self._Variable(name, "SIMD.float32x4(%s, %s, %s, %s)" %(x, y, z, w))
-
- def _Float64x2(self, name, recursion_budget):
- x = random.random()
- y = random.random()
- return self._Variable(name, "SIMD.float64x2(%s, %s)" %(x, y))
-
- def _Int32x4(self, name, recursion_budget):
- x = random.randint(-0x40000000, 0x3fffffff)
- y = random.randint(-0x40000000, 0x3fffffff)
- z = random.randint(-0x40000000, 0x3fffffff)
- w = random.randint(-0x40000000, 0x3fffffff)
- return self._Variable(name, "SIMD.int32x4(%s, %s, %s, %s)" %(x, y, z, w))
-
def _JSDate(self, name, recursion_budget):
die = random.random()
if die < 0.25:
"String": ["\"foo\"", _String],
"Symbol": ["Symbol(\"symbol\")", _Symbol],
"Uint32": ["32", _Uint32],
- "Float32x4": ["SIMD.float32x4(0.0, 0.0, 0.0, 0.0)", _Float32x4],
- "Float64x2": ["SIMD.float64x2(0.0, 0.0)", _Float64x2],
- "Int32x4": ["SIMD.int32x4(0, 0, 0, 0)", _Int32x4],
}
def _GenerateTestcase(function, definitions, argslist, throws):
s = ["// Copyright 2014 the V8 project authors. All rights reserved.",
"// AUTO-GENERATED BY tools/generate-runtime-tests.py, DO NOT MODIFY",
- "// Flags: --allow-natives-syntax --harmony"] + definitions
- if function.name.find("Float32x4") != -1 or function.name.find("Float64x2") != -1 or function.name.find("Int32x4") != -1:
- s = ["// Copyright 2014 the V8 project authors. All rights reserved.",
- "// AUTO-GENERATED BY tools/generate-runtime-tests.py, DO NOT MODIFY",
- "// Flags: --allow-natives-syntax --harmony --simd-object"] + definitions
+ "// Flags: --allow-natives-syntax --harmony --harmony-proxies"
+ ] + definitions
call = "%%%s%s(%s);" % (function.inline, function.name, ", ".join(argslist))
if throws:
s.append("try {")
with open(stderr_file_name, "w") as stderr:
process = subprocess.Popen(
[options.binary, "--allow-natives-syntax", "--harmony",
- "--enable-slow-asserts", test_file_name],
+ "--harmony-proxies", "--enable-slow-asserts", test_file_name],
stdout=devnull, stderr=stderr)
end_time = time.time() + options.timeout
timed_out = False