Commit 6c2a1394 authored by Seth Brenith's avatar Seth Brenith Committed by Commit Bot

Use Torque-generated BodyDescriptor for ScopeInfo

With this change, the GC will compute the size for ScopeInfo instances
based on a combination of flags, context_local_count, and possibly
module_variable_count, rather than using the FixedArray-style length
field. After this change and a few more cleanups, we should be able to
remove that length field and save a few bytes.

Bug: v8:8952
Change-Id: Ica8e51ee106685b44fcc55556b4bb124afc91cfa
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2598461
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72231}
parent d37562e5
......@@ -43,7 +43,6 @@ namespace internal {
V(PropertyArray) \
V(PropertyCell) \
V(PrototypeInfo) \
V(ScopeInfo) \
V(SmallOrderedHashMap) \
V(SmallOrderedHashSet) \
V(SmallOrderedNameDictionary) \
......
......@@ -189,9 +189,6 @@ VisitorId Map::GetVisitorId(Map map) {
case MAP_TYPE:
return kVisitMap;
case SCOPE_INFO_TYPE:
return kVisitScopeInfo;
case CODE_TYPE:
return kVisitCode;
......
......@@ -58,7 +58,6 @@ enum InstanceType : uint16_t;
V(PropertyArray) \
V(PropertyCell) \
V(PrototypeInfo) \
V(ScopeInfo) \
V(ShortcutCandidate) \
V(SmallOrderedHashMap) \
V(SmallOrderedHashSet) \
......
......@@ -996,8 +996,6 @@ ReturnType BodyDescriptorApply(InstanceType type, T1 p1, T2 p2, T3 p3, T4 p4) {
case WASM_MODULE_OBJECT_TYPE:
case WASM_TABLE_OBJECT_TYPE:
return Op::template apply<JSObject::BodyDescriptor>(p1, p2, p3, p4);
case SCOPE_INFO_TYPE:
return Op::template apply<ScopeInfo::BodyDescriptor>(p1, p2, p3, p4);
case WASM_INSTANCE_OBJECT_TYPE:
return Op::template apply<WasmInstanceObject::BodyDescriptor>(p1, p2, p3,
p4);
......
......@@ -2298,9 +2298,6 @@ int HeapObject::SizeFromMap(Map map) const {
return FeedbackVector::SizeFor(
FeedbackVector::unchecked_cast(*this).length());
}
if (instance_type == SCOPE_INFO_TYPE) {
return FixedArray::SizeFor(ScopeInfo::unchecked_cast(*this).length());
}
if (instance_type == BIGINT_TYPE) {
return BigInt::SizeFor(BigInt::unchecked_cast(*this).length());
}
......
......@@ -58,7 +58,7 @@ class ScopeInfo : public TorqueGeneratedScopeInfo<ScopeInfo, FixedArrayBase> {
int src_index, int len, WriteBarrierMode mode);
inline ObjectSlot RawFieldOfElementAt(int index);
using BodyDescriptor = FlexibleBodyDescriptor<kHeaderSize>;
class BodyDescriptor;
// Return the type of this scope.
ScopeType scope_type() const;
......
......@@ -98,6 +98,7 @@ struct ModuleVariable {
}
@generateCppClass
@generateBodyDescriptor
extern class ScopeInfo extends FixedArrayBase {
const flags: SmiTagged<ScopeFlags>;
......
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