Skip to content

Commit c941f11

Browse files
LeszekSwirskiCommit Bot
authored andcommitted
[sfi] Remove SFI function identifier field
Remove the function identifier field from SharedFunctionInfo. This field would store one of a) the function's inferred name, b) the "builtin function id", or c) debug info. We remove these in turn: a) The function's inferred name is available on the ScopeInfo, so like the start/end position we read it off either the ScopeInfo (for compiled functions) or the UncompiledData (for uncompiled functions). As a side-effect, now both UncompiledData and its subclass, UncompiledDataWithPreparsedScope, contain a pointer field. To keep BodyDescriptors manageable, we introduce a SubclassBodyDescriptor which effectively appends two BodyDescriptors together. b) The builtin function id is < 255, so we can steal a byte from expected no. of properies (also <255) and store these together. Eventually we want to get rid of this field and use the builtin ID, but this is pending JS builtin removal. As a side-effect, BuiltinFunctionId becomes an enum class (for better storage size guarantees). c) The debug info can hang off anything (since it stores the field it replaces), so we can attach it to the script field instead. This saves a word on compiled function (uncompiled functions unfortunately still have to store it in UncompiledData). Bug: chromium:818642 Change-Id: I8b4b3a070f0fe328aafcaeac58842d144d12d996 Reviewed-on: https://chromium-review.googlesource.com/1138328 Reviewed-by: Yang Guo <yangguo@chromium.org> Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Reviewed-by: Camillo Bruni <cbruni@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Commit-Queue: Leszek Swirski <leszeks@chromium.org> Cr-Commit-Position: refs/heads/master@{#54543}
1 parent ac0c19b commit c941f11

23 files changed

+490
-398
lines changed

src/bootstrapper.cc

Lines changed: 54 additions & 44 deletions
Large diffs are not rendered by default.

src/builtins/builtins-internal-gen.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ TF_BUILTIN(DebugBreakTrampoline, CodeStubAssembler) {
185185
// Check break-at-entry flag on the debug info.
186186
TNode<SharedFunctionInfo> shared =
187187
CAST(LoadObjectField(function, JSFunction::kSharedFunctionInfoOffset));
188-
TNode<Object> maybe_heap_object_or_smi = LoadObjectField(
189-
shared, SharedFunctionInfo::kFunctionIdentifierOrDebugInfoOffset);
188+
TNode<Object> maybe_heap_object_or_smi =
189+
LoadObjectField(shared, SharedFunctionInfo::kScriptOrDebugInfoOffset);
190190
TNode<HeapObject> maybe_debug_info =
191191
TaggedToHeapObject(maybe_heap_object_or_smi, &tailcall_to_shared);
192192
GotoIfNot(HasInstanceType(maybe_debug_info, InstanceType::DEBUG_INFO_TYPE),

0 commit comments

Comments
 (0)