Commit 9f28c129 authored by Benedikt Meurer's avatar Benedikt Meurer Committed by Commit Bot

[async] Introduce the notion of a "current microtask".

Change the way we start collecting async stack traces by storing the
current microtask as a root instead of trying to make sense of the
last frame we see. This makes it possible to use the zero cost async
stack traces in Node.js as well (where the last JavaScript frame we
see is not the actual async function, but some frame related to the
main event loop usually).

In addition to the benefit that it now works with Node.js, we can also
extend the new machinery to look through (almost arbitrary) promise
chains. For example this code snippet

```js
(async function() {
  await Promise.resolve().then(() =>
    console.log(new Error().stack));
})();
```

can be made to also show the async function frame, even though at the
point where the stack trace is collected we don't have any async
function on the stack. But instead there's a PromiseReactionJobTask
as "current microtask", and we can dig into the chained promise to
see where the async execution is going to continue and eventually
find the await promise in the chain.

This also removes the removes the need to allocate `.generator_object`
specially during scope resolution.

Bug: v8:7522
Ref: nodejs/node#11865
Tbr: ulan@chromium.org
Design-Document: bit.ly/v8-zero-cost-async-stack-traces
Change-Id: Ib96cb17c2f75cce083a24e5ba2bbb7914e20d203
Reviewed-on: https://chromium-review.googlesource.com/c/1277505
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56590}
parent 1d87634c
......@@ -308,7 +308,6 @@ void DeclarationScope::SetDefaults() {
has_arguments_parameter_ = false;
scope_uses_super_property_ = false;
has_rest_ = false;
has_generator_object_ = false;
sloppy_block_function_map_ = nullptr;
receiver_ = nullptr;
new_target_ = nullptr;
......@@ -776,7 +775,6 @@ Variable* DeclarationScope::DeclareGeneratorObjectVar(
Variable* result = EnsureRareData()->generator_object =
NewTemporary(name, kNotAssigned);
result->set_is_used();
has_generator_object_ = true;
return result;
}
......@@ -1469,7 +1467,6 @@ void DeclarationScope::ResetAfterPreparsing(AstValueFactory* ast_value_factory,
sloppy_block_function_map_ = nullptr;
rare_data_ = nullptr;
has_rest_ = false;
has_generator_object_ = false;
DCHECK_NE(zone_, ast_value_factory->zone());
zone_->ReleaseMemory();
......@@ -2145,15 +2142,6 @@ void DeclarationScope::AllocateReceiver() {
AllocateParameter(receiver(), -1);
}
void DeclarationScope::AllocateGeneratorObject() {
if (!has_generator_object_) return;
DCHECK_NOT_NULL(generator_object_var());
DCHECK_EQ(this, generator_object_var()->scope());
AllocateStackSlot(generator_object_var());
DCHECK_EQ(VariableLocation::LOCAL, generator_object_var()->location());
DCHECK_EQ(kGeneratorObjectVarIndex, generator_object_var()->index());
}
void Scope::AllocateNonParameterLocal(Variable* var) {
DCHECK(var->scope() == this);
if (var->IsUnallocated() && MustAllocate(var)) {
......@@ -2221,14 +2209,6 @@ void Scope::AllocateVariablesRecursively() {
return;
}
// Make sure to allocate the .generator_object (for async functions
// and async generators) first, so that it get's the required stack
// slot 0 in case it's needed. See
// http://bit.ly/v8-zero-cost-async-stack-traces for details.
if (is_function_scope()) {
AsDeclarationScope()->AllocateGeneratorObject();
}
// Allocate variables for inner scopes.
for (Scope* scope = inner_scope_; scope != nullptr; scope = scope->sibling_) {
scope->AllocateVariablesRecursively();
......
......@@ -773,11 +773,6 @@ class V8_EXPORT_PRIVATE DeclarationScope : public Scope {
return GetRareVariable(RareVariable::kGeneratorObject);
}
// For async generators, the .generator_object variable is always
// allocated to a fixed stack slot, such that the stack trace
// construction logic can access it.
static constexpr int kGeneratorObjectVarIndex = 0;
// Parameters. The left-most parameter has index 0.
// Only valid for function and module scopes.
Variable* parameter(int index) const {
......@@ -905,7 +900,6 @@ class V8_EXPORT_PRIVATE DeclarationScope : public Scope {
void AllocateLocals();
void AllocateParameterLocals();
void AllocateReceiver();
void AllocateGeneratorObject();
void ResetAfterPreparsing(AstValueFactory* ast_value_factory, bool aborted);
......@@ -962,8 +956,6 @@ class V8_EXPORT_PRIVATE DeclarationScope : public Scope {
bool force_eager_compilation_ : 1;
// This function scope has a rest parameter.
bool has_rest_ : 1;
// This function scope has a .generator_object variable.
bool has_generator_object_ : 1;
// This scope has a parameter called "arguments".
bool has_arguments_parameter_ : 1;
// This scope uses "super" property ('super.foo').
......
......@@ -911,7 +911,7 @@ TF_BUILTIN(RunMicrotasks, InternalBuiltinsAssembler) {
TNode<Context> current_context = GetCurrentContext();
TNode<MicrotaskQueue> microtask_queue = GetDefaultMicrotaskQueue();
Label init_queue_loop(this);
Label init_queue_loop(this), done_init_queue_loop(this);
Goto(&init_queue_loop);
BIND(&init_queue_loop);
{
......@@ -919,7 +919,7 @@ TF_BUILTIN(RunMicrotasks, InternalBuiltinsAssembler) {
Label loop(this, &index), loop_next(this);
TNode<IntPtrT> num_tasks = GetPendingMicrotaskCount(microtask_queue);
ReturnIf(IntPtrEqual(num_tasks, IntPtrConstant(0)), UndefinedConstant());
GotoIf(IntPtrEqual(num_tasks, IntPtrConstant(0)), &done_init_queue_loop);
TNode<FixedArray> queue = GetQueuedMicrotasks(microtask_queue);
......@@ -939,6 +939,7 @@ TF_BUILTIN(RunMicrotasks, InternalBuiltinsAssembler) {
CSA_ASSERT(this, TaggedIsNotSmi(microtask));
StoreRoot(RootIndex::kCurrentMicrotask, microtask);
TNode<Map> microtask_map = LoadMap(microtask);
TNode<Int32T> microtask_type = LoadMapInstanceType(microtask_map);
......@@ -1121,6 +1122,13 @@ TF_BUILTIN(RunMicrotasks, InternalBuiltinsAssembler) {
Branch(IntPtrLessThan(index.value(), num_tasks), &loop, &init_queue_loop);
}
}
BIND(&done_init_queue_loop);
{
// Reset the "current microtask" on the isolate.
StoreRoot(RootIndex::kCurrentMicrotask, UndefinedConstant());
Return(UndefinedConstant());
}
}
TF_BUILTIN(AllocateInNewSpace, CodeStubAssembler) {
......
......@@ -626,6 +626,9 @@ void Heap::CreateInitialObjects() {
set_hash_seed(*factory->NewByteArray(kInt64Size, TENURED));
InitializeHashSeed();
// There's no "current microtask" in the beginning.
set_current_microtask(roots.undefined_value());
// Allocate cache for single character one byte strings.
set_single_character_string_cache(
*factory->NewFixedArray(String::kMaxOneByteCharCode + 1, TENURED));
......
This diff is collapsed.
......@@ -274,7 +274,9 @@ class Symbol;
NoScriptSharedFunctionInfos) \
V(FixedArray, serialized_objects, SerializedObjects) \
V(FixedArray, serialized_global_proxy_sizes, SerializedGlobalProxySizes) \
V(TemplateList, message_listeners, MessageListeners)
V(TemplateList, message_listeners, MessageListeners) \
/* Support for async stack traces */ \
V(HeapObject, current_microtask, CurrentMicrotask)
// Entries in this list are limited to Smis and are not visited during GC.
#define SMI_ROOT_LIST(V) \
......
......@@ -252,19 +252,19 @@ frame size: 22
parameter count: 1
bytecode array length: 490
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(3),
B(SwitchOnGeneratorState), R(2), U8(0), U8(3),
B(Mov), R(closure), R(11),
B(Mov), R(this), R(12),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(11), U8(2),
B(Star), R(0),
B(Star), R(2),
/* 17 E> */ B(StackCheck),
B(Mov), R(context), R(13),
B(Mov), R(context), R(14),
B(Ldar), R(0),
/* 17 E> */ B(SuspendGenerator), R(0), R(0), U8(15), U8(0),
B(ResumeGenerator), R(0), R(0), U8(15),
B(Ldar), R(2),
/* 17 E> */ B(SuspendGenerator), R(2), R(0), U8(15), U8(0),
B(ResumeGenerator), R(2), R(0), U8(15),
B(Star), R(15),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(SwitchOnSmiNoFeedback), U8(3), U8(2), I8(0),
B(Ldar), R(15),
/* 17 E> */ B(Throw),
......@@ -300,16 +300,16 @@ bytecodes: [
B(Star), R(7),
B(Mov), R(8), R(3),
/* 22 E> */ B(StackCheck),
B(Mov), R(3), R(1),
B(Mov), R(3), R(0),
/* 42 S> */ B(LdaFalse),
B(Star), R(21),
B(Mov), R(0), R(19),
B(Mov), R(1), R(20),
B(Mov), R(2), R(19),
B(Mov), R(0), R(20),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorYield), R(19), U8(3),
/* 42 E> */ B(SuspendGenerator), R(0), R(0), U8(19), U8(1),
B(ResumeGenerator), R(0), R(0), U8(19),
/* 42 E> */ B(SuspendGenerator), R(2), R(0), U8(19), U8(1),
B(ResumeGenerator), R(2), R(0), U8(19),
B(Star), R(19),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(SwitchOnSmiNoFeedback), U8(10), U8(2), I8(0),
B(Ldar), R(19),
/* 42 E> */ B(Throw),
......@@ -398,12 +398,12 @@ bytecodes: [
B(ReThrow),
B(LdaUndefined),
B(Star), R(16),
B(Mov), R(0), R(15),
B(Mov), R(2), R(15),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorAwaitUncaught), R(15), U8(2),
B(SuspendGenerator), R(0), R(0), U8(15), U8(2),
B(ResumeGenerator), R(0), R(0), U8(15),
B(SuspendGenerator), R(2), R(0), U8(15), U8(2),
B(ResumeGenerator), R(2), R(0), U8(15),
B(Star), R(15),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(Star), R(16),
B(LdaZero),
B(TestReferenceEqual), R(16),
......@@ -424,7 +424,7 @@ bytecodes: [
B(PushContext), R(15),
B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(17),
B(Mov), R(0), R(16),
B(Mov), R(2), R(16),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorReject), R(16), U8(2),
B(PopContext), R(15),
B(Star), R(12),
......@@ -441,7 +441,7 @@ bytecodes: [
B(LdaTheHole),
B(SetPendingMessage),
B(Star), R(13),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(0), U8(1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(2), U8(1),
B(Ldar), R(13),
B(SetPendingMessage),
B(Ldar), R(11),
......@@ -449,7 +449,7 @@ bytecodes: [
B(Jump), U8(22),
B(LdaTrue),
B(Star), R(16),
B(Mov), R(0), R(14),
B(Mov), R(2), R(14),
B(Mov), R(12), R(15),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorResolve), R(14), U8(3),
/* 50 S> */ B(Return),
......
......@@ -611,16 +611,16 @@ frame size: 18
parameter count: 2
bytecode array length: 286
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(SwitchOnGeneratorState), R(3), U8(0), U8(1),
B(Mov), R(closure), R(12),
B(Mov), R(this), R(13),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(12), U8(2),
B(Star), R(0),
B(Star), R(3),
/* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(0), R(0), U8(12), U8(0),
B(ResumeGenerator), R(0), R(0), U8(12),
/* 11 E> */ B(SuspendGenerator), R(3), R(0), U8(12), U8(0),
B(ResumeGenerator), R(3), R(0), U8(12),
B(Star), R(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(3), U8(1),
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
B(Ldar), R(12),
/* 11 E> */ B(Throw),
......@@ -653,8 +653,8 @@ bytecodes: [
B(Star), R(8),
B(Mov), R(9), R(4),
/* 21 E> */ B(StackCheck),
B(Mov), R(4), R(2),
/* 50 S> */ B(Mov), R(2), R(1),
B(Mov), R(4), R(1),
/* 50 S> */ B(Mov), R(1), R(0),
B(LdaZero),
B(Star), R(8),
B(JumpLoop), U8(47), I8(0),
......@@ -759,16 +759,16 @@ frame size: 17
parameter count: 2
bytecode array length: 330
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(SwitchOnGeneratorState), R(2), U8(0), U8(2),
B(Mov), R(closure), R(11),
B(Mov), R(this), R(12),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(11), U8(2),
B(Star), R(0),
B(Star), R(2),
/* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(0), R(0), U8(11), U8(0),
B(ResumeGenerator), R(0), R(0), U8(11),
/* 11 E> */ B(SuspendGenerator), R(2), R(0), U8(11), U8(0),
B(ResumeGenerator), R(2), R(0), U8(11),
B(Star), R(11),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(11),
/* 11 E> */ B(Throw),
......@@ -801,15 +801,15 @@ bytecodes: [
B(Star), R(7),
B(Mov), R(8), R(3),
/* 21 E> */ B(StackCheck),
B(Mov), R(3), R(1),
B(Mov), R(3), R(0),
/* 40 S> */ B(LdaFalse),
B(Star), R(16),
B(Mov), R(1), R(15),
B(Mov), R(0), R(15),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(15), U8(2),
/* 40 E> */ B(SuspendGenerator), R(0), R(0), U8(15), U8(1),
B(ResumeGenerator), R(0), R(0), U8(15),
/* 40 E> */ B(SuspendGenerator), R(2), R(0), U8(15), U8(1),
B(ResumeGenerator), R(2), R(0), U8(15),
B(Star), R(15),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(SwitchOnSmiNoFeedback), U8(8), U8(2), I8(0),
B(Ldar), R(15),
/* 40 E> */ B(Throw),
......@@ -931,7 +931,7 @@ bytecodes: [
B(Mov), R(closure), R(12),
B(Mov), R(this), R(13),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(12), U8(2),
B(Star), R(0),
B(Star), R(3),
/* 16 E> */ B(StackCheck),
B(Mov), R(context), R(12),
B(LdaZero),
......@@ -961,8 +961,8 @@ bytecodes: [
B(Star), R(8),
B(Mov), R(9), R(4),
/* 26 E> */ B(StackCheck),
B(Mov), R(4), R(2),
/* 55 S> */ B(Mov), R(2), R(1),
B(Mov), R(4), R(1),
/* 55 S> */ B(Mov), R(1), R(0),
B(LdaZero),
B(Star), R(8),
B(JumpLoop), U8(47), I8(0),
......@@ -1042,7 +1042,7 @@ bytecodes: [
B(Star), R(14),
B(LdaFalse),
B(Star), R(15),
B(Mov), R(0), R(13),
B(Mov), R(3), R(13),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(13), U8(3),
/* 60 S> */ B(Return),
B(Jump), U8(30),
......@@ -1057,7 +1057,7 @@ bytecodes: [
B(Star), R(15),
B(LdaFalse),
B(Star), R(16),
B(Mov), R(0), R(14),
B(Mov), R(3), R(14),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(14), U8(3),
/* 60 S> */ B(Return),
B(LdaUndefined),
......@@ -1091,11 +1091,11 @@ frame size: 18
parameter count: 2
bytecode array length: 344
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(SwitchOnGeneratorState), R(2), U8(0), U8(1),
B(Mov), R(closure), R(11),
B(Mov), R(this), R(12),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(11), U8(2),
B(Star), R(0),
B(Star), R(2),
/* 16 E> */ B(StackCheck),
B(Mov), R(context), R(11),
B(LdaZero),
......@@ -1125,14 +1125,14 @@ bytecodes: [
B(Star), R(7),
B(Mov), R(8), R(3),
/* 26 E> */ B(StackCheck),
B(Mov), R(3), R(1),
/* 45 S> */ B(Mov), R(0), R(16),
B(Mov), R(1), R(17),
B(Mov), R(3), R(0),
/* 45 S> */ B(Mov), R(2), R(16),
B(Mov), R(0), R(17),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwaitUncaught), R(16), U8(2),
/* 45 E> */ B(SuspendGenerator), R(0), R(0), U8(16), U8(0),
B(ResumeGenerator), R(0), R(0), U8(16),
/* 45 E> */ B(SuspendGenerator), R(2), R(0), U8(16), U8(0),
B(ResumeGenerator), R(2), R(0), U8(16),
B(Star), R(16),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(Star), R(17),
B(LdaZero),
B(TestReferenceEqual), R(17),
......@@ -1218,7 +1218,7 @@ bytecodes: [
B(Star), R(13),
B(LdaTrue),
B(Star), R(14),
B(Mov), R(0), R(12),
B(Mov), R(2), R(12),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(12), U8(3),
/* 54 S> */ B(Return),
B(Jump), U8(30),
......@@ -1233,7 +1233,7 @@ bytecodes: [
B(Star), R(14),
B(LdaTrue),
B(Star), R(15),
B(Mov), R(0), R(13),
B(Mov), R(2), R(13),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(13), U8(3),
/* 54 S> */ B(Return),
B(LdaUndefined),
......
......@@ -102,16 +102,16 @@ frame size: 17
parameter count: 1
bytecode array length: 333
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(SwitchOnGeneratorState), R(2), U8(0), U8(2),
B(Mov), R(closure), R(11),
B(Mov), R(this), R(12),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(11), U8(2),
B(Star), R(0),
B(Star), R(2),
/* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(0), R(0), U8(11), U8(0),
B(ResumeGenerator), R(0), R(0), U8(11),
/* 11 E> */ B(SuspendGenerator), R(2), R(0), U8(11), U8(0),
B(ResumeGenerator), R(2), R(0), U8(11),
B(Star), R(11),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(11),
/* 11 E> */ B(Throw),
......@@ -145,15 +145,15 @@ bytecodes: [
B(Star), R(7),
B(Mov), R(8), R(3),
/* 16 E> */ B(StackCheck),
B(Mov), R(3), R(1),
B(Mov), R(3), R(0),
/* 36 S> */ B(LdaFalse),
B(Star), R(16),
B(Mov), R(1), R(15),
B(Mov), R(0), R(15),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(15), U8(2),
/* 36 E> */ B(SuspendGenerator), R(0), R(0), U8(15), U8(1),
B(ResumeGenerator), R(0), R(0), U8(15),
/* 36 E> */ B(SuspendGenerator), R(2), R(0), U8(15), U8(1),
B(ResumeGenerator), R(2), R(0), U8(15),
B(Star), R(15),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(SwitchOnSmiNoFeedback), U8(9), U8(2), I8(0),
B(Ldar), R(15),
/* 36 E> */ B(Throw),
......
......@@ -272,31 +272,31 @@ frame size: 5
parameter count: 1
bytecode array length: 67
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(SwitchOnGeneratorState), R(2), U8(0), U8(1),
B(Mov), R(closure), R(3),
B(Mov), R(this), R(4),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(3), U8(2),
B(Star), R(0),
B(Star), R(2),
/* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
B(ResumeGenerator), R(0), R(0), U8(3),
/* 11 E> */ B(SuspendGenerator), R(2), R(0), U8(3), U8(0),
B(ResumeGenerator), R(2), R(0), U8(3),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
B(Ldar), R(3),
/* 11 E> */ B(Throw),
B(Ldar), R(3),
/* 62 S> */ B(Return),
/* 31 S> */ B(LdaZero),
B(Star), R(2),
B(Star), R(1),
/* 36 S> */ B(LdaSmi), I8(10),
/* 36 E> */ B(TestLessThan), R(2), U8(0),
/* 36 E> */ B(TestLessThan), R(1), U8(0),
B(JumpIfFalse), U8(15),
/* 18 E> */ B(StackCheck),
/* 57 S> */ B(Mov), R(2), R(1),
/* 44 S> */ B(Ldar), R(1),
/* 57 S> */ B(Mov), R(1), R(0),
/* 44 S> */ B(Ldar), R(0),
B(Inc), U8(1),
B(Star), R(2),
B(Star), R(1),
B(JumpLoop), U8(17), I8(0),
B(LdaUndefined),
/* 62 S> */ B(Return),
......@@ -320,43 +320,43 @@ frame size: 4
parameter count: 1
bytecode array length: 99
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(SwitchOnGeneratorState), R(1), U8(0), U8(2),
B(Mov), R(closure), R(2),
B(Mov), R(this), R(3),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(2), U8(2),
B(Star), R(0),
B(Star), R(1),
/* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0),
B(ResumeGenerator), R(0), R(0), U8(2),
/* 11 E> */ B(SuspendGenerator), R(1), R(0), U8(2), U8(0),
B(ResumeGenerator), R(1), R(0), U8(2),
B(Star), R(2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(2),
/* 11 E> */ B(Throw),
B(Ldar), R(2),
/* 56 S> */ B(Return),
/* 31 S> */ B(LdaZero),
B(Star), R(1),
B(Star), R(0),
/* 36 S> */ B(LdaSmi), I8(10),
/* 36 E> */ B(TestLessThan), R(1), U8(0),
/* 36 E> */ B(TestLessThan), R(0), U8(0),
B(JumpIfFalse), U8(47),
/* 18 E> */ B(StackCheck),
/* 47 S> */ B(LdaFalse),
B(Star), R(3),
B(Mov), R(1), R(2),
B(Mov), R(0), R(2),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(2), U8(2),
/* 47 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(1),
B(ResumeGenerator), R(0), R(0), U8(2),
/* 47 E> */ B(SuspendGenerator), R(1), R(0), U8(2), U8(1),
B(ResumeGenerator), R(1), R(0), U8(2),
B(Star), R(2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
B(SwitchOnSmiNoFeedback), U8(4), U8(2), I8(0),
B(Ldar), R(2),
/* 47 E> */ B(Throw),
B(Ldar), R(2),
/* 56 S> */ B(Return),
/* 44 S> */ B(Ldar), R(1),
/* 44 S> */ B(Ldar), R(0),
B(Inc), U8(1),
B(Star), R(1),
B(Star), R(0),
B(JumpLoop), U8(49), I8(0),
B(LdaUndefined),
/* 56 S> */ B(Return),
......@@ -386,25 +386,25 @@ bytecodes: [
B(Mov), R(closure), R(3),
B(Mov), R(this), R(4),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(3), U8(2),
B(Star), R(0),
B(Star), R(2),
/* 16 E> */ B(StackCheck),
B(Mov), R(context), R(3),
/* 36 S> */ B(LdaZero),
B(Star), R(2),
B(Star), R(1),
/* 41 S> */ B(LdaSmi), I8(10),
/* 41 E> */ B(TestLessThan), R(2), U8(0),
/* 41 E> */ B(TestLessThan), R(1), U8(0),
B(JumpIfFalse), U8(15),
/* 23 E> */ B(StackCheck),
/* 62 S> */ B(Mov), R(2), R(1),
/* 49 S> */ B(Ldar), R(1),
/* 62 S> */ B(Mov), R(1), R(0),
/* 49 S> */ B(Ldar), R(0),
B(Inc), U8(1),
B(Star), R(2),
B(Star), R(1),
B(JumpLoop), U8(17), I8(0),
B(LdaUndefined),
B(Star), R(5),
B(LdaFalse),
B(Star), R(6),
B(Mov), R(0), R(4),
B(Mov), R(2), R(4),
/* 49 E> */ B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(4), U8(3),
/* 67 S> */ B(Return),
B(Jump), U8(30),
......@@ -419,7 +419,7 @@ bytecodes: [
B(Star), R(6),
B(LdaFalse),
B(Star), R(7),
B(Mov), R(0), R(5),
B(Mov), R(2), R(5),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(5), U8(3),
/* 67 S> */ B(Return),
B(LdaUndefined),
......@@ -443,41 +443,41 @@ frame size: 7
parameter count: 1
bytecode array length: 121
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(SwitchOnGeneratorState), R(1), U8(0), U8(1),
B(Mov), R(closure), R(2),
B(Mov), R(this), R(3),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(2), U8(2),
B(Star), R(0),
B(Star), R(1),
/* 16 E> */ B(StackCheck),
B(Mov), R(context), R(2),
/* 36 S> */ B(LdaZero),
B(Star), R(1),
B(Star), R(0),
/* 41 S> */ B(LdaSmi), I8(10),
/* 41 E> */ B(TestLessThan), R(1), U8(0),
/* 41 E> */ B(TestLessThan), R(0), U8(0),
B(JumpIfFalse), U8(47),
/* 23 E> */ B(StackCheck),
/* 52 S> */ B(Mov), R(0), R(3),
B(Mov), R(1), R(4),
/* 52 S> */ B(Mov), R(1), R(3),
B(Mov), R(0), R(4),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwaitUncaught), R(3), U8(2),
/* 52 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
B(ResumeGenerator), R(0), R(0), U8(3),
/* 52 E> */ B(SuspendGenerator), R(1), R(0), U8(3), U8(0),
B(ResumeGenerator), R(1), R(0), U8(3),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
B(Star), R(4),
B(LdaZero),
B(TestReferenceEqual), R(4),
B(JumpIfTrue), U8(5),
B(Ldar), R(3),
B(ReThrow),
/* 49 S> */ B(Ldar), R(1),
/* 49 S> */ B(Ldar), R(0),
B(Inc), U8(1),
B(Star), R(1),
B(Star), R(0),
B(JumpLoop), U8(49), I8(0),
B(LdaUndefined),
B(Star), R(4),
B(LdaTrue),
B(Star), R(5),
B(Mov), R(0), R(3),
B(Mov), R(1), R(3),
/* 49 E> */ B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(3), U8(3),
/* 61 S> */ B(Return),
B(Jump), U8(30),
......@@ -492,7 +492,7 @@ bytecodes: [
B(Star), R(5),
B(LdaTrue),
B(Star), R(6),
B(Mov), R(0), R(4),
B(Mov), R(1), R(4),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(4), U8(3),
/* 61 S> */ B(Return),
B(LdaUndefined),
......
......@@ -40,6 +40,7 @@ bool IsInitiallyMutable(Factory* factory, Address object_address) {
V(api_private_symbol_table) \
V(api_symbol_table) \
V(builtins_constants_table) \
V(current_microtask) \
V(detached_contexts) \
V(feedback_vectors_for_profiling_tools) \
V(materialized_objects) \
......
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