// Copyright 2015 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_API_NATIVES_H_ #define V8_API_NATIVES_H_ #include "include/v8.h" #include "src/base/macros.h" #include "src/handles.h" #include "src/maybe-handles.h" #include "src/objects.h" #include "src/property-details.h" namespace v8 { namespace internal { // Forward declarations. class ObjectTemplateInfo; class TemplateInfo; class ApiNatives { public: static const int kInitialFunctionCacheSize = 256; V8_WARN_UNUSED_RESULT static MaybeHandle InstantiateFunction( Handle data, MaybeHandle maybe_name = MaybeHandle()); V8_WARN_UNUSED_RESULT static MaybeHandle InstantiateObject( Isolate* isolate, Handle data, Handle new_target = Handle()); V8_WARN_UNUSED_RESULT static MaybeHandle InstantiateRemoteObject( Handle data); static Handle CreateApiFunction( Isolate* isolate, Handle obj, Handle prototype, InstanceType type, MaybeHandle name = MaybeHandle()); static void AddDataProperty(Isolate* isolate, Handle info, Handle name, Handle value, PropertyAttributes attributes); static void AddDataProperty(Isolate* isolate, Handle info, Handle name, v8::Intrinsic intrinsic, PropertyAttributes attributes); static void AddAccessorProperty(Isolate* isolate, Handle info, Handle name, Handle getter, Handle setter, PropertyAttributes attributes); static void AddNativeDataProperty(Isolate* isolate, Handle info, Handle property); }; } // namespace internal } // namespace v8 #endif // V8_API_NATIVES_H_