1// Copyright 2020 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@abstract
6extern class JSFunctionOrBoundFunctionOrWrappedFunction extends JSObject {
7}
8
9extern class JSBoundFunction extends
10    JSFunctionOrBoundFunctionOrWrappedFunction {
11  // The wrapped function object.
12  bound_target_function: Callable;
13  // The value that is always passed as the this value when calling the wrapped
14  // function.
15  bound_this: JSAny|SourceTextModule;
16  // A list of values whose elements are used as the first arguments to any call
17  // to the wrapped function.
18  bound_arguments: FixedArray;
19}
20
21extern class JSWrappedFunction extends
22    JSFunctionOrBoundFunctionOrWrappedFunction {
23  // The wrapped function object.
24  wrapped_target_function: Callable;
25  // The creation context.
26  context: NativeContext;
27}
28
29// This class does not use the generated verifier, so if you change anything
30// here, please also update JSFunctionVerify in objects-debug.cc.
31@highestInstanceTypeWithinParentClassRange
32extern class JSFunction extends JSFunctionOrBoundFunctionOrWrappedFunction {
33  shared_function_info: SharedFunctionInfo;
34  context: Context;
35  feedback_cell: FeedbackCell;
36  @if(V8_EXTERNAL_CODE_SPACE) code: CodeDataContainer;
37  @ifnot(V8_EXTERNAL_CODE_SPACE) code: Code;
38  // Space for the following field may or may not be allocated.
39  prototype_or_initial_map: JSReceiver|Map;
40}
41
42// Class constructors are special, because they are callable, but [[Call]] will
43// raise an exception.
44// See ES6 section 9.2.1 [[Call]] ( thisArgument, argumentsList ).
45@doNotGenerateCast
46@highestInstanceTypeWithinParentClassRange
47extern class JSClassConstructor extends JSFunction
48    generates 'TNode<JSFunction>';
49
50type JSFunctionWithPrototypeSlot extends JSFunction;
51