55f0b92d85
Reason for revert: [Sheriff] Changes a layout test. Please rebase upstream if intended: https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/7742 Original issue's description: > Refactor CreateApiFunction > > BUG= > > Committed: https://crrev.com/705574970f3899a6eda0c61130c8c31693df4039 > Cr-Commit-Position: refs/heads/master@{#37290} TBR=jochen@chromium.org,verwaest@chromium.org # Not skipping CQ checks because original CL landed more than 1 days ago. BUG= Review-Url: https://codereview.chromium.org/2099983004 Cr-Commit-Position: refs/heads/master@{#37299}
62 lines
2.1 KiB
C++
62 lines
2.1 KiB
C++
// 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 "src/handles.h"
|
|
#include "src/property-details.h"
|
|
|
|
namespace v8 {
|
|
namespace internal {
|
|
|
|
// Forward declarations.
|
|
class ObjectTemplateInfo;
|
|
class TemplateInfo;
|
|
|
|
class ApiNatives {
|
|
public:
|
|
static const int kInitialFunctionCacheSize = 256;
|
|
|
|
MUST_USE_RESULT static MaybeHandle<JSFunction> InstantiateFunction(
|
|
Handle<FunctionTemplateInfo> data);
|
|
|
|
MUST_USE_RESULT static MaybeHandle<JSObject> InstantiateObject(
|
|
Handle<ObjectTemplateInfo> data,
|
|
Handle<JSReceiver> new_target = Handle<JSReceiver>());
|
|
|
|
enum ApiInstanceType {
|
|
JavaScriptObjectType,
|
|
GlobalObjectType,
|
|
GlobalProxyType
|
|
};
|
|
|
|
static Handle<JSFunction> CreateApiFunction(Isolate* isolate,
|
|
Handle<FunctionTemplateInfo> obj,
|
|
Handle<Object> prototype,
|
|
ApiInstanceType instance_type);
|
|
|
|
static void AddDataProperty(Isolate* isolate, Handle<TemplateInfo> info,
|
|
Handle<Name> name, Handle<Object> value,
|
|
PropertyAttributes attributes);
|
|
|
|
static void AddDataProperty(Isolate* isolate, Handle<TemplateInfo> info,
|
|
Handle<Name> name, v8::Intrinsic intrinsic,
|
|
PropertyAttributes attributes);
|
|
|
|
static void AddAccessorProperty(Isolate* isolate, Handle<TemplateInfo> info,
|
|
Handle<Name> name,
|
|
Handle<FunctionTemplateInfo> getter,
|
|
Handle<FunctionTemplateInfo> setter,
|
|
PropertyAttributes attributes);
|
|
|
|
static void AddNativeDataProperty(Isolate* isolate, Handle<TemplateInfo> info,
|
|
Handle<AccessorInfo> property);
|
|
};
|
|
|
|
} // namespace internal
|
|
} // namespace v8
|
|
|
|
#endif
|