Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Unified Diff: src/builtins.h

Issue 1491883002: [builtins] Some refactoring on the builtin mechanism. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm64/builtins-arm64.cc ('k') | src/builtins.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins.h
diff --git a/src/builtins.h b/src/builtins.h
index 02259599cdbf57e7d11d59f604da4ce12dcbbfbd..315c277cbcbab95f678e4b1671ce73e33ecd1297 100644
--- a/src/builtins.h
+++ b/src/builtins.h
@@ -5,17 +5,24 @@
#ifndef V8_BUILTINS_H_
#define V8_BUILTINS_H_
+#include "src/base/flags.h"
#include "src/handles.h"
namespace v8 {
namespace internal {
// Specifies extra arguments required by a C++ builtin.
-enum BuiltinExtraArguments {
- NO_EXTRA_ARGUMENTS = 0,
- NEEDS_CALLED_FUNCTION = 1
+enum class BuiltinExtraArguments : uint8_t {
+ kNone = 0u,
+ kTarget = 1u << 0,
+ kNewTarget = 1u << 1,
+ kTargetAndNewTarget = kTarget | kNewTarget
};
+inline bool operator&(BuiltinExtraArguments lhs, BuiltinExtraArguments rhs) {
+ return static_cast<uint8_t>(lhs) & static_cast<uint8_t>(rhs);
+}
+
#define CODE_AGE_LIST_WITH_ARG(V, A) \
V(Quadragenarian, A) \
@@ -44,43 +51,43 @@ enum BuiltinExtraArguments {
// Define list of builtins implemented in C++.
-#define BUILTIN_LIST_C(V) \
- V(Illegal, NO_EXTRA_ARGUMENTS) \
- \
- V(EmptyFunction, NO_EXTRA_ARGUMENTS) \
- \
- V(ArrayPush, NO_EXTRA_ARGUMENTS) \
- V(ArrayPop, NO_EXTRA_ARGUMENTS) \
- V(ArrayShift, NO_EXTRA_ARGUMENTS) \
- V(ArrayUnshift, NO_EXTRA_ARGUMENTS) \
- V(ArraySlice, NO_EXTRA_ARGUMENTS) \
- V(ArraySplice, NO_EXTRA_ARGUMENTS) \
- V(ArrayConcat, NO_EXTRA_ARGUMENTS) \
- \
- V(DateToPrimitive, NO_EXTRA_ARGUMENTS) \
- \
- V(ReflectDefineProperty, NO_EXTRA_ARGUMENTS) \
- V(ReflectDeleteProperty, NO_EXTRA_ARGUMENTS) \
- V(ReflectGet, NO_EXTRA_ARGUMENTS) \
- V(ReflectGetOwnPropertyDescriptor, NO_EXTRA_ARGUMENTS) \
- V(ReflectGetPrototypeOf, NO_EXTRA_ARGUMENTS) \
- V(ReflectHas, NO_EXTRA_ARGUMENTS) \
- V(ReflectIsExtensible, NO_EXTRA_ARGUMENTS) \
- V(ReflectOwnKeys, NO_EXTRA_ARGUMENTS) \
- V(ReflectPreventExtensions, NO_EXTRA_ARGUMENTS) \
- V(ReflectSet, NO_EXTRA_ARGUMENTS) \
- V(ReflectSetPrototypeOf, NO_EXTRA_ARGUMENTS) \
- \
- V(SymbolConstructor, NO_EXTRA_ARGUMENTS) \
- V(SymbolConstructor_ConstructStub, NEEDS_CALLED_FUNCTION) \
- \
- V(HandleApiCall, NEEDS_CALLED_FUNCTION) \
- V(HandleApiCallConstruct, NEEDS_CALLED_FUNCTION) \
- V(HandleApiCallAsFunction, NO_EXTRA_ARGUMENTS) \
- V(HandleApiCallAsConstructor, NO_EXTRA_ARGUMENTS) \
- \
- V(RestrictedFunctionPropertiesThrower, NO_EXTRA_ARGUMENTS) \
- V(RestrictedStrictArgumentsPropertiesThrower, NO_EXTRA_ARGUMENTS)
+#define BUILTIN_LIST_C(V) \
+ V(Illegal, kNone) \
+ \
+ V(EmptyFunction, kNone) \
+ \
+ V(ArrayPush, kNone) \
+ V(ArrayPop, kNone) \
+ V(ArrayShift, kNone) \
+ V(ArrayUnshift, kNone) \
+ V(ArraySlice, kNone) \
+ V(ArraySplice, kNone) \
+ V(ArrayConcat, kNone) \
+ \
+ V(DateToPrimitive, kNone) \
+ \
+ V(ReflectDefineProperty, kNone) \
+ V(ReflectDeleteProperty, kNone) \
+ V(ReflectGet, kNone) \
+ V(ReflectGetOwnPropertyDescriptor, kNone) \
+ V(ReflectGetPrototypeOf, kNone) \
+ V(ReflectHas, kNone) \
+ V(ReflectIsExtensible, kNone) \
+ V(ReflectOwnKeys, kNone) \
+ V(ReflectPreventExtensions, kNone) \
+ V(ReflectSet, kNone) \
+ V(ReflectSetPrototypeOf, kNone) \
+ \
+ V(SymbolConstructor, kNone) \
+ V(SymbolConstructor_ConstructStub, kTarget) \
+ \
+ V(HandleApiCall, kTarget) \
+ V(HandleApiCallConstruct, kTarget) \
+ V(HandleApiCallAsFunction, kNone) \
+ V(HandleApiCallAsConstructor, kNone) \
+ \
+ V(RestrictedFunctionPropertiesThrower, kNone) \
+ V(RestrictedStrictArgumentsPropertiesThrower, kNone)
// Define list of builtins implemented in assembly.
#define BUILTIN_LIST_A(V) \
« no previous file with comments | « src/arm64/builtins-arm64.cc ('k') | src/builtins.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698