11cb0ef41Sopenharmony_ci// Copyright 2017 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_CODEGEN_CALLABLE_H_ 61cb0ef41Sopenharmony_ci#define V8_CODEGEN_CALLABLE_H_ 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_ci#include "src/codegen/interface-descriptors.h" 91cb0ef41Sopenharmony_ci#include "src/utils/allocation.h" 101cb0ef41Sopenharmony_ci 111cb0ef41Sopenharmony_cinamespace v8 { 121cb0ef41Sopenharmony_cinamespace internal { 131cb0ef41Sopenharmony_ci 141cb0ef41Sopenharmony_ciclass Code; 151cb0ef41Sopenharmony_ci 161cb0ef41Sopenharmony_ci// Associates a body of code with an interface descriptor. 171cb0ef41Sopenharmony_ciclass Callable final { 181cb0ef41Sopenharmony_ci public: 191cb0ef41Sopenharmony_ci Callable(Handle<CodeT> code, CallInterfaceDescriptor descriptor) 201cb0ef41Sopenharmony_ci : code_(code), descriptor_(descriptor) {} 211cb0ef41Sopenharmony_ci 221cb0ef41Sopenharmony_ci Handle<CodeT> code() const { return code_; } 231cb0ef41Sopenharmony_ci CallInterfaceDescriptor descriptor() const { return descriptor_; } 241cb0ef41Sopenharmony_ci 251cb0ef41Sopenharmony_ci private: 261cb0ef41Sopenharmony_ci const Handle<CodeT> code_; 271cb0ef41Sopenharmony_ci const CallInterfaceDescriptor descriptor_; 281cb0ef41Sopenharmony_ci}; 291cb0ef41Sopenharmony_ci 301cb0ef41Sopenharmony_ci} // namespace internal 311cb0ef41Sopenharmony_ci} // namespace v8 321cb0ef41Sopenharmony_ci 331cb0ef41Sopenharmony_ci#endif // V8_CODEGEN_CALLABLE_H_ 34