v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
code-factory.h
Go to the documentation of this file.
1// Copyright 2012 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_CODE_FACTORY_H_
6#define V8_CODEGEN_CODE_FACTORY_H_
7
10#include "src/common/globals.h"
12
13namespace v8 {
14namespace internal {
15
16// For ArrayNoArgumentConstructor and ArraySingleArgumentConstructor.
21
23 public:
24 // CEntry has var-args semantics (all the arguments are passed on the
25 // stack and the arguments count is passed via register) which currently
26 // can't be expressed in CallInterfaceDescriptor. Therefore only the code
27 // is exported here.
28 static DirectHandle<Code> RuntimeCEntry(Isolate* isolate, int result_size = 1,
29 bool switch_to_central_stack = false);
30
31 static Handle<Code> CEntry(Isolate* isolate, int result_size = 1,
32 ArgvMode argv_mode = ArgvMode::kStack,
33 bool builtin_exit_frame = false,
34 bool switch_to_central_stack = false);
35
36 // Initial states for ICs.
37 static Callable LoadGlobalIC(Isolate* isolate, TypeofMode typeof_mode);
38 static Callable LoadGlobalICInOptimizedCode(Isolate* isolate,
39 TypeofMode typeof_mode);
40 static Callable DefineNamedOwnIC(Isolate* isolate);
41 static Callable DefineNamedOwnICInOptimizedCode(Isolate* isolate);
42
44
45 static Callable StringAdd(Isolate* isolate,
46 StringAddFlags flags = STRING_ADD_CHECK_NONE);
47
48 static Callable FastNewFunctionContext(Isolate* isolate,
49 ScopeType scope_type);
50
51 static Callable Call(Isolate* isolate,
52 ConvertReceiverMode mode = ConvertReceiverMode::kAny);
53 // TODO(ishell): not used, remove.
54 static Callable Call_WithFeedback(Isolate* isolate, ConvertReceiverMode mode);
55 static Callable CallWithArrayLike(Isolate* isolate);
56 static Callable CallWithSpread(Isolate* isolate);
57 static Callable CallFunction(
58 Isolate* isolate, ConvertReceiverMode mode = ConvertReceiverMode::kAny);
59
60 static Callable CallForwardVarargs(Isolate* isolate);
61 static Callable CallFunctionForwardVarargs(Isolate* isolate);
62 static Callable Construct(Isolate* isolate);
63 static Callable ConstructWithSpread(Isolate* isolate);
64 static Callable ConstructForwardVarargs(Isolate* isolate);
65 static Callable ConstructFunctionForwardVarargs(Isolate* isolate);
66
67 static Callable ArrayNoArgumentConstructor(
68 Isolate* isolate, ElementsKind kind,
69 AllocationSiteOverrideMode override_mode);
70 static Callable ArraySingleArgumentConstructor(
71 Isolate* isolate, ElementsKind kind,
72 AllocationSiteOverrideMode override_mode);
73
74#ifdef V8_IS_TSAN
75 static Builtin GetTSANStoreStub(SaveFPRegsMode fp_mode, int size,
76 std::memory_order order);
77 static Builtin GetTSANRelaxedLoadStub(SaveFPRegsMode fp_mode, int size);
78#endif // V8_IS_TSAN
79};
80
81} // namespace internal
82} // namespace v8
83
84#endif // V8_CODEGEN_CODE_FACTORY_H_
Builtins::Kind kind
Definition builtins.cc:40
static Callable CallApiCallback(Isolate *isolate)
@ DISABLE_ALLOCATION_SITES
#define V8_EXPORT_PRIVATE
Definition macros.h:460