Inlined optimized runtime functions: expose Runtime versions for direct...

Inlined optimized runtime functions: expose Runtime versions for direct testing, skip Hydrogen versions

R=dslomov@chromium.org

Review URL: https://codereview.chromium.org/302703004

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21585 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent e82b97ab
......@@ -14678,7 +14678,8 @@ RUNTIME_FUNCTION(Runtime_ListNatives) {
int entry_count = 0
RUNTIME_FUNCTION_LIST(COUNT_ENTRY)
RUNTIME_HIDDEN_FUNCTION_LIST(COUNT_ENTRY)
INLINE_FUNCTION_LIST(COUNT_ENTRY);
INLINE_FUNCTION_LIST(COUNT_ENTRY)
INLINE_OPTIMIZED_FUNCTION_LIST(COUNT_ENTRY);
#undef COUNT_ENTRY
Factory* factory = isolate->factory();
Handle<FixedArray> elements = factory->NewFixedArray(entry_count);
......@@ -14702,6 +14703,7 @@ RUNTIME_FUNCTION(Runtime_ListNatives) {
}
inline_runtime_functions = false;
RUNTIME_FUNCTION_LIST(ADD_ENTRY)
INLINE_OPTIMIZED_FUNCTION_LIST(ADD_ENTRY)
// Calling hidden runtime functions should just throw.
RUNTIME_HIDDEN_FUNCTION_LIST(ADD_ENTRY)
inline_runtime_functions = true;
......@@ -15076,6 +15078,7 @@ RUNTIME_FUNCTION(Runtime_MaxSmi) {
static const Runtime::Function kIntrinsicFunctions[] = {
RUNTIME_FUNCTION_LIST(F)
INLINE_OPTIMIZED_FUNCTION_LIST(F)
RUNTIME_HIDDEN_FUNCTION_LIST(FH)
INLINE_FUNCTION_LIST(I)
INLINE_OPTIMIZED_FUNCTION_LIST(IO)
......
......@@ -661,6 +661,8 @@ namespace internal {
// INLINE_OPTIMIZED_FUNCTION_LIST defines all inlined functions accessed
// with a native call of the form %_name from within JS code that also have
// a corresponding runtime function, that is called from non-optimized code.
// For the benefit of (fuzz) tests, the runtime version can also be called
// directly as %name (i.e. without the leading underscore).
// Entries have the form F(name, number of arguments, number of return values).
#define INLINE_OPTIMIZED_FUNCTION_LIST(F) \
/* Typed Arrays */ \
......@@ -733,6 +735,7 @@ class Runtime : public AllStatic {
enum FunctionId {
#define F(name, nargs, ressize) k##name,
RUNTIME_FUNCTION_LIST(F)
INLINE_OPTIMIZED_FUNCTION_LIST(F)
#undef F
#define F(name, nargs, ressize) kHidden##name,
RUNTIME_HIDDEN_FUNCTION_LIST(F)
......
......@@ -150,6 +150,7 @@ void ExternalReferenceTable::PopulateTable(Isolate* isolate) {
"Runtime::" #name },
RUNTIME_FUNCTION_LIST(RUNTIME_ENTRY)
INLINE_OPTIMIZED_FUNCTION_LIST(RUNTIME_ENTRY)
#undef RUNTIME_ENTRY
#define RUNTIME_HIDDEN_ENTRY(name, nargs, ressize) \
......
......@@ -2,4 +2,4 @@
// AUTO-GENERATED BY tools/generate-runtime-tests.py, DO NOT MODIFY
// Flags: --allow-natives-syntax --harmony
var _holder = new ArrayBuffer(8);
%_ArrayBufferGetByteLength(_holder);
%ArrayBufferGetByteLength(_holder);
......@@ -2,4 +2,4 @@
// AUTO-GENERATED BY tools/generate-runtime-tests.py, DO NOT MODIFY
// Flags: --allow-natives-syntax --harmony
var _holder = new Int32Array(2);
%_ArrayBufferViewGetByteLength(_holder);
%ArrayBufferViewGetByteLength(_holder);
......@@ -2,4 +2,4 @@
// AUTO-GENERATED BY tools/generate-runtime-tests.py, DO NOT MODIFY
// Flags: --allow-natives-syntax --harmony
var _holder = new Int32Array(2);
%_ArrayBufferViewGetByteOffset(_holder);
%ArrayBufferViewGetByteOffset(_holder);
......@@ -3,4 +3,4 @@
// Flags: --allow-natives-syntax --harmony
var _hi = 32;
var _lo = 32;
%_ConstructDouble(_hi, _lo);
%ConstructDouble(_hi, _lo);
......@@ -5,4 +5,4 @@ var _holder = new DataView(new ArrayBuffer(24));
var _buffer = new ArrayBuffer(8);
var _byte_offset = 1.5;
var _byte_length = 1.5;
%_DataViewInitialize(_holder, _buffer, _byte_offset, _byte_length);
%DataViewInitialize(_holder, _buffer, _byte_offset, _byte_length);
......@@ -2,4 +2,4 @@
// AUTO-GENERATED BY tools/generate-runtime-tests.py, DO NOT MODIFY
// Flags: --allow-natives-syntax --harmony
var _callback = new Object();
%_DebugCallbackSupportsStepping(_callback);
%DebugCallbackSupportsStepping(_callback);
......@@ -2,4 +2,4 @@
// AUTO-GENERATED BY tools/generate-runtime-tests.py, DO NOT MODIFY
// Flags: --allow-natives-syntax --harmony
var _x = 1.5;
%_DoubleHi(_x);
%DoubleHi(_x);
......@@ -2,4 +2,4 @@
// AUTO-GENERATED BY tools/generate-runtime-tests.py, DO NOT MODIFY
// Flags: --allow-natives-syntax --harmony
var _x = 1.5;
%_DoubleLo(_x);
%DoubleLo(_x);
......@@ -2,4 +2,4 @@
// AUTO-GENERATED BY tools/generate-runtime-tests.py, DO NOT MODIFY
// Flags: --allow-natives-syntax --harmony
var _x = 1.5;
%_MathLogRT(_x);
%MathLogRT(_x);
......@@ -2,4 +2,4 @@
// AUTO-GENERATED BY tools/generate-runtime-tests.py, DO NOT MODIFY
// Flags: --allow-natives-syntax --harmony
var _x = 1.5;
%_MathSqrtRT(_x);
%MathSqrtRT(_x);
// 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
%_MaxSmi();
%MaxSmi();
......@@ -2,4 +2,4 @@
// AUTO-GENERATED BY tools/generate-runtime-tests.py, DO NOT MODIFY
// Flags: --allow-natives-syntax --harmony
var _holder = new Int32Array(2);
%_TypedArrayGetLength(_holder);
%TypedArrayGetLength(_holder);
......@@ -6,4 +6,4 @@ var arg1 = 6;
var arg2 = new ArrayBuffer(8);
var _byte_offset_object = 1.5;
var arg4 = 4;
%_TypedArrayInitialize(_holder, arg1, arg2, _byte_offset_object, arg4);
%TypedArrayInitialize(_holder, arg1, arg2, _byte_offset_object, arg4);
// 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
%_TypedArrayMaxSizeInHeap();
%TypedArrayMaxSizeInHeap();
......@@ -828,7 +828,6 @@ def FindInlineRuntimeFunctions():
inline_functions = []
with open(HEADERFILENAME, "r") as f:
inline_list = "#define INLINE_FUNCTION_LIST(F) \\\n"
inline_opt_list = "#define INLINE_OPTIMIZED_FUNCTION_LIST(F) \\\n"
inline_function = re.compile(r"^\s*F\((\w+), \d+, \d+\)\s*\\?")
mode = "SEARCHING"
for line in f:
......@@ -839,7 +838,7 @@ def FindInlineRuntimeFunctions():
if not line.endswith("\\\n"):
mode = "SEARCHING"
elif mode == "SEARCHING":
if line == inline_list or line == inline_opt_list:
if line == inline_list:
mode = "ACTIVE"
return inline_functions
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment