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

Unified Diff: src/builtins/builtins.h

Issue 2293943002: [builtins] Create StringToNumber helper. (Closed)
Patch Set: Created 4 years, 4 months 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 | « no previous file | src/builtins/builtins.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins.h
diff --git a/src/builtins/builtins.h b/src/builtins/builtins.h
index f8ce2e699fbc9e36b17bd5e516e86264364e8a22..348745073f6f996b062045407879f240bed9290d 100644
--- a/src/builtins/builtins.h
+++ b/src/builtins/builtins.h
@@ -41,13 +41,16 @@ namespace internal {
// Args: name, arguments count
// TFS: Builtin in Turbofan, with CodeStub linkage.
// Args: name, code kind, extra IC state, interface descriptor
+// TFS_UNARY_OP:
Benedikt Meurer 2016/08/30 17:16:49 Don't introduce a new category here. Instead just
+// Builtin in Turbofan, with CudeStub linkage and inlinable function.
+// Args: name, code kind, extra IC state, interface descriptor
// ASM: Builtin in platform-dependent assembly.
// Args: name
// ASH: Handlers implemented in platform-dependent assembly.
// Args: name, code kind, extra IC state
// DBG: Builtin in platform-dependent assembly, used by the debugger.
// Args: name
-#define BUILTIN_LIST(CPP, API, TFJ, TFS, ASM, ASH, DBG) \
+#define BUILTIN_LIST(CPP, API, TFJ, TFS, TFS_UNARY_OP, ASM, ASH, DBG) \
ASM(Abort) \
/* Handlers */ \
ASH(KeyedLoadIC_Megamorphic, KEYED_LOAD_IC, kNoExtraICState) \
@@ -178,7 +181,7 @@ namespace internal {
TypeConversion) \
TFS(NonPrimitiveToPrimitive_String, BUILTIN, kNoExtraICState, \
TypeConversion) \
- TFS(StringToNumber, BUILTIN, kNoExtraICState, TypeConversion) \
+ TFS_UNARY_OP(StringToNumber, BUILTIN, kNoExtraICState, TypeConversion) \
TFS(NonNumberToNumber, BUILTIN, kNoExtraICState, TypeConversion) \
ASM(ToNumber) \
\
@@ -533,24 +536,28 @@ namespace internal {
#define IGNORE_BUILTIN(...)
-#define BUILTIN_LIST_ALL(V) BUILTIN_LIST(V, V, V, V, V, V, V)
+#define BUILTIN_LIST_ALL(V) BUILTIN_LIST(V, V, V, V, V, V, V, V)
#define BUILTIN_LIST_C(V) \
BUILTIN_LIST(V, V, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \
- IGNORE_BUILTIN, IGNORE_BUILTIN)
+ IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN)
#define BUILTIN_LIST_A(V) \
BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \
- V, V, V)
+ IGNORE_BUILTIN, V, V, V)
#define BUILTIN_LIST_DBG(V) \
BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \
- IGNORE_BUILTIN, IGNORE_BUILTIN, V)
+ IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, V)
// Forward declarations.
class CodeStubAssembler;
class ObjectVisitor;
+namespace compiler {
+class Node;
+}
+
class Builtins {
public:
~Builtins();
@@ -653,12 +660,18 @@ class Builtins {
static void Generate_##Name(MacroAssembler* masm);
#define DECLARE_TF(Name, ...) \
static void Generate_##Name(CodeStubAssembler* csasm);
+#define DECLARE_TF_UNARY_OP(Name, ...) \
+ static compiler::Node* GenerateImpl_##Name(CodeStubAssembler* csasm, \
+ compiler::Node* input, \
+ compiler::Node* context); \
+ static void Generate_##Name(CodeStubAssembler* csasm);
BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, DECLARE_TF, DECLARE_TF,
- DECLARE_ASM, DECLARE_ASM, DECLARE_ASM)
+ DECLARE_TF_UNARY_OP, DECLARE_ASM, DECLARE_ASM, DECLARE_ASM)
#undef DECLARE_ASM
#undef DECLARE_TF
+#undef DECLARE_TF_UNARY_OP
// Note: These are always Code objects, but to conform with
// IterateBuiltins() above which assumes Object**'s for the callback
« no previous file with comments | « no previous file | src/builtins/builtins.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698