From a69cfac1828fb9020f52a6fc90a1ccc74bb76a88 Mon Sep 17 00:00:00 2001 From: svenpanne Date: Wed, 11 Mar 2015 08:18:44 -0700 Subject: [PATCH] Re-arranged intrinsic macros a bit. Outside of runtime.h, only the distinction between intrinsics returning pairs and those returning pairs is really meaningful, not the internal traditional partitioning of them. BUG=v8:3947 LOG=n Review URL: https://codereview.chromium.org/997933003 Cr-Commit-Position: refs/heads/master@{#27137} --- src/runtime/runtime.cc | 13 +++---------- src/runtime/runtime.h | 38 +++++++++++++++++--------------------- 2 files changed, 20 insertions(+), 31 deletions(-) diff --git a/src/runtime/runtime.cc b/src/runtime/runtime.cc index bd69fae318..776239aa42 100644 --- a/src/runtime/runtime.cc +++ b/src/runtime/runtime.cc @@ -14,20 +14,13 @@ namespace internal { #define F(name, number_of_args, result_size) \ Object* Runtime_##name(int args_length, Object** args_object, \ Isolate* isolate); +FOR_EACH_INTRINSIC_RETURN_OBJECT(F) +#undef F #define P(name, number_of_args, result_size) \ ObjectPair Runtime_##name(int args_length, Object** args_object, \ Isolate* isolate); - -RUNTIME_FUNCTION_LIST_RETURN_OBJECT(F) -RUNTIME_FUNCTION_LIST_RETURN_PAIR(P) -INLINE_OPTIMIZED_FUNCTION_LIST(F) -// Reference implementation for inlined runtime functions. Only used when the -// compiler does not support a certain intrinsic. Don't optimize these, but -// implement the intrinsic in the respective compiler instead. -INLINE_FUNCTION_LIST(F) - -#undef F +FOR_EACH_INTRINSIC_RETURN_PAIR(P) #undef P diff --git a/src/runtime/runtime.h b/src/runtime/runtime.h index fc4d96e937..ce76c6d018 100644 --- a/src/runtime/runtime.h +++ b/src/runtime/runtime.h @@ -510,7 +510,7 @@ namespace internal { F(MathPowRT, 2, 1) -#define RUNTIME_FUNCTION_LIST_RETURN_PAIR(F) \ +#define FOR_EACH_INTRINSIC_RETURN_PAIR(F) \ F(LoadLookupSlot, 2, 2) \ F(LoadLookupSlotNoReferenceError, 2, 2) \ F(ResolvePossiblyDirectEval, 6, 2) \ @@ -626,23 +626,6 @@ namespace internal { #endif -#define RUNTIME_FUNCTION_LIST_RETURN_OBJECT(F) \ - RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \ - RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \ - RUNTIME_FUNCTION_LIST_ALWAYS_3(F) \ - RUNTIME_FUNCTION_LIST_DEBUGGER(F) \ - RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F) - - -// RUNTIME_FUNCTION_LIST_ defines the intrinsics typically implemented only -// as runtime functions. These come in 2 flavors, either returning an object or -// returning a pair. -// Entries have the form F(name, number of arguments, number of return values). -#define RUNTIME_FUNCTION_LIST(F) \ - RUNTIME_FUNCTION_LIST_RETURN_OBJECT(F) \ - RUNTIME_FUNCTION_LIST_RETURN_PAIR(F) - - // ---------------------------------------------------------------------------- // INLINE_FUNCTION_LIST defines the intrinsics typically handled specially by // the various compilers. @@ -732,11 +715,24 @@ namespace internal { F(GetPrototype, 1, 1) -#define FOR_EACH_INTRINSIC(F) \ - RUNTIME_FUNCTION_LIST(F) \ - INLINE_FUNCTION_LIST(F) \ +#define FOR_EACH_INTRINSIC_RETURN_OBJECT(F) \ + RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \ + RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \ + RUNTIME_FUNCTION_LIST_ALWAYS_3(F) \ + RUNTIME_FUNCTION_LIST_DEBUGGER(F) \ + RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F) \ + INLINE_FUNCTION_LIST(F) \ INLINE_OPTIMIZED_FUNCTION_LIST(F) + +// FOR_EACH_INTRINSIC defines the list of all intrinsics, coming in 2 flavors, +// either returning an object or a pair. +// Entries have the form F(name, number of arguments, number of values). +#define FOR_EACH_INTRINSIC(F) \ + FOR_EACH_INTRINSIC_RETURN_PAIR(F) \ + FOR_EACH_INTRINSIC_RETURN_OBJECT(F) + + //--------------------------------------------------------------------------- // Runtime provides access to all C++ runtime functions.