• Seth Brenith's avatar
    Require the first three fields of ScopeInfo to be present · 2bbf3333
    Seth Brenith authored
    ScopeInfo objects generally start with three fields: flags, parameter
    count, and local variable count. But a single read-only ScopeInfo
    instance has none of those fields. This is the empty ScopeInfo, which is
    used for contexts that don't correspond to any scope (the native context
    and contexts for builtin functions). Since there is only ever a single
    instance of the empty ScopeInfo, the memory savings of omitting these
    fields is trivial, and we can simplify logic somewhat by including them.
    Rather than checking for length to be zero, this change introduces a new
    flag indicating that a ScopeInfo instance is the empty one.
    
    On its own, this change doesn't provide a whole lot of value. However,
    it sets us up for two further improvements, which are consistent with
    the goals outlined in [1]:
    
    1. We should fully describe ScopeInfo fields in Torque. Getting rid of
    the requirement to check for emptiness would substantially simplify the
    indexed field expressions.
    
    2. ScopeInfo shouldn't inherit from FixedArray, and shouldn't begin with
    a `length` field when the length can be computed from the other fields.
    This would save a small amount of heap memory and avoid any possibility
    of a mismatch between the two ways of computing the length.
    
    [1] https://docs.google.com/document/d/1tiGK7_lubxPHnInI2vscUwMHfadn8gIEa1apmI8HxR4/edit#heading=h.n63k76b3zfwa
    
    Bug: v8:8952
    Change-Id: I018127698a5d91fb2a91684bc3aec2e27ee27c41
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2561598Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
    Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
    Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
    Cr-Commit-Position: refs/heads/master@{#71500}
    2bbf3333
Name
Last commit
Last update
..
arm Loading commit data...
arm64 Loading commit data...
ia32 Loading commit data...
mips Loading commit data...
mips64 Loading commit data...
ppc Loading commit data...
s390 Loading commit data...
x64 Loading commit data...
DEPS Loading commit data...
OWNERS Loading commit data...
basic-block-profiler.cc Loading commit data...
basic-block-profiler.h Loading commit data...
code-tracer.h Loading commit data...
compilation-statistics.cc Loading commit data...
compilation-statistics.h Loading commit data...
disasm.h Loading commit data...
disassembler.cc Loading commit data...
disassembler.h Loading commit data...
eh-frame.cc Loading commit data...
eh-frame.h Loading commit data...
gdb-jit.cc Loading commit data...
gdb-jit.h Loading commit data...
objects-debug.cc Loading commit data...
objects-printer.cc Loading commit data...
perf-jit.cc Loading commit data...
perf-jit.h Loading commit data...
unwinder.cc Loading commit data...
unwinder.h Loading commit data...
unwinding-info-win64.cc Loading commit data...
unwinding-info-win64.h Loading commit data...