v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
builtins-async-gen.h
Go to the documentation of this file.
1
// Copyright 2016 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_BUILTINS_BUILTINS_ASYNC_GEN_H_
6
#define V8_BUILTINS_BUILTINS_ASYNC_GEN_H_
7
8
#include "
src/builtins/builtins-promise-gen.h
"
9
#include "
src/objects/js-generator.h
"
10
11
namespace
v8
{
12
namespace
internal
{
13
14
class
AsyncBuiltinsAssembler
:
public
PromiseBuiltinsAssembler
{
15
public
:
16
explicit
AsyncBuiltinsAssembler
(
compiler::CodeAssemblerState
* state)
17
:
PromiseBuiltinsAssembler
(state) {}
18
19
protected
:
20
// Perform steps to resume generator after `value` is resolved.
21
// `on_reject` is the SharedFunctioninfo instance used to create the reject
22
// closure. `on_resolve` is the SharedFunctioninfo instance used to create the
23
// resolve closure. Returns the Promise-wrapped `value`.
24
using
CreateClosures
=
25
std::function<std::pair<TNode<JSFunction>,
TNode<JSFunction>
>(
26
TNode<Context>
,
TNode<NativeContext>
)>;
27
TNode<Object>
Await
(
TNode<Context>
context,
28
TNode<JSGeneratorObject>
generator,
TNode<JSAny>
value,
29
TNode<JSPromise>
outer_promise,
30
const
CreateClosures
&
CreateClosures
);
31
TNode<Object>
Await
(
TNode<Context>
context,
32
TNode<JSGeneratorObject>
generator,
TNode<JSAny>
value,
33
TNode<JSPromise>
outer_promise,
RootIndex
on_resolve_sfi,
34
RootIndex
on_reject_sfi);
35
36
// Return a new built-in function object as defined in
37
// Async Iterator Value Unwrap Functions
38
TNode<JSFunction>
CreateUnwrapClosure
(
TNode<NativeContext>
native_context
,
39
TNode<Boolean>
done);
40
41
private
:
42
TNode<Context>
AllocateAsyncIteratorValueUnwrapContext
(
43
TNode<NativeContext>
native_context
,
TNode<Boolean>
done);
44
};
45
46
}
// namespace internal
47
}
// namespace v8
48
49
#endif
// V8_BUILTINS_BUILTINS_ASYNC_GEN_H_
builtins-promise-gen.h
v8::internal::AsyncBuiltinsAssembler
Definition
builtins-async-gen.h:14
v8::internal::AsyncBuiltinsAssembler::CreateClosures
std::function< std::pair< TNode< JSFunction >, TNode< JSFunction > >( TNode< Context >, TNode< NativeContext >)> CreateClosures
Definition
builtins-async-gen.h:24
v8::internal::AsyncBuiltinsAssembler::CreateUnwrapClosure
TNode< JSFunction > CreateUnwrapClosure(TNode< NativeContext > native_context, TNode< Boolean > done)
Definition
builtins-async-gen.cc:161
v8::internal::AsyncBuiltinsAssembler::Await
TNode< Object > Await(TNode< Context > context, TNode< JSGeneratorObject > generator, TNode< JSAny > value, TNode< JSPromise > outer_promise, const CreateClosures &CreateClosures)
Definition
builtins-async-gen.cc:44
v8::internal::AsyncBuiltinsAssembler::AsyncBuiltinsAssembler
AsyncBuiltinsAssembler(compiler::CodeAssemblerState *state)
Definition
builtins-async-gen.h:16
v8::internal::AsyncBuiltinsAssembler::AllocateAsyncIteratorValueUnwrapContext
TNode< Context > AllocateAsyncIteratorValueUnwrapContext(TNode< NativeContext > native_context, TNode< Boolean > done)
Definition
builtins-async-gen.cc:170
v8::internal::PromiseBuiltinsAssembler
Definition
builtins-promise-gen.h:16
v8::internal::TNode
Definition
tnode.h:391
v8::internal::compiler::CodeAssemblerState
Definition
code-assembler.h:1852
js-generator.h
v8::internal::internal
internal
Definition
wasm-objects-inl.h:458
v8::internal::RootIndex
RootIndex
Definition
roots.h:494
v8::internal::native_context
!IsContextMap !IsContextMap native_context
Definition
map-inl.h:877
v8
Definition
api-arguments-inl.h:19
src
builtins
builtins-async-gen.h
Generated on Sun Apr 6 2025 21:08:50 for v8 by
1.12.0