// Copyright 2017 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef V8_BUILTINS_BUILTINS_CALL_GEN_H_ #define V8_BUILTINS_BUILTINS_CALL_GEN_H_ #include "src/codegen/code-stub-assembler.h" namespace v8 { namespace internal { class CallOrConstructBuiltinsAssembler : public CodeStubAssembler { public: explicit CallOrConstructBuiltinsAssembler(compiler::CodeAssemblerState* state) : CodeStubAssembler(state) {} void CallOrConstructWithArrayLike(TNode target, base::Optional> new_target, TNode arguments_list, TNode context); void CallOrConstructDoubleVarargs(TNode target, base::Optional> new_target, TNode elements, TNode length, TNode args_count, TNode context, TNode kind); void CallOrConstructWithSpread(TNode target, base::Optional> new_target, TNode spread, TNode args_count, TNode context); template void CallReceiver(Builtin id, base::Optional> = base::nullopt); template void CallReceiver(Builtin id, TNode argc, TNode slot, base::Optional> = base::nullopt); enum class CallFunctionTemplateMode : uint8_t { kCheckAccess, kCheckCompatibleReceiver, kCheckAccessAndCompatibleReceiver, }; void CallFunctionTemplate(CallFunctionTemplateMode mode, TNode function_template_info, TNode argc, TNode context); void BuildConstruct(TNode target, TNode new_target, TNode argc, const LazyNode& context, const LazyNode& feedback_vector, TNode slot, UpdateFeedbackMode mode); void BuildConstructWithSpread(TNode target, TNode new_target, TNode spread, TNode argc, const LazyNode& context, const LazyNode& feedback_vector, TNode slot, UpdateFeedbackMode mode); private: TNode GetCompatibleReceiver(TNode receiver, TNode signature, TNode context); }; } // namespace internal } // namespace v8 #endif // V8_BUILTINS_BUILTINS_CALL_GEN_H_