1// Copyright 2017 the V8 project authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5#ifndef V8_CODEGEN_CALLABLE_H_ 6#define V8_CODEGEN_CALLABLE_H_ 7 8#include "src/codegen/interface-descriptors.h" 9#include "src/utils/allocation.h" 10 11namespace v8 { 12namespace internal { 13 14class Code; 15 16// Associates a body of code with an interface descriptor. 17class Callable final { 18 public: 19 Callable(Handle<CodeT> code, CallInterfaceDescriptor descriptor) 20 : code_(code), descriptor_(descriptor) {} 21 22 Handle<CodeT> code() const { return code_; } 23 CallInterfaceDescriptor descriptor() const { return descriptor_; } 24 25 private: 26 const Handle<CodeT> code_; 27 const CallInterfaceDescriptor descriptor_; 28}; 29 30} // namespace internal 31} // namespace v8 32 33#endif // V8_CODEGEN_CALLABLE_H_ 34