Commit cbf59c4c authored by jkummerow's avatar jkummerow Committed by Commit bot

[cleanup] Refactor builtins-number.cc

Introducing a TF_BUILTIN macro that wraps CodeStubAssembler usage
into a convenient interface (using a subclass under the hood).

Review-Url: https://codereview.chromium.org/2517833005
Cr-Commit-Position: refs/heads/master@{#41236}
parent c28bee0f
This diff is collapsed.
......@@ -101,6 +101,31 @@ class BuiltinArguments : public Arguments {
MUST_USE_RESULT static Object* Builtin_Impl_##name(BuiltinArguments args, \
Isolate* isolate)
// ----------------------------------------------------------------------------
// Support macro for defining builtins with Turbofan.
// ----------------------------------------------------------------------------
//
// A builtin function is defined by writing:
//
// TF_BUILTIN(name, code_assember_base_class) {
// ...
// }
//
// In the body of the builtin function the arguments can be accessed
// as "Parameter(n)".
#define TF_BUILTIN(Name, AssemblerBase) \
class Name##Assembler : public AssemblerBase { \
public: \
explicit Name##Assembler(compiler::CodeAssemblerState* state) \
: AssemblerBase(state) {} \
void Generate##Name(); \
}; \
void Builtins::Generate_##Name(compiler::CodeAssemblerState* state) { \
Name##Assembler assembler(state); \
assembler.Generate##Name(); \
} \
void Name##Assembler::Generate##Name()
// ----------------------------------------------------------------------------
#define CHECK_RECEIVER(Type, name, method) \
......
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