[parser] Make PreParsedScopeData array-like (reland)

Make PreParsedScopeData a new array-like instance type, which holds its
child data inline, rather than indirecting to a FixedArray. Should save
one map word per PreParsedScopeData.

Reland of https://chromium-review.googlesource.com/1127055, adding
padding clearing to keep MSAN happy.

TBR=jarin@chromium.org,marja@chromium.org,ulan@chromium.org

Bug: chromium:818642
Change-Id: I536db452047959e75d5116ddded4f511d05a04d9
Reviewed-on: https://chromium-review.googlesource.com/1131512
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54374}
This commit is contained in:
Leszek Swirski 2018-07-10 17:05:04 +01:00 committed by Commit Bot
parent c8354ae5e0
commit 1458c0882e
20 changed files with 310 additions and 197 deletions

View File

@ -34,57 +34,58 @@ enum class PrimitiveType { kBoolean, kNumber, kString, kSymbol };
TypedArraySpeciesProtector) \
V(StoreHandler0Map, store_handler0_map, StoreHandler0Map)
#define HEAP_IMMUTABLE_IMMOVABLE_OBJECT_LIST(V) \
V(AccessorInfoMap, accessor_info_map, AccessorInfoMap) \
V(AccessorPairMap, accessor_pair_map, AccessorPairMap) \
V(AllocationSiteWithWeakNextMap, allocation_site_map, AllocationSiteMap) \
V(AllocationSiteWithoutWeakNextMap, allocation_site_without_weaknext_map, \
AllocationSiteWithoutWeakNextMap) \
V(BooleanMap, boolean_map, BooleanMap) \
V(CodeMap, code_map, CodeMap) \
V(EmptyFixedArray, empty_fixed_array, EmptyFixedArray) \
V(EmptySlowElementDictionary, empty_slow_element_dictionary, \
EmptySlowElementDictionary) \
V(empty_string, empty_string, EmptyString) \
V(EmptyWeakCell, empty_weak_cell, EmptyWeakCell) \
V(FalseValue, false_value, False) \
V(FeedbackVectorMap, feedback_vector_map, FeedbackVectorMap) \
V(FixedArrayMap, fixed_array_map, FixedArrayMap) \
V(FixedCOWArrayMap, fixed_cow_array_map, FixedCOWArrayMap) \
V(FixedDoubleArrayMap, fixed_double_array_map, FixedDoubleArrayMap) \
V(FunctionTemplateInfoMap, function_template_info_map, \
FunctionTemplateInfoMap) \
V(GlobalPropertyCellMap, global_property_cell_map, PropertyCellMap) \
V(has_instance_symbol, has_instance_symbol, HasInstanceSymbol) \
V(HeapNumberMap, heap_number_map, HeapNumberMap) \
V(iterator_symbol, iterator_symbol, IteratorSymbol) \
V(length_string, length_string, LengthString) \
V(ManyClosuresCellMap, many_closures_cell_map, ManyClosuresCellMap) \
V(MetaMap, meta_map, MetaMap) \
V(MinusZeroValue, minus_zero_value, MinusZero) \
V(MutableHeapNumberMap, mutable_heap_number_map, MutableHeapNumberMap) \
V(NanValue, nan_value, Nan) \
V(NoClosuresCellMap, no_closures_cell_map, NoClosuresCellMap) \
V(NullValue, null_value, Null) \
V(OneClosureCellMap, one_closure_cell_map, OneClosureCellMap) \
V(prototype_string, prototype_string, PrototypeString) \
V(SharedFunctionInfoMap, shared_function_info_map, SharedFunctionInfoMap) \
V(SymbolMap, symbol_map, SymbolMap) \
V(TheHoleValue, the_hole_value, TheHole) \
V(TransitionArrayMap, transition_array_map, TransitionArrayMap) \
V(TrueValue, true_value, True) \
V(Tuple2Map, tuple2_map, Tuple2Map) \
V(Tuple3Map, tuple3_map, Tuple3Map) \
V(ArrayBoilerplateDescriptionMap, array_boilerplate_description_map, \
ArrayBoilerplateDescriptionMap) \
V(UncompiledDataWithoutPreParsedScopeMap, \
uncompiled_data_without_pre_parsed_scope_map, \
UncompiledDataWithoutPreParsedScopeMap) \
V(UncompiledDataWithPreParsedScopeMap, \
uncompiled_data_with_pre_parsed_scope_map, \
UncompiledDataWithPreParsedScopeMap) \
V(UndefinedValue, undefined_value, Undefined) \
V(WeakCellMap, weak_cell_map, WeakCellMap) \
#define HEAP_IMMUTABLE_IMMOVABLE_OBJECT_LIST(V) \
V(AccessorInfoMap, accessor_info_map, AccessorInfoMap) \
V(AccessorPairMap, accessor_pair_map, AccessorPairMap) \
V(AllocationSiteWithWeakNextMap, allocation_site_map, AllocationSiteMap) \
V(AllocationSiteWithoutWeakNextMap, allocation_site_without_weaknext_map, \
AllocationSiteWithoutWeakNextMap) \
V(BooleanMap, boolean_map, BooleanMap) \
V(CodeMap, code_map, CodeMap) \
V(EmptyFixedArray, empty_fixed_array, EmptyFixedArray) \
V(EmptySlowElementDictionary, empty_slow_element_dictionary, \
EmptySlowElementDictionary) \
V(empty_string, empty_string, EmptyString) \
V(EmptyWeakCell, empty_weak_cell, EmptyWeakCell) \
V(FalseValue, false_value, False) \
V(FeedbackVectorMap, feedback_vector_map, FeedbackVectorMap) \
V(FixedArrayMap, fixed_array_map, FixedArrayMap) \
V(FixedCOWArrayMap, fixed_cow_array_map, FixedCOWArrayMap) \
V(FixedDoubleArrayMap, fixed_double_array_map, FixedDoubleArrayMap) \
V(FunctionTemplateInfoMap, function_template_info_map, \
FunctionTemplateInfoMap) \
V(GlobalPropertyCellMap, global_property_cell_map, PropertyCellMap) \
V(has_instance_symbol, has_instance_symbol, HasInstanceSymbol) \
V(HeapNumberMap, heap_number_map, HeapNumberMap) \
V(iterator_symbol, iterator_symbol, IteratorSymbol) \
V(length_string, length_string, LengthString) \
V(ManyClosuresCellMap, many_closures_cell_map, ManyClosuresCellMap) \
V(MetaMap, meta_map, MetaMap) \
V(MinusZeroValue, minus_zero_value, MinusZero) \
V(MutableHeapNumberMap, mutable_heap_number_map, MutableHeapNumberMap) \
V(NanValue, nan_value, Nan) \
V(NoClosuresCellMap, no_closures_cell_map, NoClosuresCellMap) \
V(NullValue, null_value, Null) \
V(OneClosureCellMap, one_closure_cell_map, OneClosureCellMap) \
V(PreParsedScopeDataMap, pre_parsed_scope_data_map, PreParsedScopeDataMap) \
V(prototype_string, prototype_string, PrototypeString) \
V(SharedFunctionInfoMap, shared_function_info_map, SharedFunctionInfoMap) \
V(SymbolMap, symbol_map, SymbolMap) \
V(TheHoleValue, the_hole_value, TheHole) \
V(TransitionArrayMap, transition_array_map, TransitionArrayMap) \
V(TrueValue, true_value, True) \
V(Tuple2Map, tuple2_map, Tuple2Map) \
V(Tuple3Map, tuple3_map, Tuple3Map) \
V(ArrayBoilerplateDescriptionMap, array_boilerplate_description_map, \
ArrayBoilerplateDescriptionMap) \
V(UncompiledDataWithoutPreParsedScopeMap, \
uncompiled_data_without_pre_parsed_scope_map, \
UncompiledDataWithoutPreParsedScopeMap) \
V(UncompiledDataWithPreParsedScopeMap, \
uncompiled_data_with_pre_parsed_scope_map, \
UncompiledDataWithPreParsedScopeMap) \
V(UndefinedValue, undefined_value, Undefined) \
V(WeakCellMap, weak_cell_map, WeakCellMap) \
V(WeakFixedArrayMap, weak_fixed_array_map, WeakFixedArrayMap)
#define HEAP_IMMOVABLE_OBJECT_LIST(V) \

View File

@ -296,6 +296,7 @@ Type::bitset BitsetType::Lub(HeapObjectType const& type) {
case MODULE_TYPE:
case MODULE_INFO_ENTRY_TYPE:
case CELL_TYPE:
case PRE_PARSED_SCOPE_DATA_TYPE:
case UNCOMPILED_DATA_WITHOUT_PRE_PARSED_SCOPE_TYPE:
case UNCOMPILED_DATA_WITH_PRE_PARSED_SCOPE_TYPE:
return kOtherInternal;

View File

@ -2498,11 +2498,17 @@ Handle<ModuleInfo> Factory::NewModuleInfo() {
ModuleInfo::kLength, TENURED);
}
Handle<PreParsedScopeData> Factory::NewPreParsedScopeData() {
Handle<PreParsedScopeData> result =
Handle<PreParsedScopeData>::cast(NewStruct(TUPLE2_TYPE, TENURED));
Handle<PreParsedScopeData> Factory::NewPreParsedScopeData(int length) {
int size = PreParsedScopeData::SizeFor(length);
Handle<PreParsedScopeData> result(
PreParsedScopeData::cast(AllocateRawWithImmortalMap(
size, TENURED, *pre_parsed_scope_data_map())),
isolate());
result->set_scope_data(PodArray<uint8_t>::cast(*empty_byte_array()));
result->set_child_data(*empty_fixed_array());
result->set_length(length);
MemsetPointer(result->child_data_start(), *null_value(), length);
result->clear_padding();
return result;
}

View File

@ -724,7 +724,7 @@ class V8_EXPORT_PRIVATE Factory {
Handle<ModuleInfo> NewModuleInfo();
Handle<PreParsedScopeData> NewPreParsedScopeData();
Handle<PreParsedScopeData> NewPreParsedScopeData(int length);
Handle<UncompiledDataWithoutPreParsedScope>
NewUncompiledDataWithoutPreParsedScope(int32_t start_position,

View File

@ -129,6 +129,7 @@ using v8::MemoryPressureLevel;
V(OptimizedOut) \
V(OrderedHashMapMap) \
V(OrderedHashSetMap) \
V(PreParsedScopeDataMap) \
V(PropertyArrayMap) \
V(ScopeInfoMap) \
V(ScriptContextMap) \

View File

@ -48,6 +48,7 @@ class UncompiledDataWithPreParsedScope;
V(JSWeakCollection) \
V(Map) \
V(Oddball) \
V(PreParsedScopeData) \
V(PropertyArray) \
V(PropertyCell) \
V(PrototypeInfo) \

View File

@ -498,6 +498,7 @@ bool Heap::CreateInitialMaps() {
ALLOCATE_MAP(CALL_HANDLER_INFO_TYPE, CallHandlerInfo::kSize,
next_call_side_effect_free_call_handler_info)
ALLOCATE_VARSIZE_MAP(PRE_PARSED_SCOPE_DATA_TYPE, pre_parsed_scope_data)
ALLOCATE_MAP(UNCOMPILED_DATA_WITHOUT_PRE_PARSED_SCOPE_TYPE,
UncompiledDataWithoutPreParsedScope::kSize,
uncompiled_data_without_pre_parsed_scope)

View File

@ -388,6 +388,24 @@ class FeedbackVector::BodyDescriptor final : public BodyDescriptorBase {
}
};
class PreParsedScopeData::BodyDescriptor final : public BodyDescriptorBase {
public:
static bool IsValidSlot(Map* map, HeapObject* obj, int offset) {
return offset == kScopeDataOffset || offset >= kChildDataStartOffset;
}
template <typename ObjectVisitor>
static inline void IterateBody(Map* map, HeapObject* obj, int object_size,
ObjectVisitor* v) {
IteratePointer(obj, kScopeDataOffset, v);
IteratePointers(obj, kChildDataStartOffset, object_size, v);
}
static inline int SizeOf(Map* map, HeapObject* obj) {
return PreParsedScopeData::SizeFor(PreParsedScopeData::cast(obj)->length());
}
};
class PrototypeInfo::BodyDescriptor final : public BodyDescriptorBase {
public:
static bool IsValidSlot(Map* map, HeapObject* obj, int offset) {
@ -761,6 +779,9 @@ ReturnType BodyDescriptorApply(InstanceType type, T1 p1, T2 p2, T3 p3, T4 p4) {
case CODE_DATA_CONTAINER_TYPE:
return Op::template apply<CodeDataContainer::BodyDescriptor>(p1, p2, p3,
p4);
case PRE_PARSED_SCOPE_DATA_TYPE:
return Op::template apply<PreParsedScopeData::BodyDescriptor>(p1, p2, p3,
p4);
case UNCOMPILED_DATA_WITH_PRE_PARSED_SCOPE_TYPE:
return Op::template apply<
UncompiledDataWithPreParsedScope::BodyDescriptor>(p1, p2, p3, p4);

View File

@ -321,6 +321,9 @@ void HeapObject::HeapObjectVerify(Isolate* isolate) {
case FOREIGN_TYPE:
Foreign::cast(this)->ForeignVerify(isolate);
break;
case PRE_PARSED_SCOPE_DATA_TYPE:
PreParsedScopeData::cast(this)->PreParsedScopeDataVerify(isolate);
break;
case UNCOMPILED_DATA_WITHOUT_PRE_PARSED_SCOPE_TYPE:
UncompiledDataWithoutPreParsedScope::cast(this)
->UncompiledDataWithoutPreParsedScopeVerify(isolate);
@ -1789,7 +1792,13 @@ void StackFrameInfo::StackFrameInfoVerify(Isolate* isolate) {
void PreParsedScopeData::PreParsedScopeDataVerify(Isolate* isolate) {
CHECK(IsPreParsedScopeData());
CHECK(scope_data()->IsByteArray());
CHECK(child_data()->IsFixedArray());
CHECK_GE(length(), 0);
for (int i = 0; i < length(); ++i) {
Object* child = child_data(i);
CHECK(child->IsPreParsedScopeData() || child->IsNull());
VerifyPointer(child);
}
}
void UncompiledDataWithPreParsedScope::UncompiledDataWithPreParsedScopeVerify(

View File

@ -157,6 +157,7 @@ namespace internal {
V(FEEDBACK_CELL_TYPE) \
V(FEEDBACK_VECTOR_TYPE) \
V(LOAD_HANDLER_TYPE) \
V(PRE_PARSED_SCOPE_DATA_TYPE) \
V(PROPERTY_ARRAY_TYPE) \
V(PROPERTY_CELL_TYPE) \
V(SHARED_FUNCTION_INFO_TYPE) \

View File

@ -131,7 +131,7 @@ TYPE_CHECKER(NumberDictionary, NUMBER_DICTIONARY_TYPE)
TYPE_CHECKER(Oddball, ODDBALL_TYPE)
TYPE_CHECKER(OrderedHashMap, ORDERED_HASH_MAP_TYPE)
TYPE_CHECKER(OrderedHashSet, ORDERED_HASH_SET_TYPE)
TYPE_CHECKER(PreParsedScopeData, TUPLE2_TYPE)
TYPE_CHECKER(PreParsedScopeData, PRE_PARSED_SCOPE_DATA_TYPE)
TYPE_CHECKER(PropertyArray, PROPERTY_ARRAY_TYPE)
TYPE_CHECKER(PropertyCell, PROPERTY_CELL_TYPE)
TYPE_CHECKER(PropertyDescriptorObject, FIXED_ARRAY_TYPE)
@ -2367,6 +2367,10 @@ int HeapObject::SizeFromMap(Map* map) const {
if (instance_type == BIGINT_TYPE) {
return BigInt::SizeFor(reinterpret_cast<const BigInt*>(this)->length());
}
if (instance_type == PRE_PARSED_SCOPE_DATA_TYPE) {
return PreParsedScopeData::SizeFor(
reinterpret_cast<const PreParsedScopeData*>(this)->length());
}
DCHECK(instance_type == CODE_TYPE);
return reinterpret_cast<const Code*>(this)->CodeSize();
}

View File

@ -265,6 +265,9 @@ void HeapObject::HeapObjectPrint(Isolate* isolate,
case CALL_HANDLER_INFO_TYPE:
CallHandlerInfo::cast(this)->CallHandlerInfoPrint(os);
break;
case PRE_PARSED_SCOPE_DATA_TYPE:
PreParsedScopeData::cast(this)->PreParsedScopeDataPrint(os);
break;
case UNCOMPILED_DATA_WITHOUT_PRE_PARSED_SCOPE_TYPE:
UncompiledDataWithoutPreParsedScope::cast(this)
->UncompiledDataWithoutPreParsedScopePrint(os);
@ -2127,7 +2130,10 @@ void LayoutDescriptor::Print(std::ostream& os) { // NOLINT
void PreParsedScopeData::PreParsedScopeDataPrint(std::ostream& os) { // NOLINT
HeapObject::PrintHeader(os, "PreParsedScopeData");
os << "\n - scope_data: " << Brief(scope_data());
os << "\n - child_data: " << Brief(child_data());
os << "\n - length: " << length();
for (int i = 0; i < length(); ++i) {
os << "\n - [" << i << "]: " << Brief(child_data(i));
}
os << "\n";
}

View File

@ -3104,6 +3104,9 @@ VisitorId Map::GetVisitorId(Map* map) {
case WASM_INSTANCE_TYPE:
return kVisitWasmInstanceObject;
case PRE_PARSED_SCOPE_DATA_TYPE:
return kVisitPreParsedScopeData;
case UNCOMPILED_DATA_WITH_PRE_PARSED_SCOPE_TYPE:
return kVisitUncompiledDataWithPreParsedScope;
@ -3435,6 +3438,12 @@ void HeapObject::HeapObjectShortPrint(std::ostream& os) { // NOLINT
TYPED_ARRAYS(TYPED_ARRAY_SHORT_PRINT)
#undef TYPED_ARRAY_SHORT_PRINT
case PRE_PARSED_SCOPE_DATA_TYPE: {
PreParsedScopeData* data = PreParsedScopeData::cast(this);
os << "<PreParsedScopeData[" << data->length() << "]>";
break;
}
case UNCOMPILED_DATA_WITHOUT_PRE_PARSED_SCOPE_TYPE: {
UncompiledDataWithoutPreParsedScope* data =
UncompiledDataWithoutPreParsedScope::cast(this);

View File

@ -170,10 +170,10 @@
// - PromiseResolveThenableJobTask
// - Module
// - ModuleInfoEntry
// - PreParsedScopeData
// - WeakCell
// - FeedbackCell
// - FeedbackVector
// - PreParsedScopeData
// - UncompiledData
// - UncompiledDataWithoutPreParsedScope
// - UncompiledDataWithPreParsedScope
@ -523,6 +523,7 @@ enum InstanceType : uint16_t {
FEEDBACK_CELL_TYPE,
FEEDBACK_VECTOR_TYPE,
LOAD_HANDLER_TYPE,
PRE_PARSED_SCOPE_DATA_TYPE,
PROPERTY_ARRAY_TYPE,
PROPERTY_CELL_TYPE,
SHARED_FUNCTION_INFO_TYPE,
@ -706,6 +707,7 @@ class ModuleInfoEntry;
class ObjectHashTable;
class ObjectTemplateInfo;
class ObjectVisitor;
class PreParsedScopeData;
class PropertyCell;
class PropertyDescriptor;
class RootVisitor;

View File

@ -44,6 +44,7 @@ namespace internal {
V(Map) \
V(NativeContext) \
V(Oddball) \
V(PreParsedScopeData) \
V(PropertyArray) \
V(PropertyCell) \
V(PrototypeInfo) \

View File

@ -20,7 +20,37 @@ namespace internal {
CAST_ACCESSOR(PreParsedScopeData)
ACCESSORS(PreParsedScopeData, scope_data, PodArray<uint8_t>, kScopeDataOffset)
ACCESSORS(PreParsedScopeData, child_data, FixedArray, kChildDataOffset)
INT_ACCESSORS(PreParsedScopeData, length, kLengthOffset)
Object* PreParsedScopeData::child_data(int index) const {
DCHECK_GE(index, 0);
DCHECK_LT(index, this->length());
int offset = kChildDataStartOffset + index * kPointerSize;
return RELAXED_READ_FIELD(this, offset);
}
void PreParsedScopeData::set_child_data(int index, Object* value,
WriteBarrierMode mode) {
DCHECK_GE(index, 0);
DCHECK_LT(index, this->length());
int offset = kChildDataStartOffset + index * kPointerSize;
RELAXED_WRITE_FIELD(this, offset, value);
CONDITIONAL_WRITE_BARRIER(Heap::FromWritableHeapObject(this), this, offset,
value, mode);
}
Object** PreParsedScopeData::child_data_start() const {
return HeapObject::RawField(this, kChildDataStartOffset);
}
void PreParsedScopeData::clear_padding() {
// For archs where kIntSize < kPointerSize, there will be padding between the
// length field and the start of the child data.
if (kUnalignedChildDataStartOffset < kChildDataStartOffset) {
memset(reinterpret_cast<void*>(address() + kUnalignedChildDataStartOffset),
0, kChildDataStartOffset - kUnalignedChildDataStartOffset);
}
}
CAST_ACCESSOR(UncompiledData)
INT32_ACCESSORS(UncompiledData, start_position, kStartPositionOffset)

View File

@ -22,19 +22,44 @@ class WasmExportedFunctionData;
// Data collected by the pre-parser storing information about scopes and inner
// functions.
class PreParsedScopeData : public Struct {
class PreParsedScopeData : public HeapObject {
public:
DECL_ACCESSORS(scope_data, PodArray<uint8_t>)
DECL_ACCESSORS(child_data, FixedArray)
DECL_INT_ACCESSORS(length)
static const int kScopeDataOffset = Struct::kHeaderSize;
static const int kChildDataOffset = kScopeDataOffset + kPointerSize;
static const int kSize = kChildDataOffset + kPointerSize;
inline Object* child_data(int index) const;
inline void set_child_data(int index, Object* value,
WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
inline Object** child_data_start() const;
// Clear uninitialized padding space.
inline void clear_padding();
DECL_CAST(PreParsedScopeData)
DECL_PRINTER(PreParsedScopeData)
DECL_VERIFIER(PreParsedScopeData)
#define PRE_PARSED_SCOPE_DATA_FIELDS(V) \
V(kScopeDataOffset, kPointerSize) \
V(kLengthOffset, kIntSize) \
V(kUnalignedChildDataStartOffset, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize,
PRE_PARSED_SCOPE_DATA_FIELDS)
#undef PRE_PARSED_SCOPE_DATA_FIELDS
static const int kChildDataStartOffset =
POINTER_SIZE_ALIGN(kUnalignedChildDataStartOffset);
class BodyDescriptor;
// No weak fields.
typedef BodyDescriptor BodyDescriptorWeak;
static constexpr int SizeFor(int length) {
return kChildDataStartOffset + length * kPointerSize;
}
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(PreParsedScopeData);
};

View File

@ -292,30 +292,22 @@ MaybeHandle<PreParsedScopeData> ProducedPreParsedScopeData::Serialize(
return MaybeHandle<PreParsedScopeData>();
}
Handle<PreParsedScopeData> data = isolate->factory()->NewPreParsedScopeData();
int child_data_length = static_cast<int>(data_for_inner_functions_.size());
Handle<PreParsedScopeData> data =
isolate->factory()->NewPreParsedScopeData(child_data_length);
Handle<PodArray<uint8_t>> scope_data_array = byte_data_->Serialize(isolate);
data->set_scope_data(*scope_data_array);
int child_data_length = static_cast<int>(data_for_inner_functions_.size());
if (child_data_length == 0) {
data->set_child_data(*(isolate->factory()->empty_fixed_array()));
} else {
Handle<FixedArray> child_array =
isolate->factory()->NewFixedArray(child_data_length, TENURED);
int i = 0;
for (const auto& item : data_for_inner_functions_) {
MaybeHandle<PreParsedScopeData> maybe_child_data =
item->Serialize(isolate);
if (maybe_child_data.is_null()) {
child_array->set(i++, *(isolate->factory()->null_value()));
} else {
Handle<PreParsedScopeData> child_data =
maybe_child_data.ToHandleChecked();
child_array->set(i++, *child_data);
}
int i = 0;
for (const auto& item : data_for_inner_functions_) {
Handle<PreParsedScopeData> child_data;
if (item->Serialize(isolate).ToHandle(&child_data)) {
data->set_child_data(i, *child_data);
} else {
DCHECK(data->child_data(i)->IsNull());
}
data->set_child_data(*child_array);
i++;
}
return data;
@ -525,9 +517,8 @@ ConsumedPreParsedScopeData::GetDataForSkippableFunction(
// Retrieve the corresponding PreParsedScopeData and associate it to the
// skipped function. If the skipped functions contains inner functions, those
// can be skipped when the skipped function is eagerly parsed.
FixedArray* children = data_->child_data();
CHECK_GT(children->length(), child_index_);
Object* child_data = children->get(child_index_++);
CHECK_GT(data_->length(), child_index_);
Object* child_data = data_->child_data(child_index_++);
if (!child_data->IsPreParsedScopeData()) {
return nullptr;
}

View File

@ -89,6 +89,7 @@ namespace internal {
V(Map, one_closure_cell_map, OneClosureCellMap) \
V(Map, ordered_hash_map_map, OrderedHashMapMap) \
V(Map, ordered_hash_set_map, OrderedHashSetMap) \
V(Map, pre_parsed_scope_data_map, PreParsedScopeDataMap) \
V(Map, property_array_map, PropertyArrayMap) \
V(Map, side_effect_call_handler_info_map, SideEffectCallHandlerInfoMap) \
V(Map, side_effect_free_call_handler_info_map, \

View File

@ -114,16 +114,17 @@ INSTANCE_TYPES = {
210: "FEEDBACK_CELL_TYPE",
211: "FEEDBACK_VECTOR_TYPE",
212: "LOAD_HANDLER_TYPE",
213: "PROPERTY_ARRAY_TYPE",
214: "PROPERTY_CELL_TYPE",
215: "SHARED_FUNCTION_INFO_TYPE",
216: "SMALL_ORDERED_HASH_MAP_TYPE",
217: "SMALL_ORDERED_HASH_SET_TYPE",
218: "STORE_HANDLER_TYPE",
219: "UNCOMPILED_DATA_WITHOUT_PRE_PARSED_SCOPE_TYPE",
220: "UNCOMPILED_DATA_WITH_PRE_PARSED_SCOPE_TYPE",
221: "WEAK_CELL_TYPE",
222: "WEAK_ARRAY_LIST_TYPE",
213: "PRE_PARSED_SCOPE_DATA_TYPE",
214: "PROPERTY_ARRAY_TYPE",
215: "PROPERTY_CELL_TYPE",
216: "SHARED_FUNCTION_INFO_TYPE",
217: "SMALL_ORDERED_HASH_MAP_TYPE",
218: "SMALL_ORDERED_HASH_SET_TYPE",
219: "STORE_HANDLER_TYPE",
220: "UNCOMPILED_DATA_WITHOUT_PRE_PARSED_SCOPE_TYPE",
221: "UNCOMPILED_DATA_WITH_PRE_PARSED_SCOPE_TYPE",
222: "WEAK_CELL_TYPE",
223: "WEAK_ARRAY_LIST_TYPE",
1024: "JS_PROXY_TYPE",
1025: "JS_GLOBAL_OBJECT_TYPE",
1026: "JS_GLOBAL_PROXY_TYPE",
@ -176,7 +177,7 @@ KNOWN_MAPS = {
("RO_SPACE", 0x022e1): (131, "NullMap"),
("RO_SPACE", 0x02359): (205, "DescriptorArrayMap"),
("RO_SPACE", 0x023c1): (182, "FixedArrayMap"),
("RO_SPACE", 0x02429): (221, "WeakCellMap"),
("RO_SPACE", 0x02429): (222, "WeakCellMap"),
("RO_SPACE", 0x024d1): (152, "OnePointerFillerMap"),
("RO_SPACE", 0x02539): (152, "TwoPointerFillerMap"),
("RO_SPACE", 0x025d1): (131, "UninitializedMap"),
@ -191,11 +192,11 @@ KNOWN_MAPS = {
("RO_SPACE", 0x02b41): (128, "SymbolMap"),
("RO_SPACE", 0x02ba9): (72, "OneByteStringMap"),
("RO_SPACE", 0x02c11): (193, "ScopeInfoMap"),
("RO_SPACE", 0x02c79): (215, "SharedFunctionInfoMap"),
("RO_SPACE", 0x02c79): (216, "SharedFunctionInfoMap"),
("RO_SPACE", 0x02ce1): (133, "CodeMap"),
("RO_SPACE", 0x02d49): (199, "FunctionContextMap"),
("RO_SPACE", 0x02db1): (208, "CellMap"),
("RO_SPACE", 0x02e19): (214, "GlobalPropertyCellMap"),
("RO_SPACE", 0x02e19): (215, "GlobalPropertyCellMap"),
("RO_SPACE", 0x02e81): (135, "ForeignMap"),
("RO_SPACE", 0x02ee9): (206, "TransitionArrayMap"),
("RO_SPACE", 0x02f51): (211, "FeedbackVectorMap"),
@ -230,83 +231,84 @@ KNOWN_MAPS = {
("RO_SPACE", 0x03ce9): (210, "OneClosureCellMap"),
("RO_SPACE", 0x03d51): (185, "OrderedHashMapMap"),
("RO_SPACE", 0x03db9): (186, "OrderedHashSetMap"),
("RO_SPACE", 0x03e21): (213, "PropertyArrayMap"),
("RO_SPACE", 0x03e89): (207, "SideEffectCallHandlerInfoMap"),
("RO_SPACE", 0x03ef1): (207, "SideEffectFreeCallHandlerInfoMap"),
("RO_SPACE", 0x03f59): (207, "NextCallSideEffectFreeCallHandlerInfoMap"),
("RO_SPACE", 0x03fc1): (190, "SimpleNumberDictionaryMap"),
("RO_SPACE", 0x04029): (182, "SloppyArgumentsElementsMap"),
("RO_SPACE", 0x04091): (216, "SmallOrderedHashMapMap"),
("RO_SPACE", 0x040f9): (217, "SmallOrderedHashSetMap"),
("RO_SPACE", 0x04161): (191, "StringTableMap"),
("RO_SPACE", 0x041c9): (219, "UncompiledDataWithoutPreParsedScopeMap"),
("RO_SPACE", 0x04231): (220, "UncompiledDataWithPreParsedScopeMap"),
("RO_SPACE", 0x04299): (204, "WeakFixedArrayMap"),
("RO_SPACE", 0x04301): (222, "WeakArrayListMap"),
("RO_SPACE", 0x04369): (192, "EphemeronHashTableMap"),
("RO_SPACE", 0x043d1): (106, "NativeSourceStringMap"),
("RO_SPACE", 0x04439): (64, "StringMap"),
("RO_SPACE", 0x044a1): (73, "ConsOneByteStringMap"),
("RO_SPACE", 0x04509): (65, "ConsStringMap"),
("RO_SPACE", 0x04571): (77, "ThinOneByteStringMap"),
("RO_SPACE", 0x045d9): (69, "ThinStringMap"),
("RO_SPACE", 0x04641): (67, "SlicedStringMap"),
("RO_SPACE", 0x046a9): (75, "SlicedOneByteStringMap"),
("RO_SPACE", 0x04711): (66, "ExternalStringMap"),
("RO_SPACE", 0x04779): (82, "ExternalStringWithOneByteDataMap"),
("RO_SPACE", 0x047e1): (74, "ExternalOneByteStringMap"),
("RO_SPACE", 0x04849): (98, "ShortExternalStringMap"),
("RO_SPACE", 0x048b1): (114, "ShortExternalStringWithOneByteDataMap"),
("RO_SPACE", 0x04919): (0, "InternalizedStringMap"),
("RO_SPACE", 0x04981): (2, "ExternalInternalizedStringMap"),
("RO_SPACE", 0x049e9): (18, "ExternalInternalizedStringWithOneByteDataMap"),
("RO_SPACE", 0x04a51): (10, "ExternalOneByteInternalizedStringMap"),
("RO_SPACE", 0x04ab9): (34, "ShortExternalInternalizedStringMap"),
("RO_SPACE", 0x04b21): (50, "ShortExternalInternalizedStringWithOneByteDataMap"),
("RO_SPACE", 0x04b89): (42, "ShortExternalOneByteInternalizedStringMap"),
("RO_SPACE", 0x04bf1): (106, "ShortExternalOneByteStringMap"),
("RO_SPACE", 0x04c59): (140, "FixedUint8ArrayMap"),
("RO_SPACE", 0x04cc1): (139, "FixedInt8ArrayMap"),
("RO_SPACE", 0x04d29): (142, "FixedUint16ArrayMap"),
("RO_SPACE", 0x04d91): (141, "FixedInt16ArrayMap"),
("RO_SPACE", 0x04df9): (144, "FixedUint32ArrayMap"),
("RO_SPACE", 0x04e61): (143, "FixedInt32ArrayMap"),
("RO_SPACE", 0x04ec9): (145, "FixedFloat32ArrayMap"),
("RO_SPACE", 0x04f31): (146, "FixedFloat64ArrayMap"),
("RO_SPACE", 0x04f99): (147, "FixedUint8ClampedArrayMap"),
("RO_SPACE", 0x05001): (149, "FixedBigUint64ArrayMap"),
("RO_SPACE", 0x05069): (148, "FixedBigInt64ArrayMap"),
("RO_SPACE", 0x050d1): (131, "SelfReferenceMarkerMap"),
("RO_SPACE", 0x05151): (171, "Tuple2Map"),
("RO_SPACE", 0x054a1): (161, "InterceptorInfoMap"),
("RO_SPACE", 0x055c1): (169, "ScriptMap"),
("RO_SPACE", 0x09fb9): (154, "AccessorInfoMap"),
("RO_SPACE", 0x0a021): (153, "AccessCheckInfoMap"),
("RO_SPACE", 0x0a089): (155, "AccessorPairMap"),
("RO_SPACE", 0x0a0f1): (156, "AliasedArgumentsEntryMap"),
("RO_SPACE", 0x0a159): (157, "AllocationMementoMap"),
("RO_SPACE", 0x0a1c1): (158, "AsyncGeneratorRequestMap"),
("RO_SPACE", 0x0a229): (159, "DebugInfoMap"),
("RO_SPACE", 0x0a291): (160, "FunctionTemplateInfoMap"),
("RO_SPACE", 0x0a2f9): (162, "InterpreterDataMap"),
("RO_SPACE", 0x0a361): (163, "ModuleInfoEntryMap"),
("RO_SPACE", 0x0a3c9): (164, "ModuleMap"),
("RO_SPACE", 0x0a431): (165, "ObjectTemplateInfoMap"),
("RO_SPACE", 0x0a499): (166, "PromiseCapabilityMap"),
("RO_SPACE", 0x0a501): (167, "PromiseReactionMap"),
("RO_SPACE", 0x0a569): (168, "PrototypeInfoMap"),
("RO_SPACE", 0x0a5d1): (170, "StackFrameInfoMap"),
("RO_SPACE", 0x0a639): (172, "Tuple3Map"),
("RO_SPACE", 0x0a6a1): (173, "ArrayBoilerplateDescriptionMap"),
("RO_SPACE", 0x0a709): (174, "WasmDebugInfoMap"),
("RO_SPACE", 0x0a771): (175, "WasmExportedFunctionDataMap"),
("RO_SPACE", 0x0a7d9): (176, "CallableTaskMap"),
("RO_SPACE", 0x0a841): (177, "CallbackTaskMap"),
("RO_SPACE", 0x0a8a9): (178, "PromiseFulfillReactionJobTaskMap"),
("RO_SPACE", 0x0a911): (179, "PromiseRejectReactionJobTaskMap"),
("RO_SPACE", 0x0a979): (180, "PromiseResolveThenableJobTaskMap"),
("RO_SPACE", 0x0a9e1): (181, "AllocationSiteMap"),
("RO_SPACE", 0x03e21): (213, "PreParsedScopeDataMap"),
("RO_SPACE", 0x03e89): (214, "PropertyArrayMap"),
("RO_SPACE", 0x03ef1): (207, "SideEffectCallHandlerInfoMap"),
("RO_SPACE", 0x03f59): (207, "SideEffectFreeCallHandlerInfoMap"),
("RO_SPACE", 0x03fc1): (207, "NextCallSideEffectFreeCallHandlerInfoMap"),
("RO_SPACE", 0x04029): (190, "SimpleNumberDictionaryMap"),
("RO_SPACE", 0x04091): (182, "SloppyArgumentsElementsMap"),
("RO_SPACE", 0x040f9): (217, "SmallOrderedHashMapMap"),
("RO_SPACE", 0x04161): (218, "SmallOrderedHashSetMap"),
("RO_SPACE", 0x041c9): (191, "StringTableMap"),
("RO_SPACE", 0x04231): (220, "UncompiledDataWithoutPreParsedScopeMap"),
("RO_SPACE", 0x04299): (221, "UncompiledDataWithPreParsedScopeMap"),
("RO_SPACE", 0x04301): (204, "WeakFixedArrayMap"),
("RO_SPACE", 0x04369): (223, "WeakArrayListMap"),
("RO_SPACE", 0x043d1): (192, "EphemeronHashTableMap"),
("RO_SPACE", 0x04439): (106, "NativeSourceStringMap"),
("RO_SPACE", 0x044a1): (64, "StringMap"),
("RO_SPACE", 0x04509): (73, "ConsOneByteStringMap"),
("RO_SPACE", 0x04571): (65, "ConsStringMap"),
("RO_SPACE", 0x045d9): (77, "ThinOneByteStringMap"),
("RO_SPACE", 0x04641): (69, "ThinStringMap"),
("RO_SPACE", 0x046a9): (67, "SlicedStringMap"),
("RO_SPACE", 0x04711): (75, "SlicedOneByteStringMap"),
("RO_SPACE", 0x04779): (66, "ExternalStringMap"),
("RO_SPACE", 0x047e1): (82, "ExternalStringWithOneByteDataMap"),
("RO_SPACE", 0x04849): (74, "ExternalOneByteStringMap"),
("RO_SPACE", 0x048b1): (98, "ShortExternalStringMap"),
("RO_SPACE", 0x04919): (114, "ShortExternalStringWithOneByteDataMap"),
("RO_SPACE", 0x04981): (0, "InternalizedStringMap"),
("RO_SPACE", 0x049e9): (2, "ExternalInternalizedStringMap"),
("RO_SPACE", 0x04a51): (18, "ExternalInternalizedStringWithOneByteDataMap"),
("RO_SPACE", 0x04ab9): (10, "ExternalOneByteInternalizedStringMap"),
("RO_SPACE", 0x04b21): (34, "ShortExternalInternalizedStringMap"),
("RO_SPACE", 0x04b89): (50, "ShortExternalInternalizedStringWithOneByteDataMap"),
("RO_SPACE", 0x04bf1): (42, "ShortExternalOneByteInternalizedStringMap"),
("RO_SPACE", 0x04c59): (106, "ShortExternalOneByteStringMap"),
("RO_SPACE", 0x04cc1): (140, "FixedUint8ArrayMap"),
("RO_SPACE", 0x04d29): (139, "FixedInt8ArrayMap"),
("RO_SPACE", 0x04d91): (142, "FixedUint16ArrayMap"),
("RO_SPACE", 0x04df9): (141, "FixedInt16ArrayMap"),
("RO_SPACE", 0x04e61): (144, "FixedUint32ArrayMap"),
("RO_SPACE", 0x04ec9): (143, "FixedInt32ArrayMap"),
("RO_SPACE", 0x04f31): (145, "FixedFloat32ArrayMap"),
("RO_SPACE", 0x04f99): (146, "FixedFloat64ArrayMap"),
("RO_SPACE", 0x05001): (147, "FixedUint8ClampedArrayMap"),
("RO_SPACE", 0x05069): (149, "FixedBigUint64ArrayMap"),
("RO_SPACE", 0x050d1): (148, "FixedBigInt64ArrayMap"),
("RO_SPACE", 0x05139): (131, "SelfReferenceMarkerMap"),
("RO_SPACE", 0x051b9): (171, "Tuple2Map"),
("RO_SPACE", 0x05509): (161, "InterceptorInfoMap"),
("RO_SPACE", 0x05629): (169, "ScriptMap"),
("RO_SPACE", 0x0a021): (154, "AccessorInfoMap"),
("RO_SPACE", 0x0a089): (153, "AccessCheckInfoMap"),
("RO_SPACE", 0x0a0f1): (155, "AccessorPairMap"),
("RO_SPACE", 0x0a159): (156, "AliasedArgumentsEntryMap"),
("RO_SPACE", 0x0a1c1): (157, "AllocationMementoMap"),
("RO_SPACE", 0x0a229): (158, "AsyncGeneratorRequestMap"),
("RO_SPACE", 0x0a291): (159, "DebugInfoMap"),
("RO_SPACE", 0x0a2f9): (160, "FunctionTemplateInfoMap"),
("RO_SPACE", 0x0a361): (162, "InterpreterDataMap"),
("RO_SPACE", 0x0a3c9): (163, "ModuleInfoEntryMap"),
("RO_SPACE", 0x0a431): (164, "ModuleMap"),
("RO_SPACE", 0x0a499): (165, "ObjectTemplateInfoMap"),
("RO_SPACE", 0x0a501): (166, "PromiseCapabilityMap"),
("RO_SPACE", 0x0a569): (167, "PromiseReactionMap"),
("RO_SPACE", 0x0a5d1): (168, "PrototypeInfoMap"),
("RO_SPACE", 0x0a639): (170, "StackFrameInfoMap"),
("RO_SPACE", 0x0a6a1): (172, "Tuple3Map"),
("RO_SPACE", 0x0a709): (173, "ArrayBoilerplateDescriptionMap"),
("RO_SPACE", 0x0a771): (174, "WasmDebugInfoMap"),
("RO_SPACE", 0x0a7d9): (175, "WasmExportedFunctionDataMap"),
("RO_SPACE", 0x0a841): (176, "CallableTaskMap"),
("RO_SPACE", 0x0a8a9): (177, "CallbackTaskMap"),
("RO_SPACE", 0x0a911): (178, "PromiseFulfillReactionJobTaskMap"),
("RO_SPACE", 0x0a979): (179, "PromiseRejectReactionJobTaskMap"),
("RO_SPACE", 0x0a9e1): (180, "PromiseResolveThenableJobTaskMap"),
("RO_SPACE", 0x0aa49): (181, "AllocationSiteMap"),
("RO_SPACE", 0x0aab1): (181, "AllocationSiteMap"),
("MAP_SPACE", 0x02201): (1057, "ExternalMap"),
("MAP_SPACE", 0x02259): (1072, "JSMessageObjectMap"),
}
@ -330,26 +332,26 @@ KNOWN_OBJECTS = {
("RO_SPACE", 0x03149): "TerminationException",
("RO_SPACE", 0x03211): "OptimizedOut",
("RO_SPACE", 0x032d1): "StaleRegister",
("RO_SPACE", 0x051c9): "EmptyByteArray",
("RO_SPACE", 0x051f1): "EmptyFixedUint8Array",
("RO_SPACE", 0x05211): "EmptyFixedInt8Array",
("RO_SPACE", 0x05231): "EmptyFixedUint16Array",
("RO_SPACE", 0x05251): "EmptyFixedInt16Array",
("RO_SPACE", 0x05271): "EmptyFixedUint32Array",
("RO_SPACE", 0x05291): "EmptyFixedInt32Array",
("RO_SPACE", 0x052b1): "EmptyFixedFloat32Array",
("RO_SPACE", 0x052d1): "EmptyFixedFloat64Array",
("RO_SPACE", 0x052f1): "EmptyFixedUint8ClampedArray",
("RO_SPACE", 0x05351): "EmptySloppyArgumentsElements",
("RO_SPACE", 0x05371): "EmptySlowElementDictionary",
("RO_SPACE", 0x053b9): "EmptyOrderedHashMap",
("RO_SPACE", 0x053e1): "EmptyOrderedHashSet",
("RO_SPACE", 0x05419): "EmptyPropertyCell",
("RO_SPACE", 0x05441): "EmptyWeakCell",
("RO_SPACE", 0x05531): "InfinityValue",
("RO_SPACE", 0x05541): "MinusZeroValue",
("RO_SPACE", 0x05551): "MinusInfinityValue",
("RO_SPACE", 0x05561): "SelfReferenceMarker",
("RO_SPACE", 0x05231): "EmptyByteArray",
("RO_SPACE", 0x05259): "EmptyFixedUint8Array",
("RO_SPACE", 0x05279): "EmptyFixedInt8Array",
("RO_SPACE", 0x05299): "EmptyFixedUint16Array",
("RO_SPACE", 0x052b9): "EmptyFixedInt16Array",
("RO_SPACE", 0x052d9): "EmptyFixedUint32Array",
("RO_SPACE", 0x052f9): "EmptyFixedInt32Array",
("RO_SPACE", 0x05319): "EmptyFixedFloat32Array",
("RO_SPACE", 0x05339): "EmptyFixedFloat64Array",
("RO_SPACE", 0x05359): "EmptyFixedUint8ClampedArray",
("RO_SPACE", 0x053b9): "EmptySloppyArgumentsElements",
("RO_SPACE", 0x053d9): "EmptySlowElementDictionary",
("RO_SPACE", 0x05421): "EmptyOrderedHashMap",
("RO_SPACE", 0x05449): "EmptyOrderedHashSet",
("RO_SPACE", 0x05481): "EmptyPropertyCell",
("RO_SPACE", 0x054a9): "EmptyWeakCell",
("RO_SPACE", 0x05599): "InfinityValue",
("RO_SPACE", 0x055a9): "MinusZeroValue",
("RO_SPACE", 0x055b9): "MinusInfinityValue",
("RO_SPACE", 0x055c9): "SelfReferenceMarker",
("OLD_SPACE", 0x02211): "EmptyScript",
("OLD_SPACE", 0x02291): "ManyClosuresCell",
("OLD_SPACE", 0x022b1): "NoElementsProtector",