Commit 24c83d49 authored by Toon Verwaest's avatar Toon Verwaest Committed by Commit Bot

[modules] Setup module exports in Runtime_DeclareModuleExports

This changes how we setup modules from being entirely bytecode based to a
single fixed array with metadata that's passed into a runtime function
DeclareModuleExports, similar to DeclareGlobals. This is preperatory work to
replace the bytecode that calls those functions with explicit calls before we
even start running the code. In the case of modules that will obviate the need
for modules to be generators.

Change-Id: Ibf1c913a9dc78041e3001b174c66ab89226d9c8e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2030733
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66097}
parent e395d169
......@@ -229,12 +229,7 @@ MaybeHandle<Context> NewScriptContext(Isolate* isolate,
Handle<Context> result =
isolate->factory()->NewScriptContext(native_context, scope_info);
int header = scope_info->ContextHeaderLength();
for (int var = 0; var < scope_info->ContextLocalCount(); var++) {
if (scope_info->ContextLocalInitFlag(var) == kNeedsInitialization) {
result->set(header + var, ReadOnlyRoots(isolate).the_hole_value());
}
}
result->Initialize(isolate);
Handle<ScriptContextTable> new_script_context_table =
ScriptContextTable::Extend(script_context, result);
......
......@@ -724,47 +724,71 @@ class BytecodeGenerator::TestResultScope final : public ExpressionResultScope {
DISALLOW_COPY_AND_ASSIGN(TestResultScope);
};
// Used to build a list of global declaration initial value pairs.
class BytecodeGenerator::GlobalDeclarationsBuilder final : public ZoneObject {
// Used to build a list of toplevel declaration data.
class BytecodeGenerator::TopLevelDeclarationsBuilder final : public ZoneObject {
public:
Handle<FixedArray> AllocateDeclarations(UnoptimizedCompilationInfo* info,
BytecodeGenerator* generator,
Handle<Script> script,
Isolate* isolate) {
int size = 0;
for (Declaration* decl : *info->scope()->declarations()) {
Variable* var = decl->var();
if (!var->is_used()) continue;
if (var->location() != VariableLocation::UNALLOCATED) continue;
DCHECK_IMPLIES(decl->node_type() != AstNode::kVariableDeclaration,
decl->node_type() == AstNode::kFunctionDeclaration);
size += decl->node_type() == AstNode::kVariableDeclaration ? 1 : 2;
}
DCHECK(has_constant_pool_entry_);
Handle<FixedArray> data =
isolate->factory()->NewFixedArray(size, AllocationType::kOld);
isolate->factory()->NewFixedArray(entry_slots_, AllocationType::kOld);
int array_index = 0;
if (info->scope()->is_module_scope()) {
for (Declaration* decl : *info->scope()->declarations()) {
Variable* var = decl->var();
if (!var->is_used()) continue;
if (var->location() != VariableLocation::MODULE) continue;
#ifdef DEBUG
int start = array_index;
#endif
if (decl->IsFunctionDeclaration()) {
FunctionLiteral* f = static_cast<FunctionDeclaration*>(decl)->fun();
Handle<Object> sfi(
Compiler::GetSharedFunctionInfo(f, script, isolate));
// Return a null handle if any initial values can't be created. Caller
// will set stack overflow.
if (sfi.is_null()) return Handle<FixedArray>();
data->set(array_index++, *sfi);
int literal_index = generator->GetCachedCreateClosureSlot(f);
data->set(array_index++, Smi::FromInt(literal_index));
DCHECK(var->IsExport());
data->set(array_index++, Smi::FromInt(var->index()));
DCHECK_EQ(start + kModuleFunctionDeclarationSize, array_index);
} else if (var->IsExport() && var->binding_needs_init()) {
data->set(array_index++, Smi::FromInt(var->index()));
DCHECK_EQ(start + kModuleVariableDeclarationSize, array_index);
}
}
} else {
for (Declaration* decl : *info->scope()->declarations()) {
Variable* var = decl->var();
if (!var->is_used()) continue;
if (var->location() != VariableLocation::UNALLOCATED) continue;
if (decl->node_type() == AstNode::kVariableDeclaration) {
#ifdef DEBUG
int start = array_index;
#endif
if (decl->IsVariableDeclaration()) {
data->set(array_index++, *var->raw_name()->string().get<Factory>());
DCHECK_EQ(start + kGlobalVariableDeclarationSize, array_index);
} else {
FunctionLiteral* f = static_cast<FunctionDeclaration*>(decl)->fun();
Handle<Object> sfi(Compiler::GetSharedFunctionInfo(f, script, isolate));
Handle<Object> sfi(
Compiler::GetSharedFunctionInfo(f, script, isolate));
// Return a null handle if any initial values can't be created. Caller
// will set stack overflow.
if (sfi.is_null()) return Handle<FixedArray>();
data->set(array_index++, *sfi);
int literal_index = generator->GetCachedCreateClosureSlot(f);
data->set(array_index++, Smi::FromInt(literal_index));
DCHECK_EQ(start + kGlobalFunctionDeclarationSize, array_index);
}
}
}
DCHECK_EQ(array_index, data->length());
return data;
}
......@@ -774,21 +798,37 @@ class BytecodeGenerator::GlobalDeclarationsBuilder final : public ZoneObject {
}
void set_constant_pool_entry(size_t constant_pool_entry) {
DCHECK(has_global_declaration());
DCHECK(has_top_level_declaration());
DCHECK(!has_constant_pool_entry_);
constant_pool_entry_ = constant_pool_entry;
has_constant_pool_entry_ = true;
}
void record_global_declaration() { has_seen_global_declaration_ = true; }
bool has_global_declaration() { return has_seen_global_declaration_; }
void record_global_variable_declaration() {
entry_slots_ += kGlobalVariableDeclarationSize;
}
void record_global_function_declaration() {
entry_slots_ += kGlobalFunctionDeclarationSize;
}
void record_module_variable_declaration() {
entry_slots_ += kModuleVariableDeclarationSize;
}
void record_module_function_declaration() {
entry_slots_ += kModuleFunctionDeclarationSize;
}
bool has_top_level_declaration() { return entry_slots_ > 0; }
bool processed() { return processed_; }
void mark_processed() { processed_ = true; }
private:
const int kGlobalVariableDeclarationSize = 1;
const int kGlobalFunctionDeclarationSize = 2;
const int kModuleVariableDeclarationSize = 1;
const int kModuleFunctionDeclarationSize = 3;
size_t constant_pool_entry_ = 0;
int entry_slots_ = 0;
bool has_constant_pool_entry_ = false;
bool has_seen_global_declaration_ = false;
bool processed_ = false;
};
......@@ -983,7 +1023,7 @@ BytecodeGenerator::BytecodeGenerator(
current_scope_(info->scope()),
eager_inner_literals_(eager_inner_literals),
feedback_slot_cache_(new (zone()) FeedbackSlotCache(zone())),
globals_builder_(new (zone()) GlobalDeclarationsBuilder()),
top_level_builder_(new (zone()) TopLevelDeclarationsBuilder()),
block_coverage_builder_(nullptr),
function_literals_(0, zone()),
native_function_literals_(0, zone()),
......@@ -1066,13 +1106,13 @@ int BytecodeGenerator::CheckBytecodeMatches(Handle<BytecodeArray> bytecode) {
void BytecodeGenerator::AllocateDeferredConstants(Isolate* isolate,
Handle<Script> script) {
if (globals_builder()->has_global_declaration()) {
if (top_level_builder()->has_top_level_declaration()) {
// Build global declaration pair array.
Handle<FixedArray> declarations =
globals_builder()->AllocateDeclarations(info(), this, script, isolate);
Handle<FixedArray> declarations = top_level_builder()->AllocateDeclarations(
info(), this, script, isolate);
if (declarations.is_null()) return SetStackOverflow();
builder()->SetDeferredConstantPoolEntry(
globals_builder()->constant_pool_entry(), declarations);
top_level_builder()->constant_pool_entry(), declarations);
}
// Find or build shared function infos.
......@@ -1142,6 +1182,13 @@ void BytecodeGenerator::AllocateDeferredConstants(Isolate* isolate,
}
}
namespace {
bool NeedsContextInitialization(DeclarationScope* scope) {
return scope->NeedsContext() && !scope->is_script_scope() &&
!scope->is_module_scope();
}
} // namespace
void BytecodeGenerator::GenerateBytecode(uintptr_t stack_limit) {
DisallowHeapAllocation no_allocation;
DisallowHandleAllocation no_handles;
......@@ -1166,7 +1213,7 @@ void BytecodeGenerator::GenerateBytecode(uintptr_t stack_limit) {
BuildGeneratorPrologue();
}
if (closure_scope()->NeedsContext() && !closure_scope()->is_script_scope()) {
if (NeedsContextInitialization(closure_scope())) {
// Push a new inner context scope for the function.
BuildNewLocalActivationContext();
ContextScope local_function_context(this, closure_scope());
......@@ -1223,6 +1270,8 @@ void BytecodeGenerator::GenerateBytecodeBody() {
// Visit declarations within the function scope.
if (closure_scope()->is_script_scope()) {
VisitGlobalDeclarations(closure_scope()->declarations());
} else if (closure_scope()->is_module_scope()) {
VisitModuleDeclarations(closure_scope()->declarations());
} else {
VisitDeclarations(closure_scope()->declarations());
}
......@@ -1320,6 +1369,7 @@ void BytecodeGenerator::VisitVariableDeclaration(VariableDeclaration* decl) {
switch (variable->location()) {
case VariableLocation::UNALLOCATED:
case VariableLocation::MODULE:
UNREACHABLE();
case VariableLocation::LOCAL:
if (variable->binding_needs_init()) {
......@@ -1355,13 +1405,6 @@ void BytecodeGenerator::VisitVariableDeclaration(VariableDeclaration* decl) {
.CallRuntime(Runtime::kDeclareEvalVar, name);
break;
}
case VariableLocation::MODULE:
if (variable->IsExport() && variable->binding_needs_init()) {
builder()->LoadTheHole();
BuildVariableAssignment(variable, Token::INIT, HoleCheckMode::kElided);
}
// Nothing to do for imports.
break;
}
}
......@@ -1375,6 +1418,7 @@ void BytecodeGenerator::VisitFunctionDeclaration(FunctionDeclaration* decl) {
switch (variable->location()) {
case VariableLocation::UNALLOCATED:
case VariableLocation::MODULE:
UNREACHABLE();
case VariableLocation::PARAMETER:
case VariableLocation::LOCAL: {
......@@ -1400,12 +1444,6 @@ void BytecodeGenerator::VisitFunctionDeclaration(FunctionDeclaration* decl) {
Runtime::kDeclareEvalFunction, args);
break;
}
case VariableLocation::MODULE:
DCHECK_EQ(variable->mode(), VariableMode::kLet);
DCHECK(variable->IsExport());
VisitForAccumulatorValue(decl->fun());
BuildVariableAssignment(variable, Token::INIT, HoleCheckMode::kElided);
break;
}
DCHECK_IMPLIES(
eager_inner_literals_ != nullptr && decl->fun()->ShouldEagerCompile(),
......@@ -1430,18 +1468,60 @@ void BytecodeGenerator::VisitModuleNamespaceImports() {
}
}
void BytecodeGenerator::BuildDeclareCall(Runtime::FunctionId id) {
if (!top_level_builder()->has_top_level_declaration()) return;
DCHECK(!top_level_builder()->processed());
top_level_builder()->set_constant_pool_entry(
builder()->AllocateDeferredConstantPoolEntry());
// Emit code to declare globals.
RegisterList args = register_allocator()->NewRegisterList(2);
builder()
->LoadConstantPoolEntry(top_level_builder()->constant_pool_entry())
.StoreAccumulatorInRegister(args[0])
.MoveRegister(Register::function_closure(), args[1])
.CallRuntime(id, args);
top_level_builder()->mark_processed();
}
void BytecodeGenerator::VisitModuleDeclarations(Declaration::List* decls) {
RegisterAllocationScope register_scope(this);
for (Declaration* decl : *decls) {
Variable* var = decl->var();
if (!var->is_used()) continue;
if (var->location() == VariableLocation::MODULE) {
if (decl->IsFunctionDeclaration()) {
DCHECK(var->IsExport());
FunctionDeclaration* f = static_cast<FunctionDeclaration*>(decl);
AddToEagerLiteralsIfEager(f->fun());
top_level_builder()->record_module_function_declaration();
} else if (var->IsExport() && var->binding_needs_init()) {
DCHECK(decl->IsVariableDeclaration());
top_level_builder()->record_module_variable_declaration();
}
} else {
RegisterAllocationScope register_scope(this);
Visit(decl);
}
}
BuildDeclareCall(Runtime::kDeclareModuleExports);
}
void BytecodeGenerator::VisitGlobalDeclarations(Declaration::List* decls) {
RegisterAllocationScope register_scope(this);
bool has_global_declaration = false;
for (Declaration* decl : *decls) {
Variable* var = decl->var();
DCHECK(var->is_used());
if (var->location() == VariableLocation::UNALLOCATED) {
// var or function.
has_global_declaration = true;
if (decl->IsFunctionDeclaration()) {
top_level_builder()->record_global_function_declaration();
FunctionDeclaration* f = static_cast<FunctionDeclaration*>(decl);
AddToEagerLiteralsIfEager(f->fun());
} else {
top_level_builder()->record_global_variable_declaration();
}
} else {
// let or const. Handled in NewScriptContext.
......@@ -1450,22 +1530,7 @@ void BytecodeGenerator::VisitGlobalDeclarations(Declaration::List* decls) {
}
}
if (!has_global_declaration) return;
globals_builder()->record_global_declaration();
DCHECK(!globals_builder()->processed());
globals_builder()->set_constant_pool_entry(
builder()->AllocateDeferredConstantPoolEntry());
// Emit code to declare globals.
RegisterList args = register_allocator()->NewRegisterList(2);
builder()
->LoadConstantPoolEntry(globals_builder()->constant_pool_entry())
.StoreAccumulatorInRegister(args[0])
.MoveRegister(Register::function_closure(), args[1])
.CallRuntime(Runtime::kDeclareGlobals, args);
globals_builder()->mark_processed();
BuildDeclareCall(Runtime::kDeclareGlobals);
}
void BytecodeGenerator::VisitDeclarations(Declaration::List* declarations) {
......@@ -5996,19 +6061,6 @@ void BytecodeGenerator::BuildNewLocalActivationContext() {
DCHECK_EQ(current_scope(), closure_scope());
// Create the appropriate context.
if (scope->is_module_scope()) {
// We don't need to do anything for the outer script scope.
DCHECK(scope->outer_scope()->is_script_scope());
// A JSFunction representing a module is called with the module object as
// its sole argument.
RegisterList args = register_allocator()->NewRegisterList(2);
builder()
->MoveRegister(builder()->Parameter(0), args[0])
.LoadLiteral(scope)
.StoreAccumulatorInRegister(args[1])
.CallRuntime(Runtime::kPushModuleContext, args);
} else {
DCHECK(scope->is_function_scope() || scope->is_eval_scope());
int slot_count = scope->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
if (slot_count <= ConstructorBuiltins::MaximumFunctionContextSlots()) {
......@@ -6027,7 +6079,6 @@ void BytecodeGenerator::BuildNewLocalActivationContext() {
builder()->LoadLiteral(scope).StoreAccumulatorInRegister(arg).CallRuntime(
Runtime::kNewFunctionContext, arg);
}
}
}
void BytecodeGenerator::BuildLocalActivationContextInitialization() {
......
......@@ -24,7 +24,7 @@ enum class SourceRangeKind;
namespace interpreter {
class GlobalDeclarationsBuilder;
class TopLevelDeclarationsBuilder;
class LoopBuilder;
class BlockCoverageBuilder;
class BytecodeJumpTable;
......@@ -50,6 +50,7 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
#undef DECLARE_VISIT
// Visiting function for declarations list and statements are overridden.
void VisitModuleDeclarations(Declaration::List* declarations);
void VisitGlobalDeclarations(Declaration::List* declarations);
void VisitDeclarations(Declaration::List* declarations);
void VisitStatements(const ZonePtrList<Statement>* statments);
......@@ -66,7 +67,7 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
class ExpressionResultScope;
class EffectResultScope;
class FeedbackSlotCache;
class GlobalDeclarationsBuilder;
class TopLevelDeclarationsBuilder;
class IteratorRecord;
class NaryCodeCoverageSlots;
class RegisterAllocationScope;
......@@ -221,6 +222,8 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
void BuildThisVariableLoad();
void BuildDeclareCall(Runtime::FunctionId id);
Expression* GetDestructuringDefaultValue(Expression** target);
void BuildDestructuringArrayAssignment(
ArrayLiteral* pattern, Token::Value op,
......@@ -462,9 +465,9 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
return builder()->register_allocator();
}
GlobalDeclarationsBuilder* globals_builder() {
DCHECK_NOT_NULL(globals_builder_);
return globals_builder_;
TopLevelDeclarationsBuilder* top_level_builder() {
DCHECK_NOT_NULL(top_level_builder_);
return top_level_builder_;
}
inline LanguageMode language_mode() const;
inline FunctionKind function_kind() const;
......@@ -494,7 +497,7 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
FeedbackSlotCache* feedback_slot_cache_;
GlobalDeclarationsBuilder* globals_builder_;
TopLevelDeclarationsBuilder* top_level_builder_;
BlockCoverageBuilder* block_coverage_builder_;
ZoneVector<std::pair<FunctionLiteral*, size_t>> function_literals_;
ZoneVector<std::pair<NativeFunctionLiteral*, size_t>>
......
......@@ -36,6 +36,16 @@ Handle<ScriptContextTable> ScriptContextTable::Extend(
return result;
}
void Context::Initialize(Isolate* isolate) {
ScopeInfo scope_info = this->scope_info();
int header = scope_info.ContextHeaderLength();
for (int var = 0; var < scope_info.ContextLocalCount(); var++) {
if (scope_info.ContextLocalInitFlag(var) == kNeedsInitialization) {
set(header + var, ReadOnlyRoots(isolate).the_hole_value());
}
}
}
bool ScriptContextTable::Lookup(Isolate* isolate, ScriptContextTable table,
String name, LookupResult* result) {
DisallowHeapAllocation no_gc;
......
......@@ -507,6 +507,10 @@ class Context : public HeapObject {
return SizeFor(index) - kHeapObjectTag;
}
// Initializes the variable slots of the context. Lexical variables that need
// initialization are filled with the hole.
void Initialize(Isolate* isolate);
// TODO(ishell): eventually migrate to the offset based access instead of
// index-based.
// The default context slot layout; indices are FixedArray slot indices.
......
......@@ -369,9 +369,14 @@ bool SourceTextModule::RunInitializationCode(Isolate* isolate,
Handle<JSFunction> function(JSFunction::cast(module->code()), isolate);
DCHECK_EQ(MODULE_SCOPE, function->shared().scope_info().scope_type());
Handle<Object> receiver = isolate->factory()->undefined_value();
Handle<Object> argv[] = {module};
Handle<ScopeInfo> scope_info(function->shared().scope_info(), isolate);
Handle<Context> context = isolate->factory()->NewModuleContext(
module, isolate->native_context(), scope_info);
function->set_context(*context);
MaybeHandle<Object> maybe_generator =
Execution::Call(isolate, function, receiver, arraysize(argv), argv);
Execution::Call(isolate, function, receiver, 0, {});
Handle<Object> generator;
if (!maybe_generator.ToHandle(&generator)) {
DCHECK(isolate->has_pending_exception());
......
......@@ -570,18 +570,6 @@ FunctionLiteral* Parser::DoParseProgram(Isolate* isolate, ParseInfo* info) {
int beg_pos = scanner()->location().beg_pos;
if (parsing_module_) {
DCHECK(info->is_module());
// Declare the special module parameter.
auto name = ast_value_factory()->empty_string();
bool is_rest = false;
bool is_optional = false;
VariableMode mode = VariableMode::kVar;
bool was_added;
scope->DeclareLocal(name, mode, PARAMETER_VARIABLE, &was_added,
Variable::DefaultInitializationFlag(mode));
DCHECK(was_added);
auto var = scope->DeclareParameter(name, VariableMode::kVar, is_optional,
is_rest, ast_value_factory(), beg_pos);
var->AllocateTo(VariableLocation::PARAMETER, 0);
PrepareGeneratorVariables();
Expression* initial_yield =
......@@ -663,7 +651,7 @@ FunctionLiteral* Parser::DoParseProgram(Isolate* isolate, ParseInfo* info) {
}
}
int parameter_count = parsing_module_ ? 1 : 0;
int parameter_count = 0;
result = factory()->NewScriptOrEvalFunctionLiteral(
scope, body, function_state.expected_property_count(), parameter_count);
result->set_suspend_count(function_state.suspend_count());
......
......@@ -45,11 +45,10 @@ Object ThrowRedeclarationError(Isolate* isolate, Handle<String> name,
}
// May throw a RedeclarationError.
Object DeclareGlobal(
Isolate* isolate, Handle<JSGlobalObject> global, Handle<String> name,
Handle<Object> value, PropertyAttributes attr, bool is_var,
RedeclarationType redeclaration_type,
Handle<FeedbackVector> feedback_vector = Handle<FeedbackVector>()) {
Object DeclareGlobal(Isolate* isolate, Handle<JSGlobalObject> global,
Handle<String> name, Handle<Object> value,
PropertyAttributes attr, bool is_var,
RedeclarationType redeclaration_type) {
Handle<ScriptContextTable> script_contexts(
global->native_context().script_context_table(), isolate);
ScriptContextTable::LookupResult lookup;
......@@ -118,20 +117,70 @@ Object DeclareGlobal(
return ReadOnlyRoots(isolate).undefined_value();
}
Object DeclareGlobals(Isolate* isolate, Handle<FixedArray> declarations,
Handle<JSFunction> closure) {
} // namespace
RUNTIME_FUNCTION(Runtime_DeclareModuleExports) {
HandleScope scope(isolate);
DCHECK_EQ(2, args.length());
CONVERT_ARG_HANDLE_CHECKED(FixedArray, declarations, 0);
CONVERT_ARG_HANDLE_CHECKED(JSFunction, closure, 1);
Handle<ClosureFeedbackCellArray> closure_feedback_cell_array =
Handle<ClosureFeedbackCellArray>::null();
if (closure->has_feedback_vector()) {
closure_feedback_cell_array = Handle<ClosureFeedbackCellArray>(
closure->feedback_vector().closure_feedback_cell_array(), isolate);
} else {
closure_feedback_cell_array = Handle<ClosureFeedbackCellArray>(
closure->closure_feedback_cell_array(), isolate);
}
Handle<Context> context(isolate->context(), isolate);
DCHECK(context->IsModuleContext());
Handle<FixedArray> exports(
SourceTextModule::cast(context->extension()).regular_exports(), isolate);
int length = declarations->length();
FOR_WITH_HANDLE_SCOPE(isolate, int, i = 0, i, i < length, i++, {
Object decl = declarations->get(i);
int index;
Object value;
if (decl.IsSmi()) {
index = Smi::ToInt(decl);
value = ReadOnlyRoots(isolate).the_hole_value();
} else {
Handle<SharedFunctionInfo> sfi(
SharedFunctionInfo::cast(declarations->get(i)), isolate);
int feedback_index = Smi::ToInt(declarations->get(++i));
index = Smi::ToInt(declarations->get(++i));
Handle<FeedbackCell> feedback_cell =
closure_feedback_cell_array->GetFeedbackCell(feedback_index);
value = *isolate->factory()->NewFunctionFromSharedFunctionInfo(
sfi, context, feedback_cell, AllocationType::kOld);
}
Cell::cast(exports->get(index - 1)).set_value(value);
});
return ReadOnlyRoots(isolate).undefined_value();
}
RUNTIME_FUNCTION(Runtime_DeclareGlobals) {
HandleScope scope(isolate);
DCHECK_EQ(2, args.length());
CONVERT_ARG_HANDLE_CHECKED(FixedArray, declarations, 0);
CONVERT_ARG_HANDLE_CHECKED(JSFunction, closure, 1);
Handle<JSGlobalObject> global(isolate->global_object());
Handle<Context> context(isolate->context(), isolate);
Handle<FeedbackVector> feedback_vector = Handle<FeedbackVector>::null();
Handle<ClosureFeedbackCellArray> closure_feedback_cell_array =
Handle<ClosureFeedbackCellArray>::null();
if (closure->has_feedback_vector()) {
feedback_vector =
Handle<FeedbackVector>(closure->feedback_vector(), isolate);
closure_feedback_cell_array = Handle<ClosureFeedbackCellArray>(
feedback_vector->closure_feedback_cell_array(), isolate);
closure->feedback_vector().closure_feedback_cell_array(), isolate);
} else {
closure_feedback_cell_array = Handle<ClosureFeedbackCellArray>(
closure->closure_feedback_cell_array(), isolate);
......@@ -168,27 +217,14 @@ Object DeclareGlobals(Isolate* isolate, Handle<FixedArray> declarations,
// ES#sec-globaldeclarationinstantiation 5.d:
// If hasRestrictedGlobal is true, throw a SyntaxError exception.
Object result =
DeclareGlobal(isolate, global, name, value, attr, is_var,
RedeclarationType::kSyntaxError, feedback_vector);
Object result = DeclareGlobal(isolate, global, name, value, attr, is_var,
RedeclarationType::kSyntaxError);
if (isolate->has_pending_exception()) return result;
});
return ReadOnlyRoots(isolate).undefined_value();
}
} // namespace
RUNTIME_FUNCTION(Runtime_DeclareGlobals) {
HandleScope scope(isolate);
DCHECK_EQ(2, args.length());
CONVERT_ARG_HANDLE_CHECKED(FixedArray, declarations, 0);
CONVERT_ARG_HANDLE_CHECKED(JSFunction, closure, 1);
return DeclareGlobals(isolate, declarations, closure);
}
namespace {
Object DeclareEvalHelper(Isolate* isolate, Handle<String> name,
......@@ -619,19 +655,6 @@ RUNTIME_FUNCTION(Runtime_PushWithContext) {
return *context;
}
RUNTIME_FUNCTION(Runtime_PushModuleContext) {
HandleScope scope(isolate);
DCHECK_EQ(2, args.length());
CONVERT_ARG_HANDLE_CHECKED(SourceTextModule, module, 0);
CONVERT_ARG_HANDLE_CHECKED(ScopeInfo, scope_info, 1);
Handle<NativeContext> outer(NativeContext::cast(isolate->context()), isolate);
Handle<Context> context =
isolate->factory()->NewModuleContext(module, outer, scope_info);
isolate->set_context(*context);
return *context;
}
RUNTIME_FUNCTION(Runtime_PushCatchContext) {
HandleScope scope(isolate);
DCHECK_EQ(2, args.length());
......
......@@ -387,6 +387,7 @@ namespace internal {
F(DeclareEvalFunction, 2, 1) \
F(DeclareEvalVar, 1, 1) \
F(DeclareGlobals, 2, 1) \
F(DeclareModuleExports, 2, 1) \
F(DeleteLookupSlot, 1, 1) \
F(LoadLookupSlot, 1, 1) \
F(LoadLookupSlotInsideTypeof, 1, 1) \
......@@ -401,7 +402,6 @@ namespace internal {
F(NewStrictArguments, 1, 1) \
F(PushBlockContext, 1, 1) \
F(PushCatchContext, 2, 1) \
F(PushModuleContext, 2, 1) \
F(PushWithContext, 2, 1) \
F(StoreGlobalNoHoleCheckForReplLet, 2, 1) \
F(StoreLookupSlot_Sloppy, 2, 1) \
......
......@@ -12,162 +12,150 @@ top level await: yes
snippet: "
await 42;
"
frame size: 8
parameter count: 2
bytecode array length: 142
frame size: 7
parameter count: 1
bytecode array length: 128
bytecodes: [
/* 0 E> */ B(StackCheck),
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(LdaConstant), U8(2),
B(Star), R(3),
B(Mov), R(arg0), R(2),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(2), U8(2),
B(PushContext), R(2),
B(Mov), R(closure), R(3),
B(Mov), R(this), R(4),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(3), U8(2),
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),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star), R(3),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0),
B(ResumeGenerator), R(0), R(0), U8(2),
B(Star), R(2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(3), U8(2), I8(0),
B(Ldar), R(3),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(2),
/* 0 E> */ B(Throw),
B(Ldar), R(3),
B(Ldar), R(2),
/* 10 S> */ B(Return),
B(Mov), R(3), R(1),
B(Mov), R(2), R(1),
B(Ldar), R(1),
B(Mov), R(context), R(3),
B(Mov), R(context), R(2),
/* 0 S> */ B(LdaSmi), I8(42),
B(Star), R(5),
B(Mov), R(0), R(4),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwaitUncaught), R(4), U8(2),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(1),
B(ResumeGenerator), R(0), R(0), U8(4),
B(Star), R(4),
B(Mov), R(0), R(3),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwaitUncaught), R(3), U8(2),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(1),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star), R(5),
B(Star), R(4),
B(LdaZero),
B(TestReferenceEqual), R(5),
B(TestReferenceEqual), R(4),
B(JumpIfTrue), U8(5),
B(Ldar), R(4),
B(Ldar), R(3),
B(ReThrow),
B(LdaUndefined),
B(Star), R(5),
B(Star), R(4),
B(LdaTrue),
B(Star), R(6),
B(Mov), R(0), R(4),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(4), U8(3),
B(Star), R(5),
B(Mov), R(0), R(3),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(3), U8(3),
/* 10 S> */ B(Return),
B(Star), R(4),
B(CreateCatchContext), R(4), U8(5),
B(Star), R(3),
B(CreateCatchContext), R(3), U8(4),
B(Star), R(2),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(3),
B(PushContext), R(4),
B(Ldar), R(2),
B(PushContext), R(3),
B(LdaImmutableCurrentContextSlot), U8(2),
B(Star), R(6),
B(Star), R(5),
B(LdaTrue),
B(Star), R(7),
B(Mov), R(0), R(5),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(5), U8(3),
B(Star), R(6),
B(Mov), R(0), R(4),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(4), U8(3),
/* 10 S> */ B(Return),
]
constant pool: [
Smi [35],
Smi [79],
SCOPE_INFO_TYPE,
Smi [21],
Smi [65],
Smi [10],
Smi [7],
SCOPE_INFO_TYPE,
]
handlers: [
[64, 114, 114],
[50, 100, 100],
]
---
snippet: "
await import(\"foo\");
"
frame size: 8
parameter count: 2
bytecode array length: 152
frame size: 7
parameter count: 1
bytecode array length: 138
bytecodes: [
/* 0 E> */ B(StackCheck),
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(LdaConstant), U8(2),
B(Star), R(3),
B(Mov), R(arg0), R(2),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(2), U8(2),
B(PushContext), R(2),
B(Mov), R(closure), R(3),
B(Mov), R(this), R(4),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(3), U8(2),
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),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star), R(3),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0),
B(ResumeGenerator), R(0), R(0), U8(2),
B(Star), R(2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(3), U8(2), I8(0),
B(Ldar), R(3),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(2),
/* 0 E> */ B(Throw),
B(Ldar), R(3),
B(Ldar), R(2),
/* 21 S> */ B(Return),
B(Mov), R(3), R(1),
B(Mov), R(2), R(1),
B(Ldar), R(1),
B(Mov), R(context), R(3),
/* 0 S> */ B(LdaConstant), U8(5),
B(Star), R(5),
B(Mov), R(closure), R(4),
B(CallRuntime), U16(Runtime::kDynamicImportCall), R(4), U8(2),
B(Star), R(5),
B(Mov), R(0), R(4),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwaitUncaught), R(4), U8(2),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(1),
B(ResumeGenerator), R(0), R(0), U8(4),
B(Mov), R(context), R(2),
/* 0 S> */ B(LdaConstant), U8(4),
B(Star), R(4),
B(Mov), R(closure), R(3),
B(CallRuntime), U16(Runtime::kDynamicImportCall), R(3), U8(2),
B(Star), R(4),
B(Mov), R(0), R(3),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwaitUncaught), R(3), U8(2),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(1),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star), R(5),
B(Star), R(4),
B(LdaZero),
B(TestReferenceEqual), R(5),
B(TestReferenceEqual), R(4),
B(JumpIfTrue), U8(5),
B(Ldar), R(4),
B(Ldar), R(3),
B(ReThrow),
B(LdaUndefined),
B(Star), R(5),
B(Star), R(4),
B(LdaTrue),
B(Star), R(6),
B(Mov), R(0), R(4),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(4), U8(3),
B(Star), R(5),
B(Mov), R(0), R(3),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(3), U8(3),
/* 21 S> */ B(Return),
B(Star), R(4),
B(CreateCatchContext), R(4), U8(6),
B(Star), R(3),
B(CreateCatchContext), R(3), U8(5),
B(Star), R(2),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(3),
B(PushContext), R(4),
B(Ldar), R(2),
B(PushContext), R(3),
B(LdaImmutableCurrentContextSlot), U8(2),
B(Star), R(6),
B(Star), R(5),
B(LdaTrue),
B(Star), R(7),
B(Mov), R(0), R(5),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(5), U8(3),
B(Star), R(6),
B(Mov), R(0), R(4),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(4), U8(3),
/* 21 S> */ B(Return),
]
constant pool: [
Smi [35],
Smi [89],
SCOPE_INFO_TYPE,
Smi [21],
Smi [75],
Smi [10],
Smi [7],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["foo"],
SCOPE_INFO_TYPE,
]
handlers: [
[64, 124, 124],
[50, 110, 110],
]
---
......@@ -178,84 +166,78 @@ snippet: "
}
foo();
"
frame size: 9
parameter count: 2
bytecode array length: 153
frame size: 8
parameter count: 1
bytecode array length: 139
bytecodes: [
/* 0 E> */ B(StackCheck),
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(LdaConstant), U8(2),
B(Star), R(4),
B(Mov), R(arg0), R(3),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(3), U8(2),
B(PushContext), R(3),
B(Mov), R(closure), R(4),
B(Mov), R(this), R(5),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(4), U8(2),
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(CreateClosure), U8(3), U8(0), U8(0),
B(CreateClosure), U8(2), U8(0), U8(0),
B(Star), R(1),
B(Ldar), R(0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0),
B(ResumeGenerator), R(0), R(0), U8(4),
B(Star), R(4),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(4), U8(2), I8(0),
B(Ldar), R(4),
B(SwitchOnSmiNoFeedback), U8(3), U8(2), I8(0),
B(Ldar), R(3),
/* 0 E> */ B(Throw),
B(Ldar), R(4),
B(Ldar), R(3),
/* 54 S> */ B(Return),
B(Mov), R(4), R(2),
B(Mov), R(3), R(2),
B(Ldar), R(2),
B(Mov), R(context), R(4),
B(Mov), R(context), R(3),
/* 0 S> */ B(LdaSmi), I8(42),
B(Star), R(6),
B(Mov), R(0), R(5),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwaitUncaught), R(5), U8(2),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(5), U8(1),
B(ResumeGenerator), R(0), R(0), U8(5),
B(Star), R(5),
B(Mov), R(0), R(4),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwaitUncaught), R(4), U8(2),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(1),
B(ResumeGenerator), R(0), R(0), U8(4),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star), R(6),
B(Star), R(5),
B(LdaZero),
B(TestReferenceEqual), R(6),
B(TestReferenceEqual), R(5),
B(JumpIfTrue), U8(5),
B(Ldar), R(5),
B(Ldar), R(4),
B(ReThrow),
/* 47 S> */ B(CallUndefinedReceiver0), R(1), U8(0),
B(LdaUndefined),
B(Star), R(6),
B(Star), R(5),
B(LdaTrue),
B(Star), R(7),
B(Mov), R(0), R(5),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(5), U8(3),
B(Star), R(6),
B(Mov), R(0), R(4),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(4), U8(3),
/* 54 S> */ B(Return),
B(Star), R(5),
B(CreateCatchContext), R(5), U8(6),
B(Star), R(4),
B(CreateCatchContext), R(4), U8(5),
B(Star), R(3),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(4),
B(PushContext), R(5),
B(Ldar), R(3),
B(PushContext), R(4),
B(LdaImmutableCurrentContextSlot), U8(2),
B(Star), R(7),
B(Star), R(6),
B(LdaTrue),
B(Star), R(8),
B(Mov), R(0), R(6),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(6), U8(3),
B(Star), R(7),
B(Mov), R(0), R(5),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(5), U8(3),
/* 54 S> */ B(Return),
]
constant pool: [
Smi [43],
Smi [87],
SCOPE_INFO_TYPE,
Smi [29],
Smi [73],
SHARED_FUNCTION_INFO_TYPE,
Smi [10],
Smi [7],
SCOPE_INFO_TYPE,
]
handlers: [
[72, 125, 125],
[58, 111, 111],
]
---
......@@ -263,87 +245,81 @@ snippet: "
import * as foo from \"bar\";
await import(\"goo\");
"
frame size: 9
parameter count: 2
bytecode array length: 164
frame size: 8
parameter count: 1
bytecode array length: 150
bytecodes: [
/* 0 E> */ B(StackCheck),
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(LdaConstant), U8(2),
B(Star), R(4),
B(Mov), R(arg0), R(3),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(3), U8(2),
B(PushContext), R(3),
B(Mov), R(closure), R(4),
B(Mov), R(this), R(5),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(4), U8(2),
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(LdaZero),
B(Star), R(4),
B(CallRuntime), U16(Runtime::kGetModuleNamespace), R(4), U8(1),
B(Star), R(3),
B(CallRuntime), U16(Runtime::kGetModuleNamespace), R(3), U8(1),
B(Star), R(1),
B(Ldar), R(0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0),
B(ResumeGenerator), R(0), R(0), U8(4),
B(Star), R(4),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(3), U8(2), I8(0),
B(Ldar), R(4),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(3),
/* 0 E> */ B(Throw),
B(Ldar), R(4),
B(Ldar), R(3),
/* 49 S> */ B(Return),
B(Mov), R(4), R(2),
B(Mov), R(3), R(2),
B(Ldar), R(2),
B(Mov), R(context), R(4),
/* 28 S> */ B(LdaConstant), U8(5),
B(Star), R(6),
B(Mov), R(closure), R(5),
B(CallRuntime), U16(Runtime::kDynamicImportCall), R(5), U8(2),
B(Star), R(6),
B(Mov), R(0), R(5),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwaitUncaught), R(5), U8(2),
/* 28 E> */ B(SuspendGenerator), R(0), R(0), U8(5), U8(1),
B(ResumeGenerator), R(0), R(0), U8(5),
B(Mov), R(context), R(3),
/* 28 S> */ B(LdaConstant), U8(4),
B(Star), R(5),
B(Mov), R(closure), R(4),
B(CallRuntime), U16(Runtime::kDynamicImportCall), R(4), U8(2),
B(Star), R(5),
B(Mov), R(0), R(4),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwaitUncaught), R(4), U8(2),
/* 28 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(1),
B(ResumeGenerator), R(0), R(0), U8(4),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star), R(6),
B(Star), R(5),
B(LdaZero),
B(TestReferenceEqual), R(6),
B(TestReferenceEqual), R(5),
B(JumpIfTrue), U8(5),
B(Ldar), R(5),
B(Ldar), R(4),
B(ReThrow),
B(LdaUndefined),
B(Star), R(6),
B(Star), R(5),
B(LdaTrue),
B(Star), R(7),
B(Mov), R(0), R(5),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(5), U8(3),
B(Star), R(6),
B(Mov), R(0), R(4),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(4), U8(3),
/* 49 S> */ B(Return),
B(Star), R(5),
B(CreateCatchContext), R(5), U8(6),
B(Star), R(4),
B(CreateCatchContext), R(4), U8(5),
B(Star), R(3),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(4),
B(PushContext), R(5),
B(Ldar), R(3),
B(PushContext), R(4),
B(LdaImmutableCurrentContextSlot), U8(2),
B(Star), R(7),
B(Star), R(6),
B(LdaTrue),
B(Star), R(8),
B(Mov), R(0), R(6),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(6), U8(3),
B(Star), R(7),
B(Mov), R(0), R(5),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(5), U8(3),
/* 49 S> */ B(Return),
]
constant pool: [
Smi [47],
Smi [101],
SCOPE_INFO_TYPE,
Smi [33],
Smi [87],
Smi [10],
Smi [7],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["goo"],
SCOPE_INFO_TYPE,
]
handlers: [
[76, 136, 136],
[62, 122, 122],
]
......@@ -11,37 +11,31 @@ top level: yes
snippet: "
import \"bar\";
"
frame size: 5
parameter count: 2
bytecode array length: 62
frame size: 4
parameter count: 1
bytecode array length: 48
bytecodes: [
/* 0 E> */ B(StackCheck),
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(LdaConstant), U8(1),
B(Star), R(3),
B(Mov), R(arg0), R(2),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(2), U8(2),
B(PushContext), R(2),
B(Mov), R(closure), R(3),
B(Mov), R(this), R(4),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(3), 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),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star), R(3),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0),
B(ResumeGenerator), R(0), R(0), U8(2),
B(Star), R(2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(3),
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
B(Ldar), R(2),
/* 0 E> */ B(Throw),
B(Ldar), R(3),
B(Ldar), R(2),
/* 14 S> */ B(Return),
B(Mov), R(3), R(1),
B(Mov), R(2), R(1),
B(Ldar), R(1),
/* 14 S> */ B(Return),
]
constant pool: [
Smi [35],
SCOPE_INFO_TYPE,
Smi [21],
Smi [10],
Smi [7],
]
......@@ -52,37 +46,31 @@ handlers: [
snippet: "
import {foo} from \"bar\";
"
frame size: 5
parameter count: 2
bytecode array length: 62
frame size: 4
parameter count: 1
bytecode array length: 48
bytecodes: [
/* 0 E> */ B(StackCheck),
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(LdaConstant), U8(1),
B(Star), R(3),
B(Mov), R(arg0), R(2),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(2), U8(2),
B(PushContext), R(2),
B(Mov), R(closure), R(3),
B(Mov), R(this), R(4),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(3), 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),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star), R(3),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0),
B(ResumeGenerator), R(0), R(0), U8(2),
B(Star), R(2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(3),
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
B(Ldar), R(2),
/* 0 E> */ B(Throw),
B(Ldar), R(3),
B(Ldar), R(2),
/* 25 S> */ B(Return),
B(Mov), R(3), R(1),
B(Mov), R(2), R(1),
B(Ldar), R(1),
/* 25 S> */ B(Return),
]
constant pool: [
Smi [35],
SCOPE_INFO_TYPE,
Smi [21],
Smi [10],
Smi [7],
]
......@@ -95,50 +83,44 @@ snippet: "
goo(42);
{ let x; { goo(42) } };
"
frame size: 6
parameter count: 2
bytecode array length: 92
frame size: 5
parameter count: 1
bytecode array length: 78
bytecodes: [
/* 0 E> */ B(StackCheck),
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(LdaConstant), U8(1),
B(Star), R(4),
B(Mov), R(arg0), R(3),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(3), U8(2),
B(PushContext), R(3),
B(Mov), R(closure), R(4),
B(Mov), R(this), R(5),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
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),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0),
B(ResumeGenerator), R(0), R(0), U8(4),
B(Star), R(4),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(4),
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
B(Ldar), R(3),
/* 0 E> */ B(Throw),
B(Ldar), R(4),
B(Ldar), R(3),
/* 65 S> */ B(Return),
/* 32 S> */ B(LdaModuleVariable), I8(-1), U8(0),
B(ThrowReferenceErrorIfHole), U8(4),
B(Star), R(4),
B(ThrowReferenceErrorIfHole), U8(3),
B(Star), R(3),
B(LdaSmi), I8(42),
B(Star), R(5),
/* 32 E> */ B(CallUndefinedReceiver1), R(4), R(5), U8(0),
B(Star), R(4),
/* 32 E> */ B(CallUndefinedReceiver1), R(3), R(4), U8(0),
/* 47 S> */ B(LdaUndefined),
B(Star), R(2),
/* 52 S> */ B(LdaModuleVariable), I8(-1), U8(0),
B(ThrowReferenceErrorIfHole), U8(4),
B(Star), R(4),
B(ThrowReferenceErrorIfHole), U8(3),
B(Star), R(3),
B(LdaSmi), I8(42),
B(Star), R(5),
/* 52 E> */ B(CallUndefinedReceiver1), R(4), R(5), U8(2),
B(Star), R(4),
/* 52 E> */ B(CallUndefinedReceiver1), R(3), R(4), U8(2),
B(Star), R(1),
/* 65 S> */ B(Return),
]
constant pool: [
Smi [35],
SCOPE_INFO_TYPE,
Smi [21],
Smi [10],
Smi [7],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["goo"],
......@@ -152,29 +134,24 @@ snippet: "
foo++;
{ let x; { foo++ } };
"
frame size: 6
parameter count: 2
bytecode array length: 90
frame size: 5
parameter count: 1
bytecode array length: 76
bytecodes: [
/* 0 E> */ B(StackCheck),
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(LdaConstant), U8(1),
B(Star), R(4),
B(Mov), R(arg0), R(3),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(3), U8(2),
B(PushContext), R(3),
B(Mov), R(closure), R(4),
B(Mov), R(this), R(5),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
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),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0),
B(ResumeGenerator), R(0), R(0), U8(4),
B(Star), R(4),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(4),
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
B(Ldar), R(3),
/* 0 E> */ B(Throw),
B(Ldar), R(4),
B(Ldar), R(3),
/* 50 S> */ B(Return),
/* 17 S> */ B(LdaSmi), I8(42),
/* 17 E> */ B(StaModuleVariable), I8(1), U8(0),
......@@ -185,16 +162,15 @@ bytecodes: [
B(Star), R(2),
/* 39 S> */ B(LdaModuleVariable), I8(1), U8(0),
B(ToNumeric), U8(1),
B(Star), R(4),
B(Star), R(3),
B(Inc), U8(1),
/* 42 E> */ B(StaModuleVariable), I8(1), U8(0),
B(Mov), R(4), R(1),
B(Mov), R(3), R(1),
B(Ldar), R(1),
/* 50 S> */ B(Return),
]
constant pool: [
Smi [35],
SCOPE_INFO_TYPE,
Smi [21],
Smi [10],
Smi [7],
]
......@@ -207,32 +183,29 @@ snippet: "
foo++;
{ let x; { foo++ } };
"
frame size: 6
parameter count: 2
bytecode array length: 96
frame size: 5
parameter count: 1
bytecode array length: 90
bytecodes: [
/* 0 E> */ B(StackCheck),
B(SwitchOnGeneratorState), R(0), 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(LdaConstant), U8(1),
B(Star), R(4),
B(Mov), R(arg0), R(3),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(3), U8(2),
B(PushContext), R(3),
B(Star), R(3),
B(Mov), R(closure), R(4),
B(Mov), R(this), R(5),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
B(Star), R(0),
B(LdaTheHole),
B(StaModuleVariable), I8(1), U8(0),
B(CallRuntime), U16(Runtime::kDeclareModuleExports), R(3), U8(2),
B(Ldar), R(0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0),
B(ResumeGenerator), R(0), R(0), U8(4),
B(Star), R(4),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(4),
B(Ldar), R(3),
/* 0 E> */ B(Throw),
B(Ldar), R(4),
B(Ldar), R(3),
/* 50 S> */ B(Return),
/* 17 S> */ B(LdaSmi), I8(42),
/* 17 E> */ B(StaModuleVariable), I8(1), U8(0),
......@@ -243,16 +216,16 @@ bytecodes: [
B(Star), R(2),
/* 39 S> */ B(LdaModuleVariable), I8(1), U8(0),
B(ToNumeric), U8(1),
B(Star), R(4),
B(Star), R(3),
B(Inc), U8(1),
/* 42 E> */ B(StaModuleVariable), I8(1), U8(0),
B(Mov), R(4), R(1),
B(Mov), R(3), R(1),
B(Ldar), R(1),
/* 50 S> */ B(Return),
]
constant pool: [
Smi [41],
SCOPE_INFO_TYPE,
Smi [35],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
]
......@@ -265,32 +238,29 @@ snippet: "
foo++;
{ let x; { foo++ } };
"
frame size: 6
parameter count: 2
bytecode array length: 100
frame size: 5
parameter count: 1
bytecode array length: 94
bytecodes: [
/* 0 E> */ B(StackCheck),
B(SwitchOnGeneratorState), R(0), 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(LdaConstant), U8(1),
B(Star), R(4),
B(Mov), R(arg0), R(3),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(3), U8(2),
B(PushContext), R(3),
B(Star), R(3),
B(Mov), R(closure), R(4),
B(Mov), R(this), R(5),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
B(Star), R(0),
B(LdaTheHole),
B(StaModuleVariable), I8(1), U8(0),
B(CallRuntime), U16(Runtime::kDeclareModuleExports), R(3), U8(2),
B(Ldar), R(0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0),
B(ResumeGenerator), R(0), R(0), U8(4),
B(Star), R(4),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(4),
B(Ldar), R(3),
/* 0 E> */ B(Throw),
B(Ldar), R(4),
B(Ldar), R(3),
/* 52 S> */ B(Return),
/* 19 S> */ B(LdaSmi), I8(42),
/* 19 E> */ B(StaModuleVariable), I8(1), U8(0),
......@@ -301,16 +271,16 @@ bytecodes: [
B(Star), R(2),
/* 41 S> */ B(LdaModuleVariable), I8(1), U8(0),
B(ToNumeric), U8(1),
B(Star), R(4),
B(Star), R(3),
B(Inc), U8(1),
/* 44 E> */ B(CallRuntime), U16(Runtime::kThrowConstAssignError), R(0), U8(0),
B(Mov), R(4), R(1),
B(Mov), R(3), R(1),
B(Ldar), R(1),
/* 52 S> */ B(Return),
]
constant pool: [
Smi [41],
SCOPE_INFO_TYPE,
Smi [35],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
]
......@@ -321,42 +291,39 @@ handlers: [
snippet: "
export default (function () {});
"
frame size: 5
parameter count: 2
bytecode array length: 75
frame size: 4
parameter count: 1
bytecode array length: 69
bytecodes: [
/* 0 E> */ B(StackCheck),
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
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(LdaConstant), U8(1),
B(Star), R(3),
B(Mov), R(arg0), R(2),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(2), U8(2),
B(PushContext), R(2),
B(Star), R(2),
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(LdaTheHole),
B(StaModuleVariable), I8(1), U8(0),
B(CallRuntime), U16(Runtime::kDeclareModuleExports), R(2), U8(2),
B(Ldar), R(0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star), R(3),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0),
B(ResumeGenerator), R(0), R(0), U8(2),
B(Star), R(2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(3),
B(Ldar), R(2),
/* 0 E> */ B(Throw),
B(Ldar), R(3),
B(Ldar), R(2),
/* 33 S> */ B(Return),
B(Mov), R(3), R(1),
B(Mov), R(2), R(1),
B(CreateClosure), U8(4), U8(0), U8(0),
B(StaModuleVariable), I8(1), U8(0),
B(Ldar), R(1),
/* 33 S> */ B(Return),
]
constant pool: [
Smi [41],
SCOPE_INFO_TYPE,
Smi [35],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
SHARED_FUNCTION_INFO_TYPE,
......@@ -368,51 +335,48 @@ handlers: [
snippet: "
export default (class {});
"
frame size: 7
parameter count: 2
bytecode array length: 96
frame size: 6
parameter count: 1
bytecode array length: 90
bytecodes: [
/* 0 E> */ B(StackCheck),
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
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(LdaConstant), U8(1),
B(Star), R(3),
B(Mov), R(arg0), R(2),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(2), U8(2),
B(PushContext), R(2),
B(Star), R(2),
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(LdaTheHole),
B(StaModuleVariable), I8(1), U8(0),
B(CallRuntime), U16(Runtime::kDeclareModuleExports), R(2), U8(2),
B(Ldar), R(0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star), R(3),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0),
B(ResumeGenerator), R(0), R(0), U8(2),
B(Star), R(2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(3),
B(Ldar), R(2),
/* 0 E> */ B(Throw),
B(Ldar), R(3),
B(Ldar), R(2),
/* 27 S> */ B(Return),
B(Mov), R(3), R(1),
B(Mov), R(2), R(1),
B(LdaTheHole),
B(Star), R(6),
B(Star), R(5),
B(CreateClosure), U8(5), U8(0), U8(0),
B(Star), R(3),
B(Star), R(2),
B(LdaConstant), U8(4),
B(Star), R(4),
B(Mov), R(3), R(5),
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(3),
B(Star), R(4),
B(Ldar), R(5),
B(Star), R(3),
B(Mov), R(2), R(4),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(3),
B(Star), R(3),
B(Ldar), R(4),
B(StaModuleVariable), I8(1), U8(0),
B(Ldar), R(1),
/* 27 S> */ B(Return),
]
constant pool: [
Smi [41],
SCOPE_INFO_TYPE,
Smi [35],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
FIXED_ARRAY_TYPE,
......@@ -425,37 +389,31 @@ handlers: [
snippet: "
export {foo as goo} from \"bar\"
"
frame size: 5
parameter count: 2
bytecode array length: 62
frame size: 4
parameter count: 1
bytecode array length: 48
bytecodes: [
/* 0 E> */ B(StackCheck),
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(LdaConstant), U8(1),
B(Star), R(3),
B(Mov), R(arg0), R(2),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(2), U8(2),
B(PushContext), R(2),
B(Mov), R(closure), R(3),
B(Mov), R(this), R(4),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(3), 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),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star), R(3),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0),
B(ResumeGenerator), R(0), R(0), U8(2),
B(Star), R(2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(3),
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
B(Ldar), R(2),
/* 0 E> */ B(Throw),
B(Ldar), R(3),
B(Ldar), R(2),
/* 31 S> */ B(Return),
B(Mov), R(3), R(1),
B(Mov), R(2), R(1),
B(Ldar), R(1),
/* 31 S> */ B(Return),
]
constant pool: [
Smi [35],
SCOPE_INFO_TYPE,
Smi [21],
Smi [10],
Smi [7],
]
......@@ -466,37 +424,31 @@ handlers: [
snippet: "
export * from \"bar\"
"
frame size: 5
parameter count: 2
bytecode array length: 62
frame size: 4
parameter count: 1
bytecode array length: 48
bytecodes: [
/* 0 E> */ B(StackCheck),
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(LdaConstant), U8(1),
B(Star), R(3),
B(Mov), R(arg0), R(2),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(2), U8(2),
B(PushContext), R(2),
B(Mov), R(closure), R(3),
B(Mov), R(this), R(4),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(3), 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),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star), R(3),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0),
B(ResumeGenerator), R(0), R(0), U8(2),
B(Star), R(2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(3),
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
B(Ldar), R(2),
/* 0 E> */ B(Throw),
B(Ldar), R(3),
B(Ldar), R(2),
/* 20 S> */ B(Return),
B(Mov), R(3), R(1),
B(Mov), R(2), R(1),
B(Ldar), R(1),
/* 20 S> */ B(Return),
]
constant pool: [
Smi [35],
SCOPE_INFO_TYPE,
Smi [21],
Smi [10],
Smi [7],
]
......@@ -508,46 +460,40 @@ snippet: "
import * as foo from \"bar\"
foo.f(foo, foo.x);
"
frame size: 8
parameter count: 2
bytecode array length: 89
frame size: 7
parameter count: 1
bytecode array length: 75
bytecodes: [
/* 0 E> */ B(StackCheck),
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(LdaConstant), U8(1),
B(Star), R(4),
B(Mov), R(arg0), R(3),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(3), U8(2),
B(PushContext), R(3),
B(Mov), R(closure), R(4),
B(Mov), R(this), R(5),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
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(LdaZero),
B(Star), R(4),
B(CallRuntime), U16(Runtime::kGetModuleNamespace), R(4), U8(1),
B(Star), R(3),
B(CallRuntime), U16(Runtime::kGetModuleNamespace), R(3), U8(1),
B(Star), R(1),
B(Ldar), R(0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0),
B(ResumeGenerator), R(0), R(0), U8(4),
B(Star), R(4),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(4),
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
B(Ldar), R(3),
/* 0 E> */ B(Throw),
B(Ldar), R(4),
B(Ldar), R(3),
/* 46 S> */ B(Return),
/* 31 S> */ B(LdaNamedProperty), R(1), U8(4), U8(0),
B(Star), R(4),
/* 42 E> */ B(LdaNamedProperty), R(1), U8(5), U8(2),
B(Star), R(7),
/* 31 E> */ B(CallProperty2), R(4), R(1), R(1), R(7), U8(4),
/* 31 S> */ B(LdaNamedProperty), R(1), U8(3), U8(0),
B(Star), R(3),
/* 42 E> */ B(LdaNamedProperty), R(1), U8(4), U8(2),
B(Star), R(6),
/* 31 E> */ B(CallProperty2), R(3), R(1), R(1), R(6), U8(4),
B(Star), R(2),
/* 46 S> */ B(Return),
]
constant pool: [
Smi [47],
SCOPE_INFO_TYPE,
Smi [33],
Smi [10],
Smi [7],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["f"],
......
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