Skip to content

Commit 07dcc47

Browse files
marjakhCommit Bot
authored andcommitted
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/+/2196184 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Marja Hölttä <marja@chromium.org> Cr-Commit-Position: refs/heads/master@{#67766}
1 parent ec839eb commit 07dcc47

7 files changed

Lines changed: 12 additions & 23 deletions

File tree

src/builtins/builtins-proxy-gen.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ TNode<JSFunction> ProxiesCodeStubAssembler::AllocateProxyRevokeFunction(
7676
CreateProxyRevokeFunctionContext(proxy, native_context);
7777
const TNode<Map> revoke_map = CAST(LoadContextElement(
7878
native_context, Context::STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX));
79-
const TNode<SharedFunctionInfo> revoke_info = CAST(
80-
LoadContextElement(native_context, Context::PROXY_REVOKE_SHARED_FUN));
79+
const TNode<SharedFunctionInfo> revoke_info = ProxyRevokeSharedFunConstant();
8180

8281
return AllocateFunctionWithMapAndContext(revoke_map, revoke_info,
8382
proxy_context);

src/codegen/code-stub-assembler.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ enum class PrimitiveType { kBoolean, kNumber, kString, kSymbol };
9797
PromiseThrowerFinallySharedFun) \
9898
V(PromiseValueThunkFinallySharedFun, promise_value_thunk_finally_shared_fun, \
9999
PromiseValueThunkFinallySharedFun) \
100+
V(ProxyRevokeSharedFun, proxy_revoke_shared_fun, ProxyRevokeSharedFun) \
100101
V(RegExpSpeciesProtector, regexp_species_protector, RegExpSpeciesProtector) \
101102
V(SetIteratorProtector, set_iterator_protector, SetIteratorProtector) \
102103
V(SingleCharacterStringCache, single_character_string_cache, \

src/heap/setup-heap-internal.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,6 +1113,13 @@ void Heap::CreateInitialObjects() {
11131113
isolate_, Builtins::kPromiseAnyRejectElementClosure, 1);
11141114
set_promise_any_reject_element_shared_fun(*info);
11151115
}
1116+
1117+
// ProxyRevoke:
1118+
{
1119+
Handle<SharedFunctionInfo> info =
1120+
CreateSharedFunctionInfo(isolate_, Builtins::kProxyRevoke, 0);
1121+
set_proxy_revoke_shared_fun(*info);
1122+
}
11161123
}
11171124

11181125
void Heap::CreateInternalAccessorInfoObjects() {

src/init/bootstrapper.cc

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -368,19 +368,6 @@ void Bootstrapper::DetachGlobal(Handle<Context> env) {
368368

369369
namespace {
370370

371-
// FIXME(marja): Remove SimpleCreateSharedFunctionInfo when migration to
372-
// setup-heap-internal.cc is complete (see v8:10482).
373-
V8_NOINLINE Handle<SharedFunctionInfo> SimpleCreateSharedFunctionInfo(
374-
Isolate* isolate, Builtins::Name builtin_id, Handle<String> name, int len,
375-
FunctionKind kind = FunctionKind::kNormalFunction) {
376-
Handle<SharedFunctionInfo> shared =
377-
isolate->factory()->NewSharedFunctionInfoForBuiltin(name, builtin_id,
378-
kind);
379-
shared->set_internal_formal_parameter_count(len);
380-
shared->set_length(len);
381-
return shared;
382-
}
383-
384371
V8_NOINLINE Handle<JSFunction> CreateFunction(
385372
Isolate* isolate, Handle<String> name, InstanceType type, int instance_size,
386373
int inobject_properties, Handle<HeapObject> prototype,
@@ -3608,12 +3595,6 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
36083595

36093596
SimpleInstallFunction(isolate_, proxy_function, "revocable",
36103597
Builtins::kProxyRevocable, 2, true);
3611-
3612-
{ // Internal: ProxyRevoke
3613-
Handle<SharedFunctionInfo> info = SimpleCreateSharedFunctionInfo(
3614-
isolate_, Builtins::kProxyRevoke, factory->empty_string(), 0);
3615-
native_context()->set_proxy_revoke_shared_fun(*info);
3616-
}
36173598
}
36183599

36193600
{ // -- R e f l e c t

src/objects/contexts.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ enum ContextLookupFlags {
200200
V(PROXY_FUNCTION_INDEX, JSFunction, proxy_function) \
201201
V(PROXY_MAP_INDEX, Map, proxy_map) \
202202
V(PROXY_REVOCABLE_RESULT_MAP_INDEX, Map, proxy_revocable_result_map) \
203-
V(PROXY_REVOKE_SHARED_FUN, SharedFunctionInfo, proxy_revoke_shared_fun) \
204203
V(PROMISE_PROTOTYPE_INDEX, JSObject, promise_prototype) \
205204
V(REGEXP_EXEC_FUNCTION_INDEX, JSFunction, regexp_exec_function) \
206205
V(REGEXP_FUNCTION_INDEX, JSFunction, regexp_function) \

src/roots/roots.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,8 @@ class Symbol;
273273
V(SharedFunctionInfo, promise_thrower_finally_shared_fun, \
274274
PromiseThrowerFinallySharedFun) \
275275
V(SharedFunctionInfo, promise_value_thunk_finally_shared_fun, \
276-
PromiseValueThunkFinallySharedFun)
276+
PromiseValueThunkFinallySharedFun) \
277+
V(SharedFunctionInfo, proxy_revoke_shared_fun, ProxyRevokeSharedFun)
277278

278279
// These root references can be updated by the mutator.
279280
#define STRONG_MUTABLE_MOVABLE_ROOT_LIST(V) \

tools/v8heapconst.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@
456456
("old_space", 0x01849): "PromiseThenFinallySharedFun",
457457
("old_space", 0x01871): "PromiseThrowerFinallySharedFun",
458458
("old_space", 0x01899): "PromiseValueThunkFinallySharedFun",
459+
("old_space", 0x018c1): "ProxyRevokeSharedFun",
459460
}
460461

461462
# Lower 32 bits of first page addresses for various heap spaces.

0 commit comments

Comments
 (0)