Commit 8bb8a285 authored by Marja Hölttä's avatar Marja Hölttä Committed by Commit Bot

Move helper SFIs from NativeContext to Isolate, part 2

There's no need for them to be in NativeContext.

This CL moves the minimal subset of SFIs related to async iterators.

Bug: v8:10482
Change-Id: I80a34a886387398e6565afe77ab99f389d2ccabd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2184233Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67636}
parent d06f9f09
......@@ -283,8 +283,8 @@ TNode<JSFunction> AsyncBuiltinsAssembler::CreateUnwrapClosure(
TNode<NativeContext> native_context, TNode<Oddball> done) {
const TNode<Map> map = CAST(LoadContextElement(
native_context, Context::STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX));
const TNode<SharedFunctionInfo> on_fulfilled_shared = CAST(LoadContextElement(
native_context, Context::ASYNC_ITERATOR_VALUE_UNWRAP_SHARED_FUN));
const TNode<SharedFunctionInfo> on_fulfilled_shared =
AsyncIteratorValueUnwrapSharedFunConstant();
const TNode<Context> closure_context =
AllocateAsyncIteratorValueUnwrapContext(native_context, done);
return AllocateFunctionWithMapAndContext(map, on_fulfilled_shared,
......
......@@ -60,6 +60,8 @@ enum class PrimitiveType { kBoolean, kNumber, kString, kSymbol };
V(AsyncGeneratorYieldResolveSharedFun, \
async_generator_yield_resolve_shared_fun, \
AsyncGeneratorYieldResolveSharedFun) \
V(AsyncIteratorValueUnwrapSharedFun, async_iterator_value_unwrap_shared_fun, \
AsyncIteratorValueUnwrapSharedFun) \
V(MapIteratorProtector, map_iterator_protector, MapIteratorProtector) \
V(NoElementsProtector, no_elements_protector, NoElementsProtector) \
V(NumberStringCache, number_string_cache, NumberStringCache) \
......
......@@ -1042,6 +1042,13 @@ void Heap::CreateInitialObjects() {
isolate(), Builtins::kAsyncGeneratorReturnClosedRejectClosure, 1);
set_async_generator_return_closed_reject_shared_fun(*info);
}
// AsyncIterator:
{
Handle<SharedFunctionInfo> info = CreateSharedFunctionInfo(
isolate_, Builtins::kAsyncIteratorValueUnwrap, 1);
set_async_iterator_value_unwrap_shared_fun(*info);
}
}
void Heap::CreateInternalAccessorInfoObjects() {
......
......@@ -1616,13 +1616,6 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
}
}
{ // --- A s y n c F r o m S y n c I t e r a t o r
Handle<SharedFunctionInfo> info = SimpleCreateSharedFunctionInfo(
isolate_, Builtins::kAsyncIteratorValueUnwrap, factory->empty_string(),
1);
native_context()->set_async_iterator_value_unwrap_shared_fun(*info);
}
Handle<JSFunction> array_prototype_to_string_fun;
{ // --- A r r a y ---
Handle<JSFunction> array_function = InstallFunction(
......
......@@ -74,8 +74,6 @@ enum ContextLookupFlags {
V(ASYNC_FUNCTION_OBJECT_MAP_INDEX, Map, async_function_object_map) \
V(ASYNC_GENERATOR_FUNCTION_FUNCTION_INDEX, JSFunction, \
async_generator_function_function) \
V(ASYNC_ITERATOR_VALUE_UNWRAP_SHARED_FUN, SharedFunctionInfo, \
async_iterator_value_unwrap_shared_fun) \
V(ATOMICS_OBJECT, JSObject, atomics_object) \
V(BIGINT_FUNCTION_INDEX, JSFunction, bigint_function) \
V(BIGINT64_ARRAY_FUN_INDEX, JSFunction, bigint64_array_fun) \
......
......@@ -233,7 +233,7 @@ class Symbol;
V(FixedArray, regexp_multiple_cache, RegExpMultipleCache) \
/* Indirection lists for isolate-independent builtins */ \
V(FixedArray, builtins_constants_table, BuiltinsConstantsTable) \
/* Internal SFIs */ \
/* Internal SharedFunctionInfos */ \
V(SharedFunctionInfo, async_function_await_reject_shared_fun, \
AsyncFunctionAwaitRejectSharedFun) \
V(SharedFunctionInfo, async_function_await_resolve_shared_fun, \
......@@ -249,7 +249,9 @@ class Symbol;
V(SharedFunctionInfo, async_generator_return_closed_reject_shared_fun, \
AsyncGeneratorReturnClosedRejectSharedFun) \
V(SharedFunctionInfo, async_generator_return_closed_resolve_shared_fun, \
AsyncGeneratorReturnClosedResolveSharedFun)
AsyncGeneratorReturnClosedResolveSharedFun) \
V(SharedFunctionInfo, async_iterator_value_unwrap_shared_fun, \
AsyncIteratorValueUnwrapSharedFun)
// These root references can be updated by the mutator.
#define STRONG_MUTABLE_MOVABLE_ROOT_LIST(V) \
......
......@@ -443,6 +443,7 @@ KNOWN_OBJECTS = {
("old_space", 0x01669): "AsyncGeneratorReturnResolveSharedFun",
("old_space", 0x01691): "AsyncGeneratorReturnClosedRejectSharedFun",
("old_space", 0x016b9): "AsyncGeneratorReturnClosedResolveSharedFun",
("old_space", 0x016e1): "AsyncIteratorValueUnwrapSharedFun",
}
# Lower 32 bits of first page addresses for various heap spaces.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment