Inlined optimized runtime functions: expose Runtime versions for direct testing,...
authorjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 30 May 2014 17:07:38 +0000 (17:07 +0000)
committerjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 30 May 2014 17:07:38 +0000 (17:07 +0000)
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

18 files changed:
src/runtime.cc
src/runtime.h
src/serialize.cc
test/mjsunit/runtime-gen/arraybuffergetbytelength.js
test/mjsunit/runtime-gen/arraybufferviewgetbytelength.js
test/mjsunit/runtime-gen/arraybufferviewgetbyteoffset.js
test/mjsunit/runtime-gen/constructdouble.js
test/mjsunit/runtime-gen/dataviewinitialize.js
test/mjsunit/runtime-gen/debugcallbacksupportsstepping.js
test/mjsunit/runtime-gen/doublehi.js
test/mjsunit/runtime-gen/doublelo.js
test/mjsunit/runtime-gen/mathlogrt.js
test/mjsunit/runtime-gen/mathsqrtrt.js
test/mjsunit/runtime-gen/maxsmi.js
test/mjsunit/runtime-gen/typedarraygetlength.js
test/mjsunit/runtime-gen/typedarrayinitialize.js
test/mjsunit/runtime-gen/typedarraymaxsizeinheap.js
tools/generate-runtime-tests.py

index c596daa..686c3f5 100644 (file)
@@ -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)
index bac9666..687084f 100644 (file)
@@ -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)
index c2706f6..d639134 100644 (file)
@@ -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) \
index 18f45b4..b363791 100644 (file)
@@ -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);
index d150ce9..243c382 100644 (file)
@@ -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);
index 502795a..c9d025b 100644 (file)
@@ -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);
index 0b0e208..4ed6c6a 100644 (file)
@@ -3,4 +3,4 @@
 // Flags: --allow-natives-syntax --harmony
 var _hi = 32;
 var _lo = 32;
-%_ConstructDouble(_hi, _lo);
+%ConstructDouble(_hi, _lo);
index 7702f4e..0836651 100644 (file)
@@ -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);
index 8c14ef7..8707381 100644 (file)
@@ -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);
index 6b808f5..9212f6d 100644 (file)
@@ -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);
index 739efb9..cbc0b8e 100644 (file)
@@ -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);
index fd69bc5..6df1b66 100644 (file)
@@ -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);
index 35a155a..622d68a 100644 (file)
@@ -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);
index 8b11e48..24cf862 100644 (file)
@@ -1,4 +1,4 @@
 // 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();
index 422b24f..56ceb95 100644 (file)
@@ -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);
index d64c519..177bf3b 100644 (file)
@@ -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);
index bfa6c0c..4c2cd2a 100644 (file)
@@ -1,4 +1,4 @@
 // 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();
index 7325f85..a1ad4ad 100755 (executable)
@@ -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