v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
interpreter-intrinsics.h
Go to the documentation of this file.
1// Copyright 2015 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_INTERPRETER_INTERPRETER_INTRINSICS_H_
6#define V8_INTERPRETER_INTERPRETER_INTRINSICS_H_
7
9
10namespace v8 {
11namespace internal {
12namespace interpreter {
13
14// List of supported intrisics, with upper case name, lower case name and
15// expected number of arguments (-1 denoting argument count is variable).
16#define INTRINSICS_LIST(V) \
17 V(AsyncFunctionAwait, async_function_await_caught, 2) \
18 V(AsyncFunctionEnter, async_function_enter, 2) \
19 V(AsyncFunctionReject, async_function_reject, 2) \
20 V(AsyncFunctionResolve, async_function_resolve, 2) \
21 V(AsyncGeneratorAwait, async_generator_await_caught, 2) \
22 V(AsyncGeneratorReject, async_generator_reject, 2) \
23 V(AsyncGeneratorResolve, async_generator_resolve, 3) \
24 V(AsyncGeneratorYieldWithAwait, async_generator_yield_with_await, 2) \
25 V(CreateJSGeneratorObject, create_js_generator_object, 2) \
26 V(GeneratorGetResumeMode, generator_get_resume_mode, 1) \
27 V(GeneratorClose, generator_close, 1) \
28 V(GetImportMetaObject, get_import_meta_object, 0) \
29 V(CopyDataProperties, copy_data_properties, 2) \
30 V(CopyDataPropertiesWithExcludedPropertiesOnStack, \
31 copy_data_properties_with_excluded_properties_on_stack, -1) \
32 V(CreateIterResultObject, create_iter_result_object, 2) \
33 V(CreateAsyncFromSyncIterator, create_async_from_sync_iterator, 1)
34
36 public:
37 enum class IntrinsicId {
38#define DECLARE_INTRINSIC_ID(name, lower_case, count) k##name,
40#undef DECLARE_INTRINSIC_ID
42 };
43 static_assert(static_cast<uint32_t>(IntrinsicId::kIdCount) <= kMaxUInt8);
44
45 V8_EXPORT_PRIVATE static bool IsSupported(Runtime::FunctionId function_id);
47 static Runtime::FunctionId ToRuntimeId(IntrinsicId intrinsic_id);
48
49 private:
51};
52
53} // namespace interpreter
54} // namespace internal
55} // namespace v8
56
57#endif // V8_INTERPRETER_INTERPRETER_INTRINSICS_H_
static Runtime::FunctionId ToRuntimeId(IntrinsicId intrinsic_id)
static V8_EXPORT_PRIVATE bool IsSupported(Runtime::FunctionId function_id)
static IntrinsicId FromRuntimeId(Runtime::FunctionId function_id)
#define INTRINSICS_LIST(V)
constexpr int kMaxUInt8
Definition globals.h:378
#define V8_EXPORT_PRIVATE
Definition macros.h:460