Commit 1ed76a3c authored by Marja Hölttä's avatar Marja Hölttä Committed by Commit Bot

Move helper SFIs from NativeContext to Isolate, part 1

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

This CL moves the minimal subset of SFIs related to async functions
and async generators.

Bug: v8:10482
Change-Id: Ic90e342ae77b406c12dedf6b8f7e3fadb661b205
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2179843
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67590}
parent 61927f30
......@@ -271,10 +271,12 @@ void AsyncFunctionBuiltinsAssembler::AsyncFunctionAwait(
Goto(&after_debug_hook);
BIND(&after_debug_hook);
Await(context, async_function_object, value, outer_promise,
Context::ASYNC_FUNCTION_AWAIT_RESOLVE_SHARED_FUN,
Context::ASYNC_FUNCTION_AWAIT_REJECT_SHARED_FUN,
is_predicted_as_caught);
TNode<SharedFunctionInfo> on_resolve_sfi =
AsyncFunctionAwaitResolveSharedFunConstant();
TNode<SharedFunctionInfo> on_reject_sfi =
AsyncFunctionAwaitRejectSharedFunConstant();
Await(context, async_function_object, value, outer_promise, on_resolve_sfi,
on_reject_sfi, is_predicted_as_caught);
// Return outer promise to avoid adding an load of the outer promise before
// suspending in BytecodeGenerator.
......
......@@ -27,8 +27,8 @@ class ValueUnwrapContext {
TNode<Object> AsyncBuiltinsAssembler::AwaitOld(
TNode<Context> context, TNode<JSGeneratorObject> generator,
TNode<Object> value, TNode<JSPromise> outer_promise,
TNode<IntPtrT> on_resolve_context_index,
TNode<IntPtrT> on_reject_context_index,
TNode<SharedFunctionInfo> on_resolve_sfi,
TNode<SharedFunctionInfo> on_reject_sfi,
TNode<Oddball> is_predicted_as_caught) {
const TNode<NativeContext> native_context = LoadNativeContext(context);
......@@ -90,12 +90,12 @@ TNode<Object> AsyncBuiltinsAssembler::AwaitOld(
// Initialize resolve handler
TNode<HeapObject> on_resolve = InnerAllocate(base, kResolveClosureOffset);
InitializeNativeClosure(closure_context, native_context, on_resolve,
on_resolve_context_index);
on_resolve_sfi);
// Initialize reject handler
TNode<HeapObject> on_reject = InnerAllocate(base, kRejectClosureOffset);
InitializeNativeClosure(closure_context, native_context, on_reject,
on_reject_context_index);
on_reject_sfi);
TVARIABLE(HeapObject, var_throwaway, UndefinedConstant());
......@@ -122,8 +122,8 @@ TNode<Object> AsyncBuiltinsAssembler::AwaitOld(
TNode<Object> AsyncBuiltinsAssembler::AwaitOptimized(
TNode<Context> context, TNode<JSGeneratorObject> generator,
TNode<JSPromise> promise, TNode<JSPromise> outer_promise,
TNode<IntPtrT> on_resolve_context_index,
TNode<IntPtrT> on_reject_context_index,
TNode<SharedFunctionInfo> on_resolve_sfi,
TNode<SharedFunctionInfo> on_reject_sfi,
TNode<Oddball> is_predicted_as_caught) {
const TNode<NativeContext> native_context = LoadNativeContext(context);
......@@ -161,12 +161,12 @@ TNode<Object> AsyncBuiltinsAssembler::AwaitOptimized(
// Initialize resolve handler
TNode<HeapObject> on_resolve = InnerAllocate(base, kResolveClosureOffset);
InitializeNativeClosure(closure_context, native_context, on_resolve,
on_resolve_context_index);
on_resolve_sfi);
// Initialize reject handler
TNode<HeapObject> on_reject = InnerAllocate(base, kRejectClosureOffset);
InitializeNativeClosure(closure_context, native_context, on_reject,
on_reject_context_index);
on_reject_sfi);
TVARIABLE(HeapObject, var_throwaway, UndefinedConstant());
......@@ -190,8 +190,8 @@ TNode<Object> AsyncBuiltinsAssembler::AwaitOptimized(
TNode<Object> AsyncBuiltinsAssembler::Await(
TNode<Context> context, TNode<JSGeneratorObject> generator,
TNode<Object> value, TNode<JSPromise> outer_promise,
TNode<IntPtrT> on_resolve_context_index,
TNode<IntPtrT> on_reject_context_index,
TNode<SharedFunctionInfo> on_resolve_sfi,
TNode<SharedFunctionInfo> on_reject_sfi,
TNode<Oddball> is_predicted_as_caught) {
TVARIABLE(Object, result);
Label if_old(this), if_new(this), done(this),
......@@ -230,15 +230,14 @@ TNode<Object> AsyncBuiltinsAssembler::Await(
}
BIND(&if_old);
result = AwaitOld(context, generator, value, outer_promise,
on_resolve_context_index, on_reject_context_index,
is_predicted_as_caught);
result = AwaitOld(context, generator, value, outer_promise, on_resolve_sfi,
on_reject_sfi, is_predicted_as_caught);
Goto(&done);
BIND(&if_new);
result = AwaitOptimized(context, generator, CAST(value), outer_promise,
on_resolve_context_index, on_reject_context_index,
is_predicted_as_caught);
result =
AwaitOptimized(context, generator, CAST(value), outer_promise,
on_resolve_sfi, on_reject_sfi, is_predicted_as_caught);
Goto(&done);
BIND(&done);
......@@ -247,7 +246,7 @@ TNode<Object> AsyncBuiltinsAssembler::Await(
void AsyncBuiltinsAssembler::InitializeNativeClosure(
TNode<Context> context, TNode<NativeContext> native_context,
TNode<HeapObject> function, TNode<IntPtrT> context_index) {
TNode<HeapObject> function, TNode<SharedFunctionInfo> shared_info) {
TNode<Map> function_map = CAST(LoadContextElement(
native_context, Context::STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX));
// Ensure that we don't have to initialize prototype_or_initial_map field of
......@@ -265,8 +264,6 @@ void AsyncBuiltinsAssembler::InitializeNativeClosure(
StoreObjectFieldRoot(function, JSFunction::kFeedbackCellOffset,
RootIndex::kManyClosuresCell);
TNode<SharedFunctionInfo> shared_info =
CAST(LoadContextElement(native_context, context_index));
StoreObjectFieldNoWriteBarrier(
function, JSFunction::kSharedFunctionInfoOffset, shared_info);
StoreObjectFieldNoWriteBarrier(function, JSFunction::kContextOffset, context);
......
......@@ -17,34 +17,23 @@ class AsyncBuiltinsAssembler : public PromiseBuiltinsAssembler {
protected:
// Perform steps to resume generator after `value` is resolved.
// `on_reject_context_index` is an index into the Native Context, which should
// point to a SharedFunctioninfo instance used to create the closure. The
// value following the reject index should be a similar value for the resolve
// closure. Returns the Promise-wrapped `value`.
// `on_reject` is the SharedFunctioninfo instance used to create the reject
// closure. `on_resolve` is the SharedFunctioninfo instance used to create the
// resolve closure. Returns the Promise-wrapped `value`.
TNode<Object> Await(TNode<Context> context,
TNode<JSGeneratorObject> generator, TNode<Object> value,
TNode<JSPromise> outer_promise,
TNode<IntPtrT> on_resolve_context_index,
TNode<IntPtrT> on_reject_context_index,
TNode<SharedFunctionInfo> on_resolve_sfi,
TNode<SharedFunctionInfo> on_reject_sfi,
TNode<Oddball> is_predicted_as_caught);
TNode<Object> Await(TNode<Context> context,
TNode<JSGeneratorObject> generator, TNode<Object> value,
TNode<JSPromise> outer_promise,
int on_resolve_context_index, int on_reject_context_index,
TNode<Oddball> is_predicted_as_caught) {
return Await(context, generator, value, outer_promise,
IntPtrConstant(on_resolve_context_index),
IntPtrConstant(on_reject_context_index),
is_predicted_as_caught);
}
TNode<Object> Await(TNode<Context> context,
TNode<JSGeneratorObject> generator, TNode<Object> value,
TNode<JSPromise> outer_promise,
int on_resolve_context_index, int on_reject_context_index,
TNode<SharedFunctionInfo> on_resolve_sfi,
TNode<SharedFunctionInfo> on_reject_sfi,
bool is_predicted_as_caught) {
return Await(context, generator, value, outer_promise,
on_resolve_context_index, on_reject_context_index,
BooleanConstant(is_predicted_as_caught));
return Await(context, generator, value, outer_promise, on_resolve_sfi,
on_reject_sfi, BooleanConstant(is_predicted_as_caught));
}
// Return a new built-in function object as defined in
......@@ -56,22 +45,22 @@ class AsyncBuiltinsAssembler : public PromiseBuiltinsAssembler {
void InitializeNativeClosure(TNode<Context> context,
TNode<NativeContext> native_context,
TNode<HeapObject> function,
TNode<IntPtrT> context_index);
TNode<SharedFunctionInfo> shared_info);
TNode<Context> AllocateAsyncIteratorValueUnwrapContext(
TNode<NativeContext> native_context, TNode<Oddball> done);
TNode<Object> AwaitOld(TNode<Context> context,
TNode<JSGeneratorObject> generator,
TNode<Object> value, TNode<JSPromise> outer_promise,
TNode<IntPtrT> on_resolve_context_index,
TNode<IntPtrT> on_reject_context_index,
TNode<SharedFunctionInfo> on_resolve_sfi,
TNode<SharedFunctionInfo> on_reject_sfi,
TNode<Oddball> is_predicted_as_caught);
TNode<Object> AwaitOptimized(TNode<Context> context,
TNode<JSGeneratorObject> generator,
TNode<JSPromise> promise,
TNode<JSPromise> outer_promise,
TNode<IntPtrT> on_resolve_context_index,
TNode<IntPtrT> on_reject_context_index,
TNode<SharedFunctionInfo> on_resolve_sfi,
TNode<SharedFunctionInfo> on_reject_sfi,
TNode<Oddball> is_predicted_as_caught);
};
......
......@@ -242,12 +242,10 @@ void AsyncGeneratorBuiltinsAssembler::AsyncGeneratorAwait(bool is_catchable) {
TNode<JSPromise> outer_promise = LoadObjectField<JSPromise>(
request, AsyncGeneratorRequest::kPromiseOffset);
const int resolve_index = Context::ASYNC_GENERATOR_AWAIT_RESOLVE_SHARED_FUN;
const int reject_index = Context::ASYNC_GENERATOR_AWAIT_REJECT_SHARED_FUN;
SetGeneratorAwaiting(async_generator_object);
Await(context, async_generator_object, value, outer_promise, resolve_index,
reject_index, is_catchable);
Await(context, async_generator_object, value, outer_promise,
AsyncGeneratorAwaitResolveSharedFunConstant(),
AsyncGeneratorAwaitRejectSharedFunConstant(), is_catchable);
Return(UndefinedConstant());
}
......@@ -573,12 +571,10 @@ TF_BUILTIN(AsyncGeneratorYield, AsyncGeneratorBuiltinsAssembler) {
const TNode<JSPromise> outer_promise =
LoadPromiseFromAsyncGeneratorRequest(request);
const int on_resolve = Context::ASYNC_GENERATOR_YIELD_RESOLVE_SHARED_FUN;
const int on_reject = Context::ASYNC_GENERATOR_AWAIT_REJECT_SHARED_FUN;
SetGeneratorAwaiting(generator);
Await(context, generator, value, outer_promise, on_resolve, on_reject,
is_caught);
Await(context, generator, value, outer_promise,
AsyncGeneratorYieldResolveSharedFunConstant(),
AsyncGeneratorAwaitRejectSharedFunConstant(), is_caught);
Return(UndefinedConstant());
}
......@@ -623,19 +619,17 @@ TF_BUILTIN(AsyncGeneratorReturn, AsyncGeneratorBuiltinsAssembler) {
CAST(LoadFirstAsyncGeneratorRequestFromQueue(generator));
Label perform_await(this);
TVARIABLE(IntPtrT, var_on_resolve,
IntPtrConstant(
Context::ASYNC_GENERATOR_RETURN_CLOSED_RESOLVE_SHARED_FUN));
TVARIABLE(
IntPtrT, var_on_reject,
IntPtrConstant(Context::ASYNC_GENERATOR_RETURN_CLOSED_REJECT_SHARED_FUN));
TVARIABLE(SharedFunctionInfo, var_on_resolve,
AsyncGeneratorReturnClosedResolveSharedFunConstant());
TVARIABLE(SharedFunctionInfo, var_on_reject,
AsyncGeneratorReturnClosedRejectSharedFunConstant());
const TNode<Smi> state = LoadGeneratorState(generator);
GotoIf(IsGeneratorStateClosed(state), &perform_await);
var_on_resolve =
IntPtrConstant(Context::ASYNC_GENERATOR_RETURN_RESOLVE_SHARED_FUN);
var_on_reject =
IntPtrConstant(Context::ASYNC_GENERATOR_AWAIT_REJECT_SHARED_FUN);
var_on_resolve = AsyncGeneratorReturnResolveSharedFunConstant();
var_on_reject = AsyncGeneratorAwaitRejectSharedFunConstant();
Goto(&perform_await);
BIND(&perform_await);
......
......@@ -34,24 +34,47 @@ class StubCache;
enum class PrimitiveType { kBoolean, kNumber, kString, kSymbol };
#define HEAP_MUTABLE_IMMOVABLE_OBJECT_LIST(V) \
V(ArrayIteratorProtector, array_iterator_protector, ArrayIteratorProtector) \
V(ArraySpeciesProtector, array_species_protector, ArraySpeciesProtector) \
V(MapIteratorProtector, map_iterator_protector, MapIteratorProtector) \
V(NoElementsProtector, no_elements_protector, NoElementsProtector) \
V(NumberStringCache, number_string_cache, NumberStringCache) \
V(PromiseResolveProtector, promise_resolve_protector, \
PromiseResolveProtector) \
V(PromiseSpeciesProtector, promise_species_protector, \
PromiseSpeciesProtector) \
V(PromiseThenProtector, promise_then_protector, PromiseThenProtector) \
V(RegExpSpeciesProtector, regexp_species_protector, RegExpSpeciesProtector) \
V(SetIteratorProtector, set_iterator_protector, SetIteratorProtector) \
V(SingleCharacterStringCache, single_character_string_cache, \
SingleCharacterStringCache) \
V(StringIteratorProtector, string_iterator_protector, \
StringIteratorProtector) \
V(TypedArraySpeciesProtector, typed_array_species_protector, \
#define HEAP_MUTABLE_IMMOVABLE_OBJECT_LIST(V) \
V(ArrayIteratorProtector, array_iterator_protector, ArrayIteratorProtector) \
V(ArraySpeciesProtector, array_species_protector, ArraySpeciesProtector) \
V(AsyncFunctionAwaitRejectSharedFun, async_function_await_reject_shared_fun, \
AsyncFunctionAwaitRejectSharedFun) \
V(AsyncFunctionAwaitResolveSharedFun, \
async_function_await_resolve_shared_fun, \
AsyncFunctionAwaitResolveSharedFun) \
V(AsyncGeneratorAwaitRejectSharedFun, \
async_generator_await_reject_shared_fun, \
AsyncGeneratorAwaitRejectSharedFun) \
V(AsyncGeneratorAwaitResolveSharedFun, \
async_generator_await_resolve_shared_fun, \
AsyncGeneratorAwaitResolveSharedFun) \
V(AsyncGeneratorReturnClosedRejectSharedFun, \
async_generator_return_closed_reject_shared_fun, \
AsyncGeneratorReturnClosedRejectSharedFun) \
V(AsyncGeneratorReturnClosedResolveSharedFun, \
async_generator_return_closed_resolve_shared_fun, \
AsyncGeneratorReturnClosedResolveSharedFun) \
V(AsyncGeneratorReturnResolveSharedFun, \
async_generator_return_resolve_shared_fun, \
AsyncGeneratorReturnResolveSharedFun) \
V(AsyncGeneratorYieldResolveSharedFun, \
async_generator_yield_resolve_shared_fun, \
AsyncGeneratorYieldResolveSharedFun) \
V(MapIteratorProtector, map_iterator_protector, MapIteratorProtector) \
V(NoElementsProtector, no_elements_protector, NoElementsProtector) \
V(NumberStringCache, number_string_cache, NumberStringCache) \
V(PromiseResolveProtector, promise_resolve_protector, \
PromiseResolveProtector) \
V(PromiseSpeciesProtector, promise_species_protector, \
PromiseSpeciesProtector) \
V(PromiseThenProtector, promise_then_protector, PromiseThenProtector) \
V(RegExpSpeciesProtector, regexp_species_protector, RegExpSpeciesProtector) \
V(SetIteratorProtector, set_iterator_protector, SetIteratorProtector) \
V(SingleCharacterStringCache, single_character_string_cache, \
SingleCharacterStringCache) \
V(StringIteratorProtector, string_iterator_protector, \
StringIteratorProtector) \
V(TypedArraySpeciesProtector, typed_array_species_protector, \
TypedArraySpeciesProtector)
#define HEAP_IMMUTABLE_IMMOVABLE_OBJECT_LIST(V) \
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/init/setup-isolate.h"
#include "src/builtins/accessors.h"
#include "src/codegen/compilation-cache.h"
#include "src/execution/isolate.h"
......@@ -12,6 +10,7 @@
#include "src/heap/heap-inl.h"
#include "src/ic/handler-configuration.h"
#include "src/init/heap-symbols.h"
#include "src/init/setup-isolate.h"
#include "src/interpreter/interpreter.h"
#include "src/objects/arguments.h"
#include "src/objects/cell-inl.h"
......@@ -51,6 +50,21 @@
namespace v8 {
namespace internal {
namespace {
Handle<SharedFunctionInfo> CreateSharedFunctionInfo(
Isolate* isolate, Builtins::Name builtin_id, int len,
FunctionKind kind = FunctionKind::kNormalFunction) {
Handle<SharedFunctionInfo> shared =
isolate->factory()->NewSharedFunctionInfoForBuiltin(
isolate->factory()->empty_string(), builtin_id, kind);
shared->set_internal_formal_parameter_count(len);
shared->set_length(len);
return shared;
}
} // namespace
bool SetupIsolateDelegate::SetupHeapInternal(Heap* heap) {
return heap->CreateHeapObjects();
}
......@@ -348,7 +362,7 @@ bool Heap::CreateInitialMaps() {
}
#define ALLOCATE_VARSIZE_MAP(instance_type, field_name) \
ALLOCATE_MAP(instance_type, kVariableSizeSentinel, field_name)
ALLOCATE_MAP(instance_type, kVariableSizeSentinel, field_name)
#define ALLOCATE_PRIMITIVE_MAP(instance_type, size, field_name, \
constructor_function_index) \
......@@ -434,14 +448,14 @@ bool Heap::CreateInitialMaps() {
// The "no closures" and "one closure" FeedbackCell maps need
// to be marked unstable because their objects can change maps.
ALLOCATE_MAP(
FEEDBACK_CELL_TYPE, FeedbackCell::kAlignedSize, no_closures_cell)
ALLOCATE_MAP(FEEDBACK_CELL_TYPE, FeedbackCell::kAlignedSize,
no_closures_cell)
roots.no_closures_cell_map().mark_unstable();
ALLOCATE_MAP(
FEEDBACK_CELL_TYPE, FeedbackCell::kAlignedSize, one_closure_cell)
ALLOCATE_MAP(FEEDBACK_CELL_TYPE, FeedbackCell::kAlignedSize,
one_closure_cell)
roots.one_closure_cell_map().mark_unstable();
ALLOCATE_MAP(
FEEDBACK_CELL_TYPE, FeedbackCell::kAlignedSize, many_closures_cell)
ALLOCATE_MAP(FEEDBACK_CELL_TYPE, FeedbackCell::kAlignedSize,
many_closures_cell)
ALLOCATE_VARSIZE_MAP(TRANSITION_ARRAY_TYPE, transition_array)
......@@ -988,6 +1002,46 @@ void Heap::CreateInitialObjects() {
// Initialize compilation cache.
isolate_->compilation_cache()->Clear();
// Create internal SharedFunctionInfos.
// Async functions:
{
Handle<SharedFunctionInfo> info = CreateSharedFunctionInfo(
isolate(), Builtins::kAsyncFunctionAwaitRejectClosure, 1);
set_async_function_await_reject_shared_fun(*info);
info = CreateSharedFunctionInfo(
isolate(), Builtins::kAsyncFunctionAwaitResolveClosure, 1);
set_async_function_await_resolve_shared_fun(*info);
}
// Async generators:
{
Handle<SharedFunctionInfo> info = CreateSharedFunctionInfo(
isolate(), Builtins::kAsyncGeneratorAwaitResolveClosure, 1);
set_async_generator_await_resolve_shared_fun(*info);
info = CreateSharedFunctionInfo(
isolate(), Builtins::kAsyncGeneratorAwaitRejectClosure, 1);
set_async_generator_await_reject_shared_fun(*info);
info = CreateSharedFunctionInfo(
isolate(), Builtins::kAsyncGeneratorYieldResolveClosure, 1);
set_async_generator_yield_resolve_shared_fun(*info);
info = CreateSharedFunctionInfo(
isolate(), Builtins::kAsyncGeneratorReturnResolveClosure, 1);
set_async_generator_return_resolve_shared_fun(*info);
info = CreateSharedFunctionInfo(
isolate(), Builtins::kAsyncGeneratorReturnClosedResolveClosure, 1);
set_async_generator_return_closed_resolve_shared_fun(*info);
info = CreateSharedFunctionInfo(
isolate(), Builtins::kAsyncGeneratorReturnClosedRejectClosure, 1);
set_async_generator_return_closed_reject_shared_fun(*info);
}
}
void Heap::CreateInternalAccessorInfoObjects() {
......
......@@ -368,6 +368,9 @@ void Bootstrapper::DetachGlobal(Handle<Context> env) {
namespace {
// FIXME(marja): Remove SimpleCreateSharedFunctionInfo and
// SimpleCreateBuiltinSharedFunctionInfo when migration to
// setup-heap-internal.cc is complete (see v8:10482).
V8_NOINLINE Handle<SharedFunctionInfo> SimpleCreateSharedFunctionInfo(
Isolate* isolate, Builtins::Name builtin_id, Handle<String> name, int len,
FunctionKind kind = FunctionKind::kNormalFunction) {
......@@ -1620,40 +1623,6 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
native_context()->set_async_iterator_value_unwrap_shared_fun(*info);
}
{ // --- A s y n c G e n e r a t o r ---
Handle<SharedFunctionInfo> info = SimpleCreateSharedFunctionInfo(
isolate_, Builtins::kAsyncGeneratorAwaitResolveClosure,
factory->empty_string(), 1);
native_context()->set_async_generator_await_resolve_shared_fun(*info);
info = SimpleCreateSharedFunctionInfo(
isolate_, Builtins::kAsyncGeneratorAwaitRejectClosure,
factory->empty_string(), 1);
native_context()->set_async_generator_await_reject_shared_fun(*info);
info = SimpleCreateSharedFunctionInfo(
isolate_, Builtins::kAsyncGeneratorYieldResolveClosure,
factory->empty_string(), 1);
native_context()->set_async_generator_yield_resolve_shared_fun(*info);
info = SimpleCreateSharedFunctionInfo(
isolate_, Builtins::kAsyncGeneratorReturnResolveClosure,
factory->empty_string(), 1);
native_context()->set_async_generator_return_resolve_shared_fun(*info);
info = SimpleCreateSharedFunctionInfo(
isolate_, Builtins::kAsyncGeneratorReturnClosedResolveClosure,
factory->empty_string(), 1);
native_context()->set_async_generator_return_closed_resolve_shared_fun(
*info);
info = SimpleCreateSharedFunctionInfo(
isolate_, Builtins::kAsyncGeneratorReturnClosedRejectClosure,
factory->empty_string(), 1);
native_context()->set_async_generator_return_closed_reject_shared_fun(
*info);
}
Handle<JSFunction> array_prototype_to_string_fun;
{ // --- A r r a y ---
Handle<JSFunction> array_function = InstallFunction(
......@@ -3734,11 +3703,11 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
factory->NewJSObject(isolate_->object_function(), AllocationType::kOld);
JSObject::AddProperty(isolate_, global, reflect_string, reflect, DONT_ENUM);
SimpleInstallFunction(isolate_, reflect, "defineProperty",
Builtins::kReflectDefineProperty, 3, true);
SimpleInstallFunction(isolate_, reflect, "defineProperty",
Builtins::kReflectDefineProperty, 3, true);
SimpleInstallFunction(isolate_, reflect, "deleteProperty",
Builtins::kReflectDeleteProperty, 2, true);
SimpleInstallFunction(isolate_, reflect, "deleteProperty",
Builtins::kReflectDeleteProperty, 2, true);
Handle<JSFunction> apply = SimpleInstallFunction(
isolate_, reflect, "apply", Builtins::kReflectApply, 3, false);
......@@ -4180,20 +4149,6 @@ void Genesis::InitializeIteratorFunctions() {
Handle<Map> async_function_object_map = factory->NewMap(
JS_ASYNC_FUNCTION_OBJECT_TYPE, JSAsyncFunctionObject::kHeaderSize);
native_context->set_async_function_object_map(*async_function_object_map);
{
Handle<SharedFunctionInfo> info = SimpleCreateSharedFunctionInfo(
isolate, Builtins::kAsyncFunctionAwaitRejectClosure,
factory->empty_string(), 1);
native_context->set_async_function_await_reject_shared_fun(*info);
}
{
Handle<SharedFunctionInfo> info = SimpleCreateSharedFunctionInfo(
isolate, Builtins::kAsyncFunctionAwaitResolveClosure,
factory->empty_string(), 1);
native_context->set_async_function_await_resolve_shared_fun(*info);
}
}
}
......
......@@ -70,28 +70,12 @@ enum ContextLookupFlags {
V(ARRAY_FUNCTION_INDEX, JSFunction, array_function) \
V(ARRAY_JOIN_STACK_INDEX, HeapObject, array_join_stack) \
V(ASYNC_FROM_SYNC_ITERATOR_MAP_INDEX, Map, async_from_sync_iterator_map) \
V(ASYNC_FUNCTION_AWAIT_REJECT_SHARED_FUN, SharedFunctionInfo, \
async_function_await_reject_shared_fun) \
V(ASYNC_FUNCTION_AWAIT_RESOLVE_SHARED_FUN, SharedFunctionInfo, \
async_function_await_resolve_shared_fun) \
V(ASYNC_FUNCTION_FUNCTION_INDEX, JSFunction, async_function_constructor) \
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(ASYNC_GENERATOR_AWAIT_REJECT_SHARED_FUN, SharedFunctionInfo, \
async_generator_await_reject_shared_fun) \
V(ASYNC_GENERATOR_AWAIT_RESOLVE_SHARED_FUN, SharedFunctionInfo, \
async_generator_await_resolve_shared_fun) \
V(ASYNC_GENERATOR_YIELD_RESOLVE_SHARED_FUN, SharedFunctionInfo, \
async_generator_yield_resolve_shared_fun) \
V(ASYNC_GENERATOR_RETURN_RESOLVE_SHARED_FUN, SharedFunctionInfo, \
async_generator_return_resolve_shared_fun) \
V(ASYNC_GENERATOR_RETURN_CLOSED_RESOLVE_SHARED_FUN, SharedFunctionInfo, \
async_generator_return_closed_resolve_shared_fun) \
V(ASYNC_GENERATOR_RETURN_CLOSED_REJECT_SHARED_FUN, SharedFunctionInfo, \
async_generator_return_closed_reject_shared_fun) \
V(ATOMICS_OBJECT, JSObject, atomics_object) \
V(BIGINT_FUNCTION_INDEX, JSFunction, bigint_function) \
V(BIGINT64_ARRAY_FUN_INDEX, JSFunction, bigint64_array_fun) \
......
......@@ -231,7 +231,24 @@ class Symbol;
V(FixedArray, string_split_cache, StringSplitCache) \
V(FixedArray, regexp_multiple_cache, RegExpMultipleCache) \
/* Indirection lists for isolate-independent builtins */ \
V(FixedArray, builtins_constants_table, BuiltinsConstantsTable)
V(FixedArray, builtins_constants_table, BuiltinsConstantsTable) \
/* Internal SFIs */ \
V(SharedFunctionInfo, async_function_await_reject_shared_fun, \
AsyncFunctionAwaitRejectSharedFun) \
V(SharedFunctionInfo, async_function_await_resolve_shared_fun, \
AsyncFunctionAwaitResolveSharedFun) \
V(SharedFunctionInfo, async_generator_await_reject_shared_fun, \
AsyncGeneratorAwaitRejectSharedFun) \
V(SharedFunctionInfo, async_generator_await_resolve_shared_fun, \
AsyncGeneratorAwaitResolveSharedFun) \
V(SharedFunctionInfo, async_generator_yield_resolve_shared_fun, \
AsyncGeneratorYieldResolveSharedFun) \
V(SharedFunctionInfo, async_generator_return_resolve_shared_fun, \
AsyncGeneratorReturnResolveSharedFun) \
V(SharedFunctionInfo, async_generator_return_closed_reject_shared_fun, \
AsyncGeneratorReturnClosedRejectSharedFun) \
V(SharedFunctionInfo, async_generator_return_closed_resolve_shared_fun, \
AsyncGeneratorReturnClosedResolveSharedFun)
// These root references can be updated by the mutator.
#define STRONG_MUTABLE_MOVABLE_ROOT_LIST(V) \
......
......@@ -435,6 +435,14 @@ KNOWN_OBJECTS = {
("old_space", 0x009ed): "StringSplitCache",
("old_space", 0x00df5): "RegExpMultipleCache",
("old_space", 0x011fd): "BuiltinsConstantsTable",
("old_space", 0x015a1): "AsyncFunctionAwaitRejectSharedFun",
("old_space", 0x015c9): "AsyncFunctionAwaitResolveSharedFun",
("old_space", 0x015f1): "AsyncGeneratorAwaitRejectSharedFun",
("old_space", 0x01619): "AsyncGeneratorAwaitResolveSharedFun",
("old_space", 0x01641): "AsyncGeneratorYieldResolveSharedFun",
("old_space", 0x01669): "AsyncGeneratorReturnResolveSharedFun",
("old_space", 0x01691): "AsyncGeneratorReturnClosedRejectSharedFun",
("old_space", 0x016b9): "AsyncGeneratorReturnClosedResolveSharedFun",
}
# 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