11cb0ef41Sopenharmony_ci// Copyright 2018 the V8 project authors. All rights reserved.
21cb0ef41Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be
31cb0ef41Sopenharmony_ci// found in the LICENSE file.
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ci#ifndef V8_BUILTINS_BUILTINS_LAZY_GEN_H_
61cb0ef41Sopenharmony_ci#define V8_BUILTINS_BUILTINS_LAZY_GEN_H_
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ci#include "src/codegen/code-stub-assembler.h"
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_cinamespace v8 {
111cb0ef41Sopenharmony_cinamespace internal {
121cb0ef41Sopenharmony_ci
131cb0ef41Sopenharmony_ciclass LazyBuiltinsAssembler : public CodeStubAssembler {
141cb0ef41Sopenharmony_ci public:
151cb0ef41Sopenharmony_ci  using Descriptor = JSTrampolineDescriptor;
161cb0ef41Sopenharmony_ci
171cb0ef41Sopenharmony_ci  explicit LazyBuiltinsAssembler(compiler::CodeAssemblerState* state)
181cb0ef41Sopenharmony_ci      : CodeStubAssembler(state) {}
191cb0ef41Sopenharmony_ci
201cb0ef41Sopenharmony_ci  void GenerateTailCallToJSCode(TNode<CodeT> code, TNode<JSFunction> function);
211cb0ef41Sopenharmony_ci
221cb0ef41Sopenharmony_ci  void GenerateTailCallToReturnedCode(Runtime::FunctionId function_id,
231cb0ef41Sopenharmony_ci                                      TNode<JSFunction> function);
241cb0ef41Sopenharmony_ci  void TailCallRuntimeIfStateEquals(TNode<Uint32T> state,
251cb0ef41Sopenharmony_ci                                    TieringState expected_state,
261cb0ef41Sopenharmony_ci                                    Runtime::FunctionId function_id,
271cb0ef41Sopenharmony_ci                                    TNode<JSFunction> function);
281cb0ef41Sopenharmony_ci
291cb0ef41Sopenharmony_ci  void MaybeTailCallOptimizedCodeSlot(TNode<JSFunction> function,
301cb0ef41Sopenharmony_ci                                      TNode<FeedbackVector> feedback_vector);
311cb0ef41Sopenharmony_ci  void CompileLazy(TNode<JSFunction> function);
321cb0ef41Sopenharmony_ci};
331cb0ef41Sopenharmony_ci
341cb0ef41Sopenharmony_ci}  // namespace internal
351cb0ef41Sopenharmony_ci}  // namespace v8
361cb0ef41Sopenharmony_ci
371cb0ef41Sopenharmony_ci#endif  // V8_BUILTINS_BUILTINS_LAZY_GEN_H_
38