Commit 3eb6b7ac authored by Benedikt Meurer's avatar Benedikt Meurer Committed by V8 LUCI CQ

[debug] Hold on to promises weakly from the debugger's promise stack.

The debugger maintains a stack of promises used for catch prediction
with promise builtins and async functions. Previously this stack would
hold on to the individual promises strongly, and subtle bugs that lead
to not properly cleaning up the stack in some corner cases would often
lead to significant memory issues (e.g. leaking whole iframes).

This refactors the PromiseOnStack to be

  (a) on the V8 heap, rather than allocating C++ structs with global
      handles pointing to the promises, and
  (b) hold on to the promises only weakly.

While this will not guarantee proper promise stack management, it will
at least ensure that edge cases don't lead to catastrophic (debugger
only) leaks.

Bug: chromium:1292063
Change-Id: I9c293ca2032de3a59e1e9624f132d37187805567
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3545176
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarSimon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79594}
parent a18b1606
......@@ -390,6 +390,7 @@ void Debug::ThreadInit() {
static_cast<base::AtomicWord>(0));
thread_local_.break_on_next_function_call_ = false;
UpdateHookOnFunctionCall();
thread_local_.promise_stack_ = Smi::zero();
}
char* Debug::ArchiveDebug(char* storage) {
......@@ -448,6 +449,8 @@ void Debug::Iterate(RootVisitor* v, ThreadLocal* thread_local_data) {
v->VisitRootPointer(
Root::kDebug, nullptr,
FullObjectSlot(&thread_local_data->ignore_step_into_function_));
v->VisitRootPointer(Root::kDebug, nullptr,
FullObjectSlot(&thread_local_data->promise_stack_));
}
DebugInfoListNode::DebugInfoListNode(Isolate* isolate, DebugInfo debug_info)
......@@ -469,7 +472,6 @@ void Debug::Unload() {
ClearStepping();
RemoveAllCoverageInfos();
ClearAllDebuggerHints();
ClearGlobalPromiseStack();
debug_delegate_ = nullptr;
}
......@@ -2067,11 +2069,6 @@ void Debug::FreeDebugInfoListNode(DebugInfoListNode* prev,
delete node;
}
void Debug::ClearGlobalPromiseStack() {
while (isolate_->PopPromise()) {
}
}
bool Debug::IsBreakAtReturn(JavaScriptFrame* frame) {
RCS_SCOPE(isolate_, RuntimeCallCounterId::kDebugger);
HandleScope scope(isolate_);
......
......@@ -490,8 +490,6 @@ class V8_EXPORT_PRIVATE Debug {
DebugInfoListNode** curr);
void FreeDebugInfoListNode(DebugInfoListNode* prev, DebugInfoListNode* node);
void ClearGlobalPromiseStack();
void SetTemporaryObjectTrackingDisabled(bool disabled);
bool GetTemporaryObjectTrackingDisabled() const;
......@@ -569,6 +567,10 @@ class V8_EXPORT_PRIVATE Debug {
// This flag is true when SetBreakOnNextFunctionCall is called and it forces
// debugger to break on next function call.
bool break_on_next_function_call_;
// Throwing an exception may cause a Promise rejection. For this purpose
// we keep track of a stack of nested promises.
Object promise_stack_;
};
static void Iterate(RootVisitor* v, ThreadLocal* thread_local_data);
......
......@@ -2600,21 +2600,22 @@ bool Isolate::OptionalRescheduleException(bool clear_exception) {
}
void Isolate::PushPromise(Handle<JSObject> promise) {
ThreadLocalTop* tltop = thread_local_top();
PromiseOnStack* prev = tltop->promise_on_stack_;
Handle<JSObject> global_promise = global_handles()->Create(*promise);
tltop->promise_on_stack_ = new PromiseOnStack(global_promise, prev);
}
bool Isolate::PopPromise() {
ThreadLocalTop* tltop = thread_local_top();
if (tltop->promise_on_stack_ == nullptr) return false;
PromiseOnStack* prev = tltop->promise_on_stack_->prev();
Handle<Object> global_promise = tltop->promise_on_stack_->promise();
delete tltop->promise_on_stack_;
tltop->promise_on_stack_ = prev;
global_handles()->Destroy(global_promise.location());
return true;
Handle<Object> promise_on_stack(debug()->thread_local_.promise_stack_, this);
promise_on_stack = factory()->NewPromiseOnStack(promise_on_stack, promise);
debug()->thread_local_.promise_stack_ = *promise_on_stack;
}
void Isolate::PopPromise() {
if (!IsPromiseStackEmpty()) {
debug()->thread_local_.promise_stack_ =
PromiseOnStack::cast(debug()->thread_local_.promise_stack_).prev();
}
}
bool Isolate::IsPromiseStackEmpty() const {
DCHECK_IMPLIES(!debug()->thread_local_.promise_stack_.IsSmi(),
debug()->thread_local_.promise_stack_.IsPromiseOnStack());
return debug()->thread_local_.promise_stack_.IsSmi();
}
namespace {
......@@ -2688,15 +2689,14 @@ bool Isolate::PromiseHasUserDefinedRejectHandler(Handle<JSPromise> promise) {
Handle<Object> Isolate::GetPromiseOnStackOnThrow() {
Handle<Object> undefined = factory()->undefined_value();
ThreadLocalTop* tltop = thread_local_top();
if (tltop->promise_on_stack_ == nullptr) return undefined;
if (IsPromiseStackEmpty()) return undefined;
// Find the top-most try-catch or try-finally handler.
CatchType prediction = PredictExceptionCatcher();
if (prediction == NOT_CAUGHT || prediction == CAUGHT_BY_EXTERNAL) {
return undefined;
}
Handle<Object> retval = undefined;
PromiseOnStack* promise_on_stack = tltop->promise_on_stack_;
Handle<Object> promise_stack(debug()->thread_local_.promise_stack_, this);
for (StackFrameIterator it(this); !it.done(); it.Advance()) {
StackFrame* frame = it.frame();
HandlerTable::CatchPrediction catch_prediction;
......@@ -2728,10 +2728,16 @@ Handle<Object> Isolate::GetPromiseOnStackOnThrow() {
Handle<JSPromise>::cast(retval)->set_handled_hint(true);
}
return retval;
case HandlerTable::PROMISE:
return promise_on_stack
? Handle<Object>::cast(promise_on_stack->promise())
: undefined;
case HandlerTable::PROMISE: {
Handle<JSObject> promise;
if (promise_stack->IsPromiseOnStack() &&
PromiseOnStack::GetPromise(
Handle<PromiseOnStack>::cast(promise_stack))
.ToHandle(&promise)) {
return promise;
}
return undefined;
}
case HandlerTable::UNCAUGHT_ASYNC_AWAIT:
case HandlerTable::ASYNC_AWAIT: {
// If in the initial portion of async/await, continue the loop to pop up
......@@ -2739,15 +2745,21 @@ Handle<Object> Isolate::GetPromiseOnStackOnThrow() {
// dependents is found, or a non-async stack frame is encountered, in
// order to handle the synchronous async/await catch prediction case:
// assume that async function calls are awaited.
if (!promise_on_stack) return retval;
retval = promise_on_stack->promise();
if (!promise_stack->IsPromiseOnStack()) {
return retval;
}
Handle<PromiseOnStack> promise_on_stack =
Handle<PromiseOnStack>::cast(promise_stack);
if (!PromiseOnStack::GetPromise(promise_on_stack).ToHandle(&retval)) {
return retval;
}
if (retval->IsJSPromise()) {
if (PromiseHasUserDefinedRejectHandler(
Handle<JSPromise>::cast(retval))) {
return retval;
}
}
promise_on_stack = promise_on_stack->prev();
promise_stack = handle(promise_on_stack->prev(), this);
continue;
}
}
......@@ -5039,8 +5051,7 @@ void Isolate::OnTerminationDuringRunMicrotasks() {
heap()->set_current_microtask(ReadOnlyRoots(this).undefined_value());
// Empty the promise stack.
while (PopPromise()) {
}
debug()->thread_local_.promise_stack_ = Smi::zero();
if (current_microtask->IsPromiseReactionJobTask()) {
Handle<PromiseReactionJobTask> promise_reaction_job_task =
......
......@@ -859,7 +859,8 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory {
// Push and pop a promise and the current try-catch handler.
void PushPromise(Handle<JSObject> promise);
bool PopPromise();
void PopPromise();
bool IsPromiseStackEmpty() const;
// Return the relevant Promise that a throw/rejection pertains to, based
// on the contents of the Promise stack
......@@ -2410,18 +2411,6 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory {
#undef FIELD_ACCESSOR
#undef THREAD_LOCAL_TOP_ACCESSOR
class PromiseOnStack {
public:
PromiseOnStack(Handle<JSObject> promise, PromiseOnStack* prev)
: promise_(promise), prev_(prev) {}
Handle<JSObject> promise() { return promise_; }
PromiseOnStack* prev() { return prev_; }
private:
Handle<JSObject> promise_;
PromiseOnStack* prev_;
};
// SaveContext scopes save the current context on the Isolate on creation, and
// restore it on destruction.
class V8_EXPORT_PRIVATE SaveContext {
......
......@@ -27,7 +27,6 @@ void ThreadLocalTop::Clear() {
c_entry_fp_ = kNullAddress;
handler_ = kNullAddress;
c_function_ = kNullAddress;
promise_on_stack_ = nullptr;
simulator_ = nullptr;
js_entry_sp_ = kNullAddress;
external_callback_scope_ = nullptr;
......@@ -57,10 +56,7 @@ void ThreadLocalTop::Initialize(Isolate* isolate) {
#endif
}
void ThreadLocalTop::Free() {
// Match unmatched PopPromise calls.
while (promise_on_stack_) isolate_->PopPromise();
}
void ThreadLocalTop::Free() {}
#if defined(USE_SIMULATOR)
void ThreadLocalTop::StoreCurrentStackPosition() {
......
......@@ -26,7 +26,6 @@ namespace internal {
class EmbedderState;
class ExternalCallbackScope;
class Isolate;
class PromiseOnStack;
class Simulator;
class ThreadLocalTop {
......@@ -35,9 +34,9 @@ class ThreadLocalTop {
// refactor this to really consist of just Addresses and 32-bit
// integer fields.
#ifdef V8_ENABLE_CONSERVATIVE_STACK_SCANNING
static constexpr uint32_t kSizeInBytes = 27 * kSystemPointerSize;
#else
static constexpr uint32_t kSizeInBytes = 26 * kSystemPointerSize;
#else
static constexpr uint32_t kSizeInBytes = 25 * kSystemPointerSize;
#endif
// Does early low-level initialization that does not depend on the
......@@ -140,11 +139,6 @@ class ThreadLocalTop {
// C function that was called at c entry.
Address c_function_;
// Throwing an exception may cause a Promise rejection. For this purpose
// we keep track of a stack of nested promises and the corresponding
// try-catch handlers.
PromiseOnStack* promise_on_stack_;
// Simulator field is always present to get predictable layout.
Simulator* simulator_;
......
......@@ -3460,6 +3460,16 @@ Handle<StackFrameInfo> Factory::NewStackFrameInfo(
return handle(info, isolate());
}
Handle<PromiseOnStack> Factory::NewPromiseOnStack(Handle<Object> prev,
Handle<JSObject> promise) {
PromiseOnStack promise_on_stack = NewStructInternal<PromiseOnStack>(
PROMISE_ON_STACK_TYPE, AllocationType::kYoung);
DisallowGarbageCollection no_gc;
promise_on_stack.set_prev(*prev, SKIP_WRITE_BARRIER);
promise_on_stack.set_promise(*MaybeObjectHandle::Weak(promise));
return handle(promise_on_stack, isolate());
}
Handle<JSObject> Factory::NewArgumentsObject(Handle<JSFunction> callee,
int length) {
bool strict_mode_callee = is_strict(callee->shared().language_mode()) ||
......
......@@ -407,6 +407,9 @@ class V8_EXPORT_PRIVATE Factory : public FactoryBase<Factory> {
int bytecode_offset_or_source_position, Handle<String> function_name,
bool is_constructor);
Handle<PromiseOnStack> NewPromiseOnStack(Handle<Object> prev,
Handle<JSObject> promise);
// Allocate various microtasks.
Handle<CallableTask> NewCallableTask(Handle<JSReceiver> callable,
Handle<Context> context);
......
......@@ -41,6 +41,7 @@ namespace internal {
V(Map) \
V(NativeContext) \
V(PreparseData) \
V(PromiseOnStack) \
V(PropertyArray) \
V(PropertyCell) \
V(PrototypeInfo) \
......
......@@ -85,6 +85,9 @@ ACCESSORS_RELAXED_CHECKED(ErrorStackData, call_site_infos, FixedArray,
kCallSiteInfosOrFormattedStackOffset,
!HasFormattedStack())
NEVER_READ_ONLY_SPACE_IMPL(PromiseOnStack)
TQ_OBJECT_CONSTRUCTORS_IMPL(PromiseOnStack)
} // namespace internal
} // namespace v8
......
......@@ -457,5 +457,16 @@ void ErrorStackData::EnsureStackFrameInfos(Isolate* isolate,
error_stack->set_limit_or_stack_frame_infos(*stack_frame_infos);
}
// static
MaybeHandle<JSObject> PromiseOnStack::GetPromise(
Handle<PromiseOnStack> promise_on_stack) {
HeapObject promise;
Isolate* isolate = promise_on_stack->GetIsolate();
if (promise_on_stack->promise()->GetHeapObjectIfWeak(isolate, &promise)) {
return handle(JSObject::cast(promise), isolate);
}
return {};
}
} // namespace internal
} // namespace v8
......@@ -251,6 +251,19 @@ class ErrorStackData
TQ_OBJECT_CONSTRUCTORS(ErrorStackData)
};
class PromiseOnStack
: public TorqueGeneratedPromiseOnStack<PromiseOnStack, Struct> {
public:
NEVER_READ_ONLY_SPACE
static MaybeHandle<JSObject> GetPromise(
Handle<PromiseOnStack> promise_on_stack);
class BodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(PromiseOnStack)
};
} // namespace internal
} // namespace v8
......
......@@ -127,3 +127,8 @@ extern class ErrorStackData extends Struct {
// stack traces.
limit_or_stack_frame_infos: Smi|FixedArray;
}
extern class PromiseOnStack extends Struct {
prev: PromiseOnStack|Zero;
promise: Weak<JSObject>;
}
......@@ -348,6 +348,9 @@ VisitorId Map::GetVisitorId(Map map) {
#define MAKE_STRUCT_CASE(TYPE, Name, name) case TYPE:
STRUCT_LIST(MAKE_STRUCT_CASE)
#undef MAKE_STRUCT_CASE
if (instance_type == PROMISE_ON_STACK_TYPE) {
return kVisitPromiseOnStack;
}
if (instance_type == PROTOTYPE_INFO_TYPE) {
return kVisitPrototypeInfo;
}
......
......@@ -57,6 +57,7 @@ enum InstanceType : uint16_t;
V(Map) \
V(NativeContext) \
V(PreparseData) \
V(PromiseOnStack) \
V(PropertyArray) \
V(PropertyCell) \
V(PrototypeInfo) \
......
......@@ -606,6 +606,25 @@ class PreparseData::BodyDescriptor final : public BodyDescriptorBase {
}
};
class PromiseOnStack::BodyDescriptor final : public BodyDescriptorBase {
public:
static bool IsValidSlot(Map map, HeapObject obj, int offset) {
return offset >= HeapObject::kHeaderSize;
}
template <typename ObjectVisitor>
static inline void IterateBody(Map map, HeapObject obj, int object_size,
ObjectVisitor* v) {
IteratePointers(obj, Struct::kHeaderSize, kPromiseOffset, v);
IterateMaybeWeakPointer(obj, kPromiseOffset, v);
STATIC_ASSERT(kPromiseOffset + kTaggedSize == kHeaderSize);
}
static inline int SizeOf(Map map, HeapObject obj) {
return obj.SizeFromMap(map);
}
};
class PrototypeInfo::BodyDescriptor final : public BodyDescriptorBase {
public:
static bool IsValidSlot(Map map, HeapObject obj, int offset) {
......
......@@ -151,6 +151,7 @@ namespace internal {
V(_, INTERPRETER_DATA_TYPE, InterpreterData, interpreter_data) \
V(_, MODULE_REQUEST_TYPE, ModuleRequest, module_request) \
V(_, PROMISE_CAPABILITY_TYPE, PromiseCapability, promise_capability) \
V(_, PROMISE_ON_STACK_TYPE, PromiseOnStack, promise_on_stack) \
V(_, PROMISE_REACTION_TYPE, PromiseReaction, promise_reaction) \
V(_, PROPERTY_DESCRIPTOR_OBJECT_TYPE, PropertyDescriptorObject, \
property_descriptor_object) \
......
......@@ -183,6 +183,7 @@
// - CallSiteInfo
// - CodeCache
// - PropertyDescriptorObject
// - PromiseOnStack
// - PrototypeInfo
// - Microtask
// - CallbackTask
......
......@@ -5764,7 +5764,7 @@ TEST(AwaitCleansUpGlobalPromiseStack) {
"})();\n");
CompileRun(source);
CHECK_EQ(CcTest::i_isolate()->thread_local_top()->promise_on_stack_, nullptr);
CHECK(CcTest::i_isolate()->IsPromiseStackEmpty());
v8::debug::SetDebugDelegate(env->GetIsolate(), nullptr);
CheckDebuggerUnloaded();
......
......@@ -68,45 +68,45 @@ INSTANCE_TYPES = {
162: "INTERPRETER_DATA_TYPE",
163: "MODULE_REQUEST_TYPE",
164: "PROMISE_CAPABILITY_TYPE",
165: "PROMISE_REACTION_TYPE",
166: "PROPERTY_DESCRIPTOR_OBJECT_TYPE",
167: "PROTOTYPE_INFO_TYPE",
168: "REG_EXP_BOILERPLATE_DESCRIPTION_TYPE",
169: "SCRIPT_TYPE",
170: "SCRIPT_OR_MODULE_TYPE",
171: "SOURCE_TEXT_MODULE_INFO_ENTRY_TYPE",
172: "STACK_FRAME_INFO_TYPE",
173: "TEMPLATE_OBJECT_DESCRIPTION_TYPE",
174: "TUPLE2_TYPE",
175: "WASM_CONTINUATION_OBJECT_TYPE",
176: "WASM_EXCEPTION_TAG_TYPE",
177: "WASM_INDIRECT_FUNCTION_TABLE_TYPE",
178: "FIXED_ARRAY_TYPE",
179: "HASH_TABLE_TYPE",
180: "EPHEMERON_HASH_TABLE_TYPE",
181: "GLOBAL_DICTIONARY_TYPE",
182: "NAME_DICTIONARY_TYPE",
183: "NAME_TO_INDEX_HASH_TABLE_TYPE",
184: "NUMBER_DICTIONARY_TYPE",
185: "ORDERED_HASH_MAP_TYPE",
186: "ORDERED_HASH_SET_TYPE",
187: "ORDERED_NAME_DICTIONARY_TYPE",
188: "REGISTERED_SYMBOL_TABLE_TYPE",
189: "SIMPLE_NUMBER_DICTIONARY_TYPE",
190: "CLOSURE_FEEDBACK_CELL_ARRAY_TYPE",
191: "OBJECT_BOILERPLATE_DESCRIPTION_TYPE",
192: "SCRIPT_CONTEXT_TABLE_TYPE",
193: "BYTE_ARRAY_TYPE",
194: "BYTECODE_ARRAY_TYPE",
195: "FIXED_DOUBLE_ARRAY_TYPE",
196: "INTERNAL_CLASS_WITH_SMI_ELEMENTS_TYPE",
197: "SLOPPY_ARGUMENTS_ELEMENTS_TYPE",
198: "TURBOFAN_BITSET_TYPE_TYPE",
199: "TURBOFAN_HEAP_CONSTANT_TYPE_TYPE",
200: "TURBOFAN_OTHER_NUMBER_CONSTANT_TYPE_TYPE",
201: "TURBOFAN_RANGE_TYPE_TYPE",
202: "TURBOFAN_UNION_TYPE_TYPE",
203: "CELL_TYPE",
165: "PROMISE_ON_STACK_TYPE",
166: "PROMISE_REACTION_TYPE",
167: "PROPERTY_DESCRIPTOR_OBJECT_TYPE",
168: "PROTOTYPE_INFO_TYPE",
169: "REG_EXP_BOILERPLATE_DESCRIPTION_TYPE",
170: "SCRIPT_TYPE",
171: "SCRIPT_OR_MODULE_TYPE",
172: "SOURCE_TEXT_MODULE_INFO_ENTRY_TYPE",
173: "STACK_FRAME_INFO_TYPE",
174: "TEMPLATE_OBJECT_DESCRIPTION_TYPE",
175: "TUPLE2_TYPE",
176: "WASM_CONTINUATION_OBJECT_TYPE",
177: "WASM_EXCEPTION_TAG_TYPE",
178: "WASM_INDIRECT_FUNCTION_TABLE_TYPE",
179: "FIXED_ARRAY_TYPE",
180: "HASH_TABLE_TYPE",
181: "EPHEMERON_HASH_TABLE_TYPE",
182: "GLOBAL_DICTIONARY_TYPE",
183: "NAME_DICTIONARY_TYPE",
184: "NAME_TO_INDEX_HASH_TABLE_TYPE",
185: "NUMBER_DICTIONARY_TYPE",
186: "ORDERED_HASH_MAP_TYPE",
187: "ORDERED_HASH_SET_TYPE",
188: "ORDERED_NAME_DICTIONARY_TYPE",
189: "REGISTERED_SYMBOL_TABLE_TYPE",
190: "SIMPLE_NUMBER_DICTIONARY_TYPE",
191: "CLOSURE_FEEDBACK_CELL_ARRAY_TYPE",
192: "OBJECT_BOILERPLATE_DESCRIPTION_TYPE",
193: "SCRIPT_CONTEXT_TABLE_TYPE",
194: "BYTE_ARRAY_TYPE",
195: "BYTECODE_ARRAY_TYPE",
196: "FIXED_DOUBLE_ARRAY_TYPE",
197: "INTERNAL_CLASS_WITH_SMI_ELEMENTS_TYPE",
198: "SLOPPY_ARGUMENTS_ELEMENTS_TYPE",
199: "TURBOFAN_BITSET_TYPE_TYPE",
200: "TURBOFAN_HEAP_CONSTANT_TYPE_TYPE",
201: "TURBOFAN_OTHER_NUMBER_CONSTANT_TYPE_TYPE",
202: "TURBOFAN_RANGE_TYPE_TYPE",
203: "TURBOFAN_UNION_TYPE_TYPE",
204: "FOREIGN_TYPE",
205: "WASM_INTERNAL_FUNCTION_TYPE",
206: "WASM_TYPE_INFO_TYPE",
......@@ -142,39 +142,40 @@ INSTANCE_TYPES = {
236: "SYNTHETIC_MODULE_TYPE",
237: "WEAK_FIXED_ARRAY_TYPE",
238: "TRANSITION_ARRAY_TYPE",
239: "CODE_TYPE",
240: "CODE_DATA_CONTAINER_TYPE",
241: "COVERAGE_INFO_TYPE",
242: "EMBEDDER_DATA_ARRAY_TYPE",
243: "FEEDBACK_METADATA_TYPE",
244: "FEEDBACK_VECTOR_TYPE",
245: "FILLER_TYPE",
246: "FREE_SPACE_TYPE",
247: "INTERNAL_CLASS_TYPE",
248: "INTERNAL_CLASS_WITH_STRUCT_ELEMENTS_TYPE",
249: "MAP_TYPE",
250: "MEGA_DOM_HANDLER_TYPE",
251: "ON_HEAP_BASIC_BLOCK_PROFILER_DATA_TYPE",
252: "PREPARSE_DATA_TYPE",
253: "PROPERTY_ARRAY_TYPE",
254: "PROPERTY_CELL_TYPE",
255: "SCOPE_INFO_TYPE",
256: "SHARED_FUNCTION_INFO_TYPE",
257: "SMI_BOX_TYPE",
258: "SMI_PAIR_TYPE",
259: "SORT_STATE_TYPE",
260: "SWISS_NAME_DICTIONARY_TYPE",
261: "WASM_API_FUNCTION_REF_TYPE",
262: "WASM_ON_FULFILLED_DATA_TYPE",
263: "WEAK_ARRAY_LIST_TYPE",
264: "WEAK_CELL_TYPE",
265: "WASM_ARRAY_TYPE",
266: "WASM_STRUCT_TYPE",
267: "JS_PROXY_TYPE",
239: "CELL_TYPE",
240: "CODE_TYPE",
241: "CODE_DATA_CONTAINER_TYPE",
242: "COVERAGE_INFO_TYPE",
243: "EMBEDDER_DATA_ARRAY_TYPE",
244: "FEEDBACK_METADATA_TYPE",
245: "FEEDBACK_VECTOR_TYPE",
246: "FILLER_TYPE",
247: "FREE_SPACE_TYPE",
248: "INTERNAL_CLASS_TYPE",
249: "INTERNAL_CLASS_WITH_STRUCT_ELEMENTS_TYPE",
250: "MAP_TYPE",
251: "MEGA_DOM_HANDLER_TYPE",
252: "ON_HEAP_BASIC_BLOCK_PROFILER_DATA_TYPE",
253: "PREPARSE_DATA_TYPE",
254: "PROPERTY_ARRAY_TYPE",
255: "PROPERTY_CELL_TYPE",
256: "SCOPE_INFO_TYPE",
257: "SHARED_FUNCTION_INFO_TYPE",
258: "SMI_BOX_TYPE",
259: "SMI_PAIR_TYPE",
260: "SORT_STATE_TYPE",
261: "SWISS_NAME_DICTIONARY_TYPE",
262: "WASM_API_FUNCTION_REF_TYPE",
263: "WASM_ON_FULFILLED_DATA_TYPE",
264: "WEAK_ARRAY_LIST_TYPE",
265: "WEAK_CELL_TYPE",
266: "WASM_ARRAY_TYPE",
267: "WASM_STRUCT_TYPE",
268: "JS_PROXY_TYPE",
1057: "JS_OBJECT_TYPE",
268: "JS_GLOBAL_OBJECT_TYPE",
269: "JS_GLOBAL_PROXY_TYPE",
270: "JS_MODULE_NAMESPACE_TYPE",
269: "JS_GLOBAL_OBJECT_TYPE",
270: "JS_GLOBAL_PROXY_TYPE",
271: "JS_MODULE_NAMESPACE_TYPE",
1040: "JS_SPECIAL_API_OBJECT_TYPE",
1041: "JS_PRIMITIVE_WRAPPER_TYPE",
1058: "JS_API_OBJECT_TYPE",
......@@ -273,86 +274,86 @@ INSTANCE_TYPES = {
# List of known V8 maps.
KNOWN_MAPS = {
("read_only_space", 0x02151): (249, "MetaMap"),
("read_only_space", 0x02151): (250, "MetaMap"),
("read_only_space", 0x02179): (131, "NullMap"),
("read_only_space", 0x021a1): (234, "StrongDescriptorArrayMap"),
("read_only_space", 0x021c9): (263, "WeakArrayListMap"),
("read_only_space", 0x021c9): (264, "WeakArrayListMap"),
("read_only_space", 0x0220d): (157, "EnumCacheMap"),
("read_only_space", 0x02241): (178, "FixedArrayMap"),
("read_only_space", 0x02241): (179, "FixedArrayMap"),
("read_only_space", 0x0228d): (8, "OneByteInternalizedStringMap"),
("read_only_space", 0x022d9): (246, "FreeSpaceMap"),
("read_only_space", 0x02301): (245, "OnePointerFillerMap"),
("read_only_space", 0x02329): (245, "TwoPointerFillerMap"),
("read_only_space", 0x022d9): (247, "FreeSpaceMap"),
("read_only_space", 0x02301): (246, "OnePointerFillerMap"),
("read_only_space", 0x02329): (246, "TwoPointerFillerMap"),
("read_only_space", 0x02351): (131, "UninitializedMap"),
("read_only_space", 0x023c9): (131, "UndefinedMap"),
("read_only_space", 0x0240d): (130, "HeapNumberMap"),
("read_only_space", 0x02441): (131, "TheHoleMap"),
("read_only_space", 0x024a1): (131, "BooleanMap"),
("read_only_space", 0x02545): (193, "ByteArrayMap"),
("read_only_space", 0x0256d): (178, "FixedCOWArrayMap"),
("read_only_space", 0x02595): (179, "HashTableMap"),
("read_only_space", 0x02545): (194, "ByteArrayMap"),
("read_only_space", 0x0256d): (179, "FixedCOWArrayMap"),
("read_only_space", 0x02595): (180, "HashTableMap"),
("read_only_space", 0x025bd): (128, "SymbolMap"),
("read_only_space", 0x025e5): (40, "OneByteStringMap"),
("read_only_space", 0x0260d): (255, "ScopeInfoMap"),
("read_only_space", 0x02635): (256, "SharedFunctionInfoMap"),
("read_only_space", 0x0265d): (239, "CodeMap"),
("read_only_space", 0x02685): (203, "CellMap"),
("read_only_space", 0x026ad): (254, "GlobalPropertyCellMap"),
("read_only_space", 0x0260d): (256, "ScopeInfoMap"),
("read_only_space", 0x02635): (257, "SharedFunctionInfoMap"),
("read_only_space", 0x0265d): (240, "CodeMap"),
("read_only_space", 0x02685): (239, "CellMap"),
("read_only_space", 0x026ad): (255, "GlobalPropertyCellMap"),
("read_only_space", 0x026d5): (204, "ForeignMap"),
("read_only_space", 0x026fd): (238, "TransitionArrayMap"),
("read_only_space", 0x02725): (45, "ThinOneByteStringMap"),
("read_only_space", 0x0274d): (244, "FeedbackVectorMap"),
("read_only_space", 0x0274d): (245, "FeedbackVectorMap"),
("read_only_space", 0x02785): (131, "ArgumentsMarkerMap"),
("read_only_space", 0x027e5): (131, "ExceptionMap"),
("read_only_space", 0x02841): (131, "TerminationExceptionMap"),
("read_only_space", 0x028a9): (131, "OptimizedOutMap"),
("read_only_space", 0x02909): (131, "StaleRegisterMap"),
("read_only_space", 0x02969): (192, "ScriptContextTableMap"),
("read_only_space", 0x02991): (190, "ClosureFeedbackCellArrayMap"),
("read_only_space", 0x029b9): (243, "FeedbackMetadataArrayMap"),
("read_only_space", 0x029e1): (178, "ArrayListMap"),
("read_only_space", 0x02969): (193, "ScriptContextTableMap"),
("read_only_space", 0x02991): (191, "ClosureFeedbackCellArrayMap"),
("read_only_space", 0x029b9): (244, "FeedbackMetadataArrayMap"),
("read_only_space", 0x029e1): (179, "ArrayListMap"),
("read_only_space", 0x02a09): (129, "BigIntMap"),
("read_only_space", 0x02a31): (191, "ObjectBoilerplateDescriptionMap"),
("read_only_space", 0x02a59): (194, "BytecodeArrayMap"),
("read_only_space", 0x02a81): (240, "CodeDataContainerMap"),
("read_only_space", 0x02aa9): (241, "CoverageInfoMap"),
("read_only_space", 0x02ad1): (195, "FixedDoubleArrayMap"),
("read_only_space", 0x02af9): (181, "GlobalDictionaryMap"),
("read_only_space", 0x02a31): (192, "ObjectBoilerplateDescriptionMap"),
("read_only_space", 0x02a59): (195, "BytecodeArrayMap"),
("read_only_space", 0x02a81): (241, "CodeDataContainerMap"),
("read_only_space", 0x02aa9): (242, "CoverageInfoMap"),
("read_only_space", 0x02ad1): (196, "FixedDoubleArrayMap"),
("read_only_space", 0x02af9): (182, "GlobalDictionaryMap"),
("read_only_space", 0x02b21): (159, "ManyClosuresCellMap"),
("read_only_space", 0x02b49): (250, "MegaDomHandlerMap"),
("read_only_space", 0x02b71): (178, "ModuleInfoMap"),
("read_only_space", 0x02b99): (182, "NameDictionaryMap"),
("read_only_space", 0x02b49): (251, "MegaDomHandlerMap"),
("read_only_space", 0x02b71): (179, "ModuleInfoMap"),
("read_only_space", 0x02b99): (183, "NameDictionaryMap"),
("read_only_space", 0x02bc1): (159, "NoClosuresCellMap"),
("read_only_space", 0x02be9): (184, "NumberDictionaryMap"),
("read_only_space", 0x02be9): (185, "NumberDictionaryMap"),
("read_only_space", 0x02c11): (159, "OneClosureCellMap"),
("read_only_space", 0x02c39): (185, "OrderedHashMapMap"),
("read_only_space", 0x02c61): (186, "OrderedHashSetMap"),
("read_only_space", 0x02c89): (183, "NameToIndexHashTableMap"),
("read_only_space", 0x02cb1): (188, "RegisteredSymbolTableMap"),
("read_only_space", 0x02cd9): (187, "OrderedNameDictionaryMap"),
("read_only_space", 0x02d01): (252, "PreparseDataMap"),
("read_only_space", 0x02d29): (253, "PropertyArrayMap"),
("read_only_space", 0x02c39): (186, "OrderedHashMapMap"),
("read_only_space", 0x02c61): (187, "OrderedHashSetMap"),
("read_only_space", 0x02c89): (184, "NameToIndexHashTableMap"),
("read_only_space", 0x02cb1): (189, "RegisteredSymbolTableMap"),
("read_only_space", 0x02cd9): (188, "OrderedNameDictionaryMap"),
("read_only_space", 0x02d01): (253, "PreparseDataMap"),
("read_only_space", 0x02d29): (254, "PropertyArrayMap"),
("read_only_space", 0x02d51): (153, "SideEffectCallHandlerInfoMap"),
("read_only_space", 0x02d79): (153, "SideEffectFreeCallHandlerInfoMap"),
("read_only_space", 0x02da1): (153, "NextCallSideEffectFreeCallHandlerInfoMap"),
("read_only_space", 0x02dc9): (189, "SimpleNumberDictionaryMap"),
("read_only_space", 0x02dc9): (190, "SimpleNumberDictionaryMap"),
("read_only_space", 0x02df1): (228, "SmallOrderedHashMapMap"),
("read_only_space", 0x02e19): (229, "SmallOrderedHashSetMap"),
("read_only_space", 0x02e41): (230, "SmallOrderedNameDictionaryMap"),
("read_only_space", 0x02e69): (235, "SourceTextModuleMap"),
("read_only_space", 0x02e91): (260, "SwissNameDictionaryMap"),
("read_only_space", 0x02e91): (261, "SwissNameDictionaryMap"),
("read_only_space", 0x02eb9): (236, "SyntheticModuleMap"),
("read_only_space", 0x02ee1): (261, "WasmApiFunctionRefMap"),
("read_only_space", 0x02ee1): (262, "WasmApiFunctionRefMap"),
("read_only_space", 0x02f09): (222, "WasmCapiFunctionDataMap"),
("read_only_space", 0x02f31): (223, "WasmExportedFunctionDataMap"),
("read_only_space", 0x02f59): (205, "WasmInternalFunctionMap"),
("read_only_space", 0x02f81): (224, "WasmJSFunctionDataMap"),
("read_only_space", 0x02fa9): (262, "WasmOnFulfilledDataMap"),
("read_only_space", 0x02fa9): (263, "WasmOnFulfilledDataMap"),
("read_only_space", 0x02fd1): (206, "WasmTypeInfoMap"),
("read_only_space", 0x02ff9): (237, "WeakFixedArrayMap"),
("read_only_space", 0x03021): (180, "EphemeronHashTableMap"),
("read_only_space", 0x03049): (242, "EmbedderDataArrayMap"),
("read_only_space", 0x03071): (264, "WeakCellMap"),
("read_only_space", 0x03021): (181, "EphemeronHashTableMap"),
("read_only_space", 0x03049): (243, "EmbedderDataArrayMap"),
("read_only_space", 0x03071): (265, "WeakCellMap"),
("read_only_space", 0x03099): (32, "StringMap"),
("read_only_space", 0x030c1): (41, "ConsOneByteStringMap"),
("read_only_space", 0x030e9): (33, "ConsStringMap"),
......@@ -403,51 +404,52 @@ KNOWN_MAPS = {
("read_only_space", 0x0638d): (162, "InterpreterDataMap"),
("read_only_space", 0x063b5): (163, "ModuleRequestMap"),
("read_only_space", 0x063dd): (164, "PromiseCapabilityMap"),
("read_only_space", 0x06405): (165, "PromiseReactionMap"),
("read_only_space", 0x0642d): (166, "PropertyDescriptorObjectMap"),
("read_only_space", 0x06455): (167, "PrototypeInfoMap"),
("read_only_space", 0x0647d): (168, "RegExpBoilerplateDescriptionMap"),
("read_only_space", 0x064a5): (169, "ScriptMap"),
("read_only_space", 0x064cd): (170, "ScriptOrModuleMap"),
("read_only_space", 0x064f5): (171, "SourceTextModuleInfoEntryMap"),
("read_only_space", 0x0651d): (172, "StackFrameInfoMap"),
("read_only_space", 0x06545): (173, "TemplateObjectDescriptionMap"),
("read_only_space", 0x0656d): (174, "Tuple2Map"),
("read_only_space", 0x06595): (175, "WasmContinuationObjectMap"),
("read_only_space", 0x065bd): (176, "WasmExceptionTagMap"),
("read_only_space", 0x065e5): (177, "WasmIndirectFunctionTableMap"),
("read_only_space", 0x0660d): (197, "SloppyArgumentsElementsMap"),
("read_only_space", 0x06635): (233, "DescriptorArrayMap"),
("read_only_space", 0x0665d): (219, "UncompiledDataWithoutPreparseDataMap"),
("read_only_space", 0x06685): (217, "UncompiledDataWithPreparseDataMap"),
("read_only_space", 0x066ad): (220, "UncompiledDataWithoutPreparseDataWithJobMap"),
("read_only_space", 0x066d5): (218, "UncompiledDataWithPreparseDataAndJobMap"),
("read_only_space", 0x066fd): (251, "OnHeapBasicBlockProfilerDataMap"),
("read_only_space", 0x06725): (198, "TurbofanBitsetTypeMap"),
("read_only_space", 0x0674d): (202, "TurbofanUnionTypeMap"),
("read_only_space", 0x06775): (201, "TurbofanRangeTypeMap"),
("read_only_space", 0x0679d): (199, "TurbofanHeapConstantTypeMap"),
("read_only_space", 0x067c5): (200, "TurbofanOtherNumberConstantTypeMap"),
("read_only_space", 0x067ed): (247, "InternalClassMap"),
("read_only_space", 0x06815): (258, "SmiPairMap"),
("read_only_space", 0x0683d): (257, "SmiBoxMap"),
("read_only_space", 0x06865): (225, "ExportedSubClassBaseMap"),
("read_only_space", 0x0688d): (226, "ExportedSubClassMap"),
("read_only_space", 0x068b5): (231, "AbstractInternalClassSubclass1Map"),
("read_only_space", 0x068dd): (232, "AbstractInternalClassSubclass2Map"),
("read_only_space", 0x06905): (196, "InternalClassWithSmiElementsMap"),
("read_only_space", 0x0692d): (248, "InternalClassWithStructElementsMap"),
("read_only_space", 0x06955): (227, "ExportedSubClass2Map"),
("read_only_space", 0x0697d): (259, "SortStateMap"),
("read_only_space", 0x069a5): (146, "AllocationSiteWithWeakNextMap"),
("read_only_space", 0x069cd): (146, "AllocationSiteWithoutWeakNextMap"),
("read_only_space", 0x069f5): (137, "LoadHandler1Map"),
("read_only_space", 0x06a1d): (137, "LoadHandler2Map"),
("read_only_space", 0x06a45): (137, "LoadHandler3Map"),
("read_only_space", 0x06a6d): (138, "StoreHandler0Map"),
("read_only_space", 0x06a95): (138, "StoreHandler1Map"),
("read_only_space", 0x06abd): (138, "StoreHandler2Map"),
("read_only_space", 0x06ae5): (138, "StoreHandler3Map"),
("read_only_space", 0x06405): (165, "PromiseOnStackMap"),
("read_only_space", 0x0642d): (166, "PromiseReactionMap"),
("read_only_space", 0x06455): (167, "PropertyDescriptorObjectMap"),
("read_only_space", 0x0647d): (168, "PrototypeInfoMap"),
("read_only_space", 0x064a5): (169, "RegExpBoilerplateDescriptionMap"),
("read_only_space", 0x064cd): (170, "ScriptMap"),
("read_only_space", 0x064f5): (171, "ScriptOrModuleMap"),
("read_only_space", 0x0651d): (172, "SourceTextModuleInfoEntryMap"),
("read_only_space", 0x06545): (173, "StackFrameInfoMap"),
("read_only_space", 0x0656d): (174, "TemplateObjectDescriptionMap"),
("read_only_space", 0x06595): (175, "Tuple2Map"),
("read_only_space", 0x065bd): (176, "WasmContinuationObjectMap"),
("read_only_space", 0x065e5): (177, "WasmExceptionTagMap"),
("read_only_space", 0x0660d): (178, "WasmIndirectFunctionTableMap"),
("read_only_space", 0x06635): (198, "SloppyArgumentsElementsMap"),
("read_only_space", 0x0665d): (233, "DescriptorArrayMap"),
("read_only_space", 0x06685): (219, "UncompiledDataWithoutPreparseDataMap"),
("read_only_space", 0x066ad): (217, "UncompiledDataWithPreparseDataMap"),
("read_only_space", 0x066d5): (220, "UncompiledDataWithoutPreparseDataWithJobMap"),
("read_only_space", 0x066fd): (218, "UncompiledDataWithPreparseDataAndJobMap"),
("read_only_space", 0x06725): (252, "OnHeapBasicBlockProfilerDataMap"),
("read_only_space", 0x0674d): (199, "TurbofanBitsetTypeMap"),
("read_only_space", 0x06775): (203, "TurbofanUnionTypeMap"),
("read_only_space", 0x0679d): (202, "TurbofanRangeTypeMap"),
("read_only_space", 0x067c5): (200, "TurbofanHeapConstantTypeMap"),
("read_only_space", 0x067ed): (201, "TurbofanOtherNumberConstantTypeMap"),
("read_only_space", 0x06815): (248, "InternalClassMap"),
("read_only_space", 0x0683d): (259, "SmiPairMap"),
("read_only_space", 0x06865): (258, "SmiBoxMap"),
("read_only_space", 0x0688d): (225, "ExportedSubClassBaseMap"),
("read_only_space", 0x068b5): (226, "ExportedSubClassMap"),
("read_only_space", 0x068dd): (231, "AbstractInternalClassSubclass1Map"),
("read_only_space", 0x06905): (232, "AbstractInternalClassSubclass2Map"),
("read_only_space", 0x0692d): (197, "InternalClassWithSmiElementsMap"),
("read_only_space", 0x06955): (249, "InternalClassWithStructElementsMap"),
("read_only_space", 0x0697d): (227, "ExportedSubClass2Map"),
("read_only_space", 0x069a5): (260, "SortStateMap"),
("read_only_space", 0x069cd): (146, "AllocationSiteWithWeakNextMap"),
("read_only_space", 0x069f5): (146, "AllocationSiteWithoutWeakNextMap"),
("read_only_space", 0x06a1d): (137, "LoadHandler1Map"),
("read_only_space", 0x06a45): (137, "LoadHandler2Map"),
("read_only_space", 0x06a6d): (137, "LoadHandler3Map"),
("read_only_space", 0x06a95): (138, "StoreHandler0Map"),
("read_only_space", 0x06abd): (138, "StoreHandler1Map"),
("read_only_space", 0x06ae5): (138, "StoreHandler2Map"),
("read_only_space", 0x06b0d): (138, "StoreHandler3Map"),
("map_space", 0x02151): (2113, "ExternalMap"),
("map_space", 0x02179): (2117, "JSMessageObjectMap"),
}
......
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