Commit 07dcc47a authored by Marja Hölttä's avatar Marja Hölttä Committed by Commit Bot

Move helper SFIs from NativeContext to Isolate, part 5

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

This CL moves the only remaining Proxy-related SFI.

Bug: v8:10482
Change-Id: I2f5e2d250c30f552787915d306c1be23b9d033bb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2196184Reviewed-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@{#67766}
parent ec839eb9
......@@ -76,8 +76,7 @@ TNode<JSFunction> ProxiesCodeStubAssembler::AllocateProxyRevokeFunction(
CreateProxyRevokeFunctionContext(proxy, native_context);
const TNode<Map> revoke_map = CAST(LoadContextElement(
native_context, Context::STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX));
const TNode<SharedFunctionInfo> revoke_info = CAST(
LoadContextElement(native_context, Context::PROXY_REVOKE_SHARED_FUN));
const TNode<SharedFunctionInfo> revoke_info = ProxyRevokeSharedFunConstant();
return AllocateFunctionWithMapAndContext(revoke_map, revoke_info,
proxy_context);
......
......@@ -97,6 +97,7 @@ enum class PrimitiveType { kBoolean, kNumber, kString, kSymbol };
PromiseThrowerFinallySharedFun) \
V(PromiseValueThunkFinallySharedFun, promise_value_thunk_finally_shared_fun, \
PromiseValueThunkFinallySharedFun) \
V(ProxyRevokeSharedFun, proxy_revoke_shared_fun, ProxyRevokeSharedFun) \
V(RegExpSpeciesProtector, regexp_species_protector, RegExpSpeciesProtector) \
V(SetIteratorProtector, set_iterator_protector, SetIteratorProtector) \
V(SingleCharacterStringCache, single_character_string_cache, \
......
......@@ -1113,6 +1113,13 @@ void Heap::CreateInitialObjects() {
isolate_, Builtins::kPromiseAnyRejectElementClosure, 1);
set_promise_any_reject_element_shared_fun(*info);
}
// ProxyRevoke:
{
Handle<SharedFunctionInfo> info =
CreateSharedFunctionInfo(isolate_, Builtins::kProxyRevoke, 0);
set_proxy_revoke_shared_fun(*info);
}
}
void Heap::CreateInternalAccessorInfoObjects() {
......
......@@ -368,19 +368,6 @@ void Bootstrapper::DetachGlobal(Handle<Context> env) {
namespace {
// FIXME(marja): Remove SimpleCreateSharedFunctionInfo 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) {
Handle<SharedFunctionInfo> shared =
isolate->factory()->NewSharedFunctionInfoForBuiltin(name, builtin_id,
kind);
shared->set_internal_formal_parameter_count(len);
shared->set_length(len);
return shared;
}
V8_NOINLINE Handle<JSFunction> CreateFunction(
Isolate* isolate, Handle<String> name, InstanceType type, int instance_size,
int inobject_properties, Handle<HeapObject> prototype,
......@@ -3608,12 +3595,6 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
SimpleInstallFunction(isolate_, proxy_function, "revocable",
Builtins::kProxyRevocable, 2, true);
{ // Internal: ProxyRevoke
Handle<SharedFunctionInfo> info = SimpleCreateSharedFunctionInfo(
isolate_, Builtins::kProxyRevoke, factory->empty_string(), 0);
native_context()->set_proxy_revoke_shared_fun(*info);
}
}
{ // -- R e f l e c t
......
......@@ -200,7 +200,6 @@ enum ContextLookupFlags {
V(PROXY_FUNCTION_INDEX, JSFunction, proxy_function) \
V(PROXY_MAP_INDEX, Map, proxy_map) \
V(PROXY_REVOCABLE_RESULT_MAP_INDEX, Map, proxy_revocable_result_map) \
V(PROXY_REVOKE_SHARED_FUN, SharedFunctionInfo, proxy_revoke_shared_fun) \
V(PROMISE_PROTOTYPE_INDEX, JSObject, promise_prototype) \
V(REGEXP_EXEC_FUNCTION_INDEX, JSFunction, regexp_exec_function) \
V(REGEXP_FUNCTION_INDEX, JSFunction, regexp_function) \
......
......@@ -273,7 +273,8 @@ class Symbol;
V(SharedFunctionInfo, promise_thrower_finally_shared_fun, \
PromiseThrowerFinallySharedFun) \
V(SharedFunctionInfo, promise_value_thunk_finally_shared_fun, \
PromiseValueThunkFinallySharedFun)
PromiseValueThunkFinallySharedFun) \
V(SharedFunctionInfo, proxy_revoke_shared_fun, ProxyRevokeSharedFun)
// These root references can be updated by the mutator.
#define STRONG_MUTABLE_MOVABLE_ROOT_LIST(V) \
......
......@@ -456,6 +456,7 @@ KNOWN_OBJECTS = {
("old_space", 0x01849): "PromiseThenFinallySharedFun",
("old_space", 0x01871): "PromiseThrowerFinallySharedFun",
("old_space", 0x01899): "PromiseValueThunkFinallySharedFun",
("old_space", 0x018c1): "ProxyRevokeSharedFun",
}
# 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