summaryrefslogtreecommitdiff
path: root/deps/v8/src/objects/js-function.tq
blob: 5ffed873563da071c7b62c4f3b7b5f6b69888a93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright 2020 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.

@abstract
extern class JSFunctionOrBoundFunctionOrWrappedFunction extends JSObject {
}

extern class JSBoundFunction extends
    JSFunctionOrBoundFunctionOrWrappedFunction {
  // The wrapped function object.
  bound_target_function: Callable;
  // The value that is always passed as the this value when calling the wrapped
  // function.
  bound_this: JSAny|SourceTextModule;
  // A list of values whose elements are used as the first arguments to any call
  // to the wrapped function.
  bound_arguments: FixedArray;
}

extern class JSWrappedFunction extends
    JSFunctionOrBoundFunctionOrWrappedFunction {
  // The wrapped function object.
  wrapped_target_function: Callable;
  // The creation context.
  context: NativeContext;
}

// This class does not use the generated verifier, so if you change anything
// here, please also update JSFunctionVerify in objects-debug.cc.
@highestInstanceTypeWithinParentClassRange
extern class JSFunction extends JSFunctionOrBoundFunctionOrWrappedFunction {
  shared_function_info: SharedFunctionInfo;
  context: Context;
  feedback_cell: FeedbackCell;
  @if(V8_EXTERNAL_CODE_SPACE) code: CodeDataContainer;
  @ifnot(V8_EXTERNAL_CODE_SPACE) code: Code;
  // Space for the following field may or may not be allocated.
  prototype_or_initial_map: JSReceiver|Map;
}

// Class constructors are special, because they are callable, but [[Call]] will
// raise an exception.
// See ES6 section 9.2.1 [[Call]] ( thisArgument, argumentsList ).
@doNotGenerateCast
@highestInstanceTypeWithinParentClassRange
extern class JSClassConstructor extends JSFunction
    generates 'TNode<JSFunction>';

type JSFunctionWithPrototypeSlot extends JSFunction;