Upload Kmake

This commit is contained in:
Gorochu
2026-05-26 23:36:42 -07:00
parent ba051b2f74
commit 555ec72358
41615 changed files with 13344630 additions and 1 deletions

View File

@ -0,0 +1,937 @@
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/interpreter/bytecode-array-builder.h"
#include <limits>
#include "src/ast/scopes.h"
#include "src/common/globals.h"
#include "src/init/v8.h"
#include "src/interpreter/bytecode-array-iterator.h"
#include "src/interpreter/bytecode-jump-table.h"
#include "src/interpreter/bytecode-label.h"
#include "src/interpreter/bytecode-register-allocator.h"
#include "src/numbers/hash-seed-inl.h"
#include "src/objects/objects-inl.h"
#include "src/objects/smi.h"
#include "test/common/flag-utils.h"
#include "test/unittests/interpreter/bytecode-utils.h"
#include "test/unittests/test-utils.h"
namespace v8 {
namespace internal {
namespace interpreter {
class BytecodeArrayBuilderTest : public TestWithIsolateAndZone {
public:
BytecodeArrayBuilderTest() = default;
~BytecodeArrayBuilderTest() override = default;
};
using ToBooleanMode = BytecodeArrayBuilder::ToBooleanMode;
TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
FlagScope<bool> const_tracking_let(&i::v8_flags.const_tracking_let, true);
FlagScope<bool> script_context_mutable_heap_number(
&i::v8_flags.script_context_mutable_heap_number, true);
FeedbackVectorSpec feedback_spec(zone());
BytecodeArrayBuilder builder(zone(), 1, 131, &feedback_spec);
Factory* factory = isolate()->factory();
AstValueFactory ast_factory(zone(), isolate()->ast_string_constants(),
HashSeed(isolate()));
DeclarationScope scope(zone(), &ast_factory);
Handle<ScopeInfo> scope_info =
factory->NewScopeInfo(ScopeInfo::kVariablePartIndex);
int flags = ScopeInfo::IsEmptyBit::encode(true);
scope_info->set_flags(flags, kRelaxedStore);
scope_info->set_context_local_count(0);
scope_info->set_parameter_count(0);
scope_info->set_position_info_start(0);
scope_info->set_position_info_end(0);
scope.SetScriptScopeInfo(scope_info);
CHECK_EQ(builder.locals_count(), 131);
CHECK_EQ(builder.fixed_register_count(), 131);
Register reg(0);
Register other(reg.index() + 1);
Register wide(128);
RegisterList empty;
RegisterList single = BytecodeUtils::NewRegisterList(0, 1);
RegisterList pair = BytecodeUtils::NewRegisterList(0, 2);
RegisterList triple = BytecodeUtils::NewRegisterList(0, 3);
RegisterList reg_list = BytecodeUtils::NewRegisterList(0, 10);
// Emit argument creation operations.
builder.CreateArguments(CreateArgumentsType::kMappedArguments)
.CreateArguments(CreateArgumentsType::kUnmappedArguments)
.CreateArguments(CreateArgumentsType::kRestParameter);
// Emit constant loads.
builder.LoadLiteral(Smi::zero())
.StoreAccumulatorInRegister(reg)
.LoadLiteral(Smi::FromInt(8))
.CompareOperation(Token::kEq, reg,
1) // Prevent peephole optimization
// LdaSmi, Star -> LdrSmi.
.StoreAccumulatorInRegister(reg)
.LoadLiteral(Smi::FromInt(10000000))
.StoreAccumulatorInRegister(reg)
.LoadLiteral(ast_factory.GetOneByteString("A constant"))
.StoreAccumulatorInRegister(reg)
.LoadUndefined()
.StoreAccumulatorInRegister(reg)
.LoadNull()
.StoreAccumulatorInRegister(reg)
.LoadTheHole()
.StoreAccumulatorInRegister(reg)
.LoadTrue()
.StoreAccumulatorInRegister(reg)
.LoadFalse()
.StoreAccumulatorInRegister(wide);
// Emit Ldar and Star taking care to foil the register optimizer.
builder.LoadAccumulatorWithRegister(other)
.BinaryOperation(Token::kAdd, reg, 1)
.StoreAccumulatorInRegister(reg)
.LoadNull();
// The above had a lot of Star0, but we must also emit the rest of
// the short-star codes.
for (int i = 1; i < 16; ++i) {
builder.StoreAccumulatorInRegister(Register(i));
}
// Emit register-register transfer.
builder.MoveRegister(reg, other);
builder.MoveRegister(reg, wide);
FeedbackSlot load_global_slot =
feedback_spec.AddLoadGlobalICSlot(TypeofMode::kNotInside);
FeedbackSlot load_global_typeof_slot =
feedback_spec.AddLoadGlobalICSlot(TypeofMode::kInside);
FeedbackSlot sloppy_store_global_slot =
feedback_spec.AddStoreGlobalICSlot(LanguageMode::kSloppy);
FeedbackSlot load_slot = feedback_spec.AddLoadICSlot();
FeedbackSlot call_slot = feedback_spec.AddCallICSlot();
FeedbackSlot keyed_load_slot = feedback_spec.AddKeyedLoadICSlot();
FeedbackSlot sloppy_store_slot =
feedback_spec.AddStoreICSlot(LanguageMode::kSloppy);
FeedbackSlot strict_store_slot =
feedback_spec.AddStoreICSlot(LanguageMode::kStrict);
FeedbackSlot sloppy_keyed_store_slot =
feedback_spec.AddKeyedStoreICSlot(LanguageMode::kSloppy);
FeedbackSlot strict_keyed_store_slot =
feedback_spec.AddKeyedStoreICSlot(LanguageMode::kStrict);
FeedbackSlot define_named_own_slot = feedback_spec.AddDefineNamedOwnICSlot();
FeedbackSlot store_array_element_slot =
feedback_spec.AddStoreInArrayLiteralICSlot();
// Emit global load / store operations.
const AstRawString* name = ast_factory.GetOneByteString("var_name");
builder.LoadGlobal(name, load_global_slot.ToInt(), TypeofMode::kNotInside)
.LoadGlobal(name, load_global_typeof_slot.ToInt(), TypeofMode::kInside)
.StoreGlobal(name, sloppy_store_global_slot.ToInt());
// Emit context operations.
Variable var1(&scope, name, VariableMode::kVar, VariableKind::NORMAL_VARIABLE,
InitializationFlag::kCreatedInitialized);
var1.AllocateTo(VariableLocation::CONTEXT, 1);
Variable var2(&scope, name, VariableMode::kVar, VariableKind::NORMAL_VARIABLE,
InitializationFlag::kCreatedInitialized);
var2.AllocateTo(VariableLocation::CONTEXT, 1);
Variable var3(&scope, name, VariableMode::kVar, VariableKind::NORMAL_VARIABLE,
InitializationFlag::kCreatedInitialized);
var3.AllocateTo(VariableLocation::CONTEXT, 3);
// Emit context operations which operate on the script context.
builder.PushContext(reg)
.PopContext(reg)
.LoadContextSlot(reg, &var1, 0, BytecodeArrayBuilder::kMutableSlot)
.StoreContextSlot(reg, &var1, 0)
.LoadContextSlot(reg, &var2, 0, BytecodeArrayBuilder::kImmutableSlot)
.StoreContextSlot(reg, &var3, 0);
// Emit context operations which operate on the local context.
builder
.LoadContextSlot(Register::current_context(), &var1, 0,
BytecodeArrayBuilder::kMutableSlot)
.StoreContextSlot(Register::current_context(), &var1, 0)
.LoadContextSlot(Register::current_context(), &var2, 0,
BytecodeArrayBuilder::kImmutableSlot)
.StoreContextSlot(Register::current_context(), &var3, 0)
.LoadContextSlot(Register::current_context(), &var1, 0,
BytecodeArrayBuilder::kMutableSlot);
// Emit context operations.
DeclarationScope fun_scope(zone(), ScopeType::FUNCTION_SCOPE, &ast_factory,
scope_info);
Variable fun_var1(&fun_scope, name, VariableMode::kVar,
VariableKind::NORMAL_VARIABLE,
InitializationFlag::kCreatedInitialized);
fun_var1.AllocateTo(VariableLocation::CONTEXT, 1);
Variable fun_var2(&fun_scope, name, VariableMode::kVar,
VariableKind::NORMAL_VARIABLE,
InitializationFlag::kCreatedInitialized);
fun_var2.AllocateTo(VariableLocation::CONTEXT, 1);
Variable fun_var3(&fun_scope, name, VariableMode::kVar,
VariableKind::NORMAL_VARIABLE,
InitializationFlag::kCreatedInitialized);
fun_var3.AllocateTo(VariableLocation::CONTEXT, 3);
builder.CreateFunctionContext(&fun_scope, 3)
.StoreAccumulatorInRegister(reg)
.LoadContextSlot(reg, &fun_var1, 0, BytecodeArrayBuilder::kMutableSlot)
.StoreContextSlot(reg, &fun_var1, 0)
.LoadContextSlot(reg, &fun_var2, 0, BytecodeArrayBuilder::kImmutableSlot)
.StoreContextSlot(reg, &fun_var3, 0)
.PushContext(reg)
.LoadContextSlot(Register::current_context(), &fun_var1, 0,
BytecodeArrayBuilder::kMutableSlot)
.StoreContextSlot(Register::current_context(), &fun_var1, 0)
.LoadContextSlot(Register::current_context(), &fun_var2, 0,
BytecodeArrayBuilder::kImmutableSlot)
.StoreContextSlot(Register::current_context(), &fun_var3, 0)
.PopContext(reg);
// Emit load / store property operations.
builder.LoadNamedProperty(reg, name, load_slot.ToInt())
.LoadNamedPropertyFromSuper(reg, name, load_slot.ToInt())
.LoadKeyedProperty(reg, keyed_load_slot.ToInt())
.LoadEnumeratedKeyedProperty(reg, reg, reg, keyed_load_slot.ToInt())
.SetNamedProperty(reg, name, sloppy_store_slot.ToInt(),
LanguageMode::kSloppy)
.SetKeyedProperty(reg, reg, sloppy_keyed_store_slot.ToInt(),
LanguageMode::kSloppy)
.SetNamedProperty(reg, name, strict_store_slot.ToInt(),
LanguageMode::kStrict)
.SetKeyedProperty(reg, reg, strict_keyed_store_slot.ToInt(),
LanguageMode::kStrict)
.DefineNamedOwnProperty(reg, name, define_named_own_slot.ToInt())
.DefineKeyedOwnProperty(reg, reg, DefineKeyedOwnPropertyFlag::kNoFlags,
define_named_own_slot.ToInt())
.StoreInArrayLiteral(reg, reg, store_array_element_slot.ToInt());
// Emit Iterator-protocol operations
builder.GetIterator(reg, load_slot.ToInt(), call_slot.ToInt());
// Emit load / store lookup slots.
builder.LoadLookupSlot(name, TypeofMode::kNotInside)
.LoadLookupSlot(name, TypeofMode::kInside)
.StoreLookupSlot(name, LanguageMode::kSloppy, LookupHoistingMode::kNormal)
.StoreLookupSlot(name, LanguageMode::kSloppy,
LookupHoistingMode::kLegacySloppy)
.StoreLookupSlot(name, LanguageMode::kStrict,
LookupHoistingMode::kNormal);
// Emit load / store lookup slots with context fast paths.
builder
.LoadLookupContextSlot(name, TypeofMode::kNotInside,
ContextKind::kDefault, 1, 0)
.LoadLookupContextSlot(name, TypeofMode::kInside, ContextKind::kDefault,
1, 0)
.LoadLookupContextSlot(name, TypeofMode::kNotInside,
ContextKind::kScriptContext, 1, 0)
.LoadLookupContextSlot(name, TypeofMode::kInside,
ContextKind::kScriptContext, 1, 0);
// Emit load / store lookup slots with global fast paths.
builder.LoadLookupGlobalSlot(name, TypeofMode::kNotInside, 1, 0)
.LoadLookupGlobalSlot(name, TypeofMode::kInside, 1, 0);
// Emit closure operations.
builder.CreateClosure(0, 1, static_cast<int>(AllocationType::kYoung));
// Emit create context operation.
builder.CreateBlockContext(&scope);
builder.CreateCatchContext(reg, &scope);
builder.CreateFunctionContext(&scope, 1);
builder.CreateEvalContext(&scope, 1);
builder.CreateWithContext(reg, &scope);
// Emit literal creation operations.
builder.CreateRegExpLiteral(ast_factory.GetOneByteString("a"), 0, 0);
builder.CreateArrayLiteral(0, 0, 0);
builder.CreateObjectLiteral(0, 0, 0);
// Emit tagged template operations.
builder.GetTemplateObject(0, 0);
// Call operations.
builder.CallAnyReceiver(reg, reg_list, 1)
.CallProperty(reg, reg_list, 1)
.CallProperty(reg, single, 1)
.CallProperty(reg, pair, 1)
.CallProperty(reg, triple, 1)
.CallUndefinedReceiver(reg, reg_list, 1)
.CallUndefinedReceiver(reg, empty, 1)
.CallUndefinedReceiver(reg, single, 1)
.CallUndefinedReceiver(reg, pair, 1)
.CallRuntime(Runtime::kIsArray, reg)
.CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, reg_list, pair)
.CallJSRuntime(Context::PROMISE_THEN_INDEX, reg_list)
.CallWithSpread(reg, reg_list, 1);
// Emit binary operator invocations.
builder.BinaryOperation(Token::kAdd, reg, 1)
.BinaryOperation(Token::kSub, reg, 2)
.BinaryOperation(Token::kMul, reg, 3)
.BinaryOperation(Token::kDiv, reg, 4)
.BinaryOperation(Token::kMod, reg, 5)
.BinaryOperation(Token::kExp, reg, 6);
// Emit bitwise operator invocations
builder.BinaryOperation(Token::kBitOr, reg, 6)
.BinaryOperation(Token::kBitXor, reg, 7)
.BinaryOperation(Token::kBitAnd, reg, 8);
// Emit shift operator invocations
builder.BinaryOperation(Token::kShl, reg, 9)
.BinaryOperation(Token::kSar, reg, 10)
.BinaryOperation(Token::kShr, reg, 11);
// Emit Smi binary operations.
builder.BinaryOperationSmiLiteral(Token::kAdd, Smi::FromInt(42), 2)
.BinaryOperationSmiLiteral(Token::kSub, Smi::FromInt(42), 2)
.BinaryOperationSmiLiteral(Token::kMul, Smi::FromInt(42), 2)
.BinaryOperationSmiLiteral(Token::kDiv, Smi::FromInt(42), 2)
.BinaryOperationSmiLiteral(Token::kMod, Smi::FromInt(42), 2)
.BinaryOperationSmiLiteral(Token::kExp, Smi::FromInt(42), 2)
.BinaryOperationSmiLiteral(Token::kBitOr, Smi::FromInt(42), 2)
.BinaryOperationSmiLiteral(Token::kBitXor, Smi::FromInt(42), 2)
.BinaryOperationSmiLiteral(Token::kBitAnd, Smi::FromInt(42), 2)
.BinaryOperationSmiLiteral(Token::kShl, Smi::FromInt(42), 2)
.BinaryOperationSmiLiteral(Token::kSar, Smi::FromInt(42), 2)
.BinaryOperationSmiLiteral(Token::kShr, Smi::FromInt(42), 2);
// Emit unary and count operator invocations.
builder.UnaryOperation(Token::kInc, 1)
.UnaryOperation(Token::kDec, 1)
.UnaryOperation(Token::kAdd, 1)
.UnaryOperation(Token::kSub, 1)
.UnaryOperation(Token::kBitNot, 1);
// Emit unary operator invocations.
builder.LogicalNot(ToBooleanMode::kConvertToBoolean)
.LogicalNot(ToBooleanMode::kAlreadyBoolean)
.TypeOf(1);
// Emit delete
builder.Delete(reg, LanguageMode::kSloppy).Delete(reg, LanguageMode::kStrict);
// Emit construct.
builder.Construct(reg, reg_list, 1)
.ConstructWithSpread(reg, reg_list, 1)
.ConstructForwardAllArgs(reg, 1);
// Emit test operator invocations.
builder.CompareOperation(Token::kEq, reg, 1)
.CompareOperation(Token::kEqStrict, reg, 2)
.CompareOperation(Token::kLessThan, reg, 3)
.CompareOperation(Token::kGreaterThan, reg, 4)
.CompareOperation(Token::kLessThanEq, reg, 5)
.CompareOperation(Token::kGreaterThanEq, reg, 6)
.CompareTypeOf(TestTypeOfFlags::LiteralFlag::kNumber)
.CompareOperation(Token::kInstanceOf, reg, 7)
.CompareOperation(Token::kIn, reg, 8)
.CompareReference(reg)
.CompareUndetectable()
.CompareUndefined()
.CompareNull();
// Emit conversion operator invocations.
builder.ToNumber(1).ToNumeric(1).ToObject(reg).ToName().ToString().ToBoolean(
ToBooleanMode::kConvertToBoolean);
// Emit GetSuperConstructor.
builder.GetSuperConstructor(reg);
// Constructor check for GetSuperConstructor.
builder.ThrowIfNotSuperConstructor(reg);
// Hole checks.
builder.ThrowReferenceErrorIfHole(name)
.ThrowSuperAlreadyCalledIfNotHole()
.ThrowSuperNotCalledIfHole();
// Short jumps with Imm8 operands
{
BytecodeLoopHeader loop_header;
BytecodeLabel after_jump1, after_jump2, after_jump3, after_jump4,
after_jump5, after_jump6, after_jump7, after_jump8, after_jump9,
after_jump10, after_jump11, after_jump12, after_loop;
builder.JumpIfNull(&after_loop)
.Bind(&loop_header)
.Jump(&after_jump1)
.Bind(&after_jump1)
.JumpIfNull(&after_jump2)
.Bind(&after_jump2)
.JumpIfNotNull(&after_jump3)
.Bind(&after_jump3)
.JumpIfUndefined(&after_jump4)
.Bind(&after_jump4)
.JumpIfNotUndefined(&after_jump5)
.Bind(&after_jump5)
.JumpIfUndefinedOrNull(&after_jump6)
.Bind(&after_jump6)
.JumpIfJSReceiver(&after_jump7)
.Bind(&after_jump7)
.JumpIfForInDone(&after_jump8, reg, reg)
.Bind(&after_jump8)
.JumpIfTrue(ToBooleanMode::kConvertToBoolean, &after_jump9)
.Bind(&after_jump9)
.JumpIfTrue(ToBooleanMode::kAlreadyBoolean, &after_jump10)
.Bind(&after_jump10)
.JumpIfFalse(ToBooleanMode::kConvertToBoolean, &after_jump11)
.Bind(&after_jump11)
.JumpIfFalse(ToBooleanMode::kAlreadyBoolean, &after_jump12)
.Bind(&after_jump12)
.JumpLoop(&loop_header, 0, 0, 0)
.Bind(&after_loop);
}
BytecodeLabel end[12];
{
// Longer jumps with constant operands
BytecodeLabel after_jump;
builder.JumpIfNull(&after_jump)
.Jump(&end[0])
.Bind(&after_jump)
.JumpIfTrue(ToBooleanMode::kConvertToBoolean, &end[1])
.JumpIfTrue(ToBooleanMode::kAlreadyBoolean, &end[2])
.JumpIfFalse(ToBooleanMode::kConvertToBoolean, &end[3])
.JumpIfFalse(ToBooleanMode::kAlreadyBoolean, &end[4])
.JumpIfNull(&end[5])
.JumpIfNotNull(&end[6])
.JumpIfUndefined(&end[7])
.JumpIfNotUndefined(&end[8])
.JumpIfUndefinedOrNull(&end[9])
.LoadLiteral(ast_factory.prototype_string())
.JumpIfJSReceiver(&end[10])
.JumpIfForInDone(&end[11], reg, reg);
}
// Emit Smi table switch bytecode.
BytecodeJumpTable* jump_table = builder.AllocateJumpTable(1, 0);
builder.SwitchOnSmiNoFeedback(jump_table).Bind(jump_table, 0);
// Emit set pending message bytecode.
builder.SetPendingMessage();
// Emit throw and re-throw in it's own basic block so that the rest of the
// code isn't omitted due to being dead.
BytecodeLabel after_throw, after_rethrow;
builder.JumpIfNull(&after_throw).Throw().Bind(&after_throw);
builder.JumpIfNull(&after_rethrow).ReThrow().Bind(&after_rethrow);
builder.ForInEnumerate(reg)
.ForInPrepare(triple, 1)
.ForInNext(reg, reg, pair, 1)
.ForInStep(reg);
// Wide constant pool loads
for (int i = 0; i < 256; i++) {
// Emit junk in constant pool to force wide constant pool index.
builder.LoadLiteral(2.5321 + i);
}
builder.LoadLiteral(Smi::FromInt(20000000));
const AstRawString* wide_name = ast_factory.GetOneByteString("var_wide_name");
builder.DefineKeyedOwnPropertyInLiteral(
reg, reg, DefineKeyedOwnPropertyInLiteralFlag::kNoFlags, 0);
// Emit wide context operations.
Variable var(&scope, name, VariableMode::kVar, VariableKind::NORMAL_VARIABLE,
InitializationFlag::kCreatedInitialized);
var.AllocateTo(VariableLocation::CONTEXT, 1024);
builder.LoadContextSlot(reg, &var, 0, BytecodeArrayBuilder::kMutableSlot)
.StoreContextSlot(reg, &var, 0);
// Emit wide load / store lookup slots.
builder.LoadLookupSlot(wide_name, TypeofMode::kNotInside)
.LoadLookupSlot(wide_name, TypeofMode::kInside)
.StoreLookupSlot(wide_name, LanguageMode::kSloppy,
LookupHoistingMode::kNormal)
.StoreLookupSlot(wide_name, LanguageMode::kSloppy,
LookupHoistingMode::kLegacySloppy)
.StoreLookupSlot(wide_name, LanguageMode::kStrict,
LookupHoistingMode::kNormal);
// CreateClosureWide
builder.CreateClosure(1000, 321, static_cast<int>(AllocationType::kYoung));
// Emit wide variant of literal creation operations.
builder
.CreateRegExpLiteral(ast_factory.GetOneByteString("wide_literal"), 0, 0)
.CreateArrayLiteral(0, 0, 0)
.CreateEmptyArrayLiteral(0)
.CreateArrayFromIterable()
.CreateObjectLiteral(0, 0, 0)
.CreateEmptyObjectLiteral()
.CloneObject(reg, 0, 0);
// Emit load and store operations for module variables.
builder.LoadModuleVariable(-1, 42)
.LoadModuleVariable(0, 42)
.LoadModuleVariable(1, 42)
.StoreModuleVariable(-1, 42)
.StoreModuleVariable(0, 42)
.StoreModuleVariable(1, 42);
// Emit generator operations.
{
// We have to skip over suspend because it returns and marks the remaining
// bytecode dead.
BytecodeLabel after_suspend;
builder.JumpIfTrue(ToBooleanMode::kAlreadyBoolean, &after_suspend)
.SuspendGenerator(reg, reg_list, 0)
.Bind(&after_suspend)
.ResumeGenerator(reg, reg_list);
}
BytecodeJumpTable* gen_jump_table = builder.AllocateJumpTable(1, 0);
builder.SwitchOnGeneratorState(reg, gen_jump_table).Bind(gen_jump_table, 0);
// Intrinsics handled by the interpreter.
builder.CallRuntime(Runtime::kInlineAsyncFunctionReject, reg_list);
// Emit debugger bytecode.
builder.Debugger();
// Emit abort bytecode.
BytecodeLabel after_abort;
builder.JumpIfNull(&after_abort)
.Abort(AbortReason::kOperandIsASmi)
.Bind(&after_abort);
// Insert dummy ops to force longer jumps.
for (int i = 0; i < 256; i++) {
builder.Debugger();
}
// Emit block counter increments.
builder.IncBlockCounter(0);
// Bind labels for long jumps at the very end.
for (size_t i = 0; i < arraysize(end); i++) {
builder.Bind(&end[i]);
}
// Return must be the last instruction.
builder.Return();
// Generate BytecodeArray.
ast_factory.Internalize(isolate());
DirectHandle<BytecodeArray> the_array = builder.ToBytecodeArray(isolate());
CHECK_EQ(the_array->frame_size(),
builder.total_register_count() * kSystemPointerSize);
// Build scorecard of bytecodes encountered in the BytecodeArray.
std::vector<int> scorecard(Bytecodes::ToByte(Bytecode::kLast) + 1);
Bytecode final_bytecode = Bytecode::kLdaZero;
int i = 0;
while (i < the_array->length()) {
uint8_t code = the_array->get(i);
scorecard[code] += 1;
final_bytecode = Bytecodes::FromByte(code);
OperandScale operand_scale = OperandScale::kSingle;
int prefix_offset = 0;
if (Bytecodes::IsPrefixScalingBytecode(final_bytecode)) {
operand_scale = Bytecodes::PrefixBytecodeToOperandScale(final_bytecode);
prefix_offset = 1;
code = the_array->get(i + 1);
scorecard[code] += 1;
final_bytecode = Bytecodes::FromByte(code);
}
i += prefix_offset + Bytecodes::Size(final_bytecode, operand_scale);
}
// Insert entry for illegal bytecode as this is never willingly emitted.
scorecard[Bytecodes::ToByte(Bytecode::kIllegal)] = 1;
// This bytecode is too inconvenient to test manually.
scorecard[Bytecodes::ToByte(
Bytecode::kFindNonDefaultConstructorOrConstruct)] = 1;
// Check return occurs at the end and only once in the BytecodeArray.
CHECK_EQ(final_bytecode, Bytecode::kReturn);
CHECK_EQ(scorecard[Bytecodes::ToByte(final_bytecode)], 1);
#define CHECK_BYTECODE_PRESENT(Name, ...) \
/* Check Bytecode is marked in scorecard, unless it's a debug break */ \
if (!Bytecodes::IsDebugBreak(Bytecode::k##Name)) { \
EXPECT_GE(scorecard[Bytecodes::ToByte(Bytecode::k##Name)], 1); \
}
BYTECODE_LIST(CHECK_BYTECODE_PRESENT, CHECK_BYTECODE_PRESENT)
#undef CHECK_BYTECODE_PRESENT
}
TEST_F(BytecodeArrayBuilderTest, FrameSizesLookGood) {
for (int locals = 0; locals < 5; locals++) {
for (int temps = 0; temps < 3; temps++) {
BytecodeArrayBuilder builder(zone(), 1, locals);
BytecodeRegisterAllocator* allocator(builder.register_allocator());
for (int i = 0; i < locals; i++) {
builder.LoadLiteral(Smi::zero());
builder.StoreAccumulatorInRegister(Register(i));
}
for (int i = 0; i < temps; i++) {
Register temp = allocator->NewRegister();
builder.LoadLiteral(Smi::zero());
builder.StoreAccumulatorInRegister(temp);
// Ensure temporaries are used so not optimized away by the
// register optimizer.
builder.ToName().StoreAccumulatorInRegister(temp);
}
builder.Return();
DirectHandle<BytecodeArray> the_array =
builder.ToBytecodeArray(isolate());
int total_registers = locals + temps;
CHECK_EQ(the_array->frame_size(), total_registers * kSystemPointerSize);
}
}
}
TEST_F(BytecodeArrayBuilderTest, RegisterValues) {
int index = 1;
Register the_register(index);
CHECK_EQ(the_register.index(), index);
int actual_operand = the_register.ToOperand();
int actual_index = Register::FromOperand(actual_operand).index();
CHECK_EQ(actual_index, index);
}
TEST_F(BytecodeArrayBuilderTest, Parameters) {
BytecodeArrayBuilder builder(zone(), 10, 0);
Register receiver(builder.Receiver());
Register param8(builder.Parameter(8));
CHECK_EQ(receiver.index() - param8.index(), 9);
}
TEST_F(BytecodeArrayBuilderTest, Constants) {
BytecodeArrayBuilder builder(zone(), 1, 0);
AstValueFactory ast_factory(zone(), isolate()->ast_string_constants(),
HashSeed(isolate()));
double heap_num_1 = 3.14;
double heap_num_2 = 5.2;
double nan = std::numeric_limits<double>::quiet_NaN();
const AstRawString* string = ast_factory.GetOneByteString("foo");
const AstRawString* string_copy = ast_factory.GetOneByteString("foo");
builder.LoadLiteral(heap_num_1)
.LoadLiteral(heap_num_2)
.LoadLiteral(string)
.LoadLiteral(heap_num_1)
.LoadLiteral(heap_num_1)
.LoadLiteral(nan)
.LoadLiteral(string_copy)
.LoadLiteral(heap_num_2)
.LoadLiteral(nan)
.Return();
ast_factory.Internalize(isolate());
DirectHandle<BytecodeArray> array = builder.ToBytecodeArray(isolate());
// Should only have one entry for each identical constant.
EXPECT_EQ(4, array->constant_pool()->length());
}
TEST_F(BytecodeArrayBuilderTest, ForwardJumps) {
static const int kFarJumpDistance = 256 + 20;
BytecodeArrayBuilder builder(zone(), 1, 1);
Register reg(0);
BytecodeLabel far0, far1, far2, far3, far4;
BytecodeLabel near0, near1, near2, near3, near4;
BytecodeLabel after_jump_near0, after_jump_far0;
builder.JumpIfNull(&after_jump_near0)
.Jump(&near0)
.Bind(&after_jump_near0)
.CompareOperation(Token::kEq, reg, 1)
.JumpIfTrue(ToBooleanMode::kAlreadyBoolean, &near1)
.CompareOperation(Token::kEq, reg, 2)
.JumpIfFalse(ToBooleanMode::kAlreadyBoolean, &near2)
.BinaryOperation(Token::kAdd, reg, 1)
.JumpIfTrue(ToBooleanMode::kConvertToBoolean, &near3)
.BinaryOperation(Token::kAdd, reg, 2)
.JumpIfFalse(ToBooleanMode::kConvertToBoolean, &near4)
.Bind(&near0)
.Bind(&near1)
.Bind(&near2)
.Bind(&near3)
.Bind(&near4)
.JumpIfNull(&after_jump_far0)
.Jump(&far0)
.Bind(&after_jump_far0)
.CompareOperation(Token::kEq, reg, 3)
.JumpIfTrue(ToBooleanMode::kAlreadyBoolean, &far1)
.CompareOperation(Token::kEq, reg, 4)
.JumpIfFalse(ToBooleanMode::kAlreadyBoolean, &far2)
.BinaryOperation(Token::kAdd, reg, 3)
.JumpIfTrue(ToBooleanMode::kConvertToBoolean, &far3)
.BinaryOperation(Token::kAdd, reg, 4)
.JumpIfFalse(ToBooleanMode::kConvertToBoolean, &far4);
for (int i = 0; i < kFarJumpDistance - 22; i++) {
builder.Debugger();
}
builder.Bind(&far0).Bind(&far1).Bind(&far2).Bind(&far3).Bind(&far4);
builder.Return();
Handle<BytecodeArray> array = builder.ToBytecodeArray(isolate());
DCHECK_EQ(array->length(), 48 + kFarJumpDistance - 22 + 1);
BytecodeArrayIterator iterator(array);
// Ignore JumpIfNull operation.
iterator.Advance();
CHECK_EQ(iterator.current_bytecode(), Bytecode::kJump);
CHECK_EQ(iterator.GetUnsignedImmediateOperand(0), 22);
iterator.Advance();
// Ignore compare operation.
iterator.Advance();
CHECK_EQ(iterator.current_bytecode(), Bytecode::kJumpIfTrue);
CHECK_EQ(iterator.GetUnsignedImmediateOperand(0), 17);
iterator.Advance();
// Ignore compare operation.
iterator.Advance();
CHECK_EQ(iterator.current_bytecode(), Bytecode::kJumpIfFalse);
CHECK_EQ(iterator.GetUnsignedImmediateOperand(0), 12);
iterator.Advance();
// Ignore add operation.
iterator.Advance();
CHECK_EQ(iterator.current_bytecode(), Bytecode::kJumpIfToBooleanTrue);
CHECK_EQ(iterator.GetUnsignedImmediateOperand(0), 7);
iterator.Advance();
// Ignore add operation.
iterator.Advance();
CHECK_EQ(iterator.current_bytecode(), Bytecode::kJumpIfToBooleanFalse);
CHECK_EQ(iterator.GetUnsignedImmediateOperand(0), 2);
iterator.Advance();
// Ignore JumpIfNull operation.
iterator.Advance();
CHECK_EQ(iterator.current_bytecode(), Bytecode::kJumpConstant);
CHECK_EQ(*(iterator.GetConstantForIndexOperand(0, isolate())),
Smi::FromInt(kFarJumpDistance));
iterator.Advance();
// Ignore compare operation.
iterator.Advance();
CHECK_EQ(iterator.current_bytecode(), Bytecode::kJumpIfTrueConstant);
CHECK_EQ(*(iterator.GetConstantForIndexOperand(0, isolate())),
Smi::FromInt(kFarJumpDistance - 5));
iterator.Advance();
// Ignore compare operation.
iterator.Advance();
CHECK_EQ(iterator.current_bytecode(), Bytecode::kJumpIfFalseConstant);
CHECK_EQ(*(iterator.GetConstantForIndexOperand(0, isolate())),
Smi::FromInt(kFarJumpDistance - 10));
iterator.Advance();
// Ignore add operation.
iterator.Advance();
CHECK_EQ(iterator.current_bytecode(), Bytecode::kJumpIfToBooleanTrueConstant);
CHECK_EQ(*(iterator.GetConstantForIndexOperand(0, isolate())),
Smi::FromInt(kFarJumpDistance - 15));
iterator.Advance();
// Ignore add operation.
iterator.Advance();
CHECK_EQ(iterator.current_bytecode(),
Bytecode::kJumpIfToBooleanFalseConstant);
CHECK_EQ(*(iterator.GetConstantForIndexOperand(0, isolate())),
Smi::FromInt(kFarJumpDistance - 20));
iterator.Advance();
}
TEST_F(BytecodeArrayBuilderTest, BackwardJumps) {
BytecodeArrayBuilder builder(zone(), 1, 1);
BytecodeLabel end;
builder.JumpIfNull(&end);
BytecodeLabel after_loop;
// Conditional jump to force the code after the JumpLoop to be live.
// Technically this jump is illegal because it's jumping into the middle of
// the subsequent loops, but that's ok for this unit test.
BytecodeLoopHeader loop_header;
builder.JumpIfNull(&after_loop)
.Bind(&loop_header)
.JumpLoop(&loop_header, 0, 0, 0)
.Bind(&after_loop);
for (int i = 0; i < 42; i++) {
BytecodeLabel also_after_loop;
// Conditional jump to force the code after the JumpLoop to be live.
builder.JumpIfNull(&also_after_loop)
.JumpLoop(&loop_header, 0, 0, 0)
.Bind(&also_after_loop);
}
// Add padding to force wide backwards jumps.
for (int i = 0; i < 256; i++) {
builder.Debugger();
}
builder.JumpLoop(&loop_header, 0, 0, 0);
builder.Bind(&end);
builder.Return();
Handle<BytecodeArray> array = builder.ToBytecodeArray(isolate());
BytecodeArrayIterator iterator(array);
// Ignore the JumpIfNull to the end
iterator.Advance();
// Ignore the JumpIfNull to after the first JumpLoop
iterator.Advance();
CHECK_EQ(iterator.current_bytecode(), Bytecode::kJumpLoop);
CHECK_EQ(iterator.GetUnsignedImmediateOperand(0), 0);
iterator.Advance();
for (unsigned i = 0; i < 42; i++) {
// Ignore the JumpIfNull to after the JumpLoop
iterator.Advance();
CHECK_EQ(iterator.current_bytecode(), Bytecode::kJumpLoop);
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
// offset of 6 (because kJumpLoop takes three immediate operands and
// JumpIfNull takes 1)
CHECK_EQ(Bytecodes::NumberOfOperands(Bytecode::kJumpLoop), 3);
CHECK_EQ(iterator.GetUnsignedImmediateOperand(0), i * 6 + 6);
iterator.Advance();
}
// Check padding to force wide backwards jumps.
for (int i = 0; i < 256; i++) {
CHECK_EQ(iterator.current_bytecode(), Bytecode::kDebugger);
iterator.Advance();
}
CHECK_EQ(iterator.current_bytecode(), Bytecode::kJumpLoop);
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kDouble);
CHECK_EQ(iterator.GetUnsignedImmediateOperand(0), 42 * 6 + 1 + 256 + 4);
iterator.Advance();
CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
iterator.Advance();
CHECK(iterator.done());
}
TEST_F(BytecodeArrayBuilderTest, SmallSwitch) {
BytecodeArrayBuilder builder(zone(), 1, 1);
// Small jump table that fits into the single-size constant pool
int small_jump_table_size = 5;
int small_jump_table_base = -2;
BytecodeJumpTable* small_jump_table =
builder.AllocateJumpTable(small_jump_table_size, small_jump_table_base);
builder.LoadLiteral(Smi::FromInt(7)).SwitchOnSmiNoFeedback(small_jump_table);
for (int i = 0; i < small_jump_table_size; i++) {
builder.Bind(small_jump_table, small_jump_table_base + i).Debugger();
}
builder.Return();
Handle<BytecodeArray> array = builder.ToBytecodeArray(isolate());
BytecodeArrayIterator iterator(array);
CHECK_EQ(iterator.current_bytecode(), Bytecode::kLdaSmi);
iterator.Advance();
CHECK_EQ(iterator.current_bytecode(), Bytecode::kSwitchOnSmiNoFeedback);
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
{
int i = 0;
int switch_end =
iterator.current_offset() + iterator.current_bytecode_size();
for (JumpTableTargetOffset entry : iterator.GetJumpTableTargetOffsets()) {
CHECK_EQ(entry.case_value, small_jump_table_base + i);
CHECK_EQ(entry.target_offset, switch_end + i);
i++;
}
CHECK_EQ(i, small_jump_table_size);
}
iterator.Advance();
for (int i = 0; i < small_jump_table_size; i++) {
CHECK_EQ(iterator.current_bytecode(), Bytecode::kDebugger);
iterator.Advance();
}
CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
iterator.Advance();
CHECK(iterator.done());
}
TEST_F(BytecodeArrayBuilderTest, WideSwitch) {
BytecodeArrayBuilder builder(zone(), 1, 1);
// Large jump table that requires a wide Switch bytecode.
int large_jump_table_size = 256;
int large_jump_table_base = -10;
BytecodeJumpTable* large_jump_table =
builder.AllocateJumpTable(large_jump_table_size, large_jump_table_base);
builder.LoadLiteral(Smi::FromInt(7)).SwitchOnSmiNoFeedback(large_jump_table);
for (int i = 0; i < large_jump_table_size; i++) {
builder.Bind(large_jump_table, large_jump_table_base + i).Debugger();
}
builder.Return();
Handle<BytecodeArray> array = builder.ToBytecodeArray(isolate());
BytecodeArrayIterator iterator(array);
CHECK_EQ(iterator.current_bytecode(), Bytecode::kLdaSmi);
iterator.Advance();
CHECK_EQ(iterator.current_bytecode(), Bytecode::kSwitchOnSmiNoFeedback);
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kDouble);
{
int i = 0;
int switch_end =
iterator.current_offset() + iterator.current_bytecode_size();
for (JumpTableTargetOffset entry : iterator.GetJumpTableTargetOffsets()) {
CHECK_EQ(entry.case_value, large_jump_table_base + i);
CHECK_EQ(entry.target_offset, switch_end + i);
i++;
}
CHECK_EQ(i, large_jump_table_size);
}
iterator.Advance();
for (int i = 0; i < large_jump_table_size; i++) {
CHECK_EQ(iterator.current_bytecode(), Bytecode::kDebugger);
iterator.Advance();
}
CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
iterator.Advance();
CHECK(iterator.done());
}
} // namespace interpreter
} // namespace internal
} // namespace v8

View File

@ -0,0 +1,272 @@
// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/interpreter/bytecode-array-iterator.h"
#include "src/init/v8.h"
#include "src/interpreter/bytecode-array-builder.h"
#include "src/numbers/hash-seed-inl.h"
#include "src/objects/objects-inl.h"
#include "src/objects/smi.h"
#include "test/unittests/interpreter/bytecode-utils.h"
#include "test/unittests/test-utils.h"
namespace v8 {
namespace internal {
namespace interpreter {
class BytecodeArrayIteratorTest : public TestWithIsolateAndZone {
public:
BytecodeArrayIteratorTest() = default;
~BytecodeArrayIteratorTest() override = default;
};
TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) {
// Use a builder to create an array with containing multiple bytecodes
// with 0, 1 and 2 operands.
FeedbackVectorSpec feedback_spec(zone());
BytecodeArrayBuilder builder(zone(), 3, 17, &feedback_spec);
AstValueFactory ast_factory(zone(), isolate()->ast_string_constants(),
HashSeed(isolate()));
double heap_num_0 = 2.718;
double heap_num_1 = 2.0 * Smi::kMaxValue;
Tagged<Smi> zero = Smi::zero();
Tagged<Smi> smi_0 = Smi::FromInt(64);
Tagged<Smi> smi_1 = Smi::FromInt(-65536);
Register reg_0(0);
Register reg_16(16); // Something not eligible for short Star.
RegisterList pair = BytecodeUtils::NewRegisterList(0, 2);
RegisterList triple = BytecodeUtils::NewRegisterList(0, 3);
Register param = Register::FromParameterIndex(2);
const AstRawString* name = ast_factory.GetOneByteString("abc");
uint32_t name_index = 2;
uint32_t load_feedback_slot = feedback_spec.AddLoadICSlot().ToInt();
uint32_t forin_feedback_slot = feedback_spec.AddForInSlot().ToInt();
uint32_t load_global_feedback_slot =
feedback_spec.AddLoadGlobalICSlot(TypeofMode::kNotInside).ToInt();
builder.LoadLiteral(heap_num_0)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(heap_num_1)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(zero)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_0)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_1)
.StoreAccumulatorInRegister(reg_16)
.LoadAccumulatorWithRegister(reg_0)
.BinaryOperation(Token::kAdd, reg_0, 2)
.StoreAccumulatorInRegister(reg_16)
.LoadNamedProperty(reg_16, name, load_feedback_slot)
.BinaryOperation(Token::kAdd, reg_0, 3)
.StoreAccumulatorInRegister(param)
.CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, param, pair)
.ForInPrepare(triple, forin_feedback_slot)
.CallRuntime(Runtime::kLoadIC_Miss, reg_0)
.Debugger()
.LoadGlobal(name, load_global_feedback_slot, TypeofMode::kNotInside)
.Return();
// Test iterator sees the expected output from the builder.
ast_factory.Internalize(isolate());
BytecodeArrayIterator iterator(builder.ToBytecodeArray(isolate()));
const int kPrefixByteSize = 1;
int offset = 0;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaConstant);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(
Object::NumberValue(*iterator.GetConstantForIndexOperand(0, isolate())),
heap_num_0);
CHECK(!iterator.done());
offset += Bytecodes::Size(Bytecode::kLdaConstant, OperandScale::kSingle);
iterator.Advance();
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar0);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
CHECK(!iterator.done());
offset += Bytecodes::Size(Bytecode::kStar0, OperandScale::kSingle);
iterator.Advance();
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaConstant);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(
Object::NumberValue(*iterator.GetConstantForIndexOperand(0, isolate())),
heap_num_1);
CHECK(!iterator.done());
offset += Bytecodes::Size(Bytecode::kLdaConstant, OperandScale::kSingle);
iterator.Advance();
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar0);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
CHECK(!iterator.done());
offset += Bytecodes::Size(Bytecode::kStar0, OperandScale::kSingle);
iterator.Advance();
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaZero);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
CHECK(!iterator.done());
offset += Bytecodes::Size(Bytecode::kLdaZero, OperandScale::kSingle);
iterator.Advance();
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar0);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
CHECK(!iterator.done());
offset += Bytecodes::Size(Bytecode::kStar0, OperandScale::kSingle);
iterator.Advance();
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaSmi);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(Smi::FromInt(iterator.GetImmediateOperand(0)), smi_0);
CHECK(!iterator.done());
offset += Bytecodes::Size(Bytecode::kLdaSmi, OperandScale::kSingle);
iterator.Advance();
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar0);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
CHECK(!iterator.done());
offset += Bytecodes::Size(Bytecode::kStar0, OperandScale::kSingle);
iterator.Advance();
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaSmi);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kQuadruple);
EXPECT_EQ(Smi::FromInt(iterator.GetImmediateOperand(0)), smi_1);
CHECK(!iterator.done());
offset += Bytecodes::Size(Bytecode::kLdaSmi, OperandScale::kQuadruple) +
kPrefixByteSize;
iterator.Advance();
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_16.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(0), 1);
CHECK(!iterator.done());
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
iterator.Advance();
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdar);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
CHECK(!iterator.done());
offset += Bytecodes::Size(Bytecode::kLdar, OperandScale::kSingle);
iterator.Advance();
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kAdd);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(0), 1);
CHECK(!iterator.done());
offset += Bytecodes::Size(Bytecode::kAdd, OperandScale::kSingle);
iterator.Advance();
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_16.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(0), 1);
CHECK(!iterator.done());
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
iterator.Advance();
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kGetNamedProperty);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_16.index());
EXPECT_EQ(iterator.GetIndexOperand(1), name_index);
EXPECT_EQ(iterator.GetIndexOperand(2), load_feedback_slot);
CHECK(!iterator.done());
offset += Bytecodes::Size(Bytecode::kGetNamedProperty, OperandScale::kSingle);
iterator.Advance();
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kAdd);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(0), 1);
CHECK(!iterator.done());
offset += Bytecodes::Size(Bytecode::kAdd, OperandScale::kSingle);
iterator.Advance();
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), param.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(0), 1);
CHECK(!iterator.done());
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
iterator.Advance();
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kCallRuntimeForPair);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRuntimeIdOperand(0), Runtime::kLoadLookupSlotForCall);
EXPECT_EQ(iterator.GetRegisterOperand(1).index(), param.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(1), 1);
EXPECT_EQ(iterator.GetRegisterCountOperand(2), 1u);
EXPECT_EQ(iterator.GetRegisterOperand(3).index(), reg_0.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(3), 2);
CHECK(!iterator.done());
offset +=
Bytecodes::Size(Bytecode::kCallRuntimeForPair, OperandScale::kSingle);
iterator.Advance();
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kForInPrepare);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(0), 3);
EXPECT_EQ(iterator.GetIndexOperand(1), forin_feedback_slot);
CHECK(!iterator.done());
offset += Bytecodes::Size(Bytecode::kForInPrepare, OperandScale::kSingle);
iterator.Advance();
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kCallRuntime);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRuntimeIdOperand(0), Runtime::kLoadIC_Miss);
EXPECT_EQ(iterator.GetRegisterOperand(1).index(), reg_0.index());
EXPECT_EQ(iterator.GetRegisterCountOperand(2), 1u);
CHECK(!iterator.done());
offset += Bytecodes::Size(Bytecode::kCallRuntime, OperandScale::kSingle);
iterator.Advance();
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kDebugger);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
CHECK(!iterator.done());
offset += Bytecodes::Size(Bytecode::kDebugger, OperandScale::kSingle);
iterator.Advance();
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaGlobal);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode_size(), 3);
EXPECT_EQ(iterator.GetIndexOperand(1), load_global_feedback_slot);
offset += Bytecodes::Size(Bytecode::kLdaGlobal, OperandScale::kSingle);
iterator.Advance();
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kReturn);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
CHECK(!iterator.done());
iterator.Advance();
CHECK(iterator.done());
}
} // namespace interpreter
} // namespace internal
} // namespace v8

View File

@ -0,0 +1,938 @@
// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/init/v8.h"
#include "src/interpreter/bytecode-array-builder.h"
#include "src/interpreter/bytecode-array-random-iterator.h"
#include "src/numbers/hash-seed-inl.h"
#include "src/objects/objects-inl.h"
#include "src/objects/smi.h"
#include "test/unittests/interpreter/bytecode-utils.h"
#include "test/unittests/test-utils.h"
namespace v8 {
namespace internal {
namespace interpreter {
class BytecodeArrayRandomIteratorTest : public TestWithIsolateAndZone {
public:
BytecodeArrayRandomIteratorTest() = default;
~BytecodeArrayRandomIteratorTest() override = default;
};
TEST_F(BytecodeArrayRandomIteratorTest, InvalidBeforeStart) {
// Use a builder to create an array with containing multiple bytecodes
// with 0, 1 and 2 operands.
FeedbackVectorSpec feedback_spec(zone());
BytecodeArrayBuilder builder(zone(), 3, 3, &feedback_spec);
AstValueFactory ast_factory(zone(), isolate()->ast_string_constants(),
HashSeed(isolate()));
double heap_num_0 = 2.718;
double heap_num_1 = 2.0 * Smi::kMaxValue;
Tagged<Smi> zero = Smi::zero();
Tagged<Smi> smi_0 = Smi::FromInt(64);
Tagged<Smi> smi_1 = Smi::FromInt(-65536);
Register reg_0(0);
Register reg_1(1);
RegisterList pair = BytecodeUtils::NewRegisterList(0, 2);
RegisterList triple = BytecodeUtils::NewRegisterList(0, 3);
Register param = Register::FromParameterIndex(2);
const AstRawString* name = ast_factory.GetOneByteString("abc");
uint32_t feedback_slot = feedback_spec.AddLoadICSlot().ToInt();
builder.LoadLiteral(heap_num_0)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(heap_num_1)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(zero)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_0)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_1)
.StoreAccumulatorInRegister(reg_1)
.LoadAccumulatorWithRegister(reg_0)
.BinaryOperation(Token::kAdd, reg_0, 2)
.StoreAccumulatorInRegister(reg_1)
.LoadNamedProperty(reg_1, name, feedback_slot)
.BinaryOperation(Token::kAdd, reg_0, 3)
.StoreAccumulatorInRegister(param)
.CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, param, pair)
.ForInPrepare(triple, feedback_slot)
.CallRuntime(Runtime::kLoadIC_Miss, reg_0)
.Debugger()
.Return();
ast_factory.Internalize(isolate());
Handle<BytecodeArray> bytecodeArray = builder.ToBytecodeArray(isolate());
BytecodeArrayRandomIterator iterator(bytecodeArray, zone());
iterator.GoToStart();
ASSERT_TRUE(iterator.IsValid());
--iterator;
ASSERT_FALSE(iterator.IsValid());
}
TEST_F(BytecodeArrayRandomIteratorTest, InvalidAfterEnd) {
// Use a builder to create an array with containing multiple bytecodes
// with 0, 1 and 2 operands.
FeedbackVectorSpec feedback_spec(zone());
BytecodeArrayBuilder builder(zone(), 3, 3, &feedback_spec);
AstValueFactory ast_factory(zone(), isolate()->ast_string_constants(),
HashSeed(isolate()));
double heap_num_0 = 2.718;
double heap_num_1 = 2.0 * Smi::kMaxValue;
Tagged<Smi> zero = Smi::zero();
Tagged<Smi> smi_0 = Smi::FromInt(64);
Tagged<Smi> smi_1 = Smi::FromInt(-65536);
Register reg_0(0);
Register reg_1(1);
RegisterList pair = BytecodeUtils::NewRegisterList(0, 2);
RegisterList triple = BytecodeUtils::NewRegisterList(0, 3);
Register param = Register::FromParameterIndex(2);
const AstRawString* name = ast_factory.GetOneByteString("abc");
uint32_t feedback_slot = feedback_spec.AddLoadICSlot().ToInt();
builder.LoadLiteral(heap_num_0)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(heap_num_1)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(zero)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_0)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_1)
.StoreAccumulatorInRegister(reg_1)
.LoadAccumulatorWithRegister(reg_0)
.BinaryOperation(Token::kAdd, reg_0, 2)
.StoreAccumulatorInRegister(reg_1)
.LoadNamedProperty(reg_1, name, feedback_slot)
.BinaryOperation(Token::kAdd, reg_0, 3)
.StoreAccumulatorInRegister(param)
.CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, param, pair)
.ForInPrepare(triple, feedback_slot)
.CallRuntime(Runtime::kLoadIC_Miss, reg_0)
.Debugger()
.Return();
ast_factory.Internalize(isolate());
Handle<BytecodeArray> bytecodeArray = builder.ToBytecodeArray(isolate());
BytecodeArrayRandomIterator iterator(bytecodeArray, zone());
iterator.GoToEnd();
ASSERT_TRUE(iterator.IsValid());
++iterator;
ASSERT_FALSE(iterator.IsValid());
}
TEST_F(BytecodeArrayRandomIteratorTest, AccessesFirst) {
// Use a builder to create an array with containing multiple bytecodes
// with 0, 1 and 2 operands.
FeedbackVectorSpec feedback_spec(zone());
BytecodeArrayBuilder builder(zone(), 3, 3, &feedback_spec);
AstValueFactory ast_factory(zone(), isolate()->ast_string_constants(),
HashSeed(isolate()));
double heap_num_0 = 2.718;
double heap_num_1 = 2.0 * Smi::kMaxValue;
Tagged<Smi> zero = Smi::zero();
Tagged<Smi> smi_0 = Smi::FromInt(64);
Tagged<Smi> smi_1 = Smi::FromInt(-65536);
Register reg_0(0);
Register reg_1(1);
RegisterList pair = BytecodeUtils::NewRegisterList(0, 2);
RegisterList triple = BytecodeUtils::NewRegisterList(0, 3);
Register param = Register::FromParameterIndex(2);
const AstRawString* name = ast_factory.GetOneByteString("abc");
uint32_t feedback_slot = feedback_spec.AddLoadICSlot().ToInt();
builder.LoadLiteral(heap_num_0)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(heap_num_1)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(zero)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_0)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_1)
.StoreAccumulatorInRegister(reg_1)
.LoadAccumulatorWithRegister(reg_0)
.BinaryOperation(Token::kAdd, reg_0, 2)
.StoreAccumulatorInRegister(reg_1)
.LoadNamedProperty(reg_1, name, feedback_slot)
.BinaryOperation(Token::kAdd, reg_0, 3)
.StoreAccumulatorInRegister(param)
.CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, param, pair)
.ForInPrepare(triple, feedback_slot)
.CallRuntime(Runtime::kLoadIC_Miss, reg_0)
.Debugger()
.Return();
ast_factory.Internalize(isolate());
Handle<BytecodeArray> bytecodeArray = builder.ToBytecodeArray(isolate());
BytecodeArrayRandomIterator iterator(bytecodeArray, zone());
iterator.GoToStart();
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaConstant);
EXPECT_EQ(iterator.current_index(), 0);
EXPECT_EQ(iterator.current_offset(), 0);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(
Object::NumberValue(*iterator.GetConstantForIndexOperand(0, isolate())),
heap_num_0);
ASSERT_TRUE(iterator.IsValid());
}
TEST_F(BytecodeArrayRandomIteratorTest, AccessesLast) {
// Use a builder to create an array with containing multiple bytecodes
// with 0, 1 and 2 operands.
FeedbackVectorSpec feedback_spec(zone());
BytecodeArrayBuilder builder(zone(), 3, 3, &feedback_spec);
AstValueFactory ast_factory(zone(), isolate()->ast_string_constants(),
HashSeed(isolate()));
double heap_num_0 = 2.718;
double heap_num_1 = 2.0 * Smi::kMaxValue;
Tagged<Smi> zero = Smi::zero();
Tagged<Smi> smi_0 = Smi::FromInt(64);
Tagged<Smi> smi_1 = Smi::FromInt(-65536);
Register reg_0(0);
Register reg_1(1);
RegisterList pair = BytecodeUtils::NewRegisterList(0, 2);
RegisterList triple = BytecodeUtils::NewRegisterList(0, 3);
Register param = Register::FromParameterIndex(2);
const AstRawString* name = ast_factory.GetOneByteString("abc");
uint32_t feedback_slot = feedback_spec.AddLoadICSlot().ToInt();
builder.LoadLiteral(heap_num_0)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(heap_num_1)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(zero)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_0)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_1)
.StoreAccumulatorInRegister(reg_1)
.LoadAccumulatorWithRegister(reg_0)
.BinaryOperation(Token::kAdd, reg_0, 2)
.StoreAccumulatorInRegister(reg_1)
.LoadNamedProperty(reg_1, name, feedback_slot)
.BinaryOperation(Token::kAdd, reg_0, 3)
.StoreAccumulatorInRegister(param)
.CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, param, pair)
.ForInPrepare(triple, feedback_slot)
.CallRuntime(Runtime::kLoadIC_Miss, reg_0)
.Debugger()
.Return();
ast_factory.Internalize(isolate());
Handle<BytecodeArray> bytecodeArray = builder.ToBytecodeArray(isolate());
BytecodeArrayRandomIterator iterator(bytecodeArray, zone());
iterator.GoToEnd();
int offset = bytecodeArray->length() -
Bytecodes::Size(Bytecode::kReturn, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kReturn);
EXPECT_EQ(iterator.current_index(), 20);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
}
TEST_F(BytecodeArrayRandomIteratorTest, RandomAccessValid) {
// Use a builder to create an array with containing multiple bytecodes
// with 0, 1 and 2 operands.
FeedbackVectorSpec feedback_spec(zone());
BytecodeArrayBuilder builder(zone(), 3, 17, &feedback_spec);
AstValueFactory ast_factory(zone(), isolate()->ast_string_constants(),
HashSeed(isolate()));
double heap_num_0 = 2.718;
double heap_num_1 = 2.0 * Smi::kMaxValue;
Tagged<Smi> zero = Smi::zero();
Tagged<Smi> smi_0 = Smi::FromInt(64);
Tagged<Smi> smi_1 = Smi::FromInt(-65536);
Register reg_0(0);
Register reg_16(16); // Something not eligible for short Star.
RegisterList pair = BytecodeUtils::NewRegisterList(0, 2);
RegisterList triple = BytecodeUtils::NewRegisterList(0, 3);
Register param = Register::FromParameterIndex(2);
const AstRawString* name = ast_factory.GetOneByteString("abc");
uint32_t name_index = 2;
uint32_t feedback_slot = feedback_spec.AddLoadICSlot().ToInt();
builder.LoadLiteral(heap_num_0)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(heap_num_1)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(zero)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_0)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_1)
.StoreAccumulatorInRegister(reg_16)
.LoadAccumulatorWithRegister(reg_0)
.BinaryOperation(Token::kAdd, reg_0, 2)
.StoreAccumulatorInRegister(reg_16)
.LoadNamedProperty(reg_16, name, feedback_slot)
.BinaryOperation(Token::kAdd, reg_0, 3)
.StoreAccumulatorInRegister(param)
.CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, param, pair)
.ForInPrepare(triple, feedback_slot)
.CallRuntime(Runtime::kLoadIC_Miss, reg_0)
.Debugger()
.Return();
// Test iterator sees the expected output from the builder.
ast_factory.Internalize(isolate());
BytecodeArrayRandomIterator iterator(builder.ToBytecodeArray(isolate()),
zone());
const int kPrefixByteSize = 1;
int offset = 0;
iterator.GoToIndex(11);
offset = Bytecodes::Size(Bytecode::kLdaConstant, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar0, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdaConstant, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar0, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdaZero, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar0, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdaSmi, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar0, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdaSmi, OperandScale::kQuadruple) +
kPrefixByteSize;
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdar, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kAdd);
EXPECT_EQ(iterator.current_index(), 11);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(0), 1);
ASSERT_TRUE(iterator.IsValid());
iterator.GoToIndex(2);
offset = Bytecodes::Size(Bytecode::kLdaConstant, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar0, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaConstant);
EXPECT_EQ(iterator.current_index(), 2);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(
Object::NumberValue(*iterator.GetConstantForIndexOperand(0, isolate())),
heap_num_1);
ASSERT_TRUE(iterator.IsValid());
iterator.GoToIndex(16);
offset = Bytecodes::Size(Bytecode::kLdaConstant, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar0, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdaConstant, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar0, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdaZero, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar0, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdaSmi, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar0, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdaSmi, OperandScale::kQuadruple) +
kPrefixByteSize;
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdar, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kAdd, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kGetNamedProperty, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kAdd, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kCallRuntimeForPair);
EXPECT_EQ(iterator.current_index(), 16);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRuntimeIdOperand(0), Runtime::kLoadLookupSlotForCall);
EXPECT_EQ(iterator.GetRegisterOperand(1).index(), param.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(1), 1);
EXPECT_EQ(iterator.GetRegisterCountOperand(2), 1u);
EXPECT_EQ(iterator.GetRegisterOperand(3).index(), reg_0.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(3), 2);
ASSERT_TRUE(iterator.IsValid());
iterator -= 3;
offset -= Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
offset -= Bytecodes::Size(Bytecode::kAdd, OperandScale::kSingle);
offset -= Bytecodes::Size(Bytecode::kGetNamedProperty, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kGetNamedProperty);
EXPECT_EQ(iterator.current_index(), 13);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_16.index());
EXPECT_EQ(iterator.GetIndexOperand(1), name_index);
EXPECT_EQ(iterator.GetIndexOperand(2), feedback_slot);
ASSERT_TRUE(iterator.IsValid());
iterator += 2;
offset += Bytecodes::Size(Bytecode::kGetNamedProperty, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kAdd, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar);
EXPECT_EQ(iterator.current_index(), 15);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), param.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(0), 1);
ASSERT_TRUE(iterator.IsValid());
iterator.GoToIndex(20);
offset = Bytecodes::Size(Bytecode::kLdaConstant, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar0, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdaConstant, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar0, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdaZero, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar0, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdaSmi, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar0, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdaSmi, OperandScale::kQuadruple) +
kPrefixByteSize;
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdar, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kAdd, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kGetNamedProperty, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kAdd, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
offset +=
Bytecodes::Size(Bytecode::kCallRuntimeForPair, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kForInPrepare, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kCallRuntime, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kDebugger, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kReturn);
EXPECT_EQ(iterator.current_index(), 20);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
iterator.GoToIndex(22);
EXPECT_FALSE(iterator.IsValid());
iterator.GoToIndex(-5);
EXPECT_FALSE(iterator.IsValid());
}
TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArray) {
// Use a builder to create an array with containing multiple bytecodes
// with 0, 1 and 2 operands.
FeedbackVectorSpec feedback_spec(zone());
BytecodeArrayBuilder builder(zone(), 3, 17, &feedback_spec);
AstValueFactory ast_factory(zone(), isolate()->ast_string_constants(),
HashSeed(isolate()));
double heap_num_0 = 2.718;
double heap_num_1 = 2.0 * Smi::kMaxValue;
Tagged<Smi> zero = Smi::zero();
Tagged<Smi> smi_0 = Smi::FromInt(64);
Tagged<Smi> smi_1 = Smi::FromInt(-65536);
Register reg_0(0);
Register reg_16(16); // Something not eligible for short Star.
RegisterList pair = BytecodeUtils::NewRegisterList(0, 2);
RegisterList triple = BytecodeUtils::NewRegisterList(0, 3);
Register param = Register::FromParameterIndex(2);
const AstRawString* name = ast_factory.GetOneByteString("abc");
uint32_t name_index = 2;
uint32_t feedback_slot = feedback_spec.AddLoadICSlot().ToInt();
builder.LoadLiteral(heap_num_0)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(heap_num_1)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(zero)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_0)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_1)
.StoreAccumulatorInRegister(reg_16)
.LoadAccumulatorWithRegister(reg_0)
.BinaryOperation(Token::kAdd, reg_0, 2)
.StoreAccumulatorInRegister(reg_16)
.LoadNamedProperty(reg_16, name, feedback_slot)
.BinaryOperation(Token::kAdd, reg_0, 3)
.StoreAccumulatorInRegister(param)
.CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, param, pair)
.ForInPrepare(triple, feedback_slot)
.CallRuntime(Runtime::kLoadIC_Miss, reg_0)
.Debugger()
.Return();
// Test iterator sees the expected output from the builder.
ast_factory.Internalize(isolate());
BytecodeArrayRandomIterator iterator(builder.ToBytecodeArray(isolate()),
zone());
const int kPrefixByteSize = 1;
int offset = 0;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaConstant);
EXPECT_EQ(iterator.current_index(), 0);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(
Object::NumberValue(*iterator.GetConstantForIndexOperand(0, isolate())),
heap_num_0);
ASSERT_TRUE(iterator.IsValid());
offset += Bytecodes::Size(Bytecode::kLdaConstant, OperandScale::kSingle);
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar0);
EXPECT_EQ(iterator.current_index(), 1);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
offset += Bytecodes::Size(Bytecode::kStar0, OperandScale::kSingle);
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaConstant);
EXPECT_EQ(iterator.current_index(), 2);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(
Object::NumberValue(*iterator.GetConstantForIndexOperand(0, isolate())),
heap_num_1);
ASSERT_TRUE(iterator.IsValid());
offset += Bytecodes::Size(Bytecode::kLdaConstant, OperandScale::kSingle);
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar0);
EXPECT_EQ(iterator.current_index(), 3);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
offset += Bytecodes::Size(Bytecode::kStar0, OperandScale::kSingle);
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaZero);
EXPECT_EQ(iterator.current_index(), 4);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
offset += Bytecodes::Size(Bytecode::kLdaZero, OperandScale::kSingle);
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar0);
EXPECT_EQ(iterator.current_index(), 5);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
offset += Bytecodes::Size(Bytecode::kStar0, OperandScale::kSingle);
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaSmi);
EXPECT_EQ(iterator.current_index(), 6);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(Smi::FromInt(iterator.GetImmediateOperand(0)), smi_0);
ASSERT_TRUE(iterator.IsValid());
offset += Bytecodes::Size(Bytecode::kLdaSmi, OperandScale::kSingle);
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar0);
EXPECT_EQ(iterator.current_index(), 7);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
offset += Bytecodes::Size(Bytecode::kStar0, OperandScale::kSingle);
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaSmi);
EXPECT_EQ(iterator.current_index(), 8);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kQuadruple);
EXPECT_EQ(Smi::FromInt(iterator.GetImmediateOperand(0)), smi_1);
ASSERT_TRUE(iterator.IsValid());
offset += Bytecodes::Size(Bytecode::kLdaSmi, OperandScale::kQuadruple) +
kPrefixByteSize;
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar);
EXPECT_EQ(iterator.current_index(), 9);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_16.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(0), 1);
ASSERT_TRUE(iterator.IsValid());
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdar);
EXPECT_EQ(iterator.current_index(), 10);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
ASSERT_TRUE(iterator.IsValid());
offset += Bytecodes::Size(Bytecode::kLdar, OperandScale::kSingle);
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kAdd);
EXPECT_EQ(iterator.current_index(), 11);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(0), 1);
ASSERT_TRUE(iterator.IsValid());
offset += Bytecodes::Size(Bytecode::kAdd, OperandScale::kSingle);
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar);
EXPECT_EQ(iterator.current_index(), 12);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_16.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(0), 1);
ASSERT_TRUE(iterator.IsValid());
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kGetNamedProperty);
EXPECT_EQ(iterator.current_index(), 13);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_16.index());
EXPECT_EQ(iterator.GetIndexOperand(1), name_index);
EXPECT_EQ(iterator.GetIndexOperand(2), feedback_slot);
ASSERT_TRUE(iterator.IsValid());
offset += Bytecodes::Size(Bytecode::kGetNamedProperty, OperandScale::kSingle);
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kAdd);
EXPECT_EQ(iterator.current_index(), 14);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(0), 1);
ASSERT_TRUE(iterator.IsValid());
offset += Bytecodes::Size(Bytecode::kAdd, OperandScale::kSingle);
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar);
EXPECT_EQ(iterator.current_index(), 15);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), param.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(0), 1);
ASSERT_TRUE(iterator.IsValid());
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kCallRuntimeForPair);
EXPECT_EQ(iterator.current_index(), 16);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRuntimeIdOperand(0), Runtime::kLoadLookupSlotForCall);
EXPECT_EQ(iterator.GetRegisterOperand(1).index(), param.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(1), 1);
EXPECT_EQ(iterator.GetRegisterCountOperand(2), 1u);
EXPECT_EQ(iterator.GetRegisterOperand(3).index(), reg_0.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(3), 2);
ASSERT_TRUE(iterator.IsValid());
offset +=
Bytecodes::Size(Bytecode::kCallRuntimeForPair, OperandScale::kSingle);
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kForInPrepare);
EXPECT_EQ(iterator.current_index(), 17);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(0), 3);
EXPECT_EQ(iterator.GetIndexOperand(1), feedback_slot);
ASSERT_TRUE(iterator.IsValid());
offset += Bytecodes::Size(Bytecode::kForInPrepare, OperandScale::kSingle);
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kCallRuntime);
EXPECT_EQ(iterator.current_index(), 18);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRuntimeIdOperand(0), Runtime::kLoadIC_Miss);
EXPECT_EQ(iterator.GetRegisterOperand(1).index(), reg_0.index());
EXPECT_EQ(iterator.GetRegisterCountOperand(2), 1u);
ASSERT_TRUE(iterator.IsValid());
offset += Bytecodes::Size(Bytecode::kCallRuntime, OperandScale::kSingle);
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kDebugger);
EXPECT_EQ(iterator.current_index(), 19);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
offset += Bytecodes::Size(Bytecode::kDebugger, OperandScale::kSingle);
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kReturn);
EXPECT_EQ(iterator.current_index(), 20);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
++iterator;
ASSERT_TRUE(!iterator.IsValid());
}
TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArrayBackwards) {
// Use a builder to create an array with containing multiple bytecodes
// with 0, 1 and 2 operands.
FeedbackVectorSpec feedback_spec(zone());
BytecodeArrayBuilder builder(zone(), 3, 17, &feedback_spec);
AstValueFactory ast_factory(zone(), isolate()->ast_string_constants(),
HashSeed(isolate()));
double heap_num_0 = 2.718;
double heap_num_1 = 2.0 * Smi::kMaxValue;
Tagged<Smi> zero = Smi::zero();
Tagged<Smi> smi_0 = Smi::FromInt(64);
Tagged<Smi> smi_1 = Smi::FromInt(-65536);
Register reg_0(0);
Register reg_16(16); // Something not eligible for short Star.
RegisterList pair = BytecodeUtils::NewRegisterList(0, 2);
RegisterList triple = BytecodeUtils::NewRegisterList(0, 3);
Register param = Register::FromParameterIndex(2);
const AstRawString* name = ast_factory.GetOneByteString("abc");
uint32_t name_index = 2;
uint32_t feedback_slot = feedback_spec.AddLoadICSlot().ToInt();
builder.LoadLiteral(heap_num_0)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(heap_num_1)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(zero)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_0)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_1)
.StoreAccumulatorInRegister(reg_16)
.LoadAccumulatorWithRegister(reg_0)
.BinaryOperation(Token::kAdd, reg_0, 2)
.StoreAccumulatorInRegister(reg_16)
.LoadNamedProperty(reg_16, name, feedback_slot)
.BinaryOperation(Token::kAdd, reg_0, 3)
.StoreAccumulatorInRegister(param)
.CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, param, pair)
.ForInPrepare(triple, feedback_slot)
.CallRuntime(Runtime::kLoadIC_Miss, reg_0)
.Debugger()
.Return();
// Test iterator sees the expected output from the builder.
ast_factory.Internalize(isolate());
Handle<BytecodeArray> bytecodeArray = builder.ToBytecodeArray(isolate());
BytecodeArrayRandomIterator iterator(bytecodeArray, zone());
const int kPrefixByteSize = 1;
int offset = bytecodeArray->length();
iterator.GoToEnd();
offset -= Bytecodes::Size(Bytecode::kReturn, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kReturn);
EXPECT_EQ(iterator.current_index(), 20);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
--iterator;
offset -= Bytecodes::Size(Bytecode::kDebugger, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kDebugger);
EXPECT_EQ(iterator.current_index(), 19);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
--iterator;
offset -= Bytecodes::Size(Bytecode::kCallRuntime, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kCallRuntime);
EXPECT_EQ(iterator.current_index(), 18);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRuntimeIdOperand(0), Runtime::kLoadIC_Miss);
EXPECT_EQ(iterator.GetRegisterOperand(1).index(), reg_0.index());
EXPECT_EQ(iterator.GetRegisterCountOperand(2), 1u);
ASSERT_TRUE(iterator.IsValid());
--iterator;
offset -= Bytecodes::Size(Bytecode::kForInPrepare, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kForInPrepare);
EXPECT_EQ(iterator.current_index(), 17);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(0), 3);
EXPECT_EQ(iterator.GetIndexOperand(1), feedback_slot);
ASSERT_TRUE(iterator.IsValid());
--iterator;
offset -=
Bytecodes::Size(Bytecode::kCallRuntimeForPair, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kCallRuntimeForPair);
EXPECT_EQ(iterator.current_index(), 16);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRuntimeIdOperand(0), Runtime::kLoadLookupSlotForCall);
EXPECT_EQ(iterator.GetRegisterOperand(1).index(), param.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(1), 1);
EXPECT_EQ(iterator.GetRegisterCountOperand(2), 1u);
EXPECT_EQ(iterator.GetRegisterOperand(3).index(), reg_0.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(3), 2);
ASSERT_TRUE(iterator.IsValid());
--iterator;
offset -= Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar);
EXPECT_EQ(iterator.current_index(), 15);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), param.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(0), 1);
ASSERT_TRUE(iterator.IsValid());
--iterator;
offset -= Bytecodes::Size(Bytecode::kAdd, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kAdd);
EXPECT_EQ(iterator.current_index(), 14);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(0), 1);
ASSERT_TRUE(iterator.IsValid());
--iterator;
offset -= Bytecodes::Size(Bytecode::kGetNamedProperty, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kGetNamedProperty);
EXPECT_EQ(iterator.current_index(), 13);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_16.index());
EXPECT_EQ(iterator.GetIndexOperand(1), name_index);
EXPECT_EQ(iterator.GetIndexOperand(2), feedback_slot);
ASSERT_TRUE(iterator.IsValid());
--iterator;
offset -= Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar);
EXPECT_EQ(iterator.current_index(), 12);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_16.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(0), 1);
ASSERT_TRUE(iterator.IsValid());
--iterator;
offset -= Bytecodes::Size(Bytecode::kAdd, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kAdd);
EXPECT_EQ(iterator.current_index(), 11);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(0), 1);
ASSERT_TRUE(iterator.IsValid());
--iterator;
offset -= Bytecodes::Size(Bytecode::kLdar, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdar);
EXPECT_EQ(iterator.current_index(), 10);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
ASSERT_TRUE(iterator.IsValid());
--iterator;
offset -= Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar);
EXPECT_EQ(iterator.current_index(), 9);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_16.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(0), 1);
ASSERT_TRUE(iterator.IsValid());
--iterator;
offset -= Bytecodes::Size(Bytecode::kLdaSmi, OperandScale::kQuadruple) +
kPrefixByteSize;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaSmi);
EXPECT_EQ(iterator.current_index(), 8);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kQuadruple);
EXPECT_EQ(Smi::FromInt(iterator.GetImmediateOperand(0)), smi_1);
ASSERT_TRUE(iterator.IsValid());
--iterator;
offset -= Bytecodes::Size(Bytecode::kStar0, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar0);
EXPECT_EQ(iterator.current_index(), 7);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
--iterator;
offset -= Bytecodes::Size(Bytecode::kLdaSmi, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaSmi);
EXPECT_EQ(iterator.current_index(), 6);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(Smi::FromInt(iterator.GetImmediateOperand(0)), smi_0);
ASSERT_TRUE(iterator.IsValid());
--iterator;
offset -= Bytecodes::Size(Bytecode::kStar0, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar0);
EXPECT_EQ(iterator.current_index(), 5);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
--iterator;
offset -= Bytecodes::Size(Bytecode::kLdaZero, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaZero);
EXPECT_EQ(iterator.current_index(), 4);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
--iterator;
offset -= Bytecodes::Size(Bytecode::kStar0, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar0);
EXPECT_EQ(iterator.current_index(), 3);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
--iterator;
offset -= Bytecodes::Size(Bytecode::kLdaConstant, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaConstant);
EXPECT_EQ(iterator.current_index(), 2);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(
Object::NumberValue(*iterator.GetConstantForIndexOperand(0, isolate())),
heap_num_1);
ASSERT_TRUE(iterator.IsValid());
--iterator;
offset -= Bytecodes::Size(Bytecode::kStar0, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar0);
EXPECT_EQ(iterator.current_index(), 1);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
--iterator;
offset -= Bytecodes::Size(Bytecode::kLdaConstant, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaConstant);
EXPECT_EQ(iterator.current_index(), 0);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(
Object::NumberValue(*iterator.GetConstantForIndexOperand(0, isolate())),
heap_num_0);
ASSERT_TRUE(iterator.IsValid());
--iterator;
ASSERT_FALSE(iterator.IsValid());
}
} // namespace interpreter
} // namespace internal
} // namespace v8

View File

@ -0,0 +1,379 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/init/v8.h"
#include "src/api/api.h"
#include "src/codegen/source-position-table.h"
#include "src/execution/isolate.h"
#include "src/heap/factory.h"
#include "src/interpreter/bytecode-array-writer.h"
#include "src/interpreter/bytecode-label.h"
#include "src/interpreter/bytecode-node.h"
#include "src/interpreter/bytecode-register.h"
#include "src/interpreter/bytecode-source-info.h"
#include "src/interpreter/constant-array-builder.h"
#include "src/utils/utils.h"
#include "src/objects/objects-inl.h"
#include "test/unittests/interpreter/bytecode-utils.h"
#include "test/unittests/test-utils.h"
namespace v8 {
namespace internal {
namespace interpreter {
namespace bytecode_array_writer_unittest {
#define B(Name) static_cast<uint8_t>(Bytecode::k##Name)
#define R(i) static_cast<uint32_t>(Register(i).ToOperand())
class BytecodeArrayWriterUnittest : public TestWithIsolateAndZone {
public:
BytecodeArrayWriterUnittest()
: constant_array_builder_(zone()),
bytecode_array_writer_(
zone(), &constant_array_builder_,
SourcePositionTableBuilder::RECORD_SOURCE_POSITIONS) {}
~BytecodeArrayWriterUnittest() override = default;
void Write(Bytecode bytecode, BytecodeSourceInfo info = BytecodeSourceInfo());
void Write(Bytecode bytecode, uint32_t operand0,
BytecodeSourceInfo info = BytecodeSourceInfo());
void Write(Bytecode bytecode, uint32_t operand0, uint32_t operand1,
BytecodeSourceInfo info = BytecodeSourceInfo());
void Write(Bytecode bytecode, uint32_t operand0, uint32_t operand1,
uint32_t operand2, BytecodeSourceInfo info = BytecodeSourceInfo());
void Write(Bytecode bytecode, uint32_t operand0, uint32_t operand1,
uint32_t operand2, uint32_t operand3,
BytecodeSourceInfo info = BytecodeSourceInfo());
void WriteJump(Bytecode bytecode, BytecodeLabel* label,
BytecodeSourceInfo info = BytecodeSourceInfo());
void WriteJump(Bytecode bytecode, BytecodeLabel* label, uint32_t operand1,
uint32_t operand2,
BytecodeSourceInfo info = BytecodeSourceInfo());
void WriteJumpLoop(Bytecode bytecode, BytecodeLoopHeader* loop_header,
int depth, int feedback_index,
BytecodeSourceInfo info = BytecodeSourceInfo());
BytecodeArrayWriter* writer() { return &bytecode_array_writer_; }
ZoneVector<unsigned char>* bytecodes() { return writer()->bytecodes(); }
SourcePositionTableBuilder* source_position_table_builder() {
return writer()->source_position_table_builder();
}
private:
ConstantArrayBuilder constant_array_builder_;
BytecodeArrayWriter bytecode_array_writer_;
};
void BytecodeArrayWriterUnittest::Write(Bytecode bytecode,
BytecodeSourceInfo info) {
BytecodeNode node(bytecode, info);
writer()->Write(&node);
}
void BytecodeArrayWriterUnittest::Write(Bytecode bytecode, uint32_t operand0,
BytecodeSourceInfo info) {
BytecodeNode node(bytecode, operand0, info);
writer()->Write(&node);
}
void BytecodeArrayWriterUnittest::Write(Bytecode bytecode, uint32_t operand0,
uint32_t operand1,
BytecodeSourceInfo info) {
BytecodeNode node(bytecode, operand0, operand1, info);
writer()->Write(&node);
}
void BytecodeArrayWriterUnittest::Write(Bytecode bytecode, uint32_t operand0,
uint32_t operand1, uint32_t operand2,
BytecodeSourceInfo info) {
BytecodeNode node(bytecode, operand0, operand1, operand2, info);
writer()->Write(&node);
}
void BytecodeArrayWriterUnittest::Write(Bytecode bytecode, uint32_t operand0,
uint32_t operand1, uint32_t operand2,
uint32_t operand3,
BytecodeSourceInfo info) {
BytecodeNode node(bytecode, operand0, operand1, operand2, operand3, info);
writer()->Write(&node);
}
void BytecodeArrayWriterUnittest::WriteJump(Bytecode bytecode,
BytecodeLabel* label,
BytecodeSourceInfo info) {
BytecodeNode node(bytecode, 0, info);
writer()->WriteJump(&node, label);
}
void BytecodeArrayWriterUnittest::WriteJump(Bytecode bytecode,
BytecodeLabel* label,
uint32_t operand1,
uint32_t operand2,
BytecodeSourceInfo info) {
BytecodeNode node(bytecode, 0, operand1, operand2, info);
writer()->WriteJump(&node, label);
}
void BytecodeArrayWriterUnittest::WriteJumpLoop(Bytecode bytecode,
BytecodeLoopHeader* loop_header,
int depth, int feedback_index,
BytecodeSourceInfo info) {
BytecodeNode node(bytecode, 0, depth, feedback_index, info);
writer()->WriteJumpLoop(&node, loop_header);
}
TEST_F(BytecodeArrayWriterUnittest, SimpleExample) {
CHECK_EQ(bytecodes()->size(), 0u);
Write(Bytecode::kLdaSmi, 127, {55, true});
CHECK_EQ(bytecodes()->size(), 2u);
Write(Bytecode::kStar, Register(20).ToOperand());
CHECK_EQ(bytecodes()->size(), 4u);
Write(Bytecode::kLdar, Register(200).ToOperand());
CHECK_EQ(bytecodes()->size(), 8u);
Write(Bytecode::kReturn, {70, true});
CHECK_EQ(bytecodes()->size(), 9u);
static const uint8_t expected_bytes[] = {
// clang-format off
/* 0 55 S> */ B(LdaSmi), U8(127),
/* 2 */ B(Star), R8(20),
/* 4 */ B(Wide), B(Ldar), R16(200),
/* 8 70 S> */ B(Return),
// clang-format on
};
CHECK_EQ(bytecodes()->size(), arraysize(expected_bytes));
for (size_t i = 0; i < arraysize(expected_bytes); ++i) {
CHECK_EQ(bytecodes()->at(i), expected_bytes[i]);
}
DirectHandle<BytecodeArray> bytecode_array = writer()->ToBytecodeArray(
isolate(), 0, 0, 0, factory()->empty_trusted_byte_array());
bytecode_array->set_source_position_table(
*writer()->ToSourcePositionTable(isolate()), kReleaseStore);
CHECK_EQ(bytecodes()->size(), arraysize(expected_bytes));
PositionTableEntry expected_positions[] = {{0, 55, true}, {8, 70, true}};
SourcePositionTableIterator source_iterator(
bytecode_array->SourcePositionTable());
for (size_t i = 0; i < arraysize(expected_positions); ++i) {
const PositionTableEntry& expected = expected_positions[i];
CHECK_EQ(source_iterator.code_offset(), expected.code_offset);
CHECK_EQ(source_iterator.source_position().ScriptOffset(),
expected.source_position);
CHECK_EQ(source_iterator.is_statement(), expected.is_statement);
source_iterator.Advance();
}
CHECK(source_iterator.done());
}
TEST_F(BytecodeArrayWriterUnittest, ComplexExample) {
static const uint8_t expected_bytes[] = {
// clang-format off
/* 0 42 S> */ B(LdaConstant), U8(0),
/* 2 42 E> */ B(Add), R8(1), U8(1),
/* 4 68 S> */ B(JumpIfUndefined), U8(36),
/* 6 */ B(JumpIfNull), U8(34),
/* 8 */ B(ToObject), R8(3),
/* 10 */ B(ForInPrepare), R8(3), U8(4),
/* 13 */ B(LdaZero),
/* 14 */ B(Star), R8(7),
/* 16 63 S> */ B(JumpIfForInDone), U8(24), R8(7), R8(6),
/* 21 */ B(ForInNext), R8(3), R8(7), R8(4), U8(1),
/* 26 */ B(JumpIfUndefined), U8(9),
/* 28 */ B(Star), R8(0),
/* 30 */ B(Ldar), R8(0),
/* 32 */ B(Star), R8(2),
/* 34 85 S> */ B(Return),
/* 35 */ B(ForInStep), R8(7),
/* 39 */ B(JumpLoop), U8(20), U8(0), U8(0),
/* 43 */ B(LdaUndefined),
/* 44 85 S> */ B(Return),
// clang-format on
};
static const PositionTableEntry expected_positions[] = {
{0, 42, true}, {2, 42, false}, {5, 68, true},
{17, 63, true}, {34, 85, true}, {42, 85, true}};
BytecodeLoopHeader loop_header;
BytecodeLabel jump_for_in, jump_end_1, jump_end_2, jump_end_3;
Write(Bytecode::kLdaConstant, U8(0), {42, true});
Write(Bytecode::kAdd, R(1), U8(1), {42, false});
WriteJump(Bytecode::kJumpIfUndefined, &jump_end_1, {68, true});
WriteJump(Bytecode::kJumpIfNull, &jump_end_2);
Write(Bytecode::kToObject, R(3));
Write(Bytecode::kForInPrepare, R(3), U8(4));
Write(Bytecode::kLdaZero);
Write(Bytecode::kStar, R(7));
writer()->BindLoopHeader(&loop_header);
WriteJump(Bytecode::kJumpIfForInDone, &jump_end_3, R(7), R(6), {63, true});
Write(Bytecode::kForInNext, R(3), R(7), R(4), U8(1));
WriteJump(Bytecode::kJumpIfUndefined, &jump_for_in);
Write(Bytecode::kStar, R(0));
Write(Bytecode::kLdar, R(0));
Write(Bytecode::kStar, R(2));
Write(Bytecode::kReturn, {85, true});
writer()->BindLabel(&jump_for_in);
Write(Bytecode::kForInStep, R(7));
WriteJumpLoop(Bytecode::kJumpLoop, &loop_header, 0, 0);
writer()->BindLabel(&jump_end_1);
writer()->BindLabel(&jump_end_2);
writer()->BindLabel(&jump_end_3);
Write(Bytecode::kLdaUndefined);
Write(Bytecode::kReturn, {85, true});
CHECK_EQ(bytecodes()->size(), arraysize(expected_bytes));
for (size_t i = 0; i < arraysize(expected_bytes); ++i) {
CHECK_EQ(static_cast<int>(bytecodes()->at(i)),
static_cast<int>(expected_bytes[i]));
}
DirectHandle<BytecodeArray> bytecode_array = writer()->ToBytecodeArray(
isolate(), 0, 0, 0, factory()->empty_trusted_byte_array());
bytecode_array->set_source_position_table(
*writer()->ToSourcePositionTable(isolate()), kReleaseStore);
SourcePositionTableIterator source_iterator(
bytecode_array->SourcePositionTable());
for (size_t i = 0; i < arraysize(expected_positions); ++i) {
const PositionTableEntry& expected = expected_positions[i];
CHECK_EQ(source_iterator.code_offset(), expected.code_offset);
CHECK_EQ(source_iterator.source_position().ScriptOffset(),
expected.source_position);
CHECK_EQ(source_iterator.is_statement(), expected.is_statement);
source_iterator.Advance();
}
CHECK(source_iterator.done());
}
TEST_F(BytecodeArrayWriterUnittest, ElideNoneffectfulBytecodes) {
if (!i::v8_flags.ignition_elide_noneffectful_bytecodes) return;
static const uint8_t expected_bytes[] = {
// clang-format off
/* 0 55 S> */ B(Ldar), R8(20),
/* 2 */ B(Star), R8(20),
/* 4 */ B(CreateMappedArguments),
/* 5 60 S> */ B(LdaSmi), U8(127),
/* 7 70 S> */ B(Ldar), R8(20),
/* 9 75 S> */ B(Return),
// clang-format on
};
static const PositionTableEntry expected_positions[] = {
{0, 55, true}, {5, 60, false}, {7, 70, true}, {9, 75, true}};
Write(Bytecode::kLdaSmi, 127, {55, true}); // Should be elided.
Write(Bytecode::kLdar, Register(20).ToOperand());
Write(Bytecode::kStar, Register(20).ToOperand());
Write(Bytecode::kLdar, Register(20).ToOperand()); // Should be elided.
Write(Bytecode::kCreateMappedArguments);
Write(Bytecode::kLdaSmi, 127, {60, false}); // Not elided due to source info.
Write(Bytecode::kLdar, Register(20).ToOperand(), {70, true});
Write(Bytecode::kReturn, {75, true});
CHECK_EQ(bytecodes()->size(), arraysize(expected_bytes));
for (size_t i = 0; i < arraysize(expected_bytes); ++i) {
CHECK_EQ(static_cast<int>(bytecodes()->at(i)),
static_cast<int>(expected_bytes[i]));
}
DirectHandle<BytecodeArray> bytecode_array = writer()->ToBytecodeArray(
isolate(), 0, 0, 0, factory()->empty_trusted_byte_array());
bytecode_array->set_source_position_table(
*writer()->ToSourcePositionTable(isolate()), kReleaseStore);
SourcePositionTableIterator source_iterator(
bytecode_array->SourcePositionTable());
for (size_t i = 0; i < arraysize(expected_positions); ++i) {
const PositionTableEntry& expected = expected_positions[i];
CHECK_EQ(source_iterator.code_offset(), expected.code_offset);
CHECK_EQ(source_iterator.source_position().ScriptOffset(),
expected.source_position);
CHECK_EQ(source_iterator.is_statement(), expected.is_statement);
source_iterator.Advance();
}
CHECK(source_iterator.done());
}
TEST_F(BytecodeArrayWriterUnittest, DeadcodeElimination) {
static const uint8_t expected_bytes[] = {
// clang-format off
/* 0 55 S> */ B(LdaSmi), U8(127),
/* 2 */ B(Jump), U8(2),
/* 4 65 S> */ B(LdaSmi), U8(127),
/* 6 */ B(JumpIfFalse), U8(3),
/* 8 75 S> */ B(Return),
/* 9 */ B(JumpIfFalse), U8(3),
/* 11 */ B(Throw),
/* 12 */ B(JumpIfFalse), U8(3),
/* 14 */ B(ReThrow),
/* 15 */ B(Return),
// clang-format on
};
static const PositionTableEntry expected_positions[] = {
{0, 55, true}, {4, 65, true}, {8, 75, true}};
BytecodeLabel after_jump, after_conditional_jump, after_return, after_throw,
after_rethrow;
Write(Bytecode::kLdaSmi, 127, {55, true});
WriteJump(Bytecode::kJump, &after_jump);
Write(Bytecode::kLdaSmi, 127); // Dead code.
WriteJump(Bytecode::kJumpIfFalse, &after_conditional_jump); // Dead code.
writer()->BindLabel(&after_jump);
// We would bind the after_conditional_jump label here, but the jump to it is
// dead.
CHECK(!after_conditional_jump.has_referrer_jump());
Write(Bytecode::kLdaSmi, 127, {65, true});
WriteJump(Bytecode::kJumpIfFalse, &after_return);
Write(Bytecode::kReturn, {75, true});
Write(Bytecode::kLdaSmi, 127, {100, true}); // Dead code.
writer()->BindLabel(&after_return);
WriteJump(Bytecode::kJumpIfFalse, &after_throw);
Write(Bytecode::kThrow);
Write(Bytecode::kLdaSmi, 127); // Dead code.
writer()->BindLabel(&after_throw);
WriteJump(Bytecode::kJumpIfFalse, &after_rethrow);
Write(Bytecode::kReThrow);
Write(Bytecode::kLdaSmi, 127); // Dead code.
writer()->BindLabel(&after_rethrow);
Write(Bytecode::kReturn);
CHECK_EQ(bytecodes()->size(), arraysize(expected_bytes));
for (size_t i = 0; i < arraysize(expected_bytes); ++i) {
CHECK_EQ(static_cast<int>(bytecodes()->at(i)),
static_cast<int>(expected_bytes[i]));
}
DirectHandle<BytecodeArray> bytecode_array = writer()->ToBytecodeArray(
isolate(), 0, 0, 0, factory()->empty_trusted_byte_array());
bytecode_array->set_source_position_table(
*writer()->ToSourcePositionTable(isolate()), kReleaseStore);
SourcePositionTableIterator source_iterator(
bytecode_array->SourcePositionTable());
for (size_t i = 0; i < arraysize(expected_positions); ++i) {
const PositionTableEntry& expected = expected_positions[i];
CHECK_EQ(source_iterator.code_offset(), expected.code_offset);
CHECK_EQ(source_iterator.source_position().ScriptOffset(),
expected.source_position);
CHECK_EQ(source_iterator.is_statement(), expected.is_statement);
source_iterator.Advance();
}
CHECK(source_iterator.done());
}
#undef B
#undef R
} // namespace bytecode_array_writer_unittest
} // namespace interpreter
} // namespace internal
} // namespace v8

View File

@ -0,0 +1,91 @@
// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/interpreter/bytecode-decoder.h"
#include <iomanip>
#include <vector>
#include "src/init/v8.h"
#include "src/objects/contexts.h"
#include "src/runtime/runtime.h"
#include "test/unittests/interpreter/bytecode-utils.h"
#include "test/unittests/test-utils.h"
namespace v8 {
namespace internal {
namespace interpreter {
#define B(Name) static_cast<uint8_t>(Bytecode::k##Name)
TEST(BytecodeDecoder, DecodeBytecodeAndOperands) {
struct BytecodesAndResult {
const uint8_t bytecode[32];
const size_t length;
const char* output;
};
const BytecodesAndResult cases[] = {
{{B(LdaSmi), U8(1)}, 2, " LdaSmi [1]"},
{{B(Wide), B(LdaSmi), U16(1000)}, 4, " LdaSmi.Wide [1000]"},
{{B(ExtraWide), B(LdaSmi), U32(100000)}, 6, "LdaSmi.ExtraWide [100000]"},
{{B(LdaSmi), U8(-1)}, 2, " LdaSmi [-1]"},
{{B(Wide), B(LdaSmi), U16(-1000)}, 4, " LdaSmi.Wide [-1000]"},
{{B(ExtraWide), B(LdaSmi), U32(-100000)},
6,
"LdaSmi.ExtraWide [-100000]"},
{{B(Star), R8(5)}, 2, " Star r5"},
{{B(Wide), B(Star), R16(136)}, 4, " Star.Wide r136"},
{{B(Wide), B(CallAnyReceiver), R16(134), R16(135), U16(10), U16(177)},
10,
"CallAnyReceiver.Wide r134, r135-r144, [177]"},
{{B(ForInPrepare), R8(10), U8(11)},
3,
" ForInPrepare r10-r12, [11]"},
{{B(CallRuntime), U16(Runtime::FunctionId::kIsSmi), R8(0), U8(0)},
5,
" CallRuntime [IsSmi], r0-r0"},
{{B(Ldar),
static_cast<uint8_t>(Register::FromParameterIndex(2).ToOperand())},
2,
" Ldar a1"},
{{B(Wide), B(CreateObjectLiteral), U16(513), U16(1027), U8(165)},
7,
"CreateObjectLiteral.Wide [513], [1027], #165"},
{{B(ExtraWide), B(JumpIfNull), U32(123456789)},
6,
"JumpIfNull.ExtraWide [123456789]"},
{{B(CallJSRuntime), U8(Context::BOOLEAN_FUNCTION_INDEX), R8(0), U8(0)},
4,
" CallJSRuntime [boolean_function], r0-r0"}};
for (size_t i = 0; i < arraysize(cases); ++i) {
// Generate reference string by prepending formatted bytes.
std::stringstream expected_ss;
std::ios default_format(nullptr);
default_format.copyfmt(expected_ss);
// Match format of BytecodeDecoder::Decode() for byte representations.
expected_ss.fill('0');
expected_ss.flags(std::ios::right | std::ios::hex);
for (size_t b = 0; b < cases[i].length; b++) {
expected_ss << std::setw(2) << static_cast<uint32_t>(cases[i].bytecode[b])
<< ' ';
}
expected_ss.copyfmt(default_format);
expected_ss << cases[i].output;
// Generate decoded byte output.
std::stringstream actual_ss;
BytecodeDecoder::Decode(actual_ss, cases[i].bytecode);
// Compare.
CHECK_EQ(actual_ss.str(), expected_ss.str());
}
}
#undef B
} // namespace interpreter
} // namespace internal
} // namespace v8

View File

@ -0,0 +1,420 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "test/unittests/interpreter/bytecode-expectations-printer.h"
#include <iomanip>
#include <iostream>
#include <vector>
#include "include/libplatform/libplatform.h"
#include "include/v8-function.h"
#include "src/api/api-inl.h"
#include "src/base/logging.h"
#include "src/codegen/source-position-table.h"
#include "src/interpreter/bytecode-array-iterator.h"
#include "src/interpreter/bytecode-generator.h"
#include "src/interpreter/bytecodes.h"
#include "src/interpreter/interpreter-intrinsics.h"
#include "src/interpreter/interpreter.h"
#include "src/objects/heap-number-inl.h"
#include "src/objects/module-inl.h"
#include "src/objects/objects-inl.h"
#include "src/runtime/runtime.h"
#include "src/utils/ostreams.h"
namespace v8 {
namespace internal {
namespace interpreter {
static const char* NameForNativeContextIntrinsicIndex(uint32_t idx) {
switch (idx) {
case Context::REFLECT_APPLY_INDEX:
return "reflect_apply";
case Context::REFLECT_CONSTRUCT_INDEX:
return "reflect_construct";
default:
return "UnknownIntrinsicIndex";
}
}
// static
const char* const BytecodeExpectationsPrinter::kDefaultTopFunctionName =
"__genbckexp_wrapper__";
const char* const BytecodeExpectationsPrinter::kIndent = " ";
v8::Local<v8::String> BytecodeExpectationsPrinter::V8StringFromUTF8(
const char* data) const {
return v8::String::NewFromUtf8(isolate_, data).ToLocalChecked();
}
std::string BytecodeExpectationsPrinter::WrapCodeInFunction(
const char* function_name, const std::string& function_body) const {
std::ostringstream program_stream;
program_stream << "function " << function_name << "() {" << function_body
<< "}\n"
<< function_name << "();";
return program_stream.str();
}
v8::Local<v8::Script> BytecodeExpectationsPrinter::CompileScript(
const char* program) const {
v8::Local<v8::String> source = V8StringFromUTF8(program);
return v8::Script::Compile(isolate_->GetCurrentContext(), source)
.ToLocalChecked();
}
v8::Local<v8::Module> BytecodeExpectationsPrinter::CompileModule(
const char* program) const {
ScriptOrigin origin(Local<v8::Value>(), 0, 0, false, -1, Local<v8::Value>(),
false, false, true);
v8::ScriptCompiler::Source source(V8StringFromUTF8(program), origin);
return v8::ScriptCompiler::CompileModule(isolate_, &source).ToLocalChecked();
}
void BytecodeExpectationsPrinter::Run(v8::Local<v8::Script> script) const {
MaybeLocal<Value> result = script->Run(isolate_->GetCurrentContext());
USE(result);
}
i::Handle<v8::internal::BytecodeArray>
BytecodeExpectationsPrinter::GetBytecodeArrayForGlobal(
const char* global_name) const {
const v8::Local<v8::Context>& context = isolate_->GetCurrentContext();
v8::Local<v8::String> v8_global_name = V8StringFromUTF8(global_name);
v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast(
context->Global()->Get(context, v8_global_name).ToLocalChecked());
i::DirectHandle<i::JSFunction> js_function =
i::Cast<i::JSFunction>(v8::Utils::OpenDirectHandle(*function));
i::Handle<i::BytecodeArray> bytecodes = i::handle(
js_function->shared()->GetBytecodeArray(i_isolate()), i_isolate());
return bytecodes;
}
i::Handle<i::BytecodeArray>
BytecodeExpectationsPrinter::GetBytecodeArrayForModule(
v8::Local<v8::Module> module) const {
i::DirectHandle<i::Module> i_module = v8::Utils::OpenDirectHandle(*module);
return i::handle(
Cast<SharedFunctionInfo>(Cast<i::SourceTextModule>(i_module)->code())
->GetBytecodeArray(i_isolate()),
i_isolate());
}
i::Handle<i::BytecodeArray>
BytecodeExpectationsPrinter::GetBytecodeArrayForScript(
v8::Local<v8::Script> script) const {
i::DirectHandle<i::JSFunction> js_function =
v8::Utils::OpenDirectHandle(*script);
return i::handle(js_function->shared()->GetBytecodeArray(i_isolate()),
i_isolate());
}
i::Handle<i::BytecodeArray>
BytecodeExpectationsPrinter::GetBytecodeArrayOfCallee(
const char* source_code) const {
Local<v8::Context> context = isolate_->GetCurrentContext();
Local<v8::Script> script =
v8::Script::Compile(
context,
v8::String::NewFromUtf8(isolate_, source_code).ToLocalChecked())
.ToLocalChecked();
i::DirectHandle<i::Object> i_object =
v8::Utils::OpenDirectHandle(*script->Run(context).ToLocalChecked());
i::DirectHandle<i::JSFunction> js_function = i::Cast<i::JSFunction>(i_object);
CHECK(js_function->shared()->HasBytecodeArray());
return i::handle(js_function->shared()->GetBytecodeArray(i_isolate()),
i_isolate());
}
void BytecodeExpectationsPrinter::PrintEscapedString(
std::ostream* stream, const std::string& string) const {
for (char c : string) {
switch (c) {
case '"':
*stream << "\\\"";
break;
case '\\':
*stream << "\\\\";
break;
default:
*stream << c;
break;
}
}
}
void BytecodeExpectationsPrinter::PrintBytecodeOperand(
std::ostream* stream, const BytecodeArrayIterator& bytecode_iterator,
const Bytecode& bytecode, int op_index, int parameter_count) const {
OperandType op_type = Bytecodes::GetOperandType(bytecode, op_index);
OperandSize op_size = Bytecodes::GetOperandSize(
bytecode, op_index, bytecode_iterator.current_operand_scale());
const char* size_tag;
switch (op_size) {
case OperandSize::kByte:
size_tag = "8";
break;
case OperandSize::kShort:
size_tag = "16";
break;
case OperandSize::kQuad:
size_tag = "32";
break;
default:
UNREACHABLE();
}
if (Bytecodes::IsRegisterOperandType(op_type)) {
Register register_value = bytecode_iterator.GetRegisterOperand(op_index);
*stream << 'R';
if (op_size != OperandSize::kByte) *stream << size_tag;
if (register_value.is_current_context()) {
*stream << "(context)";
} else if (register_value.is_function_closure()) {
*stream << "(closure)";
} else if (register_value.is_parameter()) {
int parameter_index = register_value.ToParameterIndex();
if (parameter_index == 0) {
*stream << "(this)";
} else {
*stream << "(arg" << (parameter_index - 1) << ')';
}
} else {
*stream << '(' << register_value.index() << ')';
}
} else {
switch (op_type) {
case OperandType::kFlag8:
*stream << 'U' << size_tag << '(';
*stream << bytecode_iterator.GetFlag8Operand(op_index);
break;
case OperandType::kFlag16:
*stream << 'U' << size_tag << '(';
*stream << bytecode_iterator.GetFlag16Operand(op_index);
break;
case OperandType::kIdx: {
*stream << 'U' << size_tag << '(';
*stream << bytecode_iterator.GetIndexOperand(op_index);
break;
}
case OperandType::kUImm:
*stream << 'U' << size_tag << '(';
*stream << bytecode_iterator.GetUnsignedImmediateOperand(op_index);
break;
case OperandType::kImm:
*stream << 'I' << size_tag << '(';
*stream << bytecode_iterator.GetImmediateOperand(op_index);
break;
case OperandType::kRegCount:
*stream << 'U' << size_tag << '(';
*stream << bytecode_iterator.GetRegisterCountOperand(op_index);
break;
case OperandType::kRuntimeId: {
*stream << 'U' << size_tag << '(';
Runtime::FunctionId id =
bytecode_iterator.GetRuntimeIdOperand(op_index);
*stream << "Runtime::k" << i::Runtime::FunctionForId(id)->name;
break;
}
case OperandType::kIntrinsicId: {
*stream << 'U' << size_tag << '(';
Runtime::FunctionId id =
bytecode_iterator.GetIntrinsicIdOperand(op_index);
*stream << "Runtime::k" << i::Runtime::FunctionForId(id)->name;
break;
}
case OperandType::kNativeContextIndex: {
*stream << 'U' << size_tag << '(';
uint32_t idx = bytecode_iterator.GetNativeContextIndexOperand(op_index);
*stream << "%" << NameForNativeContextIntrinsicIndex(idx);
break;
}
default:
UNREACHABLE();
}
*stream << ')';
}
}
void BytecodeExpectationsPrinter::PrintBytecode(
std::ostream* stream, const BytecodeArrayIterator& bytecode_iterator,
int parameter_count) const {
Bytecode bytecode = bytecode_iterator.current_bytecode();
OperandScale operand_scale = bytecode_iterator.current_operand_scale();
if (Bytecodes::OperandScaleRequiresPrefixBytecode(operand_scale)) {
Bytecode prefix = Bytecodes::OperandScaleToPrefixBytecode(operand_scale);
*stream << "B(" << Bytecodes::ToString(prefix) << "), ";
}
*stream << "B(" << Bytecodes::ToString(bytecode) << ')';
int operands_count = Bytecodes::NumberOfOperands(bytecode);
for (int op_index = 0; op_index < operands_count; ++op_index) {
*stream << ", ";
PrintBytecodeOperand(stream, bytecode_iterator, bytecode, op_index,
parameter_count);
}
}
void BytecodeExpectationsPrinter::PrintSourcePosition(
std::ostream* stream, SourcePositionTableIterator* source_iterator,
int bytecode_offset) const {
static const size_t kPositionWidth = 4;
if (!source_iterator->done() &&
source_iterator->code_offset() == bytecode_offset) {
*stream << "/* " << std::setw(kPositionWidth)
<< source_iterator->source_position().ScriptOffset();
if (source_iterator->is_statement()) {
*stream << " S> */ ";
} else {
*stream << " E> */ ";
}
source_iterator->Advance();
} else {
*stream << " " << std::setw(kPositionWidth) << ' ' << " ";
}
}
void BytecodeExpectationsPrinter::PrintV8String(
std::ostream* stream, i::Tagged<i::String> string) const {
*stream << '"';
for (int i = 0, length = string->length(); i < length; ++i) {
*stream << i::AsEscapedUC16ForJSON(string->Get(i));
}
*stream << '"';
}
void BytecodeExpectationsPrinter::PrintConstant(
std::ostream* stream, i::DirectHandle<i::Object> constant) const {
if (IsSmi(*constant)) {
*stream << "Smi [";
i::Smi::SmiPrint(i::Cast<i::Smi>(*constant), *stream);
*stream << "]";
} else {
*stream << i::Cast<i::HeapObject>(*constant)->map()->instance_type();
if (IsHeapNumber(*constant)) {
*stream << " [";
i::Cast<i::HeapNumber>(*constant)->HeapNumberShortPrint(*stream);
*stream << "]";
} else if (IsString(*constant)) {
*stream << " [";
PrintV8String(stream, i::Cast<i::String>(*constant));
*stream << "]";
}
}
}
void BytecodeExpectationsPrinter::PrintFrameSize(
std::ostream* stream,
i::DirectHandle<i::BytecodeArray> bytecode_array) const {
int32_t frame_size = bytecode_array->frame_size();
DCHECK(IsAligned(frame_size, kSystemPointerSize));
*stream << "frame size: " << frame_size / kSystemPointerSize
<< "\nparameter count: " << bytecode_array->parameter_count() << '\n';
}
void BytecodeExpectationsPrinter::PrintBytecodeSequence(
std::ostream* stream, i::Handle<i::BytecodeArray> bytecode_array) const {
*stream << "bytecode array length: " << bytecode_array->length()
<< "\nbytecodes: [\n";
SourcePositionTableIterator source_iterator(
bytecode_array->SourcePositionTable());
BytecodeArrayIterator bytecode_iterator(bytecode_array);
for (; !bytecode_iterator.done(); bytecode_iterator.Advance()) {
*stream << kIndent;
PrintSourcePosition(stream, &source_iterator,
bytecode_iterator.current_offset());
PrintBytecode(stream, bytecode_iterator, bytecode_array->parameter_count());
*stream << ",\n";
}
*stream << "]\n";
}
void BytecodeExpectationsPrinter::PrintConstantPool(
std::ostream* stream, i::Tagged<i::TrustedFixedArray> constant_pool) const {
*stream << "constant pool: [\n";
int num_constants = constant_pool->length();
if (num_constants > 0) {
for (int i = 0; i < num_constants; ++i) {
*stream << kIndent;
PrintConstant(stream, direct_handle(constant_pool->get(i), i_isolate()));
*stream << ",\n";
}
}
*stream << "]\n";
}
void BytecodeExpectationsPrinter::PrintCodeSnippet(
std::ostream* stream, const std::string& body) const {
*stream << "snippet: \"\n";
std::stringstream body_stream(body);
std::string body_line;
while (std::getline(body_stream, body_line)) {
*stream << kIndent;
PrintEscapedString(stream, body_line);
*stream << '\n';
}
*stream << "\"\n";
}
void BytecodeExpectationsPrinter::PrintHandlers(
std::ostream* stream,
i::DirectHandle<i::BytecodeArray> bytecode_array) const {
*stream << "handlers: [\n";
HandlerTable table(*bytecode_array);
for (int i = 0, num_entries = table.NumberOfRangeEntries(); i < num_entries;
++i) {
*stream << " [" << table.GetRangeStart(i) << ", " << table.GetRangeEnd(i)
<< ", " << table.GetRangeHandler(i) << "],\n";
}
*stream << "]\n";
}
void BytecodeExpectationsPrinter::PrintBytecodeArray(
std::ostream* stream, i::Handle<i::BytecodeArray> bytecode_array) const {
PrintFrameSize(stream, bytecode_array);
PrintBytecodeSequence(stream, bytecode_array);
PrintConstantPool(stream, bytecode_array->constant_pool());
PrintHandlers(stream, bytecode_array);
}
void BytecodeExpectationsPrinter::PrintExpectation(
std::ostream* stream, const std::string& snippet) const {
std::string source_code =
wrap_ ? WrapCodeInFunction(test_function_name_.c_str(), snippet)
: snippet;
i::v8_flags.compilation_cache = false;
i::Handle<i::BytecodeArray> bytecode_array;
if (module_) {
CHECK(top_level_ && !wrap_);
v8::Local<v8::Module> module = CompileModule(source_code.c_str());
bytecode_array = GetBytecodeArrayForModule(module);
} else if (print_callee_) {
bytecode_array = GetBytecodeArrayOfCallee(source_code.c_str());
} else {
v8::Local<v8::Script> script = CompileScript(source_code.c_str());
if (top_level_) {
bytecode_array = GetBytecodeArrayForScript(script);
} else {
Run(script);
bytecode_array = GetBytecodeArrayForGlobal(test_function_name_.c_str());
}
}
*stream << "---\n";
PrintCodeSnippet(stream, snippet);
PrintBytecodeArray(stream, bytecode_array);
*stream << '\n';
}
} // namespace interpreter
} // namespace internal
} // namespace v8

View File

@ -0,0 +1,123 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef TEST_UNITTESTS_INTERPRETER_BYTECODE_EXPECTATIONS_PRINTER_H_
#define TEST_UNITTESTS_INTERPRETER_BYTECODE_EXPECTATIONS_PRINTER_H_
#include <iostream>
#include <string>
#include <vector>
#include "include/v8-local-handle.h"
#include "src/interpreter/bytecodes.h"
#include "src/objects/objects.h"
namespace v8 {
class Isolate;
class Script;
class Module;
namespace internal {
class BytecodeArray;
class SourcePositionTableIterator;
namespace interpreter {
class BytecodeArrayIterator;
class BytecodeExpectationsPrinter final {
public:
explicit BytecodeExpectationsPrinter(v8::Isolate* i)
: isolate_(i),
module_(false),
wrap_(true),
top_level_(false),
print_callee_(false),
test_function_name_(kDefaultTopFunctionName) {}
void PrintExpectation(std::ostream* stream, const std::string& snippet) const;
void set_module(bool module) { module_ = module; }
bool module() const { return module_; }
void set_wrap(bool wrap) { wrap_ = wrap; }
bool wrap() const { return wrap_; }
void set_top_level(bool top_level) { top_level_ = top_level; }
bool top_level() const { return top_level_; }
void set_print_callee(bool print_callee) { print_callee_ = print_callee; }
bool print_callee() { return print_callee_; }
void set_test_function_name(const std::string& test_function_name) {
test_function_name_ = test_function_name;
}
std::string test_function_name() const { return test_function_name_; }
private:
void PrintEscapedString(std::ostream* stream,
const std::string& string) const;
void PrintBytecodeOperand(std::ostream* stream,
const BytecodeArrayIterator& bytecode_iterator,
const Bytecode& bytecode, int op_index,
int parameter_count) const;
void PrintBytecode(std::ostream* stream,
const BytecodeArrayIterator& bytecode_iterator,
int parameter_count) const;
void PrintSourcePosition(std::ostream* stream,
SourcePositionTableIterator* source_iterator,
int bytecode_offset) const;
void PrintV8String(std::ostream* stream, i::Tagged<i::String> string) const;
void PrintConstant(std::ostream* stream,
i::DirectHandle<i::Object> constant) const;
void PrintFrameSize(std::ostream* stream,
i::DirectHandle<i::BytecodeArray> bytecode_array) const;
void PrintBytecodeSequence(std::ostream* stream,
i::Handle<i::BytecodeArray> bytecode_array) const;
void PrintConstantPool(std::ostream* stream,
i::Tagged<i::TrustedFixedArray> constant_pool) const;
void PrintCodeSnippet(std::ostream* stream, const std::string& body) const;
void PrintBytecodeArray(std::ostream* stream,
i::Handle<i::BytecodeArray> bytecode_array) const;
void PrintHandlers(std::ostream* stream,
i::DirectHandle<i::BytecodeArray> bytecode_array) const;
v8::Local<v8::String> V8StringFromUTF8(const char* data) const;
std::string WrapCodeInFunction(const char* function_name,
const std::string& function_body) const;
v8::Local<v8::Script> CompileScript(const char* program) const;
v8::Local<v8::Module> CompileModule(const char* program) const;
void Run(v8::Local<v8::Script> script) const;
i::Handle<i::BytecodeArray> GetBytecodeArrayForGlobal(
const char* global_name) const;
i::Handle<v8::internal::BytecodeArray> GetBytecodeArrayForModule(
v8::Local<v8::Module> module) const;
i::Handle<v8::internal::BytecodeArray> GetBytecodeArrayForScript(
v8::Local<v8::Script> script) const;
i::Handle<i::BytecodeArray> GetBytecodeArrayOfCallee(
const char* source_code) const;
i::Isolate* i_isolate() const {
return reinterpret_cast<i::Isolate*>(isolate_);
}
v8::Isolate* isolate_;
bool module_;
bool wrap_;
bool top_level_;
bool print_callee_;
std::string test_function_name_;
static const char* const kDefaultTopFunctionName;
static const char* const kIndent;
};
} // namespace interpreter
} // namespace internal
} // namespace v8
#endif // TEST_UNITTESTS_INTERPRETER_BYTECODE_EXPECTATIONS_PRINTER_H_

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,101 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/init/v8.h"
#include "src/interpreter/bytecode-node.h"
#include "test/unittests/test-utils.h"
namespace v8 {
namespace internal {
namespace interpreter {
using BytecodeNodeTest = TestWithIsolateAndZone;
TEST_F(BytecodeNodeTest, Constructor1) {
BytecodeNode node(Bytecode::kLdaZero);
CHECK_EQ(node.bytecode(), Bytecode::kLdaZero);
CHECK_EQ(node.operand_count(), 0);
CHECK(!node.source_info().is_valid());
}
TEST_F(BytecodeNodeTest, Constructor2) {
uint32_t operands[] = {0x11};
BytecodeNode node(Bytecode::kJumpIfTrue, operands[0]);
CHECK_EQ(node.bytecode(), Bytecode::kJumpIfTrue);
CHECK_EQ(node.operand_count(), 1);
CHECK_EQ(node.operand(0), operands[0]);
CHECK(!node.source_info().is_valid());
}
TEST_F(BytecodeNodeTest, Constructor3) {
uint32_t operands[] = {0x11, 0x22};
BytecodeNode node(Bytecode::kLdaGlobal, operands[0], operands[1]);
CHECK_EQ(node.bytecode(), Bytecode::kLdaGlobal);
CHECK_EQ(node.operand_count(), 2);
CHECK_EQ(node.operand(0), operands[0]);
CHECK_EQ(node.operand(1), operands[1]);
CHECK(!node.source_info().is_valid());
}
TEST_F(BytecodeNodeTest, Constructor4) {
uint32_t operands[] = {0x11, 0x22, 0x33};
BytecodeNode node(Bytecode::kGetNamedProperty, operands[0], operands[1],
operands[2]);
CHECK_EQ(node.operand_count(), 3);
CHECK_EQ(node.bytecode(), Bytecode::kGetNamedProperty);
CHECK_EQ(node.operand(0), operands[0]);
CHECK_EQ(node.operand(1), operands[1]);
CHECK_EQ(node.operand(2), operands[2]);
CHECK(!node.source_info().is_valid());
}
TEST_F(BytecodeNodeTest, Constructor5) {
uint32_t operands[] = {0x71, 0xA5, 0x5A, 0xFC};
BytecodeNode node(Bytecode::kForInNext, operands[0], operands[1], operands[2],
operands[3]);
CHECK_EQ(node.operand_count(), 4);
CHECK_EQ(node.bytecode(), Bytecode::kForInNext);
CHECK_EQ(node.operand(0), operands[0]);
CHECK_EQ(node.operand(1), operands[1]);
CHECK_EQ(node.operand(2), operands[2]);
CHECK_EQ(node.operand(3), operands[3]);
CHECK(!node.source_info().is_valid());
}
TEST_F(BytecodeNodeTest, Equality) {
uint32_t operands[] = {0x71, 0xA5, 0x5A, 0xFC};
BytecodeNode node(Bytecode::kForInNext, operands[0], operands[1], operands[2],
operands[3]);
CHECK_EQ(node, node);
BytecodeNode other(Bytecode::kForInNext, operands[0], operands[1],
operands[2], operands[3]);
CHECK_EQ(node, other);
}
TEST_F(BytecodeNodeTest, EqualityWithSourceInfo) {
uint32_t operands[] = {0x71, 0xA5, 0x5A, 0xFC};
BytecodeSourceInfo first_source_info(3, true);
BytecodeNode node(Bytecode::kForInNext, operands[0], operands[1], operands[2],
operands[3], first_source_info);
CHECK_EQ(node, node);
BytecodeSourceInfo second_source_info(3, true);
BytecodeNode other(Bytecode::kForInNext, operands[0], operands[1],
operands[2], operands[3], second_source_info);
CHECK_EQ(node, other);
}
TEST_F(BytecodeNodeTest, NoEqualityWithDifferentSourceInfo) {
uint32_t operands[] = {0x71, 0xA5, 0x5A, 0xFC};
BytecodeSourceInfo source_info(77, true);
BytecodeNode node(Bytecode::kForInNext, operands[0], operands[1], operands[2],
operands[3], source_info);
BytecodeNode other(Bytecode::kForInNext, operands[0], operands[1],
operands[2], operands[3]);
CHECK_NE(node, other);
}
} // namespace interpreter
} // namespace internal
} // namespace v8

View File

@ -0,0 +1,47 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/init/v8.h"
#include "src/execution/isolate.h"
#include "src/interpreter/bytecode-operands.h"
#include "test/unittests/test-utils.h"
namespace v8 {
namespace internal {
namespace interpreter {
using BytecodeOperandsTest = TestWithIsolateAndZone;
TEST(BytecodeOperandsTest, IsScalableSignedByte) {
#define SCALABLE_SIGNED_OPERAND(Name, ...) \
CHECK(BytecodeOperands::IsScalableSignedByte(OperandType::k##Name));
REGISTER_OPERAND_TYPE_LIST(SCALABLE_SIGNED_OPERAND)
SIGNED_SCALABLE_SCALAR_OPERAND_TYPE_LIST(SCALABLE_SIGNED_OPERAND)
#undef SCALABLE_SIGNED_OPERAND
#define NOT_SCALABLE_SIGNED_OPERAND(Name, ...) \
CHECK(!BytecodeOperands::IsScalableSignedByte(OperandType::k##Name));
INVALID_OPERAND_TYPE_LIST(NOT_SCALABLE_SIGNED_OPERAND)
UNSIGNED_FIXED_SCALAR_OPERAND_TYPE_LIST(NOT_SCALABLE_SIGNED_OPERAND)
UNSIGNED_SCALABLE_SCALAR_OPERAND_TYPE_LIST(NOT_SCALABLE_SIGNED_OPERAND)
#undef NOT_SCALABLE_SIGNED_OPERAND
}
TEST(BytecodeOperandsTest, IsScalableUnsignedByte) {
#define SCALABLE_UNSIGNED_OPERAND(Name, ...) \
CHECK(BytecodeOperands::IsScalableUnsignedByte(OperandType::k##Name));
UNSIGNED_SCALABLE_SCALAR_OPERAND_TYPE_LIST(SCALABLE_UNSIGNED_OPERAND)
#undef SCALABLE_SIGNED_OPERAND
#define NOT_SCALABLE_UNSIGNED_OPERAND(Name, ...) \
CHECK(!BytecodeOperands::IsScalableUnsignedByte(OperandType::k##Name));
INVALID_OPERAND_TYPE_LIST(NOT_SCALABLE_UNSIGNED_OPERAND)
REGISTER_OPERAND_TYPE_LIST(NOT_SCALABLE_UNSIGNED_OPERAND)
SIGNED_SCALABLE_SCALAR_OPERAND_TYPE_LIST(NOT_SCALABLE_UNSIGNED_OPERAND)
UNSIGNED_FIXED_SCALAR_OPERAND_TYPE_LIST(NOT_SCALABLE_UNSIGNED_OPERAND)
#undef NOT_SCALABLE_SIGNED_OPERAND
}
} // namespace interpreter
} // namespace internal
} // namespace v8

View File

@ -0,0 +1,114 @@
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/init/v8.h"
#include "src/interpreter/bytecode-array-builder.h"
#include "src/interpreter/bytecode-register-allocator.h"
#include "src/objects/objects-inl.h"
#include "test/unittests/test-utils.h"
namespace v8 {
namespace internal {
namespace interpreter {
class BytecodeRegisterAllocatorTest : public TestWithIsolateAndZone {
public:
BytecodeRegisterAllocatorTest() : allocator_(0) {}
~BytecodeRegisterAllocatorTest() override = default;
BytecodeRegisterAllocator* allocator() { return &allocator_; }
private:
BytecodeRegisterAllocator allocator_;
};
TEST_F(BytecodeRegisterAllocatorTest, SimpleAllocations) {
CHECK_EQ(allocator()->maximum_register_count(), 0);
Register reg0 = allocator()->NewRegister();
CHECK_EQ(reg0.index(), 0);
CHECK_EQ(allocator()->maximum_register_count(), 1);
CHECK_EQ(allocator()->next_register_index(), 1);
CHECK(allocator()->RegisterIsLive(reg0));
allocator()->ReleaseRegisters(0);
CHECK(!allocator()->RegisterIsLive(reg0));
CHECK_EQ(allocator()->maximum_register_count(), 1);
CHECK_EQ(allocator()->next_register_index(), 0);
reg0 = allocator()->NewRegister();
Register reg1 = allocator()->NewRegister();
CHECK_EQ(reg0.index(), 0);
CHECK_EQ(reg1.index(), 1);
CHECK(allocator()->RegisterIsLive(reg0));
CHECK(allocator()->RegisterIsLive(reg1));
CHECK_EQ(allocator()->maximum_register_count(), 2);
CHECK_EQ(allocator()->next_register_index(), 2);
allocator()->ReleaseRegisters(1);
CHECK(allocator()->RegisterIsLive(reg0));
CHECK(!allocator()->RegisterIsLive(reg1));
CHECK_EQ(allocator()->maximum_register_count(), 2);
CHECK_EQ(allocator()->next_register_index(), 1);
}
TEST_F(BytecodeRegisterAllocatorTest, RegisterListAllocations) {
CHECK_EQ(allocator()->maximum_register_count(), 0);
RegisterList reg_list = allocator()->NewRegisterList(3);
CHECK_EQ(reg_list.first_register().index(), 0);
CHECK_EQ(reg_list.register_count(), 3);
CHECK_EQ(reg_list[0].index(), 0);
CHECK_EQ(reg_list[1].index(), 1);
CHECK_EQ(reg_list[2].index(), 2);
CHECK_EQ(allocator()->maximum_register_count(), 3);
CHECK_EQ(allocator()->next_register_index(), 3);
CHECK(allocator()->RegisterIsLive(reg_list[2]));
Register reg = allocator()->NewRegister();
RegisterList reg_list_2 = allocator()->NewRegisterList(2);
CHECK_EQ(reg.index(), 3);
CHECK_EQ(reg_list_2.first_register().index(), 4);
CHECK_EQ(reg_list_2.register_count(), 2);
CHECK_EQ(reg_list_2[0].index(), 4);
CHECK_EQ(reg_list_2[1].index(), 5);
CHECK_EQ(allocator()->maximum_register_count(), 6);
CHECK_EQ(allocator()->next_register_index(), 6);
CHECK(allocator()->RegisterIsLive(reg));
CHECK(allocator()->RegisterIsLive(reg_list_2[1]));
allocator()->ReleaseRegisters(reg.index());
CHECK(!allocator()->RegisterIsLive(reg));
CHECK(!allocator()->RegisterIsLive(reg_list_2[0]));
CHECK(!allocator()->RegisterIsLive(reg_list_2[1]));
CHECK(allocator()->RegisterIsLive(reg_list[2]));
CHECK_EQ(allocator()->maximum_register_count(), 6);
CHECK_EQ(allocator()->next_register_index(), 3);
RegisterList empty_reg_list = allocator()->NewRegisterList(0);
CHECK_EQ(empty_reg_list.first_register().index(), 0);
CHECK_EQ(empty_reg_list.register_count(), 0);
CHECK_EQ(allocator()->maximum_register_count(), 6);
CHECK_EQ(allocator()->next_register_index(), 3);
}
TEST_F(BytecodeRegisterAllocatorTest, GrowableRegisterListAllocations) {
CHECK_EQ(allocator()->maximum_register_count(), 0);
Register reg = allocator()->NewRegister();
CHECK_EQ(reg.index(), 0);
RegisterList reg_list = allocator()->NewGrowableRegisterList();
CHECK_EQ(reg_list.register_count(), 0);
allocator()->GrowRegisterList(&reg_list);
allocator()->GrowRegisterList(&reg_list);
allocator()->GrowRegisterList(&reg_list);
CHECK_EQ(reg_list.register_count(), 3);
CHECK_EQ(reg_list[0].index(), 1);
CHECK_EQ(reg_list[1].index(), 2);
CHECK_EQ(reg_list[2].index(), 3);
CHECK_EQ(allocator()->maximum_register_count(), 4);
CHECK_EQ(allocator()->next_register_index(), 4);
}
} // namespace interpreter
} // namespace internal
} // namespace v8

View File

@ -0,0 +1,223 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/init/v8.h"
#include "src/interpreter/bytecode-label.h"
#include "src/interpreter/bytecode-register-optimizer.h"
#include "test/unittests/interpreter/bytecode-utils.h"
#include "test/unittests/test-utils.h"
namespace v8 {
namespace internal {
namespace interpreter {
class BytecodeRegisterOptimizerTest
: public BytecodeRegisterOptimizer::BytecodeWriter,
public TestWithIsolateAndZone {
public:
struct RegisterTransfer {
Bytecode bytecode;
Register input;
Register output;
};
BytecodeRegisterOptimizerTest() = default;
~BytecodeRegisterOptimizerTest() override { delete register_allocator_; }
void Initialize(int number_of_parameters, int number_of_locals) {
register_allocator_ = new BytecodeRegisterAllocator(number_of_locals);
register_optimizer_ = zone()->New<BytecodeRegisterOptimizer>(
zone(), register_allocator_, number_of_locals, number_of_parameters,
this);
}
void EmitLdar(Register input) override {
output_.push_back({Bytecode::kLdar, input, Register()});
}
void EmitStar(Register output) override {
output_.push_back({Bytecode::kStar, Register(), output});
}
void EmitMov(Register input, Register output) override {
output_.push_back({Bytecode::kMov, input, output});
}
BytecodeRegisterAllocator* allocator() { return register_allocator_; }
BytecodeRegisterOptimizer* optimizer() { return register_optimizer_; }
Register NewTemporary() { return allocator()->NewRegister(); }
void ReleaseTemporaries(Register reg) {
allocator()->ReleaseRegisters(reg.index());
}
size_t write_count() const { return output_.size(); }
const RegisterTransfer& last_written() const { return output_.back(); }
const std::vector<RegisterTransfer>* output() { return &output_; }
private:
BytecodeRegisterAllocator* register_allocator_;
BytecodeRegisterOptimizer* register_optimizer_;
std::vector<RegisterTransfer> output_;
};
// Sanity tests.
TEST_F(BytecodeRegisterOptimizerTest, TemporaryMaterializedForFlush) {
Initialize(1, 1);
Register temp = NewTemporary();
optimizer()->DoStar(temp);
CHECK_EQ(write_count(), 0u);
optimizer()->Flush();
CHECK_EQ(write_count(), 1u);
CHECK_EQ(output()->at(0).bytecode, Bytecode::kStar);
CHECK_EQ(output()->at(0).output.index(), temp.index());
}
TEST_F(BytecodeRegisterOptimizerTest, TemporaryMaterializedForJump) {
Initialize(1, 1);
Register temp = NewTemporary();
optimizer()->DoStar(temp);
CHECK_EQ(write_count(), 0u);
optimizer()
->PrepareForBytecode<Bytecode::kJump, ImplicitRegisterUse::kNone>();
CHECK_EQ(write_count(), 1u);
CHECK_EQ(output()->at(0).bytecode, Bytecode::kStar);
CHECK_EQ(output()->at(0).output.index(), temp.index());
}
// Basic Register Optimizations
TEST_F(BytecodeRegisterOptimizerTest, TemporaryNotEmitted) {
Initialize(3, 1);
Register parameter = Register::FromParameterIndex(1);
optimizer()->DoLdar(parameter);
CHECK_EQ(write_count(), 0u);
Register temp = NewTemporary();
optimizer()->DoStar(temp);
ReleaseTemporaries(temp);
CHECK_EQ(write_count(), 0u);
optimizer()
->PrepareForBytecode<Bytecode::kReturn,
ImplicitRegisterUse::kReadAccumulator>();
CHECK_EQ(output()->at(0).bytecode, Bytecode::kLdar);
CHECK_EQ(output()->at(0).input.index(), parameter.index());
}
TEST_F(BytecodeRegisterOptimizerTest, ReleasedRegisterUsed) {
Initialize(3, 1);
optimizer()
->PrepareForBytecode<Bytecode::kLdaSmi,
ImplicitRegisterUse::kWriteAccumulator>();
Register temp0 = NewTemporary();
Register temp1 = NewTemporary();
optimizer()->DoStar(temp1);
CHECK_EQ(write_count(), 0u);
optimizer()
->PrepareForBytecode<Bytecode::kLdaSmi,
ImplicitRegisterUse::kWriteAccumulator>();
CHECK_EQ(write_count(), 1u);
CHECK_EQ(output()->at(0).bytecode, Bytecode::kStar);
CHECK_EQ(output()->at(0).output.index(), temp1.index());
optimizer()->DoMov(temp1, temp0);
CHECK_EQ(write_count(), 1u);
ReleaseTemporaries(temp1);
CHECK_EQ(write_count(), 1u);
optimizer()->DoLdar(temp0);
CHECK_EQ(write_count(), 1u);
optimizer()
->PrepareForBytecode<Bytecode::kReturn,
ImplicitRegisterUse::kReadAccumulator>();
CHECK_EQ(write_count(), 2u);
CHECK_EQ(output()->at(1).bytecode, Bytecode::kLdar);
CHECK_EQ(output()->at(1).input.index(), temp1.index());
}
TEST_F(BytecodeRegisterOptimizerTest, ReleasedRegisterNotFlushed) {
Initialize(3, 1);
optimizer()
->PrepareForBytecode<Bytecode::kLdaSmi,
ImplicitRegisterUse::kWriteAccumulator>();
Register temp0 = NewTemporary();
Register temp1 = NewTemporary();
optimizer()->DoStar(temp0);
CHECK_EQ(write_count(), 0u);
optimizer()->DoStar(temp1);
CHECK_EQ(write_count(), 0u);
ReleaseTemporaries(temp1);
optimizer()->Flush();
CHECK_EQ(write_count(), 1u);
CHECK_EQ(output()->at(0).bytecode, Bytecode::kStar);
CHECK_EQ(output()->at(0).output.index(), temp0.index());
}
TEST_F(BytecodeRegisterOptimizerTest, StoresToLocalsImmediate) {
Initialize(3, 1);
Register parameter = Register::FromParameterIndex(1);
optimizer()->DoLdar(parameter);
CHECK_EQ(write_count(), 0u);
Register local = Register(0);
optimizer()->DoStar(local);
CHECK_EQ(write_count(), 1u);
CHECK_EQ(output()->at(0).bytecode, Bytecode::kMov);
CHECK_EQ(output()->at(0).input.index(), parameter.index());
CHECK_EQ(output()->at(0).output.index(), local.index());
optimizer()
->PrepareForBytecode<Bytecode::kReturn,
ImplicitRegisterUse::kReadAccumulator>();
CHECK_EQ(write_count(), 2u);
CHECK_EQ(output()->at(1).bytecode, Bytecode::kLdar);
CHECK_EQ(output()->at(1).input.index(), local.index());
}
TEST_F(BytecodeRegisterOptimizerTest, SingleTemporaryNotMaterializedForInput) {
Initialize(3, 1);
Register parameter = Register::FromParameterIndex(1);
Register temp0 = NewTemporary();
Register temp1 = NewTemporary();
optimizer()->DoMov(parameter, temp0);
optimizer()->DoMov(parameter, temp1);
CHECK_EQ(write_count(), 0u);
Register reg = optimizer()->GetInputRegister(temp0);
RegisterList reg_list = optimizer()->GetInputRegisterList(
BytecodeUtils::NewRegisterList(temp0.index(), 1));
CHECK_EQ(write_count(), 0u);
CHECK_EQ(parameter.index(), reg.index());
CHECK_EQ(parameter.index(), reg_list.first_register().index());
CHECK_EQ(1, reg_list.register_count());
}
TEST_F(BytecodeRegisterOptimizerTest, RangeOfTemporariesMaterializedForInput) {
Initialize(3, 1);
Register parameter = Register::FromParameterIndex(1);
Register temp0 = NewTemporary();
Register temp1 = NewTemporary();
optimizer()
->PrepareForBytecode<Bytecode::kLdaSmi,
ImplicitRegisterUse::kWriteAccumulator>();
optimizer()->DoStar(temp0);
optimizer()->DoMov(parameter, temp1);
CHECK_EQ(write_count(), 0u);
optimizer()
->PrepareForBytecode<Bytecode::kCallJSRuntime,
ImplicitRegisterUse::kWriteAccumulator>();
RegisterList reg_list = optimizer()->GetInputRegisterList(
BytecodeUtils::NewRegisterList(temp0.index(), 2));
CHECK_EQ(temp0.index(), reg_list.first_register().index());
CHECK_EQ(2, reg_list.register_count());
CHECK_EQ(write_count(), 2u);
CHECK_EQ(output()->at(0).bytecode, Bytecode::kStar);
CHECK_EQ(output()->at(0).output.index(), temp0.index());
CHECK_EQ(output()->at(1).bytecode, Bytecode::kMov);
CHECK_EQ(output()->at(1).input.index(), parameter.index());
CHECK_EQ(output()->at(1).output.index(), temp1.index());
}
} // namespace interpreter
} // namespace internal
} // namespace v8

View File

@ -0,0 +1,52 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/init/v8.h"
#include "src/interpreter/bytecode-source-info.h"
#include "test/unittests/test-utils.h"
namespace v8 {
namespace internal {
namespace interpreter {
TEST(BytecodeSourceInfo, Operations) {
BytecodeSourceInfo x(0, true);
CHECK_EQ(x.source_position(), 0);
CHECK_EQ(x.is_statement(), true);
CHECK_EQ(x.is_valid(), true);
x.set_invalid();
CHECK_EQ(x.is_statement(), false);
CHECK_EQ(x.is_valid(), false);
x.MakeStatementPosition(1);
BytecodeSourceInfo y(1, true);
CHECK(x == y);
CHECK(!(x != y));
x.set_invalid();
CHECK(!(x == y));
CHECK(x != y);
y.MakeStatementPosition(1);
CHECK_EQ(y.source_position(), 1);
CHECK_EQ(y.is_statement(), true);
y.MakeStatementPosition(2);
CHECK_EQ(y.source_position(), 2);
CHECK_EQ(y.is_statement(), true);
y.set_invalid();
y.MakeExpressionPosition(3);
CHECK_EQ(y.source_position(), 3);
CHECK_EQ(y.is_statement(), false);
y.MakeStatementPosition(3);
CHECK_EQ(y.source_position(), 3);
CHECK_EQ(y.is_statement(), true);
}
} // namespace interpreter
} // namespace internal
} // namespace v8

View File

@ -0,0 +1,56 @@
// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_UNITTESTS_INTERPRETER_BYTECODE_UTILS_H_
#define V8_UNITTESTS_INTERPRETER_BYTECODE_UTILS_H_
#include "src/execution/frames.h"
#include "src/interpreter/bytecode-register.h"
namespace v8 {
namespace internal {
namespace interpreter {
#if V8_TARGET_LITTLE_ENDIAN
#define EXTRACT(x, n) static_cast<uint8_t>((x) >> (8 * n))
#define U16(i) EXTRACT(i, 0), EXTRACT(i, 1)
#define U32(i) EXTRACT(i, 0), EXTRACT(i, 1), EXTRACT(i, 2), EXTRACT(i, 3)
#elif V8_TARGET_BIG_ENDIAN
#define EXTRACT(x, n) static_cast<uint8_t>((x) >> (8 * n))
#define U16(i) EXTRACT(i, 1), EXTRACT(i, 0)
#define U32(i) EXTRACT(i, 3), EXTRACT(i, 2), EXTRACT(i, 1), EXTRACT(i, 0)
#else
#error "Unknown Architecture"
#endif
#define U8(i) static_cast<uint8_t>(i)
#define REG_OPERAND(i) \
(InterpreterFrameConstants::kRegisterFileFromFp / kSystemPointerSize - (i))
#define R8(i) static_cast<uint8_t>(REG_OPERAND(i))
#define R16(i) U16(REG_OPERAND(i))
#define R32(i) U32(REG_OPERAND(i))
class BytecodeUtils {
public:
// Expose raw RegisterList construction to tests.
static RegisterList NewRegisterList(int first_reg_index, int register_count) {
return RegisterList(first_reg_index, register_count);
}
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(BytecodeUtils);
};
} // namespace interpreter
} // namespace internal
} // namespace v8
#endif // V8_UNITTESTS_INTERPRETER_BYTECODE_UTILS_H_

View File

@ -0,0 +1,203 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
return [ 1, 2 ];
"
frame size: 0
parameter count: 1
bytecode array length: 5
bytecodes: [
/* 34 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
/* 50 S> */ B(Return),
]
constant pool: [
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
var a = 1; return [ a, a + 1 ];
"
frame size: 3
parameter count: 1
bytecode array length: 31
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
B(Star1),
B(LdaZero),
B(Star2),
B(Ldar), R(0),
/* 54 E> */ B(StaInArrayLiteral), R(1), R(2), U8(1),
B(LdaSmi), I8(1),
B(Star2),
B(Ldar), R(0),
/* 59 E> */ B(AddSmi), I8(1), U8(3),
B(StaInArrayLiteral), R(1), R(2), U8(1),
B(Ldar), R(1),
/* 65 S> */ B(Return),
]
constant pool: [
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
return [ [ 1, 2 ], [ 3 ] ];
"
frame size: 0
parameter count: 1
bytecode array length: 5
bytecodes: [
/* 34 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(4),
/* 61 S> */ B(Return),
]
constant pool: [
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
var a = 1; return [ [ a, 2 ], [ a + 2 ] ];
"
frame size: 5
parameter count: 1
bytecode array length: 57
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(4),
B(Star1),
B(LdaZero),
B(Star2),
B(CreateArrayLiteral), U8(1), U8(1), U8(37),
B(Star3),
B(LdaZero),
B(Star4),
B(Ldar), R(0),
/* 56 E> */ B(StaInArrayLiteral), R(3), R(4), U8(2),
B(Ldar), R(3),
B(StaInArrayLiteral), R(1), R(2), U8(4),
B(LdaSmi), I8(1),
B(Star2),
B(CreateArrayLiteral), U8(2), U8(6), U8(37),
B(Star3),
B(LdaZero),
B(Star4),
B(Ldar), R(0),
/* 68 E> */ B(AddSmi), I8(2), U8(7),
B(StaInArrayLiteral), R(3), R(4), U8(8),
B(Ldar), R(3),
B(StaInArrayLiteral), R(1), R(2), U8(4),
B(Ldar), R(1),
/* 76 S> */ B(Return),
]
constant pool: [
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
var a = [ 1, 2 ]; return [ ...a ];
"
frame size: 1
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 42 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
B(Star0),
/* 64 S> */ B(CreateArrayFromIterable),
/* 68 S> */ B(Return),
]
constant pool: [
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
var a = [ 1, 2 ]; return [ 0, ...a ];
"
frame size: 6
parameter count: 1
bytecode array length: 61
bytecodes: [
/* 42 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
B(Star0),
/* 52 S> */ B(CreateArrayLiteral), U8(1), U8(1), U8(37),
B(Star1),
B(LdaSmi), I8(1),
B(Star2),
/* 67 E> */ B(GetIterator), R(0), U8(2), U8(4),
B(Star4),
B(GetNamedProperty), R(4), U8(2), U8(6),
B(Star3),
B(CallProperty0), R(3), R(4), U8(15),
B(Star5),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(5), U8(1),
B(GetNamedProperty), R(5), U8(3), U8(17),
B(JumpIfToBooleanTrue), U8(19),
B(GetNamedProperty), R(5), U8(4), U8(8),
B(StaInArrayLiteral), R(1), R(2), U8(13),
B(Ldar), R(2),
B(Inc), U8(12),
B(Star2),
B(JumpLoop), U8(31), I8(0), U8(19),
B(Ldar), R(1),
/* 71 S> */ B(Return),
]
constant pool: [
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
]
handlers: [
]
---
snippet: "
var a = [ 1, 2 ]; return [ ...a, 3 ];
"
frame size: 3
parameter count: 1
bytecode array length: 21
bytecodes: [
/* 42 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
B(Star0),
/* 64 S> */ B(CreateArrayFromIterable),
B(Star1),
B(GetNamedProperty), R(1), U8(1), U8(1),
B(Star2),
B(LdaSmi), I8(3),
B(StaInArrayLiteral), R(1), R(2), U8(3),
B(Ldar), R(1),
/* 71 S> */ B(Return),
]
constant pool: [
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["length"],
]
handlers: [
]

View File

@ -0,0 +1,261 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
var x = 0, y = 1;
return (x = 2, y = 3, x = 4, y = 5);
"
frame size: 2
parameter count: 1
bytecode array length: 18
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 49 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 52 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 69 S> */ B(LdaSmi), I8(3),
B(Star1),
/* 76 S> */ B(LdaSmi), I8(4),
B(Star0),
/* 83 S> */ B(LdaSmi), I8(5),
B(Star1),
/* 88 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 55;
var y = (x = 100);
return y;
"
frame size: 2
parameter count: 1
bytecode array length: 8
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(55),
B(Star0),
/* 54 S> */ B(LdaSmi), I8(100),
B(Star0),
B(Star1),
/* 74 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 55;
x = x + (x = 100) + (x = 101);
return x;
"
frame size: 2
parameter count: 1
bytecode array length: 21
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(55),
B(Star0),
/* 46 S> */ B(LdaSmi), I8(100),
B(Mov), R(0), R(1),
B(Star0),
/* 52 E> */ B(Add), R(1), U8(0),
B(Star1),
B(LdaSmi), I8(101),
B(Star0),
/* 64 E> */ B(Add), R(1), U8(1),
B(Star0),
/* 86 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 55;
x = (x = 56) - x + (x = 57);
x++;
return x;
"
frame size: 2
parameter count: 1
bytecode array length: 21
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(55),
B(Star0),
/* 46 S> */ B(LdaSmi), I8(56),
B(Star0),
/* 59 E> */ B(Sub), R(0), U8(1),
B(Star1),
B(LdaSmi), I8(57),
B(Star0),
/* 63 E> */ B(Add), R(1), U8(0),
B(Star0),
/* 75 S> */ B(Inc), U8(2),
B(Star0),
/* 89 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 55;
var y = x + (x = 1) + (x = 2) + (x = 3);
return y;
"
frame size: 3
parameter count: 1
bytecode array length: 28
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(55),
B(Star0),
/* 54 S> */ B(LdaSmi), I8(1),
B(Mov), R(0), R(2),
B(Star0),
/* 56 E> */ B(Add), R(2), U8(0),
B(Star2),
B(LdaSmi), I8(2),
B(Star0),
/* 66 E> */ B(Add), R(2), U8(1),
B(Star2),
B(LdaSmi), I8(3),
B(Star0),
/* 76 E> */ B(Add), R(2), U8(2),
B(Star1),
/* 96 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 55;
var x = x + (x = 1) + (x = 2) + (x = 3);
return x;
"
frame size: 2
parameter count: 1
bytecode array length: 28
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(55),
B(Star0),
/* 54 S> */ B(LdaSmi), I8(1),
B(Mov), R(0), R(1),
B(Star0),
/* 56 E> */ B(Add), R(1), U8(0),
B(Star1),
B(LdaSmi), I8(2),
B(Star0),
/* 66 E> */ B(Add), R(1), U8(1),
B(Star1),
B(LdaSmi), I8(3),
B(Star0),
/* 76 E> */ B(Add), R(1), U8(2),
B(Star0),
/* 96 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 10, y = 20;
return x + (x = 1) + (x + 1) * (y = 2) + (y = 3) + (x = 4) + (y = 5) + y;
"
frame size: 4
parameter count: 1
bytecode array length: 59
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(10),
B(Star0),
/* 50 S> */ B(LdaSmi), I8(20),
B(Star1),
/* 54 S> */ B(LdaSmi), I8(1),
B(Mov), R(0), R(2),
B(Star0),
/* 63 E> */ B(Add), R(2), U8(0),
B(Star2),
B(Ldar), R(0),
/* 78 E> */ B(AddSmi), I8(1), U8(2),
B(Star3),
B(LdaSmi), I8(2),
B(Star1),
/* 83 E> */ B(Mul), R(3), U8(1),
/* 73 E> */ B(Add), R(2), U8(3),
B(Star2),
B(LdaSmi), I8(3),
B(Star1),
/* 93 E> */ B(Add), R(2), U8(4),
B(Star2),
B(LdaSmi), I8(4),
B(Star0),
/* 103 E> */ B(Add), R(2), U8(5),
B(Star2),
B(LdaSmi), I8(5),
B(Star1),
/* 113 E> */ B(Add), R(2), U8(6),
B(Star2),
B(Ldar), R(1),
/* 123 E> */ B(Add), R(2), U8(7),
/* 127 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 17;
return 1 + x + (x++) + (++x);
"
frame size: 3
parameter count: 1
bytecode array length: 35
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(17),
B(Star0),
/* 46 S> */ B(LdaSmi), I8(1),
B(Star1),
B(Ldar), R(0),
/* 55 E> */ B(Add), R(1), U8(0),
B(Star1),
B(Ldar), R(0),
B(ToNumeric), U8(1),
B(Star2),
B(Inc), U8(1),
B(Star0),
B(Ldar), R(2),
/* 59 E> */ B(Add), R(1), U8(2),
B(Star1),
B(Ldar), R(0),
B(Inc), U8(3),
B(Star0),
/* 67 E> */ B(Add), R(1), U8(4),
/* 75 S> */ B(Return),
]
constant pool: [
]
handlers: [
]

View File

@ -0,0 +1,579 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: f
---
snippet: "
async function* f() { }
f();
"
frame size: 9
parameter count: 1
bytecode array length: 118
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(Mov), R(closure), R(1),
B(Mov), R(this), R(2),
/* 17 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(1), U8(2),
B(Star0),
B(LdaTheHole),
B(Star3),
B(Mov), R(context), R(4),
B(Mov), R(context), R(5),
B(Ldar), R(0),
/* 17 E> */ B(SuspendGenerator), R(0), R(0), U8(6), U8(0),
B(ResumeGenerator), R(0), R(0), U8(6),
B(Star6),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(1), U8(3), I8(0),
B(Ldar), R(6),
/* 17 E> */ B(ReThrow),
B(Ldar), R(6),
/* 17 E> */ B(Throw),
B(LdaSmi), I8(1),
B(Star1),
B(Mov), R(6), R(2),
B(Jump), U8(31),
B(LdaUndefined),
B(Star2),
B(LdaSmi), I8(1),
B(Star1),
B(Jump), U8(24),
B(Star7),
B(LdaTheHole),
B(SetPendingMessage),
B(Mov), R(0), R(6),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorReject), R(6), U8(2),
B(Star2),
B(LdaSmi), I8(2),
B(Star1),
B(Jump), U8(8),
B(Star2),
B(LdaZero),
B(Star1),
B(LdaTheHole),
B(SetPendingMessage),
B(Star3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(0), U8(1),
B(Ldar), R(1),
B(SwitchOnSmiNoFeedback), U8(4), U8(2), I8(1),
B(Ldar), R(3),
B(SetPendingMessage),
B(Ldar), R(2),
B(ReThrow),
B(LdaTrue),
B(Star8),
B(Mov), R(0), R(6),
B(Mov), R(2), R(7),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorResolve), R(6), U8(3),
B(Return),
B(Ldar), R(2),
B(Return),
]
constant pool: [
Smi [30],
Smi [18],
Smi [10],
Smi [7],
Smi [10],
Smi [23],
]
handlers: [
[20, 80, 80],
[23, 64, 64],
]
---
snippet: "
async function* f() { yield 42 }
f();
"
frame size: 9
parameter count: 1
bytecode array length: 160
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(1),
B(Mov), R(this), R(2),
/* 17 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(1), U8(2),
B(Star0),
B(LdaTheHole),
B(Star3),
B(Mov), R(context), R(4),
B(Mov), R(context), R(5),
B(Ldar), R(0),
/* 17 E> */ B(SuspendGenerator), R(0), R(0), U8(6), U8(0),
B(ResumeGenerator), R(0), R(0), U8(6),
B(Star6),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(3), I8(0),
B(Ldar), R(6),
/* 17 E> */ B(ReThrow),
B(Ldar), R(6),
/* 17 E> */ B(Throw),
B(LdaSmi), I8(1),
B(Star1),
B(Mov), R(6), R(2),
B(Jump), U8(73),
/* 22 S> */ B(LdaSmi), I8(42),
B(Star7),
B(Mov), R(0), R(6),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorYieldWithAwait), R(6), U8(2),
/* 22 E> */ B(SuspendGenerator), R(0), R(0), U8(6), U8(1),
B(ResumeGenerator), R(0), R(0), U8(6),
B(Star6),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(5), U8(3), I8(0),
B(Ldar), R(6),
/* 22 E> */ B(ReThrow),
B(Ldar), R(6),
/* 22 E> */ B(Throw),
B(LdaSmi), I8(1),
B(Star1),
B(Mov), R(6), R(2),
B(Jump), U8(31),
B(LdaUndefined),
B(Star2),
B(LdaSmi), I8(1),
B(Star1),
B(Jump), U8(24),
B(Star7),
B(LdaTheHole),
B(SetPendingMessage),
B(Mov), R(0), R(6),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorReject), R(6), U8(2),
B(Star2),
B(LdaSmi), I8(2),
B(Star1),
B(Jump), U8(8),
B(Star2),
B(LdaZero),
B(Star1),
B(LdaTheHole),
B(SetPendingMessage),
B(Star3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(0), U8(1),
B(Ldar), R(1),
B(SwitchOnSmiNoFeedback), U8(8), U8(2), I8(1),
B(Ldar), R(3),
B(SetPendingMessage),
B(Ldar), R(2),
B(ReThrow),
B(LdaTrue),
B(Star8),
B(Mov), R(0), R(6),
B(Mov), R(2), R(7),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorResolve), R(6), U8(3),
B(Return),
B(Ldar), R(2),
B(Return),
]
constant pool: [
Smi [30],
Smi [72],
Smi [18],
Smi [10],
Smi [7],
Smi [18],
Smi [10],
Smi [7],
Smi [10],
Smi [23],
]
handlers: [
[20, 122, 122],
[23, 106, 106],
]
---
snippet: "
async function* f() { for (let x of [42]) yield x }
f();
"
frame size: 19
parameter count: 1
bytecode array length: 298
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(4),
B(Mov), R(this), R(5),
/* 17 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
B(Star0),
B(LdaTheHole),
B(Star6),
B(Mov), R(context), R(7),
B(Mov), R(context), R(8),
B(Ldar), R(0),
/* 17 E> */ B(SuspendGenerator), R(0), R(0), U8(9), U8(0),
B(ResumeGenerator), R(0), R(0), U8(9),
B(Star9),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(3), I8(0),
B(Ldar), R(9),
/* 17 E> */ B(ReThrow),
B(Ldar), R(9),
/* 17 E> */ B(Throw),
B(LdaSmi), I8(1),
B(Star4),
B(Mov), R(9), R(5),
B(Jump), U8(211),
/* 36 S> */ B(CreateArrayLiteral), U8(5), U8(0), U8(37),
B(Star11),
B(GetIterator), R(11), U8(1), U8(3),
B(Star10),
B(GetNamedProperty), R(10), U8(6), U8(5),
B(Star9),
B(LdaFalse),
B(Star11),
B(LdaTheHole),
B(Star14),
B(Mov), R(context), R(15),
B(LdaTrue),
B(Star11),
/* 31 S> */ B(CallProperty0), R(9), R(10), U8(7),
B(Star), R(16),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(16), U8(1),
B(GetNamedProperty), R(16), U8(7), U8(9),
B(JumpIfToBooleanTrue), U8(65),
B(GetNamedProperty), R(16), U8(8), U8(11),
B(Star), R(16),
B(LdaFalse),
B(Star11),
B(Mov), R(16), R(1),
/* 31 S> */ B(Mov), R(1), R(3),
/* 42 S> */ B(Mov), R(0), R(16),
B(Mov), R(3), R(17),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorYieldWithAwait), R(16), U8(2),
/* 42 E> */ B(SuspendGenerator), R(0), R(0), U8(16), U8(1),
B(ResumeGenerator), R(0), R(0), U8(16),
B(Star), R(16),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(9), U8(3), I8(0),
B(Ldar), R(16),
/* 42 E> */ B(ReThrow),
B(Ldar), R(16),
/* 42 E> */ B(Throw),
B(LdaSmi), I8(1),
B(Star12),
B(Mov), R(16), R(13),
B(Jump), U8(20),
B(Ldar), R(16),
/* 22 E> */ B(JumpLoop), U8(80), I8(0), U8(13),
B(LdaSmi), I8(-1),
B(Star13),
B(Star12),
B(Jump), U8(8),
B(Star13),
B(LdaZero),
B(Star12),
B(LdaTheHole),
B(SetPendingMessage),
B(Star14),
B(Ldar), R(11),
B(JumpIfToBooleanTrue), U8(38),
B(Mov), R(context), R(16),
B(GetNamedProperty), R(10), U8(12), U8(14),
B(JumpIfUndefinedOrNull), U8(29),
B(Star), R(17),
B(CallProperty0), R(17), R(10), U8(16),
B(JumpIfJSReceiver), U8(21),
B(Star), R(18),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(18), U8(1),
B(Jump), U8(12),
B(Star), R(16),
B(LdaZero),
B(TestReferenceEqual), R(12),
B(JumpIfTrue), U8(5),
B(Ldar), R(16),
B(ReThrow),
B(Ldar), R(12),
B(SwitchOnSmiNoFeedback), U8(13), U8(2), I8(0),
B(Jump), U8(16),
B(Ldar), R(14),
B(SetPendingMessage),
B(Ldar), R(13),
B(ReThrow),
B(LdaSmi), I8(1),
B(Star4),
B(Mov), R(13), R(5),
B(Jump), U8(31),
B(LdaUndefined),
B(Star5),
B(LdaSmi), I8(1),
B(Star4),
B(Jump), U8(24),
B(Star10),
B(LdaTheHole),
B(SetPendingMessage),
B(Mov), R(0), R(9),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorReject), R(9), U8(2),
B(Star5),
B(LdaSmi), I8(2),
B(Star4),
B(Jump), U8(8),
B(Star5),
B(LdaZero),
B(Star4),
B(LdaTheHole),
B(SetPendingMessage),
B(Star6),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(0), U8(1),
B(Ldar), R(4),
B(SwitchOnSmiNoFeedback), U8(15), U8(2), I8(1),
B(Ldar), R(6),
B(SetPendingMessage),
B(Ldar), R(5),
B(ReThrow),
B(LdaTrue),
B(Star11),
B(Mov), R(0), R(9),
B(Mov), R(5), R(10),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorResolve), R(9), U8(3),
B(Return),
B(Ldar), R(5),
B(Return),
]
constant pool: [
Smi [30],
Smi [129],
Smi [18],
Smi [10],
Smi [7],
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
Smi [18],
Smi [10],
Smi [7],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["return"],
Smi [6],
Smi [12],
Smi [10],
Smi [23],
]
handlers: [
[20, 260, 260],
[23, 244, 244],
[79, 163, 169],
[182, 203, 205],
]
---
snippet: "
function* g() { yield 42 }
async function* f() { yield* g() }
f();
"
frame size: 18
parameter count: 1
bytecode array length: 412
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(5),
B(Mov), R(closure), R(1),
B(Mov), R(this), R(2),
/* 44 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(1), U8(2),
B(Star0),
B(LdaTheHole),
B(Star3),
B(Mov), R(context), R(4),
B(Mov), R(context), R(5),
B(Ldar), R(0),
/* 44 E> */ B(SuspendGenerator), R(0), R(0), U8(6), U8(0),
B(ResumeGenerator), R(0), R(0), U8(6),
B(Star6),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(5), U8(3), I8(0),
B(Ldar), R(6),
/* 44 E> */ B(ReThrow),
B(Ldar), R(6),
/* 44 E> */ B(Throw),
B(LdaSmi), I8(1),
B(Star1),
B(Mov), R(6), R(2),
B(JumpConstant), U8(18),
/* 49 S> */ B(LdaGlobal), U8(8), U8(0),
B(Star10),
/* 56 E> */ B(CallUndefinedReceiver0), R(10), U8(2),
B(Star11),
B(GetNamedProperty), R(11), U8(9), U8(4),
B(JumpIfUndefinedOrNull), U8(14),
B(Star12),
B(CallProperty0), R(12), R(11), U8(6),
B(JumpIfJSReceiver), U8(21),
B(CallRuntime), U16(Runtime::kThrowSymbolAsyncIteratorInvalid), R(0), U8(0),
B(GetNamedProperty), R(11), U8(10), U8(8),
B(Star12),
B(CallProperty0), R(12), R(11), U8(10),
B(Star12),
B(InvokeIntrinsic), U8(Runtime::k_CreateAsyncFromSyncIterator), R(12), U8(1),
B(Star8),
B(GetNamedProperty), R(8), U8(11), U8(12),
B(Star10),
B(LdaUndefined),
B(Star9),
B(LdaZero),
B(Star7),
B(Ldar), R(7),
B(SwitchOnSmiNoFeedback), U8(12), U8(2), I8(1),
B(CallProperty1), R(10), R(8), R(9), U8(14),
B(Jump), U8(130),
B(GetNamedProperty), R(8), U8(14), U8(16),
B(JumpIfUndefinedOrNull), U8(10),
B(Star11),
B(CallProperty1), R(11), R(8), R(9), U8(18),
B(Jump), U8(116),
B(Mov), R(0), R(11),
B(Mov), R(9), R(12),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorAwait), R(11), U8(2),
/* 49 E> */ B(SuspendGenerator), R(0), R(0), U8(11), U8(1),
B(ResumeGenerator), R(0), R(0), U8(11),
B(Star11),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star12),
B(LdaZero),
B(TestReferenceEqual), R(12),
B(JumpIfTrue), U8(5),
B(Ldar), R(11),
B(ReThrow),
B(LdaSmi), I8(1),
B(Star1),
B(Mov), R(11), R(2),
B(Jump), U8(207),
B(GetNamedProperty), R(8), U8(15), U8(20),
B(JumpIfUndefinedOrNull), U8(10),
B(Star13),
B(CallProperty1), R(13), R(8), R(9), U8(22),
B(Jump), U8(61),
B(GetNamedProperty), R(8), U8(14), U8(24),
B(JumpIfUndefinedOrNull), U8(50),
B(Star13),
B(CallProperty0), R(13), R(8), U8(26),
B(Jump), U8(2),
B(Star14),
B(Mov), R(0), R(13),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorAwait), R(13), U8(2),
/* 49 E> */ B(SuspendGenerator), R(0), R(0), U8(13), U8(2),
B(ResumeGenerator), R(0), R(0), U8(13),
B(Star13),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star14),
B(LdaZero),
B(TestReferenceEqual), R(14),
B(JumpIfTrue), U8(5),
B(Ldar), R(13),
B(ReThrow),
B(Ldar), R(13),
B(JumpIfJSReceiver), U8(8),
B(Star15),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(15), U8(1),
B(CallRuntime), U16(Runtime::kThrowThrowMethodMissing), R(0), U8(0),
B(Star14),
B(Mov), R(0), R(13),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorAwait), R(13), U8(2),
/* 49 E> */ B(SuspendGenerator), R(0), R(0), U8(13), U8(3),
B(ResumeGenerator), R(0), R(0), U8(13),
B(Star13),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star14),
B(LdaZero),
B(TestReferenceEqual), R(14),
B(JumpIfTrue), U8(5),
B(Ldar), R(13),
B(ReThrow),
B(Ldar), R(13),
B(Mov), R(13), R(6),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
B(GetNamedProperty), R(6), U8(16), U8(28),
B(JumpIfToBooleanTrue), U8(37),
B(GetNamedProperty), R(6), U8(17), U8(30),
B(Star), R(16),
B(LdaFalse),
B(Star), R(17),
B(Mov), R(0), R(15),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorResolve), R(15), U8(3),
/* 49 E> */ B(SuspendGenerator), R(0), R(0), U8(15), U8(4),
B(ResumeGenerator), R(0), R(0), U8(15),
B(Star9),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star7),
B(JumpLoop), U8(221), I8(0), U8(32),
B(GetNamedProperty), R(6), U8(17), U8(33),
B(Star8),
B(LdaSmi), I8(1),
B(TestReferenceEqual), R(7),
B(JumpIfFalse), U8(10),
B(LdaSmi), I8(1),
B(Star1),
B(Mov), R(8), R(2),
B(Jump), U8(31),
B(LdaUndefined),
B(Star2),
B(LdaSmi), I8(1),
B(Star1),
B(Jump), U8(24),
B(Star7),
B(LdaTheHole),
B(SetPendingMessage),
B(Mov), R(0), R(6),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorReject), R(6), U8(2),
B(Star2),
B(LdaSmi), I8(2),
B(Star1),
B(Jump), U8(8),
B(Star2),
B(LdaZero),
B(Star1),
B(LdaTheHole),
B(SetPendingMessage),
B(Star3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(0), U8(1),
B(Ldar), R(1),
B(SwitchOnSmiNoFeedback), U8(19), U8(2), I8(1),
B(Ldar), R(3),
B(SetPendingMessage),
B(Ldar), R(2),
B(ReThrow),
B(LdaTrue),
B(Star8),
B(Mov), R(0), R(6),
B(Mov), R(2), R(7),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorResolve), R(6), U8(3),
B(Return),
B(Ldar), R(2),
B(Return),
]
constant pool: [
Smi [30],
Smi [149],
Smi [215],
Smi [261],
Smi [318],
Smi [18],
Smi [10],
Smi [7],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["g"],
SYMBOL_TYPE,
SYMBOL_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
Smi [11],
Smi [66],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["return"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["throw"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
Smi [325],
Smi [10],
Smi [23],
]
handlers: [
[20, 374, 374],
[23, 358, 358],
]

View File

@ -0,0 +1,274 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
module: yes
top level: yes
---
snippet: "
await 42;
"
frame size: 4
parameter count: 1
bytecode array length: 98
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(1),
B(Mov), R(this), R(2),
/* 0 E> */ B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(1), U8(2),
B(Star0),
B(Mov), R(context), R(1),
B(Ldar), R(0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0),
B(ResumeGenerator), R(0), R(0), U8(2),
B(Star2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(2),
/* 0 E> */ B(Throw),
B(Ldar), R(2),
B(Return),
/* 0 S> */ B(LdaSmi), I8(42),
B(Star3),
B(Mov), R(0), R(2),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwait), R(2), U8(2),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(1),
B(ResumeGenerator), R(0), R(0), U8(2),
B(Star2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star3),
B(LdaZero),
B(TestReferenceEqual), R(3),
B(JumpIfTrue), U8(5),
B(Ldar), R(2),
B(ReThrow),
B(LdaUndefined),
B(Star3),
B(Mov), R(0), R(2),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(2), U8(2),
/* 10 S> */ B(Return),
B(Star3),
B(LdaTheHole),
B(SetPendingMessage),
B(Mov), R(0), R(2),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(2), U8(2),
B(Return),
]
constant pool: [
Smi [25],
Smi [59],
Smi [10],
Smi [7],
]
handlers: [
[18, 87, 87],
]
---
snippet: "
await import(\"foo\");
"
frame size: 5
parameter count: 1
bytecode array length: 110
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(1),
B(Mov), R(this), R(2),
/* 0 E> */ B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(1), U8(2),
B(Star0),
B(Mov), R(context), R(1),
B(Ldar), R(0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0),
B(ResumeGenerator), R(0), R(0), U8(2),
B(Star2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(2),
/* 0 E> */ B(Throw),
B(Ldar), R(2),
B(Return),
/* 0 S> */ B(LdaConstant), U8(4),
B(Star3),
B(LdaSmi), I8(1),
B(Star4),
B(Mov), R(closure), R(2),
B(CallRuntime), U16(Runtime::kDynamicImportCall), R(2), U8(3),
B(Star3),
B(Mov), R(0), R(2),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwait), R(2), U8(2),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(1),
B(ResumeGenerator), R(0), R(0), U8(2),
B(Star2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star3),
B(LdaZero),
B(TestReferenceEqual), R(3),
B(JumpIfTrue), U8(5),
B(Ldar), R(2),
B(ReThrow),
B(LdaUndefined),
B(Star3),
B(Mov), R(0), R(2),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(2), U8(2),
/* 21 S> */ B(Return),
B(Star3),
B(LdaTheHole),
B(SetPendingMessage),
B(Mov), R(0), R(2),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(2), U8(2),
B(Return),
]
constant pool: [
Smi [25],
Smi [71],
Smi [10],
Smi [7],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["foo"],
]
handlers: [
[18, 99, 99],
]
---
snippet: "
await 42;
async function foo() {
await 42;
}
foo();
"
frame size: 5
parameter count: 1
bytecode array length: 106
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(2),
B(Mov), R(this), R(3),
/* 0 E> */ B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(2), U8(2),
B(Star0),
B(CreateClosure), U8(2), U8(0), U8(0),
B(Star1),
B(Mov), R(context), R(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(Star3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(3), U8(2), I8(0),
B(Ldar), R(3),
/* 0 E> */ B(Throw),
B(Ldar), R(3),
B(Return),
/* 0 S> */ B(LdaSmi), I8(42),
B(Star4),
B(Mov), R(0), R(3),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwait), 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(Star3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star4),
B(LdaZero),
B(TestReferenceEqual), R(4),
B(JumpIfTrue), U8(5),
B(Ldar), R(3),
B(ReThrow),
/* 47 S> */ B(CallUndefinedReceiver0), R(1), U8(0),
B(LdaUndefined),
B(Star4),
B(Mov), R(0), R(3),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(3), U8(2),
/* 54 S> */ B(Return),
B(Star4),
B(LdaTheHole),
B(SetPendingMessage),
B(Mov), R(0), R(3),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(3), U8(2),
B(Return),
]
constant pool: [
Smi [30],
Smi [64],
SHARED_FUNCTION_INFO_TYPE,
Smi [10],
Smi [7],
]
handlers: [
[23, 95, 95],
]
---
snippet: "
import * as foo from \"bar\";
await import(\"goo\");
"
frame size: 6
parameter count: 1
bytecode array length: 118
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(2),
B(Mov), R(this), R(3),
/* 0 E> */ B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(2), U8(2),
B(Star0),
B(LdaZero),
B(Star2),
B(CallRuntime), U16(Runtime::kGetModuleNamespace), R(2), U8(1),
B(Star1),
B(Mov), R(context), R(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(Star3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(3),
/* 0 E> */ B(Throw),
B(Ldar), R(3),
B(Return),
/* 28 S> */ B(LdaConstant), U8(4),
B(Star4),
B(LdaSmi), I8(1),
B(Star5),
B(Mov), R(closure), R(3),
B(CallRuntime), U16(Runtime::kDynamicImportCall), R(3), U8(3),
B(Star4),
B(Mov), R(0), R(3),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwait), R(3), U8(2),
/* 28 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(1),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star4),
B(LdaZero),
B(TestReferenceEqual), R(4),
B(JumpIfTrue), U8(5),
B(Ldar), R(3),
B(ReThrow),
B(LdaUndefined),
B(Star4),
B(Mov), R(0), R(3),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(3), U8(2),
/* 49 S> */ B(Return),
B(Star4),
B(LdaTheHole),
B(SetPendingMessage),
B(Mov), R(0), R(3),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(3), U8(2),
B(Return),
]
constant pool: [
Smi [33],
Smi [79],
Smi [10],
Smi [7],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["goo"],
]
handlers: [
[26, 107, 107],
]

View File

@ -0,0 +1,81 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
var a = 1; if (a || a < 0) { return 1; }
"
frame size: 1
parameter count: 1
bytecode array length: 16
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(JumpIfToBooleanTrue), U8(8),
B(LdaZero),
/* 56 E> */ B(TestLessThan), R(0), U8(0),
B(JumpIfFalse), U8(5),
/* 63 S> */ B(LdaSmi), I8(1),
/* 72 S> */ B(Return),
B(LdaUndefined),
/* 75 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 1; if (a && a < 0) { return 1; }
"
frame size: 1
parameter count: 1
bytecode array length: 16
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(JumpIfToBooleanFalse), U8(11),
B(LdaZero),
/* 56 E> */ B(TestLessThan), R(0), U8(0),
B(JumpIfFalse), U8(5),
/* 63 S> */ B(LdaSmi), I8(1),
/* 72 S> */ B(Return),
B(LdaUndefined),
/* 75 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 1; a = (a || a < 0) ? 2 : 3;
"
frame size: 1
parameter count: 1
bytecode array length: 20
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(JumpIfToBooleanTrue), U8(8),
B(LdaZero),
/* 57 E> */ B(TestLessThan), R(0), U8(0),
B(JumpIfFalse), U8(6),
B(LdaSmi), I8(2),
B(Jump), U8(4),
B(LdaSmi), I8(3),
B(Star0),
B(LdaUndefined),
/* 71 S> */ B(Return),
]
constant pool: [
]
handlers: [
]

View File

@ -0,0 +1,695 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
var x = 0;
while (false) { x = 99; break; continue; }
return x;
"
frame size: 1
parameter count: 1
bytecode array length: 3
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 97 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0;
while (false) {
x = x + 1;
};
return x;
"
frame size: 1
parameter count: 1
bytecode array length: 3
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 86 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0;
var y = 1;
while (x < 10) {
y = y * 12;
x = x + 1;
if (x == 3) continue;
if (x == 4) break;
}
return y;
"
frame size: 2
parameter count: 1
bytecode array length: 49
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 53 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 65 S> */ B(LdaSmi), I8(10),
/* 65 E> */ B(TestLessThan), R(0), U8(0),
B(JumpIfFalse), U8(36),
/* 75 S> */ B(Ldar), R(1),
/* 81 E> */ B(MulSmi), I8(12), U8(1),
B(Star1),
/* 89 S> */ B(Ldar), R(0),
/* 95 E> */ B(AddSmi), I8(1), U8(2),
B(Star0),
/* 102 S> */ B(LdaSmi), I8(3),
/* 108 E> */ B(TestEqual), R(0), U8(3),
B(JumpIfFalse), U8(4),
/* 114 S> */ B(Jump), U8(11),
/* 126 S> */ B(LdaSmi), I8(4),
/* 132 E> */ B(TestEqual), R(0), U8(4),
B(JumpIfFalse), U8(4),
/* 138 S> */ B(Jump), U8(6),
/* 56 E> */ B(JumpLoop), U8(37), I8(0), U8(5),
/* 147 S> */ B(Ldar), R(1),
/* 156 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var i = 0;
while (true) {
if (i < 0) continue;
if (i == 3) break;
if (i == 4) break;
if (i == 10) continue;
if (i == 5) break;
i = i + 1;
}
return i;
"
frame size: 1
parameter count: 1
bytecode array length: 59
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 62 S> */ B(LdaZero),
/* 68 E> */ B(TestLessThan), R(0), U8(0),
B(JumpIfFalse), U8(4),
/* 73 S> */ B(Jump), U8(44),
/* 85 S> */ B(LdaSmi), I8(3),
/* 91 E> */ B(TestEqual), R(0), U8(1),
B(JumpIfFalse), U8(4),
/* 97 S> */ B(Jump), U8(39),
/* 106 S> */ B(LdaSmi), I8(4),
/* 112 E> */ B(TestEqual), R(0), U8(2),
B(JumpIfFalse), U8(4),
/* 118 S> */ B(Jump), U8(30),
/* 127 S> */ B(LdaSmi), I8(10),
/* 133 E> */ B(TestEqual), R(0), U8(3),
B(JumpIfFalse), U8(4),
/* 140 S> */ B(Jump), U8(17),
/* 152 S> */ B(LdaSmi), I8(5),
/* 158 E> */ B(TestEqual), R(0), U8(4),
B(JumpIfFalse), U8(4),
/* 164 S> */ B(Jump), U8(12),
/* 173 S> */ B(Ldar), R(0),
/* 179 E> */ B(AddSmi), I8(1), U8(5),
B(Star0),
/* 45 E> */ B(JumpLoop), U8(50), I8(0), U8(6),
/* 186 S> */ B(Ldar), R(0),
/* 195 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var i = 0;
while (true) {
while (i < 3) {
if (i == 2) break;
i = i + 1;
}
i = i + 1;
break;
}
return i;
"
frame size: 1
parameter count: 1
bytecode array length: 41
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 71 S> */ B(LdaSmi), I8(3),
/* 71 E> */ B(TestLessThan), R(0), U8(0),
B(JumpIfFalse), U8(19),
/* 82 S> */ B(LdaSmi), I8(2),
/* 88 E> */ B(TestEqual), R(0), U8(1),
B(JumpIfFalse), U8(4),
/* 94 S> */ B(Jump), U8(10),
/* 105 S> */ B(Ldar), R(0),
/* 111 E> */ B(AddSmi), I8(1), U8(2),
B(Star0),
B(Jump), U8(10),
/* 122 S> */ B(Ldar), R(0),
/* 128 E> */ B(AddSmi), I8(1), U8(3),
B(Star0),
/* 135 S> */ B(Jump), U8(6),
/* 45 E> */ B(JumpLoop), U8(32), I8(0), U8(4),
/* 144 S> */ B(Ldar), R(0),
/* 153 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 10;
var y = 1;
while (x) {
y = y * 12;
x = x - 1;
}
return y;
"
frame size: 2
parameter count: 1
bytecode array length: 29
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(10),
B(Star0),
/* 54 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 64 S> */ B(Ldar), R(0),
B(JumpIfToBooleanFalse), U8(18),
/* 71 S> */ B(Ldar), R(1),
/* 77 E> */ B(MulSmi), I8(12), U8(0),
B(Star1),
/* 85 S> */ B(Ldar), R(0),
/* 91 E> */ B(SubSmi), I8(1), U8(1),
B(Star0),
/* 57 E> */ B(JumpLoop), U8(16), I8(0), U8(2),
/* 98 S> */ B(Ldar), R(1),
/* 107 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0; var y = 1;
do {
y = y * 10;
if (x == 5) break;
if (x == 6) continue;
x = x + 1;
} while (x < 10);
return y;
"
frame size: 2
parameter count: 1
bytecode array length: 49
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 53 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 63 S> */ B(Ldar), R(1),
/* 69 E> */ B(MulSmi), I8(10), U8(0),
B(Star1),
/* 77 S> */ B(LdaSmi), I8(5),
/* 83 E> */ B(TestEqual), R(0), U8(1),
B(JumpIfFalse), U8(4),
/* 89 S> */ B(Jump), U8(28),
/* 98 S> */ B(LdaSmi), I8(6),
/* 104 E> */ B(TestEqual), R(0), U8(2),
B(JumpIfFalse), U8(4),
/* 110 S> */ B(Jump), U8(8),
/* 122 S> */ B(Ldar), R(0),
/* 128 E> */ B(AddSmi), I8(1), U8(3),
B(Star0),
/* 144 S> */ B(LdaSmi), I8(10),
/* 144 E> */ B(TestLessThan), R(0), U8(4),
B(JumpIfFalse), U8(6),
/* 56 E> */ B(JumpLoop), U8(37), I8(0), U8(5),
/* 151 S> */ B(Ldar), R(1),
/* 160 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 10;
var y = 1;
do {
y = y * 12;
x = x - 1;
} while (x);
return y;
"
frame size: 2
parameter count: 1
bytecode array length: 27
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(10),
B(Star0),
/* 54 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 64 S> */ B(Ldar), R(1),
/* 70 E> */ B(MulSmi), I8(12), U8(0),
B(Star1),
/* 78 S> */ B(Ldar), R(0),
/* 84 E> */ B(SubSmi), I8(1), U8(1),
B(Star0),
/* 98 S> */ B(JumpIfToBooleanFalse), U8(6),
/* 57 E> */ B(JumpLoop), U8(14), I8(0), U8(2),
/* 102 S> */ B(Ldar), R(1),
/* 111 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0; var y = 1;
do {
y = y * 10;
if (x == 5) break;
x = x + 1;
if (x == 6) continue;
} while (false);
return y;
"
frame size: 2
parameter count: 1
bytecode array length: 36
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 53 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 69 S> */ B(MulSmi), I8(10), U8(0),
B(Star1),
/* 77 S> */ B(LdaSmi), I8(5),
/* 83 E> */ B(TestEqual), R(0), U8(1),
B(JumpIfFalse), U8(4),
/* 89 S> */ B(Jump), U8(17),
/* 98 S> */ B(Ldar), R(0),
/* 104 E> */ B(AddSmi), I8(1), U8(2),
B(Star0),
/* 111 S> */ B(LdaSmi), I8(6),
/* 117 E> */ B(TestEqual), R(0), U8(3),
B(JumpIfFalse), U8(4),
/* 123 S> */ B(Jump), U8(2),
/* 150 S> */ B(Ldar), R(1),
/* 159 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0; var y = 1;
do {
y = y * 10;
if (x == 5) break;
x = x + 1;
if (x == 6) continue;
} while (true);
return y;
"
frame size: 2
parameter count: 1
bytecode array length: 42
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 53 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 63 S> */ B(Ldar), R(1),
/* 69 E> */ B(MulSmi), I8(10), U8(0),
B(Star1),
/* 77 S> */ B(LdaSmi), I8(5),
/* 83 E> */ B(TestEqual), R(0), U8(1),
B(JumpIfFalse), U8(4),
/* 89 S> */ B(Jump), U8(21),
/* 98 S> */ B(Ldar), R(0),
/* 104 E> */ B(AddSmi), I8(1), U8(2),
B(Star0),
/* 111 S> */ B(LdaSmi), I8(6),
/* 117 E> */ B(TestEqual), R(0), U8(3),
B(JumpIfFalse), U8(4),
/* 123 S> */ B(Jump), U8(2),
/* 56 E> */ B(JumpLoop), U8(30), I8(0), U8(4),
/* 149 S> */ B(Ldar), R(1),
/* 158 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0;
for (;;) {
if (x == 1) break;
if (x == 2) continue;
x = x + 1;
}
"
frame size: 1
parameter count: 1
bytecode array length: 32
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 58 S> */ B(LdaSmi), I8(1),
/* 64 E> */ B(TestEqual), R(0), U8(0),
B(JumpIfFalse), U8(4),
/* 70 S> */ B(Jump), U8(21),
/* 79 S> */ B(LdaSmi), I8(2),
/* 85 E> */ B(TestEqual), R(0), U8(1),
B(JumpIfFalse), U8(4),
/* 91 S> */ B(Jump), U8(8),
/* 103 S> */ B(Ldar), R(0),
/* 109 E> */ B(AddSmi), I8(1), U8(2),
B(Star0),
/* 45 E> */ B(JumpLoop), U8(24), I8(0), U8(3),
B(LdaUndefined),
/* 116 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
for (var x = 0;;) {
if (x == 1) break;
if (x == 2) continue;
x = x + 1;
}
"
frame size: 1
parameter count: 1
bytecode array length: 32
bytecodes: [
/* 47 S> */ B(LdaZero),
B(Star0),
/* 56 S> */ B(LdaSmi), I8(1),
/* 62 E> */ B(TestEqual), R(0), U8(0),
B(JumpIfFalse), U8(4),
/* 68 S> */ B(Jump), U8(21),
/* 77 S> */ B(LdaSmi), I8(2),
/* 83 E> */ B(TestEqual), R(0), U8(1),
B(JumpIfFalse), U8(4),
/* 89 S> */ B(Jump), U8(8),
/* 101 S> */ B(Ldar), R(0),
/* 107 E> */ B(AddSmi), I8(1), U8(2),
B(Star0),
/* 34 E> */ B(JumpLoop), U8(24), I8(0), U8(3),
B(LdaUndefined),
/* 114 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0;
for (;; x = x + 1) {
if (x == 1) break;
if (x == 2) continue;
}
"
frame size: 1
parameter count: 1
bytecode array length: 32
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 68 S> */ B(LdaSmi), I8(1),
/* 74 E> */ B(TestEqual), R(0), U8(0),
B(JumpIfFalse), U8(4),
/* 80 S> */ B(Jump), U8(21),
/* 89 S> */ B(LdaSmi), I8(2),
/* 95 E> */ B(TestEqual), R(0), U8(1),
B(JumpIfFalse), U8(4),
/* 101 S> */ B(Jump), U8(2),
/* 55 S> */ B(Ldar), R(0),
/* 59 E> */ B(AddSmi), I8(1), U8(2),
B(Star0),
/* 45 E> */ B(JumpLoop), U8(24), I8(0), U8(3),
B(LdaUndefined),
/* 113 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
for (var x = 0;; x = x + 1) {
if (x == 1) break;
if (x == 2) continue;
}
"
frame size: 1
parameter count: 1
bytecode array length: 32
bytecodes: [
/* 47 S> */ B(LdaZero),
B(Star0),
/* 66 S> */ B(LdaSmi), I8(1),
/* 72 E> */ B(TestEqual), R(0), U8(0),
B(JumpIfFalse), U8(4),
/* 78 S> */ B(Jump), U8(21),
/* 87 S> */ B(LdaSmi), I8(2),
/* 93 E> */ B(TestEqual), R(0), U8(1),
B(JumpIfFalse), U8(4),
/* 99 S> */ B(Jump), U8(2),
/* 53 S> */ B(Ldar), R(0),
/* 57 E> */ B(AddSmi), I8(1), U8(2),
B(Star0),
/* 34 E> */ B(JumpLoop), U8(24), I8(0), U8(3),
B(LdaUndefined),
/* 111 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var u = 0;
for (var i = 0; i < 100; i = i + 1) {
u = u + 1;
continue;
}
"
frame size: 2
parameter count: 1
bytecode array length: 31
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 58 S> */ B(LdaZero),
B(Star1),
/* 63 S> */ B(LdaSmi), I8(100),
/* 63 E> */ B(TestLessThan), R(1), U8(0),
B(JumpIfFalse), U8(20),
/* 85 S> */ B(Ldar), R(0),
/* 91 E> */ B(AddSmi), I8(1), U8(1),
B(Star0),
/* 98 S> */ B(Jump), U8(2),
/* 72 S> */ B(Ldar), R(1),
/* 76 E> */ B(AddSmi), I8(1), U8(2),
B(Star1),
/* 45 E> */ B(JumpLoop), U8(21), I8(0), U8(3),
B(LdaUndefined),
/* 110 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var y = 1;
for (var x = 10; x; --x) {
y = y * 12;
}
return y;
"
frame size: 2
parameter count: 1
bytecode array length: 28
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 58 S> */ B(LdaSmi), I8(10),
B(Star1),
/* 62 S> */ B(Ldar), R(1),
B(JumpIfToBooleanFalse), U8(17),
/* 74 S> */ B(Ldar), R(0),
/* 80 E> */ B(MulSmi), I8(12), U8(0),
B(Star0),
/* 67 S> */ B(Ldar), R(1),
B(Dec), U8(1),
B(Star1),
/* 45 E> */ B(JumpLoop), U8(15), I8(0), U8(2),
/* 88 S> */ B(Ldar), R(0),
/* 97 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0;
for (var i = 0; false; i++) {
x = x + 1;
};
return x;
"
frame size: 2
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 58 S> */ B(LdaZero),
B(Star1),
/* 91 S> */ B(Ldar), R(0),
/* 100 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0;
for (var i = 0; true; ++i) {
x = x + 1;
if (x == 20) break;
};
return x;
"
frame size: 2
parameter count: 1
bytecode array length: 31
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 58 S> */ B(LdaZero),
B(Star1),
/* 76 S> */ B(Ldar), R(0),
/* 82 E> */ B(AddSmi), I8(1), U8(0),
B(Star0),
/* 89 S> */ B(LdaSmi), I8(20),
/* 95 E> */ B(TestEqual), R(0), U8(1),
B(JumpIfFalse), U8(4),
/* 102 S> */ B(Jump), U8(11),
/* 69 S> */ B(Ldar), R(1),
B(Inc), U8(2),
B(Star1),
/* 45 E> */ B(JumpLoop), U8(20), I8(0), U8(3),
/* 112 S> */ B(Ldar), R(0),
/* 121 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 0;
while (a) {
{
let z = 1;
function f() { z = 2; }
if (z) continue;
z++;
}
}
"
frame size: 4
parameter count: 1
bytecode array length: 47
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 52 S> */ B(Ldar), R(0),
B(JumpIfToBooleanFalse), U8(41),
B(CreateBlockContext), U8(0),
B(PushContext), R(3),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
B(CreateClosure), U8(1), U8(0), U8(2),
B(Star2),
/* 73 S> */ B(LdaSmi), I8(1),
/* 73 E> */ B(StaCurrentContextSlot), U8(2),
/* 102 S> */ B(Mov), R(2), R(1),
/* 106 S> */ B(LdaCurrentContextSlot), U8(2),
B(JumpIfToBooleanFalse), U8(6),
/* 113 S> */ B(PopContext), R(3),
B(Jump), U8(10),
/* 126 S> */ B(LdaCurrentContextSlot), U8(2),
B(Inc), U8(0),
/* 127 E> */ B(StaCurrentContextSlot), U8(2),
B(PopContext), R(3),
/* 45 E> */ B(JumpLoop), U8(39), I8(0), U8(1),
B(LdaUndefined),
/* 137 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]

View File

@ -0,0 +1,175 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
var x = 0;
label: {
x = x + 1;
break label;
x = x + 1;
}
return x;
"
frame size: 1
parameter count: 1
bytecode array length: 11
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 62 S> */ B(AddSmi), I8(1), U8(0),
B(Star0),
/* 69 S> */ B(Jump), U8(2),
/* 97 S> */ B(Ldar), R(0),
/* 106 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var sum = 0;
outer: {
for (var x = 0; x < 10; ++x) {
for (var y = 0; y < 3; ++y) {
++sum;
if (x + y == 12) { break outer; }
}
}
}
return sum;
"
frame size: 4
parameter count: 1
bytecode array length: 61
bytecodes: [
/* 44 S> */ B(LdaZero),
B(Star0),
/* 71 S> */ B(LdaZero),
B(Star1),
/* 76 S> */ B(LdaSmi), I8(10),
/* 76 E> */ B(TestLessThan), R(1), U8(0),
B(JumpIfFalse), U8(49),
/* 106 S> */ B(LdaZero),
B(Star2),
/* 111 S> */ B(LdaSmi), I8(3),
/* 111 E> */ B(TestLessThan), R(2), U8(1),
B(JumpIfFalse), U8(31),
/* 129 S> */ B(Ldar), R(0),
B(Inc), U8(2),
B(Star0),
/* 142 S> */ B(Ldar), R(2),
/* 148 E> */ B(Add), R(1), U8(3),
B(Star3),
B(LdaSmi), I8(12),
/* 152 E> */ B(TestEqual), R(3), U8(4),
B(JumpIfFalse), U8(4),
/* 161 S> */ B(Jump), U8(20),
/* 118 S> */ B(Ldar), R(2),
B(Inc), U8(5),
B(Star2),
/* 93 E> */ B(JumpLoop), U8(32), I8(1), U8(6),
/* 84 S> */ B(Ldar), R(1),
B(Inc), U8(7),
B(Star1),
/* 58 E> */ B(JumpLoop), U8(50), I8(0), U8(8),
/* 188 S> */ B(Ldar), R(0),
/* 199 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
outer: {
let y = 10;
function f() { return y; }
break outer;
}
"
frame size: 3
parameter count: 1
bytecode array length: 27
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(2),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
B(CreateClosure), U8(1), U8(0), U8(2),
B(Star1),
/* 53 S> */ B(LdaSmi), I8(10),
/* 53 E> */ B(StaCurrentContextSlot), U8(2),
/* 85 S> */ B(Mov), R(1), R(0),
B(Ldar), R(1),
/* 88 S> */ B(Jump), U8(2),
B(PopContext), R(2),
B(LdaUndefined),
/* 103 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
let x = 1;
outer: {
inner: {
let y = 2;
function f() { return x + y; }
if (y) break outer;
y = 3;
}
}
x = 4;
"
frame size: 4
parameter count: 1
bytecode array length: 51
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(2),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
/* 42 S> */ B(LdaSmi), I8(1),
/* 42 E> */ B(StaCurrentContextSlot), U8(2),
B(CreateBlockContext), U8(1),
B(PushContext), R(3),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
B(CreateClosure), U8(2), U8(0), U8(2),
B(Star1),
/* 76 S> */ B(LdaSmi), I8(2),
/* 76 E> */ B(StaCurrentContextSlot), U8(2),
/* 113 S> */ B(Mov), R(1), R(0),
/* 118 S> */ B(LdaCurrentContextSlot), U8(2),
B(JumpIfToBooleanFalse), U8(6),
/* 125 S> */ B(PopContext), R(3),
B(Jump), U8(8),
/* 142 S> */ B(LdaSmi), I8(3),
/* 144 E> */ B(StaCurrentContextSlot), U8(2),
B(PopContext), R(3),
/* 155 S> */ B(LdaSmi), I8(4),
/* 157 E> */ B(StaCurrentContextSlot), U8(2),
B(LdaUndefined),
/* 162 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
SCOPE_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]

View File

@ -0,0 +1,113 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
Math.max(...[1, 2, 3]);
"
frame size: 3
parameter count: 1
bytecode array length: 21
bytecodes: [
/* 34 S> */ B(LdaGlobal), U8(0), U8(0),
B(Star1),
/* 39 E> */ B(GetNamedProperty), R(1), U8(1), U8(2),
B(Star0),
B(CreateArrayLiteral), U8(2), U8(4), U8(37),
B(Star2),
/* 39 E> */ B(CallWithSpread), R(0), R(1), U8(2), U8(5),
B(LdaUndefined),
/* 58 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["Math"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["max"],
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
Math.max(0, ...[1, 2, 3]);
"
frame size: 4
parameter count: 1
bytecode array length: 23
bytecodes: [
/* 34 S> */ B(LdaGlobal), U8(0), U8(0),
B(Star1),
/* 39 E> */ B(GetNamedProperty), R(1), U8(1), U8(2),
B(Star0),
B(LdaZero),
B(Star2),
B(CreateArrayLiteral), U8(2), U8(4), U8(37),
B(Star3),
/* 39 E> */ B(CallWithSpread), R(0), R(1), U8(3), U8(5),
B(LdaUndefined),
/* 61 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["Math"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["max"],
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
Math.max(0, ...[1, 2, 3], 4);
"
frame size: 7
parameter count: 1
bytecode array length: 79
bytecodes: [
/* 34 S> */ B(LdaGlobal), U8(0), U8(0),
B(Star1),
/* 39 E> */ B(GetNamedProperty), R(1), U8(1), U8(2),
B(Star0),
B(CreateArrayLiteral), U8(2), U8(4), U8(37),
B(Star2),
B(LdaSmi), I8(1),
B(Star3),
/* 49 E> */ B(CreateArrayLiteral), U8(3), U8(5), U8(37),
B(Star6),
/* 49 E> */ B(GetIterator), R(6), U8(6), U8(8),
B(Star5),
B(GetNamedProperty), R(5), U8(4), U8(10),
B(Star4),
B(CallProperty0), R(4), R(5), U8(19),
B(Star6),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
B(GetNamedProperty), R(6), U8(5), U8(21),
B(JumpIfToBooleanTrue), U8(19),
B(GetNamedProperty), R(6), U8(6), U8(12),
B(StaInArrayLiteral), R(2), R(3), U8(17),
B(Ldar), R(3),
B(Inc), U8(16),
B(Star3),
B(JumpLoop), U8(31), I8(0), U8(23),
B(LdaSmi), I8(4),
B(StaInArrayLiteral), R(2), R(3), U8(17),
/* 39 E> */ B(CallJSRuntime), U8(%reflect_apply), R(0), U8(3),
B(LdaUndefined),
/* 64 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["Math"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["max"],
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
]
handlers: [
]

View File

@ -0,0 +1,56 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: f
---
snippet: "
function t() { }
function f() { return t(); }
f();
"
frame size: 1
parameter count: 1
bytecode array length: 8
bytecodes: [
/* 32 S> */ B(LdaGlobal), U8(0), U8(0),
B(Star0),
/* 39 E> */ B(CallUndefinedReceiver0), R(0), U8(2),
/* 43 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["t"],
]
handlers: [
]
---
snippet: "
function t(a, b, c) { }
function f() { return t(1, 2, 3); }
f();
"
frame size: 4
parameter count: 1
bytecode array length: 19
bytecodes: [
/* 39 S> */ B(LdaGlobal), U8(0), U8(0),
B(Star0),
B(LdaSmi), I8(1),
B(Star1),
B(LdaSmi), I8(2),
B(Star2),
B(LdaSmi), I8(3),
B(Star3),
/* 46 E> */ B(CallUndefinedReceiver), R(0), R(1), U8(3), U8(2),
/* 57 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["t"],
]
handlers: [
]

View File

@ -0,0 +1,56 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
g = function(){}; eval(''); return g();
"
frame size: 10
parameter count: 1
bytecode array length: 67
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(4),
B(PushContext), R(1),
B(Ldar), R(this),
B(StaCurrentContextSlot), U8(3),
B(CreateMappedArguments),
B(StaCurrentContextSlot), U8(5),
B(Ldar), R(0),
B(StaCurrentContextSlot), U8(4),
/* 34 S> */ B(CreateClosure), U8(1), U8(0), U8(2),
/* 36 E> */ B(StaLookupSlot), U8(2), U8(0),
/* 52 S> */ B(LdaLookupGlobalSlot), U8(3), U8(0), U8(1),
B(Star2),
B(LdaConstant), U8(4),
B(Star3),
B(LdaZero),
B(Star7),
B(LdaSmi), I8(3),
B(Star8),
B(LdaSmi), I8(52),
B(Star9),
B(Mov), R(2), R(4),
B(Mov), R(3), R(5),
B(Mov), R(closure), R(6),
B(CallRuntime), U16(Runtime::kResolvePossiblyDirectEval), R(4), U8(6),
B(Star2),
/* 52 E> */ B(CallUndefinedReceiver1), R(2), R(3), U8(2),
/* 62 S> */ B(LdaLookupGlobalSlot), U8(2), U8(4), U8(1),
B(Star2),
/* 69 E> */ B(CallUndefinedReceiver0), R(2), U8(6),
/* 73 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["g"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["eval"],
INTERNALIZED_ONE_BYTE_STRING_TYPE [""],
]
handlers: [
]

View File

@ -0,0 +1,119 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: f
---
snippet: "
function bar() { this.value = 0; }
function f() { return new bar(); }
f();
"
frame size: 1
parameter count: 1
bytecode array length: 10
bytecodes: [
/* 50 S> */ B(LdaGlobal), U8(0), U8(0),
B(Star0),
/* 57 E> */ B(Construct), R(0), R(0), U8(0), U8(2),
/* 67 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["bar"],
]
handlers: [
]
---
snippet: "
function bar(x) { this.value = 18; this.x = x;}
function f() { return new bar(3); }
f();
"
frame size: 2
parameter count: 1
bytecode array length: 15
bytecodes: [
/* 63 S> */ B(LdaGlobal), U8(0), U8(0),
B(Star0),
B(LdaSmi), I8(3),
B(Star1),
B(Ldar), R(0),
/* 70 E> */ B(Construct), R(0), R(1), U8(1), U8(2),
/* 81 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["bar"],
]
handlers: [
]
---
snippet: "
function bar(w, x, y, z) {
this.value = 18;
this.x = x;
this.y = y;
this.z = z;
}
function f() { return new bar(3, 4, 5); }
f();
"
frame size: 4
parameter count: 1
bytecode array length: 21
bytecodes: [
/* 105 S> */ B(LdaGlobal), U8(0), U8(0),
B(Star0),
B(LdaSmi), I8(3),
B(Star1),
B(LdaSmi), I8(4),
B(Star2),
B(LdaSmi), I8(5),
B(Star3),
B(Ldar), R(0),
/* 112 E> */ B(Construct), R(0), R(1), U8(3), U8(2),
/* 129 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["bar"],
]
handlers: [
]
---
snippet: "
function f() { new class {}; }
f();
"
frame size: 5
parameter count: 1
bytecode array length: 33
bytecodes: [
/* 15 S> */ B(CreateBlockContext), U8(0),
B(PushContext), R(0),
B(LdaTheHole),
B(Star4),
B(CreateClosure), U8(2), U8(0), U8(2),
B(Star1),
B(LdaConstant), U8(1),
B(Star2),
B(Mov), R(1), R(3),
B(CallRuntime), U16(Runtime::kDefineClass), R(2), U8(3),
B(PopContext), R(0),
B(Ldar), R(3),
/* 15 E> */ B(Construct), R(3), R(0), U8(0), U8(0),
B(LdaUndefined),
/* 29 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]

View File

@ -0,0 +1,64 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: f
---
snippet: "
function f() { %TheHole() }
f();
"
frame size: 0
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 15 S> */ B(CallRuntime), U16(Runtime::kTheHole), R(0), U8(0),
B(LdaUndefined),
/* 26 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function f(a) { return %IsArray(a) }
f(undefined);
"
frame size: 0
parameter count: 2
bytecode array length: 6
bytecodes: [
/* 16 S> */ B(CallRuntime), U16(Runtime::kIsArray), R(arg0), U8(1),
/* 34 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function f() { return %Add(1, 2) }
f();
"
frame size: 2
parameter count: 1
bytecode array length: 12
bytecodes: [
/* 15 S> */ B(LdaSmi), I8(1),
B(Star0),
B(LdaSmi), I8(2),
B(Star1),
B(CallRuntime), U16(Runtime::kAdd), R(0), U8(2),
/* 32 S> */ B(Return),
]
constant pool: [
]
handlers: [
]

View File

@ -0,0 +1,164 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: test
---
snippet: "
var test;
(function() {
class A {
method() { return 2; }
}
class B extends A {
method() { return super.method() + 1; }
}
test = new B().method;
test();
})();
"
frame size: 1
parameter count: 1
bytecode array length: 16
bytecodes: [
/* 104 S> */ B(LdaImmutableCurrentContextSlot), U8(2),
/* 117 E> */ B(GetNamedPropertyFromSuper), R(this), U8(0), U8(1),
B(Star0),
/* 117 E> */ B(CallAnyReceiver), R(0), R(this), U8(1), U8(3),
/* 126 E> */ B(AddSmi), I8(1), U8(0),
/* 130 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["method"],
]
handlers: [
]
---
snippet: "
var test;
(function() {
class A {
get x() { return 1; }
set x(val) { return; }
}
class B extends A {
method() { super.x = 2; return super.x; }
}
test = new B().method;
test();
})();
"
frame size: 4
parameter count: 1
bytecode array length: 24
bytecodes: [
/* 130 S> */ B(LdaImmutableCurrentContextSlot), U8(2),
B(Star1),
B(LdaConstant), U8(0),
B(Star2),
B(LdaSmi), I8(2),
B(Star3),
B(Mov), R(this), R(0),
/* 138 E> */ B(CallRuntime), U16(Runtime::kStoreToSuper), R(0), U8(4),
/* 143 S> */ B(LdaImmutableCurrentContextSlot), U8(2),
/* 156 E> */ B(GetNamedPropertyFromSuper), R(this), U8(0), U8(0),
/* 158 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["x"],
]
handlers: [
]
---
snippet: "
var test;
(function() {
class A {
constructor(x) { this.x_ = x; }
}
class B extends A {
constructor() { super(1); this.y_ = 2; }
}
test = new B().constructor;
})();
"
frame size: 9
parameter count: 1
bytecode array length: 49
bytecodes: [
B(Mov), R(closure), R(1),
/* 118 S> */ B(LdaSmi), I8(1),
B(Star5),
/* 118 E> */ B(FindNonDefaultConstructorOrConstruct), R(1), R(0), R(7),
B(Ldar), R(7),
B(Mov), R(1), R(3),
B(Mov), R(0), R(6),
B(Mov), R(8), R(4),
B(JumpIfTrue), U8(12),
B(ThrowIfNotSuperConstructor), R(4),
B(Ldar), R(6),
/* 118 E> */ B(Construct), R(4), R(5), U8(1), U8(0),
B(Star4),
B(Ldar), R(this),
B(ThrowSuperAlreadyCalledIfNotHole),
B(Mov), R(4), R(this),
/* 128 S> */ B(LdaSmi), I8(2),
/* 136 E> */ B(SetNamedProperty), R(this), U8(0), U8(2),
B(Ldar), R(this),
B(ThrowSuperNotCalledIfHole),
/* 141 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["y_"],
]
handlers: [
]
---
snippet: "
var test;
(function() {
class A {
constructor() { this.x_ = 1; }
}
class B extends A {
constructor() { super(); this.y_ = 2; }
}
test = new B().constructor;
})();
"
frame size: 8
parameter count: 1
bytecode array length: 46
bytecodes: [
B(Mov), R(closure), R(1),
/* 117 S> */ B(FindNonDefaultConstructorOrConstruct), R(1), R(0), R(6),
B(Ldar), R(6),
B(Mov), R(1), R(3),
B(Mov), R(0), R(5),
B(Mov), R(7), R(4),
B(JumpIfTrue), U8(12),
B(ThrowIfNotSuperConstructor), R(4),
B(Ldar), R(5),
/* 117 E> */ B(Construct), R(4), R(0), U8(0), U8(0),
B(Star4),
B(Ldar), R(this),
B(ThrowSuperAlreadyCalledIfNotHole),
B(Mov), R(4), R(this),
/* 126 S> */ B(LdaSmi), I8(2),
/* 134 E> */ B(SetNamedProperty), R(this), U8(0), U8(2),
B(Ldar), R(this),
B(ThrowSuperNotCalledIfHole),
/* 139 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["y_"],
]
handlers: [
]

View File

@ -0,0 +1,231 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
class Person {
constructor(name) { this.name = name; }
speak() { console.log(this.name + ' is speaking.'); }
}
"
frame size: 7
parameter count: 1
bytecode array length: 34
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(1),
B(LdaTheHole),
B(Star5),
B(CreateClosure), U8(2), U8(0), U8(2),
B(Star2),
B(LdaConstant), U8(1),
B(Star3),
B(CreateClosure), U8(3), U8(1), U8(2),
B(Star6),
B(Mov), R(2), R(4),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(4),
B(PopContext), R(1),
B(Mov), R(4), R(0),
B(LdaUndefined),
/* 149 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
class person {
constructor(name) { this.name = name; }
speak() { console.log(this.name + ' is speaking.'); }
}
"
frame size: 7
parameter count: 1
bytecode array length: 34
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(1),
B(LdaTheHole),
B(Star5),
B(CreateClosure), U8(2), U8(0), U8(2),
B(Star2),
B(LdaConstant), U8(1),
B(Star3),
B(CreateClosure), U8(3), U8(1), U8(2),
B(Star6),
B(Mov), R(2), R(4),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(4),
B(PopContext), R(1),
B(Mov), R(4), R(0),
B(LdaUndefined),
/* 149 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
var n0 = 'a';
var n1 = 'b';
class N {
[n0]() { return n0; }
static [n1]() { return n1; }
}
"
frame size: 11
parameter count: 1
bytecode array length: 76
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(2),
B(PushContext), R(1),
/* 43 S> */ B(LdaConstant), U8(1),
/* 43 E> */ B(StaCurrentContextSlot), U8(2),
/* 57 S> */ B(LdaConstant), U8(2),
/* 57 E> */ B(StaCurrentContextSlot), U8(3),
B(CreateBlockContext), U8(3),
B(PushContext), R(2),
B(LdaTheHole),
B(Star6),
B(CreateClosure), U8(5), U8(0), U8(2),
B(Star3),
B(LdaConstant), U8(4),
B(Star4),
/* 75 S> */ B(LdaImmutableContextSlot), R(2), U8(2), U8(0),
B(ToName),
B(Star7),
B(CreateClosure), U8(6), U8(1), U8(2),
B(Star8),
/* 106 S> */ B(LdaImmutableContextSlot), R(2), U8(3), U8(0),
B(ToName),
B(Star9),
B(LdaConstant), U8(7),
B(TestEqualStrict), R(9), U8(0),
B(Mov), R(3), R(5),
B(JumpIfFalse), U8(7),
B(CallRuntime), U16(Runtime::kThrowStaticPrototypeError), R(0), U8(0),
B(CreateClosure), U8(8), U8(2), U8(2),
B(Star10),
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(7),
B(PopContext), R(2),
B(Mov), R(3), R(0),
B(LdaUndefined),
/* 129 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["a"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["b"],
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["prototype"],
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
var count = 0;
class C { constructor() { count++; }}
return new C();
"
frame size: 7
parameter count: 1
bytecode array length: 43
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(1),
/* 46 S> */ B(LdaZero),
/* 46 E> */ B(StaCurrentContextSlot), U8(2),
B(CreateBlockContext), U8(1),
B(PushContext), R(2),
B(LdaTheHole),
B(Star6),
B(CreateClosure), U8(3), U8(0), U8(2),
B(Star3),
B(LdaConstant), U8(2),
B(Star4),
B(Mov), R(3), R(5),
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(3),
B(PopContext), R(2),
B(Mov), R(5), R(0),
/* 87 S> */ B(Ldar), R(0),
/* 94 E> */ B(Construct), R(0), R(0), U8(0), U8(0),
/* 102 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
(class {})
class E { static name () {}}
"
frame size: 7
parameter count: 1
bytecode array length: 58
bytecodes: [
/* 34 S> */ B(CreateBlockContext), U8(0),
B(PushContext), R(1),
B(LdaTheHole),
B(Star5),
B(CreateClosure), U8(2), U8(0), U8(2),
B(Star2),
B(LdaConstant), U8(1),
B(Star3),
B(Mov), R(2), R(4),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(3),
B(PopContext), R(1),
B(CreateBlockContext), U8(3),
B(PushContext), R(1),
B(LdaTheHole),
B(Star5),
B(CreateClosure), U8(5), U8(1), U8(2),
B(Star2),
B(LdaConstant), U8(4),
B(Star3),
B(CreateClosure), U8(6), U8(2), U8(2),
B(Star6),
B(Mov), R(2), R(4),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(4),
B(PopContext), R(1),
B(Mov), R(4), R(0),
B(LdaUndefined),
/* 74 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]

View File

@ -0,0 +1,400 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
var a = 1;
return a === true;
"
frame size: 1
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(LdaTrue),
B(TestReferenceEqual), R(0),
/* 63 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = true;
return true === a;
"
frame size: 1
parameter count: 1
bytecode array length: 6
bytecodes: [
/* 42 S> */ B(LdaTrue),
B(Star0),
/* 48 S> */ B(LdaTrue),
B(TestReferenceEqual), R(0),
/* 66 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = false;
return true !== a;
"
frame size: 1
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 42 S> */ B(LdaFalse),
B(Star0),
/* 49 S> */ B(LdaTrue),
B(TestReferenceEqual), R(0),
/* 61 E> */ B(LogicalNot),
/* 67 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 1;
return true === a ? 1 : 2;
"
frame size: 1
parameter count: 1
bytecode array length: 15
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(LdaTrue),
B(TestReferenceEqual), R(0),
B(JumpIfFalse), U8(6),
B(LdaSmi), I8(1),
B(Jump), U8(4),
B(LdaSmi), I8(2),
/* 71 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = true;
return false === a ? 1 : 2;
"
frame size: 1
parameter count: 1
bytecode array length: 14
bytecodes: [
/* 42 S> */ B(LdaTrue),
B(Star0),
/* 48 S> */ B(LdaFalse),
B(TestReferenceEqual), R(0),
B(JumpIfFalse), U8(6),
B(LdaSmi), I8(1),
B(Jump), U8(4),
B(LdaSmi), I8(2),
/* 75 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 1;
return true !== a ? 1 : 2;
"
frame size: 1
parameter count: 1
bytecode array length: 15
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(LdaTrue),
B(TestReferenceEqual), R(0),
B(JumpIfTrue), U8(6),
B(LdaSmi), I8(1),
B(Jump), U8(4),
B(LdaSmi), I8(2),
/* 71 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = false;
return false !== null ? 1 : 2;
"
frame size: 2
parameter count: 1
bytecode array length: 16
bytecodes: [
/* 42 S> */ B(LdaFalse),
B(Star0),
/* 49 S> */ B(LdaNull),
B(Star1),
B(LdaFalse),
B(TestReferenceEqual), R(1),
B(JumpIfTrue), U8(6),
B(LdaSmi), I8(1),
B(Jump), U8(4),
B(LdaSmi), I8(2),
/* 79 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 0;
if (a !== true) {
return 1;
}
"
frame size: 1
parameter count: 1
bytecode array length: 12
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 45 S> */ B(LdaTrue),
B(TestReferenceEqual), R(0),
B(JumpIfTrue), U8(5),
/* 65 S> */ B(LdaSmi), I8(1),
/* 74 S> */ B(Return),
B(LdaUndefined),
/* 77 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = true;
var b = 0;
while (a !== true) {
b++;
}
"
frame size: 2
parameter count: 1
bytecode array length: 20
bytecodes: [
/* 42 S> */ B(LdaTrue),
B(Star0),
/* 56 S> */ B(LdaZero),
B(Star1),
/* 68 S> */ B(LdaTrue),
B(TestReferenceEqual), R(0),
B(JumpIfTrue), U8(11),
/* 82 S> */ B(Ldar), R(1),
B(Inc), U8(0),
B(Star1),
/* 59 E> */ B(JumpLoop), U8(10), I8(0), U8(1),
B(LdaUndefined),
/* 89 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
(0 === true) ? 1 : 2;
"
frame size: 1
parameter count: 1
bytecode array length: 15
bytecodes: [
/* 34 S> */ B(LdaZero),
B(Star0),
B(LdaTrue),
B(TestReferenceEqual), R(0),
B(JumpIfFalse), U8(6),
B(LdaSmi), I8(1),
B(Jump), U8(4),
B(LdaSmi), I8(2),
B(LdaUndefined),
/* 56 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
(0 !== true) ? 1 : 2;
"
frame size: 1
parameter count: 1
bytecode array length: 15
bytecodes: [
/* 34 S> */ B(LdaZero),
B(Star0),
B(LdaTrue),
B(TestReferenceEqual), R(0),
B(JumpIfTrue), U8(6),
B(LdaSmi), I8(1),
B(Jump), U8(4),
B(LdaSmi), I8(2),
B(LdaUndefined),
/* 56 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
(false === 0) ? 1 : 2;
"
frame size: 1
parameter count: 1
bytecode array length: 15
bytecodes: [
/* 34 S> */ B(LdaZero),
B(Star0),
B(LdaFalse),
B(TestReferenceEqual), R(0),
B(JumpIfFalse), U8(6),
B(LdaSmi), I8(1),
B(Jump), U8(4),
B(LdaSmi), I8(2),
B(LdaUndefined),
/* 57 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
(0 === true || 0 === false) ? 1 : 2;
"
frame size: 1
parameter count: 1
bytecode array length: 22
bytecodes: [
/* 34 S> */ B(LdaZero),
B(Star0),
B(LdaTrue),
B(TestReferenceEqual), R(0),
B(JumpIfTrue), U8(9),
B(LdaZero),
B(Star0),
B(LdaFalse),
B(TestReferenceEqual), R(0),
B(JumpIfFalse), U8(6),
B(LdaSmi), I8(1),
B(Jump), U8(4),
B(LdaSmi), I8(2),
B(LdaUndefined),
/* 71 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
if (0 === true || 0 === false) return 1;
"
frame size: 1
parameter count: 1
bytecode array length: 19
bytecodes: [
/* 34 S> */ B(LdaZero),
B(Star0),
B(LdaTrue),
B(TestReferenceEqual), R(0),
B(JumpIfTrue), U8(9),
B(LdaZero),
B(Star0),
B(LdaFalse),
B(TestReferenceEqual), R(0),
B(JumpIfFalse), U8(5),
/* 65 S> */ B(LdaSmi), I8(1),
/* 74 S> */ B(Return),
B(LdaUndefined),
/* 75 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
if (!('false' === false)) return 1;
"
frame size: 1
parameter count: 1
bytecode array length: 13
bytecodes: [
/* 34 S> */ B(LdaConstant), U8(0),
B(Star0),
B(LdaFalse),
B(TestReferenceEqual), R(0),
B(JumpIfTrue), U8(5),
/* 60 S> */ B(LdaSmi), I8(1),
/* 69 S> */ B(Return),
B(LdaUndefined),
/* 70 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["false"],
]
handlers: [
]
---
snippet: "
if (!('false' !== false)) return 1;
"
frame size: 1
parameter count: 1
bytecode array length: 13
bytecodes: [
/* 34 S> */ B(LdaConstant), U8(0),
B(Star0),
B(LdaFalse),
B(TestReferenceEqual), R(0),
B(JumpIfFalse), U8(5),
/* 60 S> */ B(LdaSmi), I8(1),
/* 69 S> */ B(Return),
B(LdaUndefined),
/* 70 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["false"],
]
handlers: [
]

View File

@ -0,0 +1,274 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
var a = 1;
return a === null;
"
frame size: 1
parameter count: 1
bytecode array length: 5
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(TestNull),
/* 63 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = undefined;
return undefined === a;
"
frame size: 1
parameter count: 1
bytecode array length: 4
bytecodes: [
/* 42 S> */ B(LdaUndefined),
B(Star0),
/* 53 S> */ B(TestUndefined),
/* 76 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = undefined;
return undefined !== a;
"
frame size: 1
parameter count: 1
bytecode array length: 5
bytecodes: [
/* 42 S> */ B(LdaUndefined),
B(Star0),
/* 53 S> */ B(TestUndefined),
/* 70 E> */ B(LogicalNot),
/* 76 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 2;
return a != null;
"
frame size: 1
parameter count: 1
bytecode array length: 6
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 45 S> */ B(TestUndetectable),
/* 54 E> */ B(LogicalNot),
/* 62 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = undefined;
return undefined == a;
"
frame size: 1
parameter count: 1
bytecode array length: 4
bytecodes: [
/* 42 S> */ B(LdaUndefined),
B(Star0),
/* 53 S> */ B(TestUndetectable),
/* 75 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = undefined;
return undefined === a ? 1 : 2;
"
frame size: 1
parameter count: 1
bytecode array length: 11
bytecodes: [
/* 42 S> */ B(LdaUndefined),
B(Star0),
/* 53 S> */ B(JumpIfNotUndefined), U8(6),
B(LdaSmi), I8(1),
B(Jump), U8(4),
B(LdaSmi), I8(2),
/* 84 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 0;
return null == a ? 1 : 2;
"
frame size: 1
parameter count: 1
bytecode array length: 12
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 45 S> */ B(TestUndetectable),
B(JumpIfFalse), U8(6),
B(LdaSmi), I8(1),
B(Jump), U8(4),
B(LdaSmi), I8(2),
/* 70 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 0;
return undefined !== a ? 1 : 2;
"
frame size: 1
parameter count: 1
bytecode array length: 11
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 45 S> */ B(JumpIfUndefined), U8(6),
B(LdaSmi), I8(1),
B(Jump), U8(4),
B(LdaSmi), I8(2),
/* 76 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 0;
return a === null ? 1 : 2;
"
frame size: 1
parameter count: 1
bytecode array length: 11
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 45 S> */ B(JumpIfNotNull), U8(6),
B(LdaSmi), I8(1),
B(Jump), U8(4),
B(LdaSmi), I8(2),
/* 71 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 0;
if (a === null) {
return 1;
} else {
return 2;
}
"
frame size: 1
parameter count: 1
bytecode array length: 10
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 45 S> */ B(JumpIfNotNull), U8(5),
/* 65 S> */ B(LdaSmi), I8(1),
/* 74 S> */ B(Return),
/* 86 S> */ B(LdaSmi), I8(2),
/* 95 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 0;
if (a != undefined) {
return 1;
}
"
frame size: 1
parameter count: 1
bytecode array length: 10
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 45 S> */ B(TestUndetectable),
B(JumpIfTrue), U8(5),
/* 69 S> */ B(LdaSmi), I8(1),
/* 78 S> */ B(Return),
B(LdaUndefined),
/* 81 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = undefined;
var b = 0;
while (a !== undefined) {
b++;
}
"
frame size: 2
parameter count: 1
bytecode array length: 19
bytecodes: [
/* 42 S> */ B(LdaUndefined),
B(Star0),
/* 61 S> */ B(LdaZero),
B(Star1),
/* 73 S> */ B(Ldar), R(0),
B(JumpIfUndefined), U8(11),
/* 92 S> */ B(Ldar), R(1),
B(Inc), U8(0),
B(Star1),
/* 64 E> */ B(JumpLoop), U8(9), I8(0), U8(1),
B(LdaUndefined),
/* 99 S> */ B(Return),
]
constant pool: [
]
handlers: [
]

View File

@ -0,0 +1,92 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
return typeof(1) === 'number';
"
frame size: 0
parameter count: 1
bytecode array length: 5
bytecodes: [
/* 34 S> */ B(LdaSmi), I8(1),
B(TestTypeOf), U8(0),
/* 64 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
return 'string' === typeof('foo');
"
frame size: 0
parameter count: 1
bytecode array length: 5
bytecodes: [
/* 34 S> */ B(LdaConstant), U8(0),
B(TestTypeOf), U8(1),
/* 68 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["foo"],
]
handlers: [
]
---
snippet: "
return typeof(true) == 'boolean';
"
frame size: 0
parameter count: 1
bytecode array length: 4
bytecodes: [
/* 34 S> */ B(LdaTrue),
B(TestTypeOf), U8(3),
/* 67 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
return 'string' === typeof(undefined);
"
frame size: 0
parameter count: 1
bytecode array length: 4
bytecodes: [
/* 34 S> */ B(LdaUndefined),
B(TestTypeOf), U8(1),
/* 72 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
return 'unknown' === typeof(undefined);
"
frame size: 0
parameter count: 1
bytecode array length: 2
bytecodes: [
/* 34 S> */ B(LdaFalse),
/* 73 S> */ B(Return),
]
constant pool: [
]
handlers: [
]

View File

@ -0,0 +1,120 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
var a = 1; a += 2;
"
frame size: 1
parameter count: 1
bytecode array length: 9
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(AddSmi), I8(2), U8(0),
B(Star0),
B(LdaUndefined),
/* 53 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 1; a /= 2;
"
frame size: 1
parameter count: 1
bytecode array length: 9
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(DivSmi), I8(2), U8(0),
B(Star0),
B(LdaUndefined),
/* 53 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = { val: 2 }; a.name *= 2;
"
frame size: 1
parameter count: 1
bytecode array length: 18
bytecodes: [
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star0),
/* 54 S> */ B(GetNamedProperty), R(0), U8(1), U8(1),
B(MulSmi), I8(2), U8(3),
/* 61 E> */ B(SetNamedProperty), R(0), U8(1), U8(4),
B(LdaUndefined),
/* 67 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name"],
]
handlers: [
]
---
snippet: "
var a = { 1: 2 }; a[1] ^= 2;
"
frame size: 3
parameter count: 1
bytecode array length: 20
bytecodes: [
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star0),
/* 52 S> */ B(LdaSmi), I8(1),
B(Star2),
B(GetKeyedProperty), R(0), U8(1),
B(BitwiseXorSmi), I8(2), U8(3),
/* 57 E> */ B(SetKeyedProperty), R(0), R(2), U8(4),
B(LdaUndefined),
/* 63 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
var a = 1; (function f() { return a; }); a |= 24;
"
frame size: 1
parameter count: 1
bytecode array length: 22
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(0),
/* 42 S> */ B(LdaSmi), I8(1),
/* 42 E> */ B(StaCurrentContextSlot), U8(2),
/* 45 S> */ B(CreateClosure), U8(1), U8(0), U8(2),
/* 75 S> */ B(LdaCurrentContextSlot), U8(2),
B(BitwiseOrSmi), I8(24), U8(0),
/* 77 E> */ B(StaCurrentContextSlot), U8(2),
B(LdaUndefined),
/* 84 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]

View File

@ -0,0 +1,84 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
return 1 ? 2 : 3;
"
frame size: 0
parameter count: 1
bytecode array length: 3
bytecodes: [
/* 34 S> */ B(LdaSmi), I8(2),
/* 51 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
return 1 ? 2 ? 3 : 4 : 5;
"
frame size: 0
parameter count: 1
bytecode array length: 3
bytecodes: [
/* 34 S> */ B(LdaSmi), I8(3),
/* 59 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
return 0 < 1 ? 2 : 3;
"
frame size: 1
parameter count: 1
bytecode array length: 16
bytecodes: [
/* 34 S> */ B(LdaZero),
B(Star0),
B(LdaSmi), I8(1),
/* 43 E> */ B(TestLessThan), R(0), U8(0),
B(JumpIfFalse), U8(6),
B(LdaSmi), I8(2),
B(Jump), U8(4),
B(LdaSmi), I8(3),
/* 55 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0;
return x ? 2 : 3;
"
frame size: 1
parameter count: 1
bytecode array length: 11
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 45 S> */ B(JumpIfToBooleanFalse), U8(6),
B(LdaSmi), I8(2),
B(Jump), U8(4),
B(LdaSmi), I8(3),
/* 62 S> */ B(Return),
]
constant pool: [
]
handlers: [
]

View File

@ -0,0 +1,87 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
const x = 10;
"
frame size: 1
parameter count: 1
bytecode array length: 5
bytecodes: [
/* 44 S> */ B(LdaSmi), I8(10),
B(Star0),
B(LdaUndefined),
/* 48 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
const x = 10; return x;
"
frame size: 1
parameter count: 1
bytecode array length: 4
bytecodes: [
/* 44 S> */ B(LdaSmi), I8(10),
B(Star0),
/* 57 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
const x = ( x = 20);
"
frame size: 2
parameter count: 1
bytecode array length: 17
bytecodes: [
B(LdaTheHole),
B(Star0),
/* 44 S> */ B(LdaSmi), I8(20),
B(Star1),
B(Ldar), R(0),
/* 48 E> */ B(ThrowReferenceErrorIfHole), U8(0),
B(CallRuntime), U16(Runtime::kThrowConstAssignError), R(0), U8(0),
B(Star0),
B(LdaUndefined),
/* 55 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["x"],
]
handlers: [
]
---
snippet: "
const x = 10; x = 20;
"
frame size: 1
parameter count: 1
bytecode array length: 12
bytecodes: [
/* 44 S> */ B(LdaSmi), I8(10),
B(Star0),
/* 48 S> */ B(LdaSmi), I8(20),
/* 50 E> */ B(CallRuntime), U16(Runtime::kThrowConstAssignError), R(0), U8(0),
B(LdaUndefined),
/* 56 S> */ B(Return),
]
constant pool: [
]
handlers: [
]

View File

@ -0,0 +1,106 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
const x = 10; function f1() {return x;}
"
frame size: 1
parameter count: 1
bytecode array length: 14
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(0),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
/* 44 S> */ B(LdaSmi), I8(10),
/* 44 E> */ B(StaCurrentContextSlot), U8(2),
B(LdaUndefined),
/* 74 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
]
handlers: [
]
---
snippet: "
const x = 10; function f1() {return x;} return x;
"
frame size: 1
parameter count: 1
bytecode array length: 15
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(0),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
/* 44 S> */ B(LdaSmi), I8(10),
/* 44 E> */ B(StaCurrentContextSlot), U8(2),
/* 74 S> */ B(LdaImmutableCurrentContextSlot), U8(2),
/* 83 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
]
handlers: [
]
---
snippet: "
const x = (x = 20); function f1() {return x;}
"
frame size: 2
parameter count: 1
bytecode array length: 24
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(0),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
/* 44 S> */ B(LdaSmi), I8(20),
B(Star1),
B(LdaCurrentContextSlot), U8(2),
/* 47 E> */ B(ThrowReferenceErrorIfHole), U8(1),
B(CallRuntime), U16(Runtime::kThrowConstAssignError), R(0), U8(0),
/* 44 E> */ B(StaCurrentContextSlot), U8(2),
B(LdaUndefined),
/* 80 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["x"],
]
handlers: [
]
---
snippet: "
const x = 10; x = 20; function f1() {return x;}
"
frame size: 1
parameter count: 1
bytecode array length: 21
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(0),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
/* 44 S> */ B(LdaSmi), I8(10),
/* 44 E> */ B(StaCurrentContextSlot), U8(2),
/* 48 S> */ B(LdaSmi), I8(20),
/* 50 E> */ B(CallRuntime), U16(Runtime::kThrowConstAssignError), R(0), U8(0),
B(LdaUndefined),
/* 82 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
]
handlers: [
]

View File

@ -0,0 +1,104 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: f
---
snippet: "
function f(arg1) { return function() { arg1 = 2; }; }
f();
"
frame size: 1
parameter count: 2
bytecode array length: 14
bytecodes: [
/* 10 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(0),
B(Ldar), R(arg0),
B(StaCurrentContextSlot), U8(2),
/* 19 S> */ B(CreateClosure), U8(1), U8(0), U8(2),
/* 51 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
function f(arg1) { var a = function() { arg1 = 2; }; return arg1; }
f();
"
frame size: 2
parameter count: 2
bytecode array length: 17
bytecodes: [
/* 10 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(1),
B(Ldar), R(arg0),
B(StaCurrentContextSlot), U8(2),
/* 27 S> */ B(CreateClosure), U8(1), U8(0), U8(2),
B(Star0),
/* 53 S> */ B(LdaCurrentContextSlot), U8(2),
/* 65 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
function f(a1, a2, a3, a4) { return function() { a1 = a3; }; }
f();
"
frame size: 1
parameter count: 5
bytecode array length: 18
bytecodes: [
/* 10 E> */ B(CreateFunctionContext), U8(0), U8(2),
B(PushContext), R(0),
B(Ldar), R(arg0),
B(StaCurrentContextSlot), U8(3),
B(Ldar), R(arg2),
B(StaCurrentContextSlot), U8(2),
/* 29 S> */ B(CreateClosure), U8(1), U8(0), U8(2),
/* 60 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
function f() { var self = this; return function() { self = 2; }; }
f();
"
frame size: 1
parameter count: 1
bytecode array length: 14
bytecodes: [
/* 10 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(0),
/* 26 S> */ B(Ldar), R(this),
/* 26 E> */ B(StaCurrentContextSlot), U8(2),
/* 32 S> */ B(CreateClosure), U8(1), U8(0), U8(2),
/* 64 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]

View File

@ -0,0 +1,919 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
var a; return function() { a = 1; };
"
frame size: 1
parameter count: 1
bytecode array length: 10
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(0),
/* 41 S> */ B(CreateClosure), U8(1), U8(0), U8(2),
/* 70 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
var a = 1; return function() { a = 2; };
"
frame size: 1
parameter count: 1
bytecode array length: 14
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(0),
/* 42 S> */ B(LdaSmi), I8(1),
/* 42 E> */ B(StaCurrentContextSlot), U8(2),
/* 45 S> */ B(CreateClosure), U8(1), U8(0), U8(2),
/* 74 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
var a = 1; var b = 2; return function() { a = 2; b = 3 };
"
frame size: 1
parameter count: 1
bytecode array length: 18
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(2),
B(PushContext), R(0),
/* 42 S> */ B(LdaSmi), I8(1),
/* 42 E> */ B(StaCurrentContextSlot), U8(2),
/* 53 S> */ B(LdaSmi), I8(2),
/* 53 E> */ B(StaCurrentContextSlot), U8(3),
/* 56 S> */ B(CreateClosure), U8(1), U8(0), U8(2),
/* 91 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
var a; (function() { a = 2; })(); return a;
"
frame size: 2
parameter count: 1
bytecode array length: 16
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(0),
/* 41 S> */ B(CreateClosure), U8(1), U8(0), U8(2),
B(Star1),
/* 64 E> */ B(CallUndefinedReceiver0), R(1), U8(0),
/* 68 S> */ B(LdaCurrentContextSlot), U8(2),
/* 77 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
'use strict';
let a = 1;
{ let b = 2; return function() { a + b; }; }
"
frame size: 2
parameter count: 1
bytecode array length: 28
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(0),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
/* 56 S> */ B(LdaSmi), I8(1),
/* 56 E> */ B(StaCurrentContextSlot), U8(2),
B(CreateBlockContext), U8(1),
B(PushContext), R(1),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
/* 69 S> */ B(LdaSmi), I8(2),
/* 69 E> */ B(StaCurrentContextSlot), U8(2),
/* 72 S> */ B(CreateClosure), U8(2), U8(0), U8(2),
/* 101 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
SCOPE_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
'use strict';
var a896 = 0;
var a897 = 0;
var a898 = 0;
var a899 = 0;
var a900 = 0;
var a901 = 0;
var a902 = 0;
var a903 = 0;
var a904 = 0;
var a905 = 0;
var a906 = 0;
var a907 = 0;
var a908 = 0;
var a909 = 0;
var a910 = 0;
var a911 = 0;
var a912 = 0;
var a913 = 0;
var a914 = 0;
var a915 = 0;
var a916 = 0;
var a917 = 0;
var a918 = 0;
var a919 = 0;
var a920 = 0;
var a921 = 0;
var a922 = 0;
var a923 = 0;
var a924 = 0;
var a925 = 0;
var a926 = 0;
var a927 = 0;
var a928 = 0;
var a929 = 0;
var a930 = 0;
var a931 = 0;
var a932 = 0;
var a933 = 0;
var a934 = 0;
var a935 = 0;
var a936 = 0;
var a937 = 0;
var a938 = 0;
var a939 = 0;
var a940 = 0;
var a941 = 0;
var a942 = 0;
var a943 = 0;
var a944 = 0;
var a945 = 0;
var a946 = 0;
var a947 = 0;
var a948 = 0;
var a949 = 0;
var a950 = 0;
var a951 = 0;
var a952 = 0;
var a953 = 0;
var a954 = 0;
var a955 = 0;
var a956 = 0;
var a957 = 0;
var a958 = 0;
var a959 = 0;
var a960 = 0;
var a961 = 0;
var a962 = 0;
var a963 = 0;
var a964 = 0;
var a965 = 0;
var a966 = 0;
var a967 = 0;
var a968 = 0;
var a969 = 0;
var a970 = 0;
var a971 = 0;
var a972 = 0;
var a973 = 0;
var a974 = 0;
var a975 = 0;
var a976 = 0;
var a977 = 0;
var a978 = 0;
var a979 = 0;
var a980 = 0;
var a981 = 0;
var a982 = 0;
var a983 = 0;
var a984 = 0;
var a985 = 0;
var a986 = 0;
var a987 = 0;
var a988 = 0;
var a989 = 0;
var a990 = 0;
var a991 = 0;
var a992 = 0;
var a993 = 0;
var a994 = 0;
var a995 = 0;
var a996 = 0;
var a997 = 0;
var a998 = 0;
var a999 = 0;
var a1000 = 0;
var a1001 = 0;
var a1002 = 0;
var a1003 = 0;
var a1004 = 0;
var a1005 = 0;
var a1006 = 0;
var a1007 = 0;
var a1008 = 0;
var a1009 = 0;
var a1010 = 0;
var a1011 = 0;
var a1012 = 0;
var a1013 = 0;
var a1014 = 0;
var a1015 = 0;
var a1016 = 0;
var a1017 = 0;
var a1018 = 0;
var a1019 = 0;
var a1020 = 0;
var a1021 = 0;
var a1022 = 0;
var a1023 = 0;
var a1024 = 0;
var a1025 = 0;
var a1026 = 0;
var a1027 = 0;
var a1028 = 0;
var a1029 = 0;
var a1030 = 0;
var a1031 = 0;
var a1032 = 0;
var a1033 = 0;
var a1034 = 0;
var a1035 = 0;
var a1036 = 0;
var a1037 = 0;
var a1038 = 0;
var a1039 = 0;
var a1040 = 0;
var a1041 = 0;
var a1042 = 0;
var a1043 = 0;
var a1044 = 0;
var a1045 = 0;
var a1046 = 0;
var a1047 = 0;
var a1048 = 0;
var a1049 = 0;
var a1050 = 0;
var a1051 = 0;
var a1052 = 0;
var a1053 = 0;
var a1054 = 0;
var a1055 = 0;
var a1056 = 0;
var a1057 = 0;
var a1058 = 0;
var a1059 = 0;
var a1060 = 0;
var a1061 = 0;
var a1062 = 0;
var a1063 = 0;
var a1064 = 0;
var a1065 = 0;
var a1066 = 0;
var a1067 = 0;
var a1068 = 0;
var a1069 = 0;
var a1070 = 0;
var a1071 = 0;
var a1072 = 0;
var a1073 = 0;
var a1074 = 0;
var a1075 = 0;
var a1076 = 0;
var a1077 = 0;
var a1078 = 0;
var a1079 = 0;
var a1080 = 0;
var a1081 = 0;
var a1082 = 0;
var a1083 = 0;
var a1084 = 0;
var a1085 = 0;
var a1086 = 0;
var a1087 = 0;
var a1088 = 0;
var a1089 = 0;
var a1090 = 0;
var a1091 = 0;
var a1092 = 0;
var a1093 = 0;
var a1094 = 0;
var a1095 = 0;
var a1096 = 0;
var a1097 = 0;
var a1098 = 0;
var a1099 = 0;
var a1100 = 0;
var a1101 = 0;
var a1102 = 0;
var a1103 = 0;
var a1104 = 0;
var a1105 = 0;
var a1106 = 0;
var a1107 = 0;
var a1108 = 0;
var a1109 = 0;
var a1110 = 0;
var a1111 = 0;
var a1112 = 0;
var a1113 = 0;
var a1114 = 0;
var a1115 = 0;
var a1116 = 0;
var a1117 = 0;
var a1118 = 0;
var a1119 = 0;
var a1120 = 0;
var a1121 = 0;
var a1122 = 0;
var a1123 = 0;
var a1124 = 0;
var a1125 = 0;
var a1126 = 0;
var a1127 = 0;
var a1128 = 0;
var a1129 = 0;
var a1130 = 0;
var a1131 = 0;
var a1132 = 0;
var a1133 = 0;
var a1134 = 0;
var a1135 = 0;
var a1136 = 0;
var a1137 = 0;
var a1138 = 0;
var a1139 = 0;
var a1140 = 0;
var a1141 = 0;
var a1142 = 0;
var a1143 = 0;
var a1144 = 0;
var a1145 = 0;
var a1146 = 0;
var a1147 = 0;
eval();
var b = 100;
return b
"
frame size: 3
parameter count: 1
bytecode array length: 795
bytecodes: [
/* 30 E> */ B(Wide), B(CreateFunctionContext), U16(0), U16(256),
B(PushContext), R(1),
B(Ldar), R(this),
B(StaCurrentContextSlot), U8(2),
B(CreateUnmappedArguments),
B(Wide), B(StaCurrentContextSlot), U16(257),
B(Ldar), R(0),
B(StaCurrentContextSlot), U8(3),
/* 59 S> */ B(LdaZero),
/* 59 E> */ B(StaCurrentContextSlot), U8(4),
/* 73 S> */ B(LdaZero),
/* 73 E> */ B(StaCurrentContextSlot), U8(5),
/* 87 S> */ B(LdaZero),
/* 87 E> */ B(StaCurrentContextSlot), U8(6),
/* 101 S> */ B(LdaZero),
/* 101 E> */ B(StaCurrentContextSlot), U8(7),
/* 115 S> */ B(LdaZero),
/* 115 E> */ B(StaCurrentContextSlot), U8(8),
/* 129 S> */ B(LdaZero),
/* 129 E> */ B(StaCurrentContextSlot), U8(9),
/* 143 S> */ B(LdaZero),
/* 143 E> */ B(StaCurrentContextSlot), U8(10),
/* 157 S> */ B(LdaZero),
/* 157 E> */ B(StaCurrentContextSlot), U8(11),
/* 171 S> */ B(LdaZero),
/* 171 E> */ B(StaCurrentContextSlot), U8(12),
/* 185 S> */ B(LdaZero),
/* 185 E> */ B(StaCurrentContextSlot), U8(13),
/* 199 S> */ B(LdaZero),
/* 199 E> */ B(StaCurrentContextSlot), U8(14),
/* 213 S> */ B(LdaZero),
/* 213 E> */ B(StaCurrentContextSlot), U8(15),
/* 227 S> */ B(LdaZero),
/* 227 E> */ B(StaCurrentContextSlot), U8(16),
/* 241 S> */ B(LdaZero),
/* 241 E> */ B(StaCurrentContextSlot), U8(17),
/* 255 S> */ B(LdaZero),
/* 255 E> */ B(StaCurrentContextSlot), U8(18),
/* 269 S> */ B(LdaZero),
/* 269 E> */ B(StaCurrentContextSlot), U8(19),
/* 283 S> */ B(LdaZero),
/* 283 E> */ B(StaCurrentContextSlot), U8(20),
/* 297 S> */ B(LdaZero),
/* 297 E> */ B(StaCurrentContextSlot), U8(21),
/* 311 S> */ B(LdaZero),
/* 311 E> */ B(StaCurrentContextSlot), U8(22),
/* 325 S> */ B(LdaZero),
/* 325 E> */ B(StaCurrentContextSlot), U8(23),
/* 339 S> */ B(LdaZero),
/* 339 E> */ B(StaCurrentContextSlot), U8(24),
/* 353 S> */ B(LdaZero),
/* 353 E> */ B(StaCurrentContextSlot), U8(25),
/* 367 S> */ B(LdaZero),
/* 367 E> */ B(StaCurrentContextSlot), U8(26),
/* 381 S> */ B(LdaZero),
/* 381 E> */ B(StaCurrentContextSlot), U8(27),
/* 395 S> */ B(LdaZero),
/* 395 E> */ B(StaCurrentContextSlot), U8(28),
/* 409 S> */ B(LdaZero),
/* 409 E> */ B(StaCurrentContextSlot), U8(29),
/* 423 S> */ B(LdaZero),
/* 423 E> */ B(StaCurrentContextSlot), U8(30),
/* 437 S> */ B(LdaZero),
/* 437 E> */ B(StaCurrentContextSlot), U8(31),
/* 451 S> */ B(LdaZero),
/* 451 E> */ B(StaCurrentContextSlot), U8(32),
/* 465 S> */ B(LdaZero),
/* 465 E> */ B(StaCurrentContextSlot), U8(33),
/* 479 S> */ B(LdaZero),
/* 479 E> */ B(StaCurrentContextSlot), U8(34),
/* 493 S> */ B(LdaZero),
/* 493 E> */ B(StaCurrentContextSlot), U8(35),
/* 507 S> */ B(LdaZero),
/* 507 E> */ B(StaCurrentContextSlot), U8(36),
/* 521 S> */ B(LdaZero),
/* 521 E> */ B(StaCurrentContextSlot), U8(37),
/* 535 S> */ B(LdaZero),
/* 535 E> */ B(StaCurrentContextSlot), U8(38),
/* 549 S> */ B(LdaZero),
/* 549 E> */ B(StaCurrentContextSlot), U8(39),
/* 563 S> */ B(LdaZero),
/* 563 E> */ B(StaCurrentContextSlot), U8(40),
/* 577 S> */ B(LdaZero),
/* 577 E> */ B(StaCurrentContextSlot), U8(41),
/* 591 S> */ B(LdaZero),
/* 591 E> */ B(StaCurrentContextSlot), U8(42),
/* 605 S> */ B(LdaZero),
/* 605 E> */ B(StaCurrentContextSlot), U8(43),
/* 619 S> */ B(LdaZero),
/* 619 E> */ B(StaCurrentContextSlot), U8(44),
/* 633 S> */ B(LdaZero),
/* 633 E> */ B(StaCurrentContextSlot), U8(45),
/* 647 S> */ B(LdaZero),
/* 647 E> */ B(StaCurrentContextSlot), U8(46),
/* 661 S> */ B(LdaZero),
/* 661 E> */ B(StaCurrentContextSlot), U8(47),
/* 675 S> */ B(LdaZero),
/* 675 E> */ B(StaCurrentContextSlot), U8(48),
/* 689 S> */ B(LdaZero),
/* 689 E> */ B(StaCurrentContextSlot), U8(49),
/* 703 S> */ B(LdaZero),
/* 703 E> */ B(StaCurrentContextSlot), U8(50),
/* 717 S> */ B(LdaZero),
/* 717 E> */ B(StaCurrentContextSlot), U8(51),
/* 731 S> */ B(LdaZero),
/* 731 E> */ B(StaCurrentContextSlot), U8(52),
/* 745 S> */ B(LdaZero),
/* 745 E> */ B(StaCurrentContextSlot), U8(53),
/* 759 S> */ B(LdaZero),
/* 759 E> */ B(StaCurrentContextSlot), U8(54),
/* 773 S> */ B(LdaZero),
/* 773 E> */ B(StaCurrentContextSlot), U8(55),
/* 787 S> */ B(LdaZero),
/* 787 E> */ B(StaCurrentContextSlot), U8(56),
/* 801 S> */ B(LdaZero),
/* 801 E> */ B(StaCurrentContextSlot), U8(57),
/* 815 S> */ B(LdaZero),
/* 815 E> */ B(StaCurrentContextSlot), U8(58),
/* 829 S> */ B(LdaZero),
/* 829 E> */ B(StaCurrentContextSlot), U8(59),
/* 843 S> */ B(LdaZero),
/* 843 E> */ B(StaCurrentContextSlot), U8(60),
/* 857 S> */ B(LdaZero),
/* 857 E> */ B(StaCurrentContextSlot), U8(61),
/* 871 S> */ B(LdaZero),
/* 871 E> */ B(StaCurrentContextSlot), U8(62),
/* 885 S> */ B(LdaZero),
/* 885 E> */ B(StaCurrentContextSlot), U8(63),
/* 899 S> */ B(LdaZero),
/* 899 E> */ B(StaCurrentContextSlot), U8(64),
/* 913 S> */ B(LdaZero),
/* 913 E> */ B(StaCurrentContextSlot), U8(65),
/* 927 S> */ B(LdaZero),
/* 927 E> */ B(StaCurrentContextSlot), U8(66),
/* 941 S> */ B(LdaZero),
/* 941 E> */ B(StaCurrentContextSlot), U8(67),
/* 955 S> */ B(LdaZero),
/* 955 E> */ B(StaCurrentContextSlot), U8(68),
/* 969 S> */ B(LdaZero),
/* 969 E> */ B(StaCurrentContextSlot), U8(69),
/* 983 S> */ B(LdaZero),
/* 983 E> */ B(StaCurrentContextSlot), U8(70),
/* 997 S> */ B(LdaZero),
/* 997 E> */ B(StaCurrentContextSlot), U8(71),
/* 1011 S> */ B(LdaZero),
/* 1011 E> */ B(StaCurrentContextSlot), U8(72),
/* 1025 S> */ B(LdaZero),
/* 1025 E> */ B(StaCurrentContextSlot), U8(73),
/* 1039 S> */ B(LdaZero),
/* 1039 E> */ B(StaCurrentContextSlot), U8(74),
/* 1053 S> */ B(LdaZero),
/* 1053 E> */ B(StaCurrentContextSlot), U8(75),
/* 1067 S> */ B(LdaZero),
/* 1067 E> */ B(StaCurrentContextSlot), U8(76),
/* 1081 S> */ B(LdaZero),
/* 1081 E> */ B(StaCurrentContextSlot), U8(77),
/* 1095 S> */ B(LdaZero),
/* 1095 E> */ B(StaCurrentContextSlot), U8(78),
/* 1109 S> */ B(LdaZero),
/* 1109 E> */ B(StaCurrentContextSlot), U8(79),
/* 1123 S> */ B(LdaZero),
/* 1123 E> */ B(StaCurrentContextSlot), U8(80),
/* 1137 S> */ B(LdaZero),
/* 1137 E> */ B(StaCurrentContextSlot), U8(81),
/* 1151 S> */ B(LdaZero),
/* 1151 E> */ B(StaCurrentContextSlot), U8(82),
/* 1165 S> */ B(LdaZero),
/* 1165 E> */ B(StaCurrentContextSlot), U8(83),
/* 1179 S> */ B(LdaZero),
/* 1179 E> */ B(StaCurrentContextSlot), U8(84),
/* 1193 S> */ B(LdaZero),
/* 1193 E> */ B(StaCurrentContextSlot), U8(85),
/* 1207 S> */ B(LdaZero),
/* 1207 E> */ B(StaCurrentContextSlot), U8(86),
/* 1221 S> */ B(LdaZero),
/* 1221 E> */ B(StaCurrentContextSlot), U8(87),
/* 1235 S> */ B(LdaZero),
/* 1235 E> */ B(StaCurrentContextSlot), U8(88),
/* 1249 S> */ B(LdaZero),
/* 1249 E> */ B(StaCurrentContextSlot), U8(89),
/* 1263 S> */ B(LdaZero),
/* 1263 E> */ B(StaCurrentContextSlot), U8(90),
/* 1277 S> */ B(LdaZero),
/* 1277 E> */ B(StaCurrentContextSlot), U8(91),
/* 1291 S> */ B(LdaZero),
/* 1291 E> */ B(StaCurrentContextSlot), U8(92),
/* 1305 S> */ B(LdaZero),
/* 1305 E> */ B(StaCurrentContextSlot), U8(93),
/* 1319 S> */ B(LdaZero),
/* 1319 E> */ B(StaCurrentContextSlot), U8(94),
/* 1333 S> */ B(LdaZero),
/* 1333 E> */ B(StaCurrentContextSlot), U8(95),
/* 1347 S> */ B(LdaZero),
/* 1347 E> */ B(StaCurrentContextSlot), U8(96),
/* 1361 S> */ B(LdaZero),
/* 1361 E> */ B(StaCurrentContextSlot), U8(97),
/* 1375 S> */ B(LdaZero),
/* 1375 E> */ B(StaCurrentContextSlot), U8(98),
/* 1389 S> */ B(LdaZero),
/* 1389 E> */ B(StaCurrentContextSlot), U8(99),
/* 1403 S> */ B(LdaZero),
/* 1403 E> */ B(StaCurrentContextSlot), U8(100),
/* 1417 S> */ B(LdaZero),
/* 1417 E> */ B(StaCurrentContextSlot), U8(101),
/* 1431 S> */ B(LdaZero),
/* 1431 E> */ B(StaCurrentContextSlot), U8(102),
/* 1445 S> */ B(LdaZero),
/* 1445 E> */ B(StaCurrentContextSlot), U8(103),
/* 1459 S> */ B(LdaZero),
/* 1459 E> */ B(StaCurrentContextSlot), U8(104),
/* 1473 S> */ B(LdaZero),
/* 1473 E> */ B(StaCurrentContextSlot), U8(105),
/* 1487 S> */ B(LdaZero),
/* 1487 E> */ B(StaCurrentContextSlot), U8(106),
/* 1501 S> */ B(LdaZero),
/* 1501 E> */ B(StaCurrentContextSlot), U8(107),
/* 1516 S> */ B(LdaZero),
/* 1516 E> */ B(StaCurrentContextSlot), U8(108),
/* 1531 S> */ B(LdaZero),
/* 1531 E> */ B(StaCurrentContextSlot), U8(109),
/* 1546 S> */ B(LdaZero),
/* 1546 E> */ B(StaCurrentContextSlot), U8(110),
/* 1561 S> */ B(LdaZero),
/* 1561 E> */ B(StaCurrentContextSlot), U8(111),
/* 1576 S> */ B(LdaZero),
/* 1576 E> */ B(StaCurrentContextSlot), U8(112),
/* 1591 S> */ B(LdaZero),
/* 1591 E> */ B(StaCurrentContextSlot), U8(113),
/* 1606 S> */ B(LdaZero),
/* 1606 E> */ B(StaCurrentContextSlot), U8(114),
/* 1621 S> */ B(LdaZero),
/* 1621 E> */ B(StaCurrentContextSlot), U8(115),
/* 1636 S> */ B(LdaZero),
/* 1636 E> */ B(StaCurrentContextSlot), U8(116),
/* 1651 S> */ B(LdaZero),
/* 1651 E> */ B(StaCurrentContextSlot), U8(117),
/* 1666 S> */ B(LdaZero),
/* 1666 E> */ B(StaCurrentContextSlot), U8(118),
/* 1681 S> */ B(LdaZero),
/* 1681 E> */ B(StaCurrentContextSlot), U8(119),
/* 1696 S> */ B(LdaZero),
/* 1696 E> */ B(StaCurrentContextSlot), U8(120),
/* 1711 S> */ B(LdaZero),
/* 1711 E> */ B(StaCurrentContextSlot), U8(121),
/* 1726 S> */ B(LdaZero),
/* 1726 E> */ B(StaCurrentContextSlot), U8(122),
/* 1741 S> */ B(LdaZero),
/* 1741 E> */ B(StaCurrentContextSlot), U8(123),
/* 1756 S> */ B(LdaZero),
/* 1756 E> */ B(StaCurrentContextSlot), U8(124),
/* 1771 S> */ B(LdaZero),
/* 1771 E> */ B(StaCurrentContextSlot), U8(125),
/* 1786 S> */ B(LdaZero),
/* 1786 E> */ B(StaCurrentContextSlot), U8(126),
/* 1801 S> */ B(LdaZero),
/* 1801 E> */ B(StaCurrentContextSlot), U8(127),
/* 1816 S> */ B(LdaZero),
/* 1816 E> */ B(StaCurrentContextSlot), U8(128),
/* 1831 S> */ B(LdaZero),
/* 1831 E> */ B(StaCurrentContextSlot), U8(129),
/* 1846 S> */ B(LdaZero),
/* 1846 E> */ B(StaCurrentContextSlot), U8(130),
/* 1861 S> */ B(LdaZero),
/* 1861 E> */ B(StaCurrentContextSlot), U8(131),
/* 1876 S> */ B(LdaZero),
/* 1876 E> */ B(StaCurrentContextSlot), U8(132),
/* 1891 S> */ B(LdaZero),
/* 1891 E> */ B(StaCurrentContextSlot), U8(133),
/* 1906 S> */ B(LdaZero),
/* 1906 E> */ B(StaCurrentContextSlot), U8(134),
/* 1921 S> */ B(LdaZero),
/* 1921 E> */ B(StaCurrentContextSlot), U8(135),
/* 1936 S> */ B(LdaZero),
/* 1936 E> */ B(StaCurrentContextSlot), U8(136),
/* 1951 S> */ B(LdaZero),
/* 1951 E> */ B(StaCurrentContextSlot), U8(137),
/* 1966 S> */ B(LdaZero),
/* 1966 E> */ B(StaCurrentContextSlot), U8(138),
/* 1981 S> */ B(LdaZero),
/* 1981 E> */ B(StaCurrentContextSlot), U8(139),
/* 1996 S> */ B(LdaZero),
/* 1996 E> */ B(StaCurrentContextSlot), U8(140),
/* 2011 S> */ B(LdaZero),
/* 2011 E> */ B(StaCurrentContextSlot), U8(141),
/* 2026 S> */ B(LdaZero),
/* 2026 E> */ B(StaCurrentContextSlot), U8(142),
/* 2041 S> */ B(LdaZero),
/* 2041 E> */ B(StaCurrentContextSlot), U8(143),
/* 2056 S> */ B(LdaZero),
/* 2056 E> */ B(StaCurrentContextSlot), U8(144),
/* 2071 S> */ B(LdaZero),
/* 2071 E> */ B(StaCurrentContextSlot), U8(145),
/* 2086 S> */ B(LdaZero),
/* 2086 E> */ B(StaCurrentContextSlot), U8(146),
/* 2101 S> */ B(LdaZero),
/* 2101 E> */ B(StaCurrentContextSlot), U8(147),
/* 2116 S> */ B(LdaZero),
/* 2116 E> */ B(StaCurrentContextSlot), U8(148),
/* 2131 S> */ B(LdaZero),
/* 2131 E> */ B(StaCurrentContextSlot), U8(149),
/* 2146 S> */ B(LdaZero),
/* 2146 E> */ B(StaCurrentContextSlot), U8(150),
/* 2161 S> */ B(LdaZero),
/* 2161 E> */ B(StaCurrentContextSlot), U8(151),
/* 2176 S> */ B(LdaZero),
/* 2176 E> */ B(StaCurrentContextSlot), U8(152),
/* 2191 S> */ B(LdaZero),
/* 2191 E> */ B(StaCurrentContextSlot), U8(153),
/* 2206 S> */ B(LdaZero),
/* 2206 E> */ B(StaCurrentContextSlot), U8(154),
/* 2221 S> */ B(LdaZero),
/* 2221 E> */ B(StaCurrentContextSlot), U8(155),
/* 2236 S> */ B(LdaZero),
/* 2236 E> */ B(StaCurrentContextSlot), U8(156),
/* 2251 S> */ B(LdaZero),
/* 2251 E> */ B(StaCurrentContextSlot), U8(157),
/* 2266 S> */ B(LdaZero),
/* 2266 E> */ B(StaCurrentContextSlot), U8(158),
/* 2281 S> */ B(LdaZero),
/* 2281 E> */ B(StaCurrentContextSlot), U8(159),
/* 2296 S> */ B(LdaZero),
/* 2296 E> */ B(StaCurrentContextSlot), U8(160),
/* 2311 S> */ B(LdaZero),
/* 2311 E> */ B(StaCurrentContextSlot), U8(161),
/* 2326 S> */ B(LdaZero),
/* 2326 E> */ B(StaCurrentContextSlot), U8(162),
/* 2341 S> */ B(LdaZero),
/* 2341 E> */ B(StaCurrentContextSlot), U8(163),
/* 2356 S> */ B(LdaZero),
/* 2356 E> */ B(StaCurrentContextSlot), U8(164),
/* 2371 S> */ B(LdaZero),
/* 2371 E> */ B(StaCurrentContextSlot), U8(165),
/* 2386 S> */ B(LdaZero),
/* 2386 E> */ B(StaCurrentContextSlot), U8(166),
/* 2401 S> */ B(LdaZero),
/* 2401 E> */ B(StaCurrentContextSlot), U8(167),
/* 2416 S> */ B(LdaZero),
/* 2416 E> */ B(StaCurrentContextSlot), U8(168),
/* 2431 S> */ B(LdaZero),
/* 2431 E> */ B(StaCurrentContextSlot), U8(169),
/* 2446 S> */ B(LdaZero),
/* 2446 E> */ B(StaCurrentContextSlot), U8(170),
/* 2461 S> */ B(LdaZero),
/* 2461 E> */ B(StaCurrentContextSlot), U8(171),
/* 2476 S> */ B(LdaZero),
/* 2476 E> */ B(StaCurrentContextSlot), U8(172),
/* 2491 S> */ B(LdaZero),
/* 2491 E> */ B(StaCurrentContextSlot), U8(173),
/* 2506 S> */ B(LdaZero),
/* 2506 E> */ B(StaCurrentContextSlot), U8(174),
/* 2521 S> */ B(LdaZero),
/* 2521 E> */ B(StaCurrentContextSlot), U8(175),
/* 2536 S> */ B(LdaZero),
/* 2536 E> */ B(StaCurrentContextSlot), U8(176),
/* 2551 S> */ B(LdaZero),
/* 2551 E> */ B(StaCurrentContextSlot), U8(177),
/* 2566 S> */ B(LdaZero),
/* 2566 E> */ B(StaCurrentContextSlot), U8(178),
/* 2581 S> */ B(LdaZero),
/* 2581 E> */ B(StaCurrentContextSlot), U8(179),
/* 2596 S> */ B(LdaZero),
/* 2596 E> */ B(StaCurrentContextSlot), U8(180),
/* 2611 S> */ B(LdaZero),
/* 2611 E> */ B(StaCurrentContextSlot), U8(181),
/* 2626 S> */ B(LdaZero),
/* 2626 E> */ B(StaCurrentContextSlot), U8(182),
/* 2641 S> */ B(LdaZero),
/* 2641 E> */ B(StaCurrentContextSlot), U8(183),
/* 2656 S> */ B(LdaZero),
/* 2656 E> */ B(StaCurrentContextSlot), U8(184),
/* 2671 S> */ B(LdaZero),
/* 2671 E> */ B(StaCurrentContextSlot), U8(185),
/* 2686 S> */ B(LdaZero),
/* 2686 E> */ B(StaCurrentContextSlot), U8(186),
/* 2701 S> */ B(LdaZero),
/* 2701 E> */ B(StaCurrentContextSlot), U8(187),
/* 2716 S> */ B(LdaZero),
/* 2716 E> */ B(StaCurrentContextSlot), U8(188),
/* 2731 S> */ B(LdaZero),
/* 2731 E> */ B(StaCurrentContextSlot), U8(189),
/* 2746 S> */ B(LdaZero),
/* 2746 E> */ B(StaCurrentContextSlot), U8(190),
/* 2761 S> */ B(LdaZero),
/* 2761 E> */ B(StaCurrentContextSlot), U8(191),
/* 2776 S> */ B(LdaZero),
/* 2776 E> */ B(StaCurrentContextSlot), U8(192),
/* 2791 S> */ B(LdaZero),
/* 2791 E> */ B(StaCurrentContextSlot), U8(193),
/* 2806 S> */ B(LdaZero),
/* 2806 E> */ B(StaCurrentContextSlot), U8(194),
/* 2821 S> */ B(LdaZero),
/* 2821 E> */ B(StaCurrentContextSlot), U8(195),
/* 2836 S> */ B(LdaZero),
/* 2836 E> */ B(StaCurrentContextSlot), U8(196),
/* 2851 S> */ B(LdaZero),
/* 2851 E> */ B(StaCurrentContextSlot), U8(197),
/* 2866 S> */ B(LdaZero),
/* 2866 E> */ B(StaCurrentContextSlot), U8(198),
/* 2881 S> */ B(LdaZero),
/* 2881 E> */ B(StaCurrentContextSlot), U8(199),
/* 2896 S> */ B(LdaZero),
/* 2896 E> */ B(StaCurrentContextSlot), U8(200),
/* 2911 S> */ B(LdaZero),
/* 2911 E> */ B(StaCurrentContextSlot), U8(201),
/* 2926 S> */ B(LdaZero),
/* 2926 E> */ B(StaCurrentContextSlot), U8(202),
/* 2941 S> */ B(LdaZero),
/* 2941 E> */ B(StaCurrentContextSlot), U8(203),
/* 2956 S> */ B(LdaZero),
/* 2956 E> */ B(StaCurrentContextSlot), U8(204),
/* 2971 S> */ B(LdaZero),
/* 2971 E> */ B(StaCurrentContextSlot), U8(205),
/* 2986 S> */ B(LdaZero),
/* 2986 E> */ B(StaCurrentContextSlot), U8(206),
/* 3001 S> */ B(LdaZero),
/* 3001 E> */ B(StaCurrentContextSlot), U8(207),
/* 3016 S> */ B(LdaZero),
/* 3016 E> */ B(StaCurrentContextSlot), U8(208),
/* 3031 S> */ B(LdaZero),
/* 3031 E> */ B(StaCurrentContextSlot), U8(209),
/* 3046 S> */ B(LdaZero),
/* 3046 E> */ B(StaCurrentContextSlot), U8(210),
/* 3061 S> */ B(LdaZero),
/* 3061 E> */ B(StaCurrentContextSlot), U8(211),
/* 3076 S> */ B(LdaZero),
/* 3076 E> */ B(StaCurrentContextSlot), U8(212),
/* 3091 S> */ B(LdaZero),
/* 3091 E> */ B(StaCurrentContextSlot), U8(213),
/* 3106 S> */ B(LdaZero),
/* 3106 E> */ B(StaCurrentContextSlot), U8(214),
/* 3121 S> */ B(LdaZero),
/* 3121 E> */ B(StaCurrentContextSlot), U8(215),
/* 3136 S> */ B(LdaZero),
/* 3136 E> */ B(StaCurrentContextSlot), U8(216),
/* 3151 S> */ B(LdaZero),
/* 3151 E> */ B(StaCurrentContextSlot), U8(217),
/* 3166 S> */ B(LdaZero),
/* 3166 E> */ B(StaCurrentContextSlot), U8(218),
/* 3181 S> */ B(LdaZero),
/* 3181 E> */ B(StaCurrentContextSlot), U8(219),
/* 3196 S> */ B(LdaZero),
/* 3196 E> */ B(StaCurrentContextSlot), U8(220),
/* 3211 S> */ B(LdaZero),
/* 3211 E> */ B(StaCurrentContextSlot), U8(221),
/* 3226 S> */ B(LdaZero),
/* 3226 E> */ B(StaCurrentContextSlot), U8(222),
/* 3241 S> */ B(LdaZero),
/* 3241 E> */ B(StaCurrentContextSlot), U8(223),
/* 3256 S> */ B(LdaZero),
/* 3256 E> */ B(StaCurrentContextSlot), U8(224),
/* 3271 S> */ B(LdaZero),
/* 3271 E> */ B(StaCurrentContextSlot), U8(225),
/* 3286 S> */ B(LdaZero),
/* 3286 E> */ B(StaCurrentContextSlot), U8(226),
/* 3301 S> */ B(LdaZero),
/* 3301 E> */ B(StaCurrentContextSlot), U8(227),
/* 3316 S> */ B(LdaZero),
/* 3316 E> */ B(StaCurrentContextSlot), U8(228),
/* 3331 S> */ B(LdaZero),
/* 3331 E> */ B(StaCurrentContextSlot), U8(229),
/* 3346 S> */ B(LdaZero),
/* 3346 E> */ B(StaCurrentContextSlot), U8(230),
/* 3361 S> */ B(LdaZero),
/* 3361 E> */ B(StaCurrentContextSlot), U8(231),
/* 3376 S> */ B(LdaZero),
/* 3376 E> */ B(StaCurrentContextSlot), U8(232),
/* 3391 S> */ B(LdaZero),
/* 3391 E> */ B(StaCurrentContextSlot), U8(233),
/* 3406 S> */ B(LdaZero),
/* 3406 E> */ B(StaCurrentContextSlot), U8(234),
/* 3421 S> */ B(LdaZero),
/* 3421 E> */ B(StaCurrentContextSlot), U8(235),
/* 3436 S> */ B(LdaZero),
/* 3436 E> */ B(StaCurrentContextSlot), U8(236),
/* 3451 S> */ B(LdaZero),
/* 3451 E> */ B(StaCurrentContextSlot), U8(237),
/* 3466 S> */ B(LdaZero),
/* 3466 E> */ B(StaCurrentContextSlot), U8(238),
/* 3481 S> */ B(LdaZero),
/* 3481 E> */ B(StaCurrentContextSlot), U8(239),
/* 3496 S> */ B(LdaZero),
/* 3496 E> */ B(StaCurrentContextSlot), U8(240),
/* 3511 S> */ B(LdaZero),
/* 3511 E> */ B(StaCurrentContextSlot), U8(241),
/* 3526 S> */ B(LdaZero),
/* 3526 E> */ B(StaCurrentContextSlot), U8(242),
/* 3541 S> */ B(LdaZero),
/* 3541 E> */ B(StaCurrentContextSlot), U8(243),
/* 3556 S> */ B(LdaZero),
/* 3556 E> */ B(StaCurrentContextSlot), U8(244),
/* 3571 S> */ B(LdaZero),
/* 3571 E> */ B(StaCurrentContextSlot), U8(245),
/* 3586 S> */ B(LdaZero),
/* 3586 E> */ B(StaCurrentContextSlot), U8(246),
/* 3601 S> */ B(LdaZero),
/* 3601 E> */ B(StaCurrentContextSlot), U8(247),
/* 3616 S> */ B(LdaZero),
/* 3616 E> */ B(StaCurrentContextSlot), U8(248),
/* 3631 S> */ B(LdaZero),
/* 3631 E> */ B(StaCurrentContextSlot), U8(249),
/* 3646 S> */ B(LdaZero),
/* 3646 E> */ B(StaCurrentContextSlot), U8(250),
/* 3661 S> */ B(LdaZero),
/* 3661 E> */ B(StaCurrentContextSlot), U8(251),
/* 3676 S> */ B(LdaZero),
/* 3676 E> */ B(StaCurrentContextSlot), U8(252),
/* 3691 S> */ B(LdaZero),
/* 3691 E> */ B(StaCurrentContextSlot), U8(253),
/* 3706 S> */ B(LdaZero),
/* 3706 E> */ B(StaCurrentContextSlot), U8(254),
/* 3721 S> */ B(LdaZero),
/* 3721 E> */ B(StaCurrentContextSlot), U8(255),
/* 3724 S> */ B(LdaGlobal), U8(1), U8(0),
B(Star2),
/* 3724 E> */ B(CallUndefinedReceiver0), R(2), U8(2),
/* 3740 S> */ B(LdaSmi), I8(100),
/* 3740 E> */ B(Wide), B(StaCurrentContextSlot), U16(256),
/* 3745 S> */ B(Wide), B(LdaCurrentContextSlot), U16(256),
/* 3753 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["eval"],
]
handlers: [
]

View File

@ -0,0 +1,279 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
var a = 1; return ++a;
"
frame size: 1
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(Inc), U8(0),
B(Star0),
/* 56 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 1; return a++;
"
frame size: 2
parameter count: 1
bytecode array length: 12
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(ToNumeric), U8(0),
B(Star1),
B(Inc), U8(0),
B(Star0),
B(Ldar), R(1),
/* 56 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 1; return --a;
"
frame size: 1
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(Dec), U8(0),
B(Star0),
/* 56 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 1; return a--;
"
frame size: 2
parameter count: 1
bytecode array length: 12
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(ToNumeric), U8(0),
B(Star1),
B(Dec), U8(0),
B(Star0),
B(Ldar), R(1),
/* 56 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = { val: 1 }; return a.val++;
"
frame size: 4
parameter count: 1
bytecode array length: 22
bytecodes: [
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star0),
/* 54 S> */ B(GetNamedProperty), R(0), U8(1), U8(1),
B(ToNumeric), U8(3),
B(Star2),
B(Inc), U8(3),
B(Star3),
/* 66 E> */ B(SetNamedProperty), R(0), U8(1), U8(4),
B(Ldar), R(2),
/* 69 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["val"],
]
handlers: [
]
---
snippet: "
var a = { val: 1 }; return --a.val;
"
frame size: 3
parameter count: 1
bytecode array length: 19
bytecodes: [
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star0),
/* 54 S> */ B(GetNamedProperty), R(0), U8(1), U8(1),
B(Dec), U8(3),
B(Star2),
/* 65 E> */ B(SetNamedProperty), R(0), U8(1), U8(4),
B(Ldar), R(2),
/* 69 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["val"],
]
handlers: [
]
---
snippet: "
var name = 'var'; var a = { val: 1 }; return a[name]--;
"
frame size: 6
parameter count: 1
bytecode array length: 26
bytecodes: [
/* 45 S> */ B(LdaConstant), U8(0),
B(Star0),
/* 60 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(41),
B(Star1),
/* 72 S> */ B(Ldar), R(0),
/* 81 E> */ B(GetKeyedProperty), R(1), U8(1),
B(ToNumeric), U8(3),
B(Star4),
B(Dec), U8(3),
B(Star5),
/* 86 E> */ B(SetKeyedProperty), R(1), R(0), U8(4),
B(Ldar), R(4),
/* 89 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["var"],
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
var name = 'var'; var a = { val: 1 }; return ++a[name];
"
frame size: 5
parameter count: 1
bytecode array length: 23
bytecodes: [
/* 45 S> */ B(LdaConstant), U8(0),
B(Star0),
/* 60 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(41),
B(Star1),
/* 72 S> */ B(Ldar), R(0),
/* 83 E> */ B(GetKeyedProperty), R(1), U8(1),
B(Inc), U8(3),
B(Star4),
/* 87 E> */ B(SetKeyedProperty), R(1), R(0), U8(4),
B(Ldar), R(4),
/* 89 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["var"],
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
var a = 1; var b = function() { return a }; return ++a;
"
frame size: 2
parameter count: 1
bytecode array length: 21
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(1),
/* 42 S> */ B(LdaSmi), I8(1),
/* 42 E> */ B(StaCurrentContextSlot), U8(2),
/* 53 S> */ B(CreateClosure), U8(1), U8(0), U8(2),
B(Star0),
/* 78 S> */ B(LdaCurrentContextSlot), U8(2),
B(Inc), U8(0),
/* 87 E> */ B(StaCurrentContextSlot), U8(2),
/* 89 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
var a = 1; var b = function() { return a }; return a--;
"
frame size: 3
parameter count: 1
bytecode array length: 26
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(1),
/* 42 S> */ B(LdaSmi), I8(1),
/* 42 E> */ B(StaCurrentContextSlot), U8(2),
/* 53 S> */ B(CreateClosure), U8(1), U8(0), U8(2),
B(Star0),
/* 78 S> */ B(LdaCurrentContextSlot), U8(2),
B(ToNumeric), U8(0),
B(Star2),
B(Dec), U8(0),
/* 86 E> */ B(StaCurrentContextSlot), U8(2),
B(Ldar), R(2),
/* 89 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
var idx = 1; var a = [1, 2]; return a[idx++] = 2;
"
frame size: 5
parameter count: 1
bytecode array length: 26
bytecodes: [
/* 44 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 55 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
B(Star1),
/* 63 S> */ B(Ldar), R(0),
B(ToNumeric), U8(1),
B(Star3),
B(Inc), U8(1),
B(Star0),
B(LdaSmi), I8(2),
B(Star4),
/* 79 E> */ B(SetKeyedProperty), R(1), R(3), U8(2),
B(Ldar), R(4),
/* 83 S> */ B(Return),
]
constant pool: [
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]

View File

@ -0,0 +1,134 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: f
---
snippet: "
function f() { return arguments; }
f();
"
frame size: 1
parameter count: 1
bytecode array length: 3
bytecodes: [
/* 10 E> */ B(CreateMappedArguments),
B(Star0),
/* 32 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function f() { return arguments[0]; }
f();
"
frame size: 1
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 10 E> */ B(CreateMappedArguments),
B(Star0),
/* 15 S> */ B(LdaZero),
/* 31 E> */ B(GetKeyedProperty), R(0), U8(0),
/* 35 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function f() { 'use strict'; return arguments; }
f();
"
frame size: 1
parameter count: 1
bytecode array length: 3
bytecodes: [
/* 10 E> */ B(CreateUnmappedArguments),
B(Star0),
/* 46 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function f(a) { return arguments[0]; }
f();
"
frame size: 2
parameter count: 2
bytecode array length: 16
bytecodes: [
/* 10 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(1),
B(Ldar), R(arg0),
B(StaCurrentContextSlot), U8(2),
B(CreateMappedArguments),
B(Star0),
/* 16 S> */ B(LdaZero),
/* 32 E> */ B(GetKeyedProperty), R(0), U8(0),
/* 36 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
]
handlers: [
]
---
snippet: "
function f(a, b, c) { return arguments; }
f();
"
frame size: 2
parameter count: 4
bytecode array length: 20
bytecodes: [
/* 10 E> */ B(CreateFunctionContext), U8(0), U8(3),
B(PushContext), R(1),
B(Ldar), R(arg0),
B(StaCurrentContextSlot), U8(4),
B(Ldar), R(arg1),
B(StaCurrentContextSlot), U8(3),
B(Ldar), R(arg2),
B(StaCurrentContextSlot), U8(2),
B(CreateMappedArguments),
B(Star0),
/* 39 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
]
handlers: [
]
---
snippet: "
function f(a, b, c) { 'use strict'; return arguments; }
f();
"
frame size: 1
parameter count: 4
bytecode array length: 3
bytecodes: [
/* 10 E> */ B(CreateUnmappedArguments),
B(Star0),
/* 53 S> */ B(Return),
]
constant pool: [
]
handlers: [
]

View File

@ -0,0 +1,98 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: f
---
snippet: "
function f(...restArgs) { return restArgs; }
f();
"
frame size: 2
parameter count: 1
bytecode array length: 4
bytecodes: [
/* 10 E> */ B(CreateRestParameter),
B(Star1),
B(Star0),
/* 42 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function f(a, ...restArgs) { return restArgs; }
f();
"
frame size: 3
parameter count: 2
bytecode array length: 11
bytecodes: [
/* 10 E> */ B(CreateRestParameter),
B(Star2),
B(Mov), R(arg0), R(0),
B(Mov), R(2), R(1),
/* 29 S> */ B(Ldar), R(1),
/* 45 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function f(a, ...restArgs) { return restArgs[0]; }
f();
"
frame size: 3
parameter count: 2
bytecode array length: 13
bytecodes: [
/* 10 E> */ B(CreateRestParameter),
B(Star2),
B(Mov), R(arg0), R(0),
B(Mov), R(2), R(1),
/* 29 S> */ B(LdaZero),
/* 44 E> */ B(GetKeyedProperty), R(1), U8(0),
/* 48 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function f(a, ...restArgs) { return restArgs[0] + arguments[0]; }
f();
"
frame size: 5
parameter count: 2
bytecode array length: 23
bytecodes: [
/* 10 E> */ B(CreateUnmappedArguments),
B(Star3),
B(CreateRestParameter),
B(Star2),
B(Mov), R(arg0), R(0),
B(Mov), R(2), R(1),
/* 29 S> */ B(LdaZero),
/* 44 E> */ B(GetKeyedProperty), R(1), U8(1),
B(Star4),
B(LdaZero),
/* 59 E> */ B(GetKeyedProperty), R(3), U8(3),
/* 48 E> */ B(Add), R(4), U8(0),
/* 63 S> */ B(Return),
]
constant pool: [
]
handlers: [
]

View File

@ -0,0 +1,78 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
return; var a = 1; a();
"
frame size: 1
parameter count: 1
bytecode array length: 2
bytecodes: [
/* 34 S> */ B(LdaUndefined),
/* 41 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
if (false) { return; }; var a = 1;
"
frame size: 1
parameter count: 1
bytecode array length: 5
bytecodes: [
/* 66 S> */ B(LdaSmi), I8(1),
B(Star0),
B(LdaUndefined),
/* 69 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
if (true) { return 1; } else { return 2; };
"
frame size: 0
parameter count: 1
bytecode array length: 3
bytecodes: [
/* 46 S> */ B(LdaSmi), I8(1),
/* 55 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 1; if (a) { return 1; }; return 2;
"
frame size: 1
parameter count: 1
bytecode array length: 11
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(JumpIfToBooleanFalse), U8(5),
/* 54 S> */ B(LdaSmi), I8(1),
/* 63 S> */ B(Return),
/* 67 S> */ B(LdaSmi), I8(2),
/* 76 S> */ B(Return),
]
constant pool: [
]
handlers: [
]

View File

@ -0,0 +1,108 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
top level: yes
---
snippet: "
var a = 1;
"
frame size: 3
parameter count: 1
bytecode array length: 18
bytecodes: [
B(LdaConstant), U8(0),
B(Star1),
B(Mov), R(closure), R(2),
/* 0 E> */ B(CallRuntime), U16(Runtime::kDeclareGlobals), R(1), U8(2),
/* 8 S> */ B(LdaSmi), I8(1),
/* 8 E> */ B(StaGlobal), U8(1), U8(0),
B(LdaUndefined),
/* 11 S> */ B(Return),
]
constant pool: [
FIXED_ARRAY_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["a"],
]
handlers: [
]
---
snippet: "
function f() {}
"
frame size: 2
parameter count: 1
bytecode array length: 13
bytecodes: [
B(LdaConstant), U8(0),
B(Star0),
B(Mov), R(closure), R(1),
/* 0 E> */ B(CallRuntime), U16(Runtime::kDeclareGlobals), R(0), U8(2),
B(LdaUndefined),
/* 16 S> */ B(Return),
]
constant pool: [
FIXED_ARRAY_TYPE,
]
handlers: [
]
---
snippet: "
var a = 1;
a=2;
"
frame size: 3
parameter count: 1
bytecode array length: 28
bytecodes: [
B(LdaConstant), U8(0),
B(Star1),
B(Mov), R(closure), R(2),
/* 0 E> */ B(CallRuntime), U16(Runtime::kDeclareGlobals), R(1), U8(2),
/* 8 S> */ B(LdaSmi), I8(1),
/* 8 E> */ B(StaGlobal), U8(1), U8(0),
/* 11 S> */ B(LdaSmi), I8(2),
B(Star1),
/* 12 E> */ B(StaGlobal), U8(1), U8(0),
B(Mov), R(1), R(0),
B(Ldar), R(0),
/* 16 S> */ B(Return),
]
constant pool: [
FIXED_ARRAY_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["a"],
]
handlers: [
]
---
snippet: "
function f() {}
f();
"
frame size: 3
parameter count: 1
bytecode array length: 20
bytecodes: [
B(LdaConstant), U8(0),
B(Star1),
B(Mov), R(closure), R(2),
/* 0 E> */ B(CallRuntime), U16(Runtime::kDeclareGlobals), R(1), U8(2),
/* 16 S> */ B(LdaGlobal), U8(1), U8(0),
B(Star1),
/* 16 E> */ B(CallUndefinedReceiver0), R(1), U8(2),
B(Star0),
/* 21 S> */ B(Return),
]
constant pool: [
FIXED_ARRAY_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["f"],
]
handlers: [
]

View File

@ -0,0 +1,149 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
var a = {x:13, y:14}; return delete a.x;
"
frame size: 1
parameter count: 1
bytecode array length: 10
bytecodes: [
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star0),
/* 56 S> */ B(LdaConstant), U8(1),
B(DeletePropertySloppy), R(0),
/* 74 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["x"],
]
handlers: [
]
---
snippet: "
'use strict'; var a = {x:13, y:14}; return delete a.x;
"
frame size: 1
parameter count: 1
bytecode array length: 10
bytecodes: [
/* 56 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star0),
/* 70 S> */ B(LdaConstant), U8(1),
B(DeletePropertyStrict), R(0),
/* 88 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["x"],
]
handlers: [
]
---
snippet: "
var a = {1:13, 2:14}; return delete a[2];
"
frame size: 1
parameter count: 1
bytecode array length: 10
bytecodes: [
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star0),
/* 56 S> */ B(LdaSmi), I8(2),
B(DeletePropertySloppy), R(0),
/* 75 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
var a = 10; return delete a;
"
frame size: 1
parameter count: 1
bytecode array length: 5
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(10),
B(Star0),
/* 46 S> */ B(LdaFalse),
/* 62 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
'use strict';
var a = {1:10};
(function f1() {return a;});
return delete a[1];
"
frame size: 2
parameter count: 1
bytecode array length: 23
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(0),
/* 56 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(41),
/* 56 E> */ B(StaCurrentContextSlot), U8(2),
/* 64 S> */ B(CreateClosure), U8(2), U8(0), U8(2),
/* 93 S> */ B(LdaImmutableCurrentContextSlot), U8(2),
B(Star1),
B(LdaSmi), I8(1),
B(DeletePropertyStrict), R(1),
/* 112 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
return delete 'test';
"
frame size: 0
parameter count: 1
bytecode array length: 2
bytecodes: [
/* 34 S> */ B(LdaTrue),
/* 55 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
return delete this;
"
frame size: 0
parameter count: 1
bytecode array length: 2
bytecodes: [
/* 34 S> */ B(LdaTrue),
/* 53 S> */ B(Return),
]
constant pool: [
]
handlers: [
]

View File

@ -0,0 +1,84 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: f
---
snippet: "
var f;
var x = 1;
z = 10;
function f1() {
var y;
eval(\"function t() { delete x; }; f = t; f();\");
}
f1();
"
frame size: 1
parameter count: 1
bytecode array length: 10
bytecodes: [
/* 15 S> */ B(LdaConstant), U8(0),
B(Star0),
B(CallRuntime), U16(Runtime::kDeleteLookupSlot), R(0), U8(1),
B(LdaUndefined),
/* 25 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["x"],
]
handlers: [
]
---
snippet: "
var f;
var x = 1;
z = 10;
function f1() {
var y;
eval(\"function t() { return delete y; }; f = t; f();\");
}
f1();
"
frame size: 0
parameter count: 1
bytecode array length: 2
bytecodes: [
/* 15 S> */ B(LdaFalse),
/* 31 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var f;
var x = 1;
z = 10;
function f1() {
var y;
eval(\"function t() { return delete z; }; f = t; f();\");
}
f1();
"
frame size: 1
parameter count: 1
bytecode array length: 9
bytecodes: [
/* 15 S> */ B(LdaConstant), U8(0),
B(Star0),
B(CallRuntime), U16(Runtime::kDeleteLookupSlot), R(0), U8(1),
/* 31 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["z"],
]
handlers: [
]

View File

@ -0,0 +1,406 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
var x, a = [0,1,2,3];
[x] = a;
"
frame size: 14
parameter count: 1
bytecode array length: 124
bytecodes: [
/* 45 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
B(Star1),
/* 60 S> */ B(GetIterator), R(1), U8(1), U8(3),
B(Star4),
B(GetNamedProperty), R(4), U8(1), U8(5),
B(Star3),
B(LdaFalse),
B(Star5),
B(LdaTheHole),
B(Mov), R(1), R(2),
B(Star8),
B(Mov), R(context), R(9),
B(Ldar), R(5),
/* 57 E> */ B(JumpIfToBooleanTrue), U8(33),
B(LdaTrue),
B(Star5),
B(CallProperty0), R(3), R(4), U8(11),
B(Star10),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
B(GetNamedProperty), R(10), U8(2), U8(9),
B(JumpIfToBooleanTrue), U8(13),
B(GetNamedProperty), R(10), U8(3), U8(7),
B(Star10),
B(LdaFalse),
B(Star5),
B(Ldar), R(10),
B(Jump), U8(3),
B(LdaUndefined),
B(Star0),
B(LdaSmi), I8(-1),
B(Star7),
B(Star6),
B(Jump), U8(8),
B(Star7),
B(LdaZero),
B(Star6),
B(LdaTheHole),
B(SetPendingMessage),
B(Star8),
B(Ldar), R(5),
B(JumpIfToBooleanTrue), U8(35),
B(Mov), R(context), R(11),
B(GetNamedProperty), R(4), U8(4), U8(13),
B(JumpIfUndefinedOrNull), U8(26),
B(Star12),
B(CallProperty0), R(12), R(4), U8(15),
B(JumpIfJSReceiver), U8(19),
B(Star13),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(13), U8(1),
B(Jump), U8(11),
B(Star11),
B(LdaZero),
B(TestReferenceEqual), R(6),
B(JumpIfTrue), U8(5),
B(Ldar), R(11),
B(ReThrow),
B(LdaZero),
B(TestReferenceEqual), R(6),
B(JumpIfFalse), U8(8),
B(Ldar), R(8),
B(SetPendingMessage),
B(Ldar), R(7),
B(ReThrow),
B(LdaUndefined),
/* 65 S> */ B(Return),
]
constant pool: [
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["return"],
]
handlers: [
[25, 62, 68],
[81, 100, 102],
]
---
snippet: "
var x, y, a = [0,1,2,3];
[,x,...y] = a;
"
frame size: 15
parameter count: 1
bytecode array length: 199
bytecodes: [
/* 48 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
B(Star2),
/* 69 S> */ B(GetIterator), R(2), U8(1), U8(3),
B(Star5),
B(GetNamedProperty), R(5), U8(1), U8(5),
B(Star4),
B(LdaFalse),
B(Star6),
B(LdaTheHole),
B(Mov), R(2), R(3),
B(Star9),
B(Mov), R(context), R(10),
B(Ldar), R(6),
B(JumpIfToBooleanTrue), U8(24),
B(LdaTrue),
B(Star6),
B(CallProperty0), R(4), R(5), U8(11),
B(Star11),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(11), U8(1),
B(GetNamedProperty), R(11), U8(2), U8(9),
B(JumpIfToBooleanTrue), U8(4),
B(LdaFalse),
B(Star6),
B(Ldar), R(6),
/* 61 E> */ B(JumpIfToBooleanTrue), U8(33),
B(LdaTrue),
B(Star6),
B(CallProperty0), R(4), R(5), U8(13),
B(Star11),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(11), U8(1),
B(GetNamedProperty), R(11), U8(2), U8(9),
B(JumpIfToBooleanTrue), U8(13),
B(GetNamedProperty), R(11), U8(3), U8(7),
B(Star11),
B(LdaFalse),
B(Star6),
B(Ldar), R(11),
B(Jump), U8(3),
B(LdaUndefined),
B(Star0),
/* 63 E> */ B(CreateEmptyArrayLiteral), U8(15),
B(Star12),
B(Ldar), R(6),
B(JumpIfToBooleanTrue), U8(41),
B(LdaZero),
B(Star13),
B(LdaTrue),
B(Star6),
B(CallProperty0), R(4), R(5), U8(19),
B(Star11),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(11), U8(1),
B(GetNamedProperty), R(11), U8(2), U8(21),
B(JumpIfToBooleanTrue), U8(19),
B(GetNamedProperty), R(11), U8(3), U8(7),
B(StaInArrayLiteral), R(12), R(13), U8(16),
B(Ldar), R(13),
B(Inc), U8(18),
B(Star13),
B(JumpLoop), U8(31), I8(0), U8(23),
B(Mov), R(12), R(1),
B(LdaSmi), I8(-1),
B(Star8),
B(Star7),
B(Jump), U8(8),
B(Star8),
B(LdaZero),
B(Star7),
B(LdaTheHole),
B(SetPendingMessage),
B(Star9),
B(Ldar), R(6),
B(JumpIfToBooleanTrue), U8(35),
B(Mov), R(context), R(12),
B(GetNamedProperty), R(5), U8(4), U8(24),
B(JumpIfUndefinedOrNull), U8(26),
B(Star13),
B(CallProperty0), R(13), R(5), U8(26),
B(JumpIfJSReceiver), U8(19),
B(Star14),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(14), U8(1),
B(Jump), U8(11),
B(Star12),
B(LdaZero),
B(TestReferenceEqual), R(7),
B(JumpIfTrue), U8(5),
B(Ldar), R(12),
B(ReThrow),
B(LdaZero),
B(TestReferenceEqual), R(7),
B(JumpIfFalse), U8(8),
B(Ldar), R(9),
B(SetPendingMessage),
B(Ldar), R(8),
B(ReThrow),
B(LdaUndefined),
/* 74 S> */ B(Return),
]
constant pool: [
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["return"],
]
handlers: [
[25, 137, 143],
[156, 175, 177],
]
---
snippet: "
var x={}, y, a = [0];
[x.foo,y=4] = a;
"
frame size: 16
parameter count: 1
bytecode array length: 170
bytecodes: [
/* 40 S> */ B(CreateEmptyObjectLiteral),
B(Star0),
/* 51 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
B(Star2),
/* 68 S> */ B(GetIterator), R(2), U8(1), U8(3),
B(Star5),
B(GetNamedProperty), R(5), U8(1), U8(5),
B(Star4),
B(LdaFalse),
B(Star6),
B(LdaTheHole),
B(Mov), R(2), R(3),
B(Star9),
B(Mov), R(context), R(10),
B(Ldar), R(6),
B(Mov), R(0), R(12),
/* 57 E> */ B(JumpIfToBooleanTrue), U8(33),
B(LdaTrue),
B(Star6),
B(CallProperty0), R(4), R(5), U8(11),
B(Star11),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(11), U8(1),
B(GetNamedProperty), R(11), U8(2), U8(9),
B(JumpIfToBooleanTrue), U8(13),
B(GetNamedProperty), R(11), U8(3), U8(7),
B(Star11),
B(LdaFalse),
B(Star6),
B(Ldar), R(11),
B(Jump), U8(3),
B(LdaUndefined),
B(SetNamedProperty), R(12), U8(4), U8(13),
B(Ldar), R(6),
/* 63 E> */ B(JumpIfToBooleanTrue), U8(33),
B(LdaTrue),
B(Star6),
B(CallProperty0), R(4), R(5), U8(15),
B(Star11),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(11), U8(1),
B(GetNamedProperty), R(11), U8(2), U8(9),
B(JumpIfToBooleanTrue), U8(13),
B(GetNamedProperty), R(11), U8(3), U8(7),
B(Star11),
B(LdaFalse),
B(Star6),
B(Ldar), R(11),
B(JumpIfNotUndefined), U8(4),
B(LdaSmi), I8(4),
B(Star1),
B(LdaSmi), I8(-1),
B(Star8),
B(Star7),
B(Jump), U8(8),
B(Star8),
B(LdaZero),
B(Star7),
B(LdaTheHole),
B(SetPendingMessage),
B(Star9),
B(Ldar), R(6),
B(JumpIfToBooleanTrue), U8(35),
B(Mov), R(context), R(13),
B(GetNamedProperty), R(5), U8(5), U8(17),
B(JumpIfUndefinedOrNull), U8(26),
B(Star14),
B(CallProperty0), R(14), R(5), U8(19),
B(JumpIfJSReceiver), U8(19),
B(Star15),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(15), U8(1),
B(Jump), U8(11),
B(Star13),
B(LdaZero),
B(TestReferenceEqual), R(7),
B(JumpIfTrue), U8(5),
B(Ldar), R(13),
B(ReThrow),
B(LdaZero),
B(TestReferenceEqual), R(7),
B(JumpIfFalse), U8(8),
B(Ldar), R(9),
B(SetPendingMessage),
B(Ldar), R(8),
B(ReThrow),
B(LdaUndefined),
/* 73 S> */ B(Return),
]
constant pool: [
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["foo"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["return"],
]
handlers: [
[27, 108, 114],
[127, 146, 148],
]
---
snippet: "
var x, a = {x:1};
({x} = a);
"
frame size: 2
parameter count: 1
bytecode array length: 12
bytecodes: [
/* 45 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star1),
/* 54 S> */ B(GetNamedProperty), R(1), U8(1), U8(1),
B(Star0),
B(LdaUndefined),
/* 63 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["x"],
]
handlers: [
]
---
snippet: "
var x={}, a = {y:1};
({y:x.foo} = a);
"
frame size: 2
parameter count: 1
bytecode array length: 17
bytecodes: [
/* 40 S> */ B(CreateEmptyObjectLiteral),
B(Star0),
/* 48 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star1),
/* 59 S> */ B(GetNamedProperty), R(1), U8(1), U8(1),
B(SetNamedProperty), R(0), U8(2), U8(3),
B(LdaUndefined),
/* 72 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["y"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["foo"],
]
handlers: [
]
---
snippet: "
var x, a = {y:1, w:2, v:3};
({x=0,...y} = a);
"
frame size: 4
parameter count: 1
bytecode array length: 28
bytecodes: [
/* 45 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star1),
/* 62 S> */ B(LdaConstant), U8(1),
B(Star3),
/* 64 E> */ B(GetNamedProperty), R(1), U8(1), U8(1),
B(Mov), R(1), R(2),
B(JumpIfNotUndefined), U8(3),
B(LdaZero),
B(Star0),
/* 71 E> */ B(InvokeIntrinsic), U8(Runtime::k_CopyDataPropertiesWithExcludedPropertiesOnStack), R(2), U8(2),
B(StaGlobal), U8(2), U8(3),
B(LdaUndefined),
/* 80 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["x"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["y"],
]
handlers: [
]

View File

@ -0,0 +1,24 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
debugger;
"
frame size: 0
parameter count: 1
bytecode array length: 3
bytecodes: [
/* 34 S> */ B(Debugger),
B(LdaUndefined),
/* 44 S> */ B(Return),
]
constant pool: [
]
handlers: [
]

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,36 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: test
---
snippet: "
var test;
(function () {
var a = {b: 2, c: 3};
function foo() {a.b = a.c;}
foo();
test = foo;
})();
"
frame size: 1
parameter count: 1
bytecode array length: 13
bytecodes: [
/* 67 S> */ B(LdaImmutableCurrentContextSlot), U8(2),
B(Star0),
/* 75 E> */ B(GetNamedProperty), R(0), U8(0), U8(0),
/* 71 E> */ B(SetNamedProperty), R(0), U8(1), U8(2),
B(LdaUndefined),
/* 77 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["c"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["b"],
]
handlers: [
]

View File

@ -0,0 +1,49 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
return eval('1;');
"
frame size: 10
parameter count: 1
bytecode array length: 52
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(4),
B(PushContext), R(1),
B(Ldar), R(this),
B(StaCurrentContextSlot), U8(3),
B(CreateMappedArguments),
B(StaCurrentContextSlot), U8(5),
B(Ldar), R(0),
B(StaCurrentContextSlot), U8(4),
/* 34 S> */ B(LdaLookupGlobalSlot), U8(1), U8(0), U8(1),
B(Star2),
B(LdaConstant), U8(2),
B(Star3),
B(LdaZero),
B(Star7),
B(LdaSmi), I8(2),
B(Star8),
B(LdaSmi), I8(41),
B(Star9),
B(Mov), R(2), R(4),
B(Mov), R(3), R(5),
B(Mov), R(closure), R(6),
B(CallRuntime), U16(Runtime::kResolvePossiblyDirectEval), R(4), U8(6),
B(Star2),
/* 41 E> */ B(CallUndefinedReceiver1), R(2), R(3), U8(2),
/* 52 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["eval"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["1;"],
]
handlers: [
]

View File

@ -0,0 +1,577 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: f
---
snippet: "
async function f() {
for await (let x of [1, 2, 3]) {}
}
f();
"
frame size: 17
parameter count: 1
bytecode array length: 257
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(4),
B(Mov), R(this), R(5),
/* 16 E> */ B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(4), U8(2),
B(Star0),
B(Mov), R(context), R(4),
/* 43 S> */ B(CreateArrayLiteral), U8(2), U8(0), U8(37),
B(Star7),
B(GetNamedProperty), R(7), U8(3), U8(1),
B(JumpIfUndefinedOrNull), U8(14),
B(Star8),
B(CallProperty0), R(8), R(7), U8(3),
B(JumpIfJSReceiver), U8(21),
B(CallRuntime), U16(Runtime::kThrowSymbolAsyncIteratorInvalid), R(0), U8(0),
B(GetNamedProperty), R(7), U8(4), U8(5),
B(Star8),
B(CallProperty0), R(8), R(7), U8(7),
B(Star8),
B(InvokeIntrinsic), U8(Runtime::k_CreateAsyncFromSyncIterator), R(8), U8(1),
B(Star6),
B(GetNamedProperty), R(6), U8(5), U8(9),
B(Star5),
B(LdaFalse),
B(Star7),
B(LdaTheHole),
B(Star10),
B(Mov), R(context), R(11),
B(LdaTrue),
B(Star7),
/* 38 S> */ B(CallProperty0), R(5), R(6), U8(11),
B(Star14),
B(Mov), R(0), R(13),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwait), R(13), U8(2),
B(SuspendGenerator), R(0), R(0), U8(13), U8(0),
B(ResumeGenerator), R(0), R(0), U8(13),
B(Star13),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star14),
B(LdaZero),
B(TestReferenceEqual), R(14),
B(JumpIfTrue), U8(5),
B(Ldar), R(13),
B(ReThrow),
B(Ldar), R(13),
B(Mov), R(13), R(12),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(12), U8(1),
B(GetNamedProperty), R(12), U8(6), U8(13),
B(JumpIfToBooleanTrue), U8(21),
B(GetNamedProperty), R(12), U8(7), U8(15),
B(Star12),
B(LdaFalse),
B(Star7),
B(Mov), R(12), R(1),
/* 38 S> */ B(Mov), R(1), R(3),
B(Ldar), R(12),
/* 23 E> */ B(JumpLoop), U8(70), I8(0), U8(17),
B(LdaSmi), I8(-1),
B(Star9),
B(Star8),
B(Jump), U8(8),
B(Star9),
B(LdaZero),
B(Star8),
B(LdaTheHole),
B(SetPendingMessage),
B(Star10),
B(Ldar), R(7),
B(JumpIfToBooleanTrue), U8(69),
B(Mov), R(context), R(12),
B(GetNamedProperty), R(6), U8(8), U8(18),
B(JumpIfUndefinedOrNull), U8(60),
B(Star13),
B(CallProperty0), R(13), R(6), U8(20),
B(Star15),
B(Mov), R(0), R(14),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwait), R(14), U8(2),
B(SuspendGenerator), R(0), R(0), U8(14), U8(1),
B(ResumeGenerator), R(0), R(0), U8(14),
B(Star14),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star15),
B(LdaZero),
B(TestReferenceEqual), R(15),
B(JumpIfTrue), U8(5),
B(Ldar), R(14),
B(ReThrow),
B(Ldar), R(14),
B(JumpIfJSReceiver), U8(20),
B(Star), R(16),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(16), U8(1),
B(Jump), U8(11),
B(Star12),
B(LdaZero),
B(TestReferenceEqual), R(8),
B(JumpIfTrue), U8(5),
B(Ldar), R(12),
B(ReThrow),
B(LdaZero),
B(TestReferenceEqual), R(8),
B(JumpIfFalse), U8(8),
B(Ldar), R(10),
B(SetPendingMessage),
B(Ldar), R(9),
B(ReThrow),
B(LdaUndefined),
B(Star6),
B(Mov), R(0), R(5),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(5), U8(2),
/* 57 S> */ B(Return),
B(Star6),
B(LdaTheHole),
B(SetPendingMessage),
B(Mov), R(0), R(5),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(5), U8(2),
B(Return),
]
constant pool: [
Smi [87],
Smi [185],
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
SYMBOL_TYPE,
SYMBOL_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["return"],
]
handlers: [
[18, 246, 246],
[68, 142, 148],
[161, 214, 216],
]
---
snippet: "
async function f() {
for await (let x of [1, 2, 3]) { return x; }
}
f();
"
frame size: 17
parameter count: 1
bytecode array length: 273
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(4),
B(Mov), R(this), R(5),
/* 16 E> */ B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(4), U8(2),
B(Star0),
B(Mov), R(context), R(4),
/* 43 S> */ B(CreateArrayLiteral), U8(2), U8(0), U8(37),
B(Star7),
B(GetNamedProperty), R(7), U8(3), U8(1),
B(JumpIfUndefinedOrNull), U8(14),
B(Star8),
B(CallProperty0), R(8), R(7), U8(3),
B(JumpIfJSReceiver), U8(21),
B(CallRuntime), U16(Runtime::kThrowSymbolAsyncIteratorInvalid), R(0), U8(0),
B(GetNamedProperty), R(7), U8(4), U8(5),
B(Star8),
B(CallProperty0), R(8), R(7), U8(7),
B(Star8),
B(InvokeIntrinsic), U8(Runtime::k_CreateAsyncFromSyncIterator), R(8), U8(1),
B(Star6),
B(GetNamedProperty), R(6), U8(5), U8(9),
B(Star5),
B(LdaFalse),
B(Star7),
B(LdaTheHole),
B(Star10),
B(Mov), R(context), R(11),
B(LdaTrue),
B(Star7),
/* 38 S> */ B(CallProperty0), R(5), R(6), U8(11),
B(Star14),
B(Mov), R(0), R(13),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwait), R(13), U8(2),
B(SuspendGenerator), R(0), R(0), U8(13), U8(0),
B(ResumeGenerator), R(0), R(0), U8(13),
B(Star13),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star14),
B(LdaZero),
B(TestReferenceEqual), R(14),
B(JumpIfTrue), U8(5),
B(Ldar), R(13),
B(ReThrow),
B(Ldar), R(13),
B(Mov), R(13), R(12),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(12), U8(1),
B(GetNamedProperty), R(12), U8(6), U8(13),
B(JumpIfToBooleanTrue), U8(23),
B(GetNamedProperty), R(12), U8(7), U8(15),
B(Star12),
B(LdaFalse),
B(Star7),
B(Mov), R(12), R(1),
/* 38 S> */ B(Mov), R(1), R(3),
/* 56 S> */ B(LdaSmi), I8(1),
B(Mov), R(12), R(9),
B(Star8),
B(Jump), U8(14),
B(LdaSmi), I8(-1),
B(Star9),
B(Star8),
B(Jump), U8(8),
B(Star9),
B(LdaZero),
B(Star8),
B(LdaTheHole),
B(SetPendingMessage),
B(Star10),
B(Ldar), R(7),
B(JumpIfToBooleanTrue), U8(69),
B(Mov), R(context), R(12),
B(GetNamedProperty), R(6), U8(8), U8(18),
B(JumpIfUndefinedOrNull), U8(60),
B(Star13),
B(CallProperty0), R(13), R(6), U8(20),
B(Star15),
B(Mov), R(0), R(14),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwait), R(14), U8(2),
B(SuspendGenerator), R(0), R(0), U8(14), U8(1),
B(ResumeGenerator), R(0), R(0), U8(14),
B(Star14),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star15),
B(LdaZero),
B(TestReferenceEqual), R(15),
B(JumpIfTrue), U8(5),
B(Ldar), R(14),
B(ReThrow),
B(Ldar), R(14),
B(JumpIfJSReceiver), U8(20),
B(Star), R(16),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(16), U8(1),
B(Jump), U8(11),
B(Star12),
B(LdaZero),
B(TestReferenceEqual), R(8),
B(JumpIfTrue), U8(5),
B(Ldar), R(12),
B(ReThrow),
B(Ldar), R(8),
B(SwitchOnSmiNoFeedback), U8(9), U8(2), I8(0),
B(Jump), U8(19),
B(Ldar), R(10),
B(SetPendingMessage),
B(Ldar), R(9),
B(ReThrow),
B(Mov), R(0), R(12),
B(Mov), R(9), R(13),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(12), U8(2),
B(Return),
B(LdaUndefined),
B(Star6),
B(Mov), R(0), R(5),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(5), U8(2),
/* 68 S> */ B(Return),
B(Star6),
B(LdaTheHole),
B(SetPendingMessage),
B(Mov), R(0), R(5),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(5), U8(2),
B(Return),
]
constant pool: [
Smi [87],
Smi [187],
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
SYMBOL_TYPE,
SYMBOL_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["return"],
Smi [6],
Smi [12],
]
handlers: [
[18, 262, 262],
[68, 144, 150],
[163, 216, 218],
]
---
snippet: "
async function f() {
for await (let x of [10, 20, 30]) {
if (x == 10) continue;
if (x == 20) break;
}
}
f();
"
frame size: 17
parameter count: 1
bytecode array length: 273
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(4),
B(Mov), R(this), R(5),
/* 16 E> */ B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(4), U8(2),
B(Star0),
B(Mov), R(context), R(4),
/* 43 S> */ B(CreateArrayLiteral), U8(2), U8(0), U8(37),
B(Star7),
B(GetNamedProperty), R(7), U8(3), U8(1),
B(JumpIfUndefinedOrNull), U8(14),
B(Star8),
B(CallProperty0), R(8), R(7), U8(3),
B(JumpIfJSReceiver), U8(21),
B(CallRuntime), U16(Runtime::kThrowSymbolAsyncIteratorInvalid), R(0), U8(0),
B(GetNamedProperty), R(7), U8(4), U8(5),
B(Star8),
B(CallProperty0), R(8), R(7), U8(7),
B(Star8),
B(InvokeIntrinsic), U8(Runtime::k_CreateAsyncFromSyncIterator), R(8), U8(1),
B(Star6),
B(GetNamedProperty), R(6), U8(5), U8(9),
B(Star5),
B(LdaFalse),
B(Star7),
B(LdaTheHole),
B(Star10),
B(Mov), R(context), R(11),
B(LdaTrue),
B(Star7),
/* 38 S> */ B(CallProperty0), R(5), R(6), U8(11),
B(Star14),
B(Mov), R(0), R(13),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwait), R(13), U8(2),
B(SuspendGenerator), R(0), R(0), U8(13), U8(0),
B(ResumeGenerator), R(0), R(0), U8(13),
B(Star13),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star14),
B(LdaZero),
B(TestReferenceEqual), R(14),
B(JumpIfTrue), U8(5),
B(Ldar), R(13),
B(ReThrow),
B(Ldar), R(13),
B(Mov), R(13), R(12),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(12), U8(1),
B(GetNamedProperty), R(12), U8(6), U8(13),
B(JumpIfToBooleanTrue), U8(37),
B(GetNamedProperty), R(12), U8(7), U8(15),
B(Star12),
B(LdaFalse),
B(Star7),
B(Mov), R(12), R(1),
/* 38 S> */ B(Mov), R(1), R(3),
/* 63 S> */ B(LdaSmi), I8(10),
/* 69 E> */ B(TestEqual), R(12), U8(17),
B(JumpIfFalse), U8(4),
/* 76 S> */ B(Jump), U8(11),
/* 90 S> */ B(LdaSmi), I8(20),
/* 96 E> */ B(TestEqual), R(3), U8(18),
B(JumpIfFalse), U8(4),
/* 103 S> */ B(Jump), U8(6),
/* 23 E> */ B(JumpLoop), U8(86), I8(0), U8(19),
B(LdaSmi), I8(-1),
B(Star9),
B(Star8),
B(Jump), U8(8),
B(Star9),
B(LdaZero),
B(Star8),
B(LdaTheHole),
B(SetPendingMessage),
B(Star10),
B(Ldar), R(7),
B(JumpIfToBooleanTrue), U8(69),
B(Mov), R(context), R(12),
B(GetNamedProperty), R(6), U8(8), U8(20),
B(JumpIfUndefinedOrNull), U8(60),
B(Star13),
B(CallProperty0), R(13), R(6), U8(22),
B(Star15),
B(Mov), R(0), R(14),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwait), R(14), U8(2),
B(SuspendGenerator), R(0), R(0), U8(14), U8(1),
B(ResumeGenerator), R(0), R(0), U8(14),
B(Star14),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star15),
B(LdaZero),
B(TestReferenceEqual), R(15),
B(JumpIfTrue), U8(5),
B(Ldar), R(14),
B(ReThrow),
B(Ldar), R(14),
B(JumpIfJSReceiver), U8(20),
B(Star), R(16),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(16), U8(1),
B(Jump), U8(11),
B(Star12),
B(LdaZero),
B(TestReferenceEqual), R(8),
B(JumpIfTrue), U8(5),
B(Ldar), R(12),
B(ReThrow),
B(LdaZero),
B(TestReferenceEqual), R(8),
B(JumpIfFalse), U8(8),
B(Ldar), R(10),
B(SetPendingMessage),
B(Ldar), R(9),
B(ReThrow),
B(LdaUndefined),
B(Star6),
B(Mov), R(0), R(5),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(5), U8(2),
/* 114 S> */ B(Return),
B(Star6),
B(LdaTheHole),
B(SetPendingMessage),
B(Mov), R(0), R(5),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(5), U8(2),
B(Return),
]
constant pool: [
Smi [87],
Smi [201],
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
SYMBOL_TYPE,
SYMBOL_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["return"],
]
handlers: [
[18, 262, 262],
[68, 158, 164],
[177, 230, 232],
]
---
snippet: "
async function f() {
var x = { 'a': 1, 'b': 2 };
for (x['a'] of [1,2,3]) { return x['a']; }
}
f();
"
frame size: 13
parameter count: 1
bytecode array length: 179
bytecodes: [
B(Mov), R(closure), R(2),
B(Mov), R(this), R(3),
/* 16 E> */ B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(2), U8(2),
B(Star0),
B(Mov), R(context), R(2),
/* 31 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star1),
/* 68 S> */ B(CreateArrayLiteral), U8(1), U8(1), U8(37),
B(Star5),
B(GetIterator), R(5), U8(2), U8(4),
B(Star4),
B(GetNamedProperty), R(4), U8(2), U8(6),
B(Star3),
B(LdaFalse),
B(Star5),
B(LdaTheHole),
B(Star8),
B(Mov), R(context), R(9),
B(LdaTrue),
B(Star5),
/* 59 S> */ B(CallProperty0), R(3), R(4), U8(8),
B(Star10),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
B(GetNamedProperty), R(10), U8(3), U8(10),
B(JumpIfToBooleanTrue), U8(25),
B(GetNamedProperty), R(10), U8(4), U8(12),
B(Star10),
B(LdaFalse),
B(Star5),
B(Ldar), R(10),
/* 58 E> */ B(SetNamedProperty), R(1), U8(5), U8(14),
/* 87 S> */ B(GetNamedProperty), R(1), U8(5), U8(16),
B(Star7),
B(LdaSmi), I8(1),
B(Star6),
B(Jump), U8(14),
B(LdaSmi), I8(-1),
B(Star7),
B(Star6),
B(Jump), U8(8),
B(Star7),
B(LdaZero),
B(Star6),
B(LdaTheHole),
B(SetPendingMessage),
B(Star8),
B(Ldar), R(5),
B(JumpIfToBooleanTrue), U8(35),
B(Mov), R(context), R(10),
B(GetNamedProperty), R(4), U8(6), U8(19),
B(JumpIfUndefinedOrNull), U8(26),
B(Star11),
B(CallProperty0), R(11), R(4), U8(21),
B(JumpIfJSReceiver), U8(19),
B(Star12),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(12), U8(1),
B(Jump), U8(11),
B(Star10),
B(LdaZero),
B(TestReferenceEqual), R(6),
B(JumpIfTrue), U8(5),
B(Ldar), R(10),
B(ReThrow),
B(Ldar), R(6),
B(SwitchOnSmiNoFeedback), U8(7), U8(2), I8(0),
B(Jump), U8(19),
B(Ldar), R(8),
B(SetPendingMessage),
B(Ldar), R(7),
B(ReThrow),
B(Mov), R(0), R(10),
B(Mov), R(7), R(11),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(10), U8(2),
B(Return),
B(LdaUndefined),
B(Star4),
B(Mov), R(0), R(3),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(3), U8(2),
/* 96 S> */ B(Return),
B(Star4),
B(LdaTheHole),
B(SetPendingMessage),
B(Mov), R(0), R(3),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(3), U8(2),
B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["a"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["return"],
Smi [6],
Smi [12],
]
handlers: [
[14, 168, 168],
[41, 84, 90],
[103, 122, 124],
]

View File

@ -0,0 +1,220 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
for (var p in null) {}
"
frame size: 2
parameter count: 1
bytecode array length: 2
bytecodes: [
B(LdaUndefined),
/* 57 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
for (var p in undefined) {}
"
frame size: 2
parameter count: 1
bytecode array length: 2
bytecodes: [
B(LdaUndefined),
/* 62 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
for (var p in undefined) {}
"
frame size: 2
parameter count: 1
bytecode array length: 2
bytecodes: [
B(LdaUndefined),
/* 62 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 'potatoes';
for (var p in x) { return p; }
"
frame size: 8
parameter count: 1
bytecode array length: 36
bytecodes: [
/* 42 S> */ B(LdaConstant), U8(0),
B(Star0),
/* 68 S> */ B(JumpIfUndefinedOrNull), U8(31),
B(ToObject), R(3),
B(ForInEnumerate), R(3),
B(ForInPrepare), R(4), U8(0),
B(LdaZero),
B(Star7),
/* 63 S> */ B(JumpIfForInDone), U8(20), R(7), R(6),
B(ForInNext), R(3), R(7), R(4), U8(0),
B(JumpIfUndefined), U8(5),
B(Star2),
/* 63 S> */ B(Star1),
/* 82 S> */ B(Return),
B(ForInStep), R(7),
/* 54 E> */ B(JumpLoop), U8(16), I8(0), U8(1),
B(LdaUndefined),
/* 85 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["potatoes"],
]
handlers: [
]
---
snippet: "
var x = 0;
for (var p in [1,2,3]) { x += p; }
"
frame size: 9
parameter count: 1
bytecode array length: 47
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 59 S> */ B(CreateArrayLiteral), U8(0), U8(1), U8(37),
B(JumpIfUndefinedOrNull), U8(39),
B(ToObject), R(3),
B(ForInEnumerate), R(3),
B(ForInPrepare), R(4), U8(0),
B(LdaZero),
B(Star7),
/* 54 S> */ B(JumpIfForInDone), U8(28), R(7), R(6),
B(ForInNext), R(3), R(7), R(4), U8(0),
B(JumpIfUndefined), U8(13),
B(Star2),
/* 54 S> */ B(Star1),
/* 70 S> */ B(Ldar), R(2),
/* 75 E> */ B(Add), R(0), U8(2),
B(Mov), R(0), R(8),
B(Star0),
/* 72 E> */ B(ForInStep), R(7),
/* 45 E> */ B(JumpLoop), U8(24), I8(0), U8(3),
B(LdaUndefined),
/* 80 S> */ B(Return),
]
constant pool: [
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
var x = { 'a': 1, 'b': 2 };
for (x['a'] in [10, 20, 30]) {
if (x['a'] == 10) continue;
if (x['a'] == 20) break;
}
"
frame size: 7
parameter count: 1
bytecode array length: 74
bytecodes: [
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star0),
/* 77 S> */ B(CreateArrayLiteral), U8(1), U8(2), U8(37),
B(JumpIfUndefinedOrNull), U8(63),
B(ToObject), R(1),
B(ForInEnumerate), R(1),
B(ForInPrepare), R(2), U8(1),
B(LdaZero),
B(Star5),
/* 68 S> */ B(JumpIfForInDone), U8(52), R(5), R(4),
B(ForInNext), R(1), R(5), R(2), U8(1),
B(JumpIfUndefined), U8(37),
B(Star6),
B(Ldar), R(6),
/* 68 E> */ B(SetNamedProperty), R(0), U8(2), U8(3),
/* 100 S> */ B(GetNamedProperty), R(0), U8(2), U8(5),
B(Star6),
B(LdaSmi), I8(10),
/* 106 E> */ B(TestEqual), R(6), U8(7),
B(JumpIfFalse), U8(4),
/* 113 S> */ B(Jump), U8(16),
/* 130 S> */ B(GetNamedProperty), R(0), U8(2), U8(5),
B(Star6),
B(LdaSmi), I8(20),
/* 136 E> */ B(TestEqual), R(6), U8(8),
B(JumpIfFalse), U8(4),
/* 143 S> */ B(Jump), U8(8),
B(ForInStep), R(5),
/* 62 E> */ B(JumpLoop), U8(48), I8(0), U8(9),
B(LdaUndefined),
/* 152 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["a"],
]
handlers: [
]
---
snippet: "
var x = [ 10, 11, 12 ] ;
for (x[0] in [1,2,3]) { return x[3]; }
"
frame size: 9
parameter count: 1
bytecode array length: 54
bytecodes: [
/* 42 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
B(Star0),
/* 72 S> */ B(CreateArrayLiteral), U8(1), U8(2), U8(37),
B(JumpIfUndefinedOrNull), U8(43),
B(ToObject), R(1),
B(ForInEnumerate), R(1),
B(ForInPrepare), R(2), U8(1),
B(LdaZero),
B(Star5),
/* 65 S> */ B(JumpIfForInDone), U8(32), R(5), R(4),
B(ForInNext), R(1), R(5), R(2), U8(1),
B(JumpIfUndefined), U8(17),
B(Star6),
B(LdaZero),
B(Star8),
B(Ldar), R(6),
/* 65 E> */ B(SetKeyedProperty), R(0), R(8), U8(3),
/* 83 S> */ B(LdaSmi), I8(3),
/* 91 E> */ B(GetKeyedProperty), R(0), U8(5),
/* 95 S> */ B(Return),
B(ForInStep), R(5),
/* 59 E> */ B(JumpLoop), U8(28), I8(0), U8(7),
B(LdaUndefined),
/* 98 S> */ B(Return),
]
constant pool: [
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]

View File

@ -0,0 +1,372 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
for (var p of [0, 1, 2]) {}
"
frame size: 12
parameter count: 1
bytecode array length: 123
bytecodes: [
/* 48 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
B(Star4),
B(GetIterator), R(4), U8(1), U8(3),
B(Star3),
B(GetNamedProperty), R(3), U8(1), U8(5),
B(Star2),
B(LdaFalse),
B(Star4),
B(LdaTheHole),
B(Star7),
B(Mov), R(context), R(8),
B(LdaTrue),
B(Star4),
/* 43 S> */ B(CallProperty0), R(2), R(3), U8(7),
B(Star9),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(9), U8(1),
B(GetNamedProperty), R(9), U8(2), U8(9),
B(JumpIfToBooleanTrue), U8(21),
B(GetNamedProperty), R(9), U8(3), U8(11),
B(Star9),
B(LdaFalse),
B(Star4),
B(Mov), R(9), R(1),
/* 43 S> */ B(Mov), R(1), R(0),
B(Ldar), R(9),
/* 34 E> */ B(JumpLoop), U8(35), I8(0), U8(13),
B(LdaSmi), I8(-1),
B(Star6),
B(Star5),
B(Jump), U8(8),
B(Star6),
B(LdaZero),
B(Star5),
B(LdaTheHole),
B(SetPendingMessage),
B(Star7),
B(Ldar), R(4),
B(JumpIfToBooleanTrue), U8(35),
B(Mov), R(context), R(9),
B(GetNamedProperty), R(3), U8(4), U8(14),
B(JumpIfUndefinedOrNull), U8(26),
B(Star10),
B(CallProperty0), R(10), R(3), U8(16),
B(JumpIfJSReceiver), U8(19),
B(Star11),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(11), U8(1),
B(Jump), U8(11),
B(Star9),
B(LdaZero),
B(TestReferenceEqual), R(5),
B(JumpIfTrue), U8(5),
B(Ldar), R(9),
B(ReThrow),
B(LdaZero),
B(TestReferenceEqual), R(5),
B(JumpIfFalse), U8(8),
B(Ldar), R(7),
B(SetPendingMessage),
B(Ldar), R(6),
B(ReThrow),
B(LdaUndefined),
/* 62 S> */ B(Return),
]
constant pool: [
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["return"],
]
handlers: [
[22, 61, 67],
[80, 99, 101],
]
---
snippet: "
var x = 'potatoes';
for (var p of x) { return p; }
"
frame size: 13
parameter count: 1
bytecode array length: 129
bytecodes: [
/* 42 S> */ B(LdaConstant), U8(0),
B(Star0),
/* 68 S> */ B(GetIterator), R(0), U8(0), U8(2),
B(Star4),
B(GetNamedProperty), R(4), U8(1), U8(4),
B(Star3),
B(LdaFalse),
B(Star5),
B(LdaTheHole),
B(Star8),
B(Mov), R(context), R(9),
B(LdaTrue),
B(Star5),
/* 63 S> */ B(CallProperty0), R(3), R(4), U8(6),
B(Star10),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
B(GetNamedProperty), R(10), U8(2), U8(8),
B(JumpIfToBooleanTrue), U8(23),
B(GetNamedProperty), R(10), U8(3), U8(10),
B(Star10),
B(LdaFalse),
B(Star5),
B(Mov), R(10), R(2),
/* 63 S> */ B(Mov), R(2), R(1),
/* 73 S> */ B(LdaSmi), I8(1),
B(Mov), R(10), R(7),
B(Star6),
B(Jump), U8(14),
B(LdaSmi), I8(-1),
B(Star7),
B(Star6),
B(Jump), U8(8),
B(Star7),
B(LdaZero),
B(Star6),
B(LdaTheHole),
B(SetPendingMessage),
B(Star8),
B(Ldar), R(5),
B(JumpIfToBooleanTrue), U8(35),
B(Mov), R(context), R(10),
B(GetNamedProperty), R(4), U8(4), U8(13),
B(JumpIfUndefinedOrNull), U8(26),
B(Star11),
B(CallProperty0), R(11), R(4), U8(15),
B(JumpIfJSReceiver), U8(19),
B(Star12),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(12), U8(1),
B(Jump), U8(11),
B(Star10),
B(LdaZero),
B(TestReferenceEqual), R(6),
B(JumpIfTrue), U8(5),
B(Ldar), R(10),
B(ReThrow),
B(Ldar), R(6),
B(SwitchOnSmiNoFeedback), U8(5), U8(2), I8(0),
B(Jump), U8(11),
B(Ldar), R(8),
B(SetPendingMessage),
B(Ldar), R(7),
B(ReThrow),
B(Ldar), R(7),
B(Return),
B(LdaUndefined),
/* 85 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["potatoes"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["return"],
Smi [6],
Smi [12],
]
handlers: [
[20, 61, 67],
[80, 99, 101],
]
---
snippet: "
for (var x of [10, 20, 30]) {
if (x == 10) continue;
if (x == 20) break;
}
"
frame size: 12
parameter count: 1
bytecode array length: 139
bytecodes: [
/* 48 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
B(Star4),
B(GetIterator), R(4), U8(1), U8(3),
B(Star3),
B(GetNamedProperty), R(3), U8(1), U8(5),
B(Star2),
B(LdaFalse),
B(Star4),
B(LdaTheHole),
B(Star7),
B(Mov), R(context), R(8),
B(LdaTrue),
B(Star4),
/* 43 S> */ B(CallProperty0), R(2), R(3), U8(7),
B(Star9),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(9), U8(1),
B(GetNamedProperty), R(9), U8(2), U8(9),
B(JumpIfToBooleanTrue), U8(37),
B(GetNamedProperty), R(9), U8(3), U8(11),
B(Star9),
B(LdaFalse),
B(Star4),
B(Mov), R(9), R(1),
/* 43 S> */ B(Mov), R(1), R(0),
/* 66 S> */ B(LdaSmi), I8(10),
/* 72 E> */ B(TestEqual), R(9), U8(13),
B(JumpIfFalse), U8(4),
/* 79 S> */ B(Jump), U8(11),
/* 91 S> */ B(LdaSmi), I8(20),
/* 97 E> */ B(TestEqual), R(0), U8(14),
B(JumpIfFalse), U8(4),
/* 104 S> */ B(Jump), U8(6),
/* 34 E> */ B(JumpLoop), U8(51), I8(0), U8(15),
B(LdaSmi), I8(-1),
B(Star6),
B(Star5),
B(Jump), U8(8),
B(Star6),
B(LdaZero),
B(Star5),
B(LdaTheHole),
B(SetPendingMessage),
B(Star7),
B(Ldar), R(4),
B(JumpIfToBooleanTrue), U8(35),
B(Mov), R(context), R(9),
B(GetNamedProperty), R(3), U8(4), U8(16),
B(JumpIfUndefinedOrNull), U8(26),
B(Star10),
B(CallProperty0), R(10), R(3), U8(18),
B(JumpIfJSReceiver), U8(19),
B(Star11),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(11), U8(1),
B(Jump), U8(11),
B(Star9),
B(LdaZero),
B(TestReferenceEqual), R(5),
B(JumpIfTrue), U8(5),
B(Ldar), R(9),
B(ReThrow),
B(LdaZero),
B(TestReferenceEqual), R(5),
B(JumpIfFalse), U8(8),
B(Ldar), R(7),
B(SetPendingMessage),
B(Ldar), R(6),
B(ReThrow),
B(LdaUndefined),
/* 113 S> */ B(Return),
]
constant pool: [
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["return"],
]
handlers: [
[22, 77, 83],
[96, 115, 117],
]
---
snippet: "
var x = { 'a': 1, 'b': 2 };
for (x['a'] of [1,2,3]) { return x['a']; }
"
frame size: 11
parameter count: 1
bytecode array length: 138
bytecodes: [
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star0),
/* 77 S> */ B(CreateArrayLiteral), U8(1), U8(1), U8(37),
B(Star3),
B(GetIterator), R(3), U8(2), U8(4),
B(Star2),
B(GetNamedProperty), R(2), U8(2), U8(6),
B(Star1),
B(LdaFalse),
B(Star3),
B(LdaTheHole),
B(Star6),
B(Mov), R(context), R(7),
B(LdaTrue),
B(Star3),
/* 68 S> */ B(CallProperty0), R(1), R(2), U8(8),
B(Star8),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(8), U8(1),
B(GetNamedProperty), R(8), U8(3), U8(10),
B(JumpIfToBooleanTrue), U8(25),
B(GetNamedProperty), R(8), U8(4), U8(12),
B(Star8),
B(LdaFalse),
B(Star3),
B(Ldar), R(8),
/* 67 E> */ B(SetNamedProperty), R(0), U8(5), U8(14),
/* 96 S> */ B(GetNamedProperty), R(0), U8(5), U8(16),
B(Star5),
B(LdaSmi), I8(1),
B(Star4),
B(Jump), U8(14),
B(LdaSmi), I8(-1),
B(Star5),
B(Star4),
B(Jump), U8(8),
B(Star5),
B(LdaZero),
B(Star4),
B(LdaTheHole),
B(SetPendingMessage),
B(Star6),
B(Ldar), R(3),
B(JumpIfToBooleanTrue), U8(35),
B(Mov), R(context), R(8),
B(GetNamedProperty), R(2), U8(6), U8(19),
B(JumpIfUndefinedOrNull), U8(26),
B(Star9),
B(CallProperty0), R(9), R(2), U8(21),
B(JumpIfJSReceiver), U8(19),
B(Star10),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
B(Jump), U8(11),
B(Star8),
B(LdaZero),
B(TestReferenceEqual), R(4),
B(JumpIfTrue), U8(5),
B(Ldar), R(8),
B(ReThrow),
B(Ldar), R(4),
B(SwitchOnSmiNoFeedback), U8(7), U8(2), I8(0),
B(Jump), U8(11),
B(Ldar), R(6),
B(SetPendingMessage),
B(Ldar), R(5),
B(ReThrow),
B(Ldar), R(5),
B(Return),
B(LdaUndefined),
/* 105 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["a"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["return"],
Smi [6],
Smi [12],
]
handlers: [
[27, 70, 76],
[89, 108, 110],
]

View File

@ -0,0 +1,843 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: f
---
snippet: "
function f(arr) {
for (let x of arr) { let y = x; }
}
f([1, 2, 3]);
"
frame size: 14
parameter count: 2
bytecode array length: 121
bytecodes: [
/* 34 S> */ B(GetIterator), R(arg0), U8(0), U8(2),
B(Star5),
B(GetNamedProperty), R(5), U8(0), U8(4),
B(Star4),
B(LdaFalse),
B(Star6),
B(LdaTheHole),
B(Star9),
B(Mov), R(context), R(10),
B(LdaTrue),
B(Star6),
/* 29 S> */ B(CallProperty0), R(4), R(5), U8(6),
B(Star11),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(11), U8(1),
B(GetNamedProperty), R(11), U8(1), U8(8),
B(JumpIfToBooleanTrue), U8(24),
B(GetNamedProperty), R(11), U8(2), U8(10),
B(Star11),
B(LdaFalse),
B(Star6),
B(Mov), R(11), R(0),
/* 29 S> */ B(Mov), R(0), R(2),
/* 49 S> */ B(Mov), R(2), R(3),
B(Ldar), R(11),
/* 20 E> */ B(JumpLoop), U8(38), I8(0), U8(12),
B(LdaSmi), I8(-1),
B(Star8),
B(Star7),
B(Jump), U8(8),
B(Star8),
B(LdaZero),
B(Star7),
B(LdaTheHole),
B(SetPendingMessage),
B(Star9),
B(Ldar), R(6),
B(JumpIfToBooleanTrue), U8(35),
B(Mov), R(context), R(11),
B(GetNamedProperty), R(5), U8(3), U8(13),
B(JumpIfUndefinedOrNull), U8(26),
B(Star12),
B(CallProperty0), R(12), R(5), U8(15),
B(JumpIfJSReceiver), U8(19),
B(Star13),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(13), U8(1),
B(Jump), U8(11),
B(Star11),
B(LdaZero),
B(TestReferenceEqual), R(7),
B(JumpIfTrue), U8(5),
B(Ldar), R(11),
B(ReThrow),
B(LdaZero),
B(TestReferenceEqual), R(7),
B(JumpIfFalse), U8(8),
B(Ldar), R(9),
B(SetPendingMessage),
B(Ldar), R(8),
B(ReThrow),
B(LdaUndefined),
/* 54 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["return"],
]
handlers: [
[17, 59, 65],
[78, 97, 99],
]
---
snippet: "
function f(arr) {
for (let x of arr) { eval('1'); }
}
f([1, 2, 3]);
"
frame size: 20
parameter count: 2
bytecode array length: 198
bytecodes: [
/* 10 E> */ B(CreateFunctionContext), U8(0), U8(5),
B(PushContext), R(2),
B(Ldar), R(this),
B(StaCurrentContextSlot), U8(3),
B(Ldar), R(arg0),
B(StaCurrentContextSlot), U8(4),
B(CreateMappedArguments),
B(StaCurrentContextSlot), U8(6),
B(Ldar), R(1),
B(StaCurrentContextSlot), U8(5),
B(CreateBlockContext), U8(1),
B(PushContext), R(3),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
/* 34 S> */ B(LdaContextSlot), R(3), U8(4), U8(0),
B(Star6),
B(GetIterator), R(6), U8(0), U8(2),
B(Star5),
B(GetNamedProperty), R(5), U8(2), U8(4),
B(Star4),
B(LdaFalse),
B(Star6),
B(LdaTheHole),
B(Star9),
B(Mov), R(context), R(10),
B(LdaTrue),
B(Star6),
/* 29 S> */ B(CallProperty0), R(4), R(5), U8(6),
B(Star11),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(11), U8(1),
B(GetNamedProperty), R(11), U8(3), U8(8),
B(JumpIfToBooleanTrue), U8(67),
B(GetNamedProperty), R(11), U8(4), U8(10),
B(Star11),
B(LdaFalse),
B(Star6),
B(Mov), R(11), R(0),
B(CreateBlockContext), U8(5),
B(PushContext), R(11),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
/* 29 S> */ B(Ldar), R(0),
/* 29 E> */ B(StaCurrentContextSlot), U8(2),
/* 41 S> */ B(LdaLookupGlobalSlot), U8(6), U8(12), U8(3),
B(Star12),
B(LdaConstant), U8(7),
B(Star13),
B(LdaZero),
B(Star), R(17),
B(LdaSmi), I8(2),
B(Star), R(18),
B(LdaSmi), I8(41),
B(Star), R(19),
B(Mov), R(12), R(14),
B(Mov), R(13), R(15),
B(Mov), R(closure), R(16),
B(CallRuntime), U16(Runtime::kResolvePossiblyDirectEval), R(14), U8(6),
B(Star12),
/* 41 E> */ B(CallUndefinedReceiver1), R(12), R(13), U8(14),
B(PopContext), R(11),
/* 20 E> */ B(JumpLoop), U8(81), I8(0), U8(16),
B(LdaSmi), I8(-1),
B(Star8),
B(Star7),
B(Jump), U8(8),
B(Star8),
B(LdaZero),
B(Star7),
B(LdaTheHole),
B(SetPendingMessage),
B(Star9),
B(Ldar), R(6),
B(JumpIfToBooleanTrue), U8(35),
B(Mov), R(context), R(12),
B(GetNamedProperty), R(5), U8(8), U8(17),
B(JumpIfUndefinedOrNull), U8(26),
B(Star13),
B(CallProperty0), R(13), R(5), U8(19),
B(JumpIfJSReceiver), U8(19),
B(Star14),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(14), U8(1),
B(Jump), U8(11),
B(Star12),
B(LdaZero),
B(TestReferenceEqual), R(7),
B(JumpIfTrue), U8(5),
B(Ldar), R(12),
B(ReThrow),
B(LdaZero),
B(TestReferenceEqual), R(7),
B(JumpIfFalse), U8(8),
B(Ldar), R(9),
B(SetPendingMessage),
B(Ldar), R(8),
B(ReThrow),
B(PopContext), R(3),
B(LdaUndefined),
/* 54 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
SCOPE_INFO_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
SCOPE_INFO_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["eval"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["1"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["return"],
]
handlers: [
[49, 134, 140],
[153, 172, 174],
]
---
snippet: "
function f(arr) {
for (let x of arr) { (function() { return x; })(); }
}
f([1, 2, 3]);
"
frame size: 13
parameter count: 2
bytecode array length: 134
bytecodes: [
/* 34 S> */ B(GetIterator), R(arg0), U8(0), U8(2),
B(Star3),
B(GetNamedProperty), R(3), U8(0), U8(4),
B(Star2),
B(LdaFalse),
B(Star4),
B(LdaTheHole),
B(Star7),
B(Mov), R(context), R(8),
B(LdaTrue),
B(Star4),
/* 29 S> */ B(CallProperty0), R(2), R(3), U8(6),
B(Star9),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(9), U8(1),
B(GetNamedProperty), R(9), U8(1), U8(8),
B(JumpIfToBooleanTrue), U8(37),
B(GetNamedProperty), R(9), U8(2), U8(10),
B(Star9),
B(LdaFalse),
B(Star4),
B(Mov), R(9), R(0),
B(CreateBlockContext), U8(3),
B(PushContext), R(9),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
/* 29 S> */ B(Ldar), R(0),
/* 29 E> */ B(StaCurrentContextSlot), U8(2),
/* 41 S> */ B(CreateClosure), U8(4), U8(0), U8(2),
B(Star10),
/* 67 E> */ B(CallUndefinedReceiver0), R(10), U8(12),
B(PopContext), R(9),
/* 20 E> */ B(JumpLoop), U8(51), I8(0), U8(14),
B(LdaSmi), I8(-1),
B(Star6),
B(Star5),
B(Jump), U8(8),
B(Star6),
B(LdaZero),
B(Star5),
B(LdaTheHole),
B(SetPendingMessage),
B(Star7),
B(Ldar), R(4),
B(JumpIfToBooleanTrue), U8(35),
B(Mov), R(context), R(10),
B(GetNamedProperty), R(3), U8(5), U8(15),
B(JumpIfUndefinedOrNull), U8(26),
B(Star11),
B(CallProperty0), R(11), R(3), U8(17),
B(JumpIfJSReceiver), U8(19),
B(Star12),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(12), U8(1),
B(Jump), U8(11),
B(Star10),
B(LdaZero),
B(TestReferenceEqual), R(5),
B(JumpIfTrue), U8(5),
B(Ldar), R(10),
B(ReThrow),
B(LdaZero),
B(TestReferenceEqual), R(5),
B(JumpIfFalse), U8(8),
B(Ldar), R(7),
B(SetPendingMessage),
B(Ldar), R(6),
B(ReThrow),
B(LdaUndefined),
/* 73 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
SCOPE_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["return"],
]
handlers: [
[17, 72, 78],
[91, 110, 112],
]
---
snippet: "
function f(arr) {
for (let { x, y } of arr) { let z = x + y; }
}
f([{ x: 0, y: 3 }, { x: 1, y: 9 }, { x: -12, y: 17 }]);
"
frame size: 16
parameter count: 2
bytecode array length: 129
bytecodes: [
/* 41 S> */ B(GetIterator), R(arg0), U8(0), U8(2),
B(Star7),
B(GetNamedProperty), R(7), U8(0), U8(4),
B(Star6),
B(LdaFalse),
B(Star8),
B(LdaTheHole),
B(Star11),
B(Mov), R(context), R(12),
B(LdaTrue),
B(Star8),
/* 36 S> */ B(CallProperty0), R(6), R(7), U8(6),
B(Star13),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(13), U8(1),
B(GetNamedProperty), R(13), U8(1), U8(8),
B(JumpIfToBooleanTrue), U8(32),
B(GetNamedProperty), R(13), U8(2), U8(10),
B(Star13),
B(LdaFalse),
B(Star8),
B(Mov), R(13), R(0),
/* 31 S> */ B(GetNamedProperty), R(13), U8(3), U8(12),
B(Star3),
/* 34 E> */ B(GetNamedProperty), R(13), U8(4), U8(14),
B(Star4),
/* 56 S> */ B(Ldar), R(4),
/* 58 E> */ B(Add), R(3), U8(16),
B(Star5),
/* 20 E> */ B(JumpLoop), U8(46), I8(0), U8(17),
B(LdaSmi), I8(-1),
B(Star10),
B(Star9),
B(Jump), U8(8),
B(Star10),
B(LdaZero),
B(Star9),
B(LdaTheHole),
B(SetPendingMessage),
B(Star11),
B(Ldar), R(8),
B(JumpIfToBooleanTrue), U8(35),
B(Mov), R(context), R(13),
B(GetNamedProperty), R(7), U8(5), U8(18),
B(JumpIfUndefinedOrNull), U8(26),
B(Star14),
B(CallProperty0), R(14), R(7), U8(20),
B(JumpIfJSReceiver), U8(19),
B(Star15),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(15), U8(1),
B(Jump), U8(11),
B(Star13),
B(LdaZero),
B(TestReferenceEqual), R(9),
B(JumpIfTrue), U8(5),
B(Ldar), R(13),
B(ReThrow),
B(LdaZero),
B(TestReferenceEqual), R(9),
B(JumpIfFalse), U8(8),
B(Ldar), R(11),
B(SetPendingMessage),
B(Ldar), R(10),
B(ReThrow),
B(LdaUndefined),
/* 65 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["x"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["y"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["return"],
]
handlers: [
[17, 67, 73],
[86, 105, 107],
]
---
snippet: "
function* f(arr) {
for (let x of arr) { let y = x; }
}
f([1, 2, 3]);
"
frame size: 15
parameter count: 2
bytecode array length: 160
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(Mov), R(closure), R(5),
B(Mov), R(this), R(6),
/* 11 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(5), U8(2),
B(Star0),
/* 11 E> */ B(SuspendGenerator), R(0), R(0), U8(5), U8(0),
B(ResumeGenerator), R(0), R(0), U8(5),
B(Star5),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
B(Ldar), R(5),
/* 11 E> */ B(Throw),
B(Ldar), R(5),
B(Return),
/* 35 S> */ B(GetIterator), R(arg0), U8(0), U8(2),
B(Star6),
B(GetNamedProperty), R(6), U8(3), U8(4),
B(Star5),
B(LdaFalse),
B(Star7),
B(LdaTheHole),
B(Star10),
B(Mov), R(context), R(11),
B(LdaTrue),
B(Star7),
/* 30 S> */ B(CallProperty0), R(5), R(6), U8(6),
B(Star12),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(12), U8(1),
B(GetNamedProperty), R(12), U8(4), U8(8),
B(JumpIfToBooleanTrue), U8(24),
B(GetNamedProperty), R(12), U8(5), U8(10),
B(Star12),
B(LdaFalse),
B(Star7),
B(Mov), R(12), R(1),
/* 30 S> */ B(Mov), R(1), R(3),
/* 50 S> */ B(Mov), R(3), R(4),
B(Ldar), R(12),
/* 21 E> */ B(JumpLoop), U8(38), I8(0), U8(12),
B(LdaSmi), I8(-1),
B(Star9),
B(Star8),
B(Jump), U8(8),
B(Star9),
B(LdaZero),
B(Star8),
B(LdaTheHole),
B(SetPendingMessage),
B(Star10),
B(Ldar), R(7),
B(JumpIfToBooleanTrue), U8(35),
B(Mov), R(context), R(12),
B(GetNamedProperty), R(6), U8(6), U8(13),
B(JumpIfUndefinedOrNull), U8(26),
B(Star13),
B(CallProperty0), R(13), R(6), U8(15),
B(JumpIfJSReceiver), U8(19),
B(Star14),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(14), U8(1),
B(Jump), U8(11),
B(Star12),
B(LdaZero),
B(TestReferenceEqual), R(8),
B(JumpIfTrue), U8(5),
B(Ldar), R(12),
B(ReThrow),
B(LdaZero),
B(TestReferenceEqual), R(8),
B(JumpIfFalse), U8(8),
B(Ldar), R(10),
B(SetPendingMessage),
B(Ldar), R(9),
B(ReThrow),
B(LdaUndefined),
/* 55 S> */ B(Return),
]
constant pool: [
Smi [20],
Smi [10],
Smi [7],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["return"],
]
handlers: [
[56, 98, 104],
[117, 136, 138],
]
---
snippet: "
function* f(arr) {
for (let x of arr) yield x;
}
f([1, 2, 3]);
"
frame size: 14
parameter count: 2
bytecode array length: 198
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(4),
B(Mov), R(this), R(5),
/* 11 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
B(Star0),
/* 11 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0),
B(ResumeGenerator), R(0), R(0), U8(4),
B(Star4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(4),
/* 11 E> */ B(Throw),
B(Ldar), R(4),
B(Return),
/* 35 S> */ B(GetIterator), R(arg0), U8(0), U8(2),
B(Star5),
B(GetNamedProperty), R(5), U8(4), U8(4),
B(Star4),
B(LdaFalse),
B(Star6),
B(LdaTheHole),
B(Star9),
B(Mov), R(context), R(10),
B(LdaTrue),
B(Star6),
/* 30 S> */ B(CallProperty0), R(4), R(5), U8(6),
B(Star11),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(11), U8(1),
B(GetNamedProperty), R(11), U8(5), U8(8),
B(JumpIfToBooleanTrue), U8(56),
B(GetNamedProperty), R(11), U8(6), U8(10),
B(Star11),
B(LdaFalse),
B(Star6),
B(Mov), R(11), R(1),
/* 30 S> */ B(Mov), R(1), R(3),
/* 40 S> */ B(LdaFalse),
B(Star12),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(11), U8(2),
/* 40 E> */ B(SuspendGenerator), R(0), R(0), U8(11), U8(1),
B(ResumeGenerator), R(0), R(0), U8(11),
B(Star11),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(7), U8(2), I8(0),
B(Ldar), R(11),
/* 40 E> */ B(Throw),
B(LdaSmi), I8(1),
B(Star7),
B(Mov), R(11), R(8),
B(Jump), U8(20),
B(Ldar), R(11),
/* 21 E> */ B(JumpLoop), U8(70), I8(0), U8(12),
B(LdaSmi), I8(-1),
B(Star8),
B(Star7),
B(Jump), U8(8),
B(Star8),
B(LdaZero),
B(Star7),
B(LdaTheHole),
B(SetPendingMessage),
B(Star9),
B(Ldar), R(6),
B(JumpIfToBooleanTrue), U8(35),
B(Mov), R(context), R(11),
B(GetNamedProperty), R(5), U8(9), U8(13),
B(JumpIfUndefinedOrNull), U8(26),
B(Star12),
B(CallProperty0), R(12), R(5), U8(15),
B(JumpIfJSReceiver), U8(19),
B(Star13),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(13), U8(1),
B(Jump), U8(11),
B(Star11),
B(LdaZero),
B(TestReferenceEqual), R(7),
B(JumpIfTrue), U8(5),
B(Ldar), R(11),
B(ReThrow),
B(Ldar), R(7),
B(SwitchOnSmiNoFeedback), U8(10), U8(2), I8(0),
B(Jump), U8(11),
B(Ldar), R(9),
B(SetPendingMessage),
B(Ldar), R(8),
B(ReThrow),
B(Ldar), R(8),
B(Return),
B(LdaUndefined),
/* 49 S> */ B(Return),
]
constant pool: [
Smi [20],
Smi [100],
Smi [10],
Smi [7],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
Smi [15],
Smi [7],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["return"],
Smi [6],
Smi [12],
]
handlers: [
[56, 130, 136],
[149, 168, 170],
]
---
snippet: "
async function f(arr) {
for (let x of arr) { let y = x; }
}
f([1, 2, 3]);
"
frame size: 16
parameter count: 2
bytecode array length: 154
bytecodes: [
B(Mov), R(closure), R(5),
B(Mov), R(this), R(6),
/* 16 E> */ B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(5), U8(2),
B(Star0),
B(Mov), R(context), R(5),
/* 40 S> */ B(GetIterator), R(arg0), U8(0), U8(2),
B(Star7),
B(GetNamedProperty), R(7), U8(0), U8(4),
B(Star6),
B(LdaFalse),
B(Star8),
B(LdaTheHole),
B(Star11),
B(Mov), R(context), R(12),
B(LdaTrue),
B(Star8),
/* 35 S> */ B(CallProperty0), R(6), R(7), U8(6),
B(Star13),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(13), U8(1),
B(GetNamedProperty), R(13), U8(1), U8(8),
B(JumpIfToBooleanTrue), U8(24),
B(GetNamedProperty), R(13), U8(2), U8(10),
B(Star13),
B(LdaFalse),
B(Star8),
B(Mov), R(13), R(1),
/* 35 S> */ B(Mov), R(1), R(3),
/* 55 S> */ B(Mov), R(3), R(4),
B(Ldar), R(13),
/* 26 E> */ B(JumpLoop), U8(38), I8(0), U8(12),
B(LdaSmi), I8(-1),
B(Star10),
B(Star9),
B(Jump), U8(8),
B(Star10),
B(LdaZero),
B(Star9),
B(LdaTheHole),
B(SetPendingMessage),
B(Star11),
B(Ldar), R(8),
B(JumpIfToBooleanTrue), U8(35),
B(Mov), R(context), R(13),
B(GetNamedProperty), R(7), U8(3), U8(13),
B(JumpIfUndefinedOrNull), U8(26),
B(Star14),
B(CallProperty0), R(14), R(7), U8(15),
B(JumpIfJSReceiver), U8(19),
B(Star15),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(15), U8(1),
B(Jump), U8(11),
B(Star13),
B(LdaZero),
B(TestReferenceEqual), R(9),
B(JumpIfTrue), U8(5),
B(Ldar), R(13),
B(ReThrow),
B(LdaZero),
B(TestReferenceEqual), R(9),
B(JumpIfFalse), U8(8),
B(Ldar), R(11),
B(SetPendingMessage),
B(Ldar), R(10),
B(ReThrow),
B(LdaUndefined),
B(Star7),
B(Mov), R(0), R(6),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(6), U8(2),
/* 60 S> */ B(Return),
B(Star7),
B(LdaTheHole),
B(SetPendingMessage),
B(Mov), R(0), R(6),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(6), U8(2),
B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["return"],
]
handlers: [
[14, 143, 143],
[31, 73, 79],
[92, 111, 113],
]
---
snippet: "
async function f(arr) {
for (let x of arr) await x;
}
f([1, 2, 3]);
"
frame size: 15
parameter count: 2
bytecode array length: 188
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(Mov), R(closure), R(4),
B(Mov), R(this), R(5),
/* 16 E> */ B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(4), U8(2),
B(Star0),
B(Mov), R(context), R(4),
/* 40 S> */ B(GetIterator), R(arg0), U8(0), U8(2),
B(Star6),
B(GetNamedProperty), R(6), U8(1), U8(4),
B(Star5),
B(LdaFalse),
B(Star7),
B(LdaTheHole),
B(Star10),
B(Mov), R(context), R(11),
B(LdaTrue),
B(Star7),
/* 35 S> */ B(CallProperty0), R(5), R(6), U8(6),
B(Star12),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(12), U8(1),
B(GetNamedProperty), R(12), U8(2), U8(8),
B(JumpIfToBooleanTrue), U8(54),
B(GetNamedProperty), R(12), U8(3), U8(10),
B(Star12),
B(LdaFalse),
B(Star7),
B(Mov), R(12), R(1),
/* 35 S> */ B(Mov), R(1), R(3),
/* 45 S> */ B(Mov), R(0), R(12),
B(Mov), R(3), R(13),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwait), R(12), U8(2),
/* 45 E> */ B(SuspendGenerator), R(0), R(0), U8(12), U8(0),
B(ResumeGenerator), R(0), R(0), U8(12),
B(Star12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star13),
B(LdaZero),
B(TestReferenceEqual), R(13),
B(JumpIfTrue), U8(5),
B(Ldar), R(12),
B(ReThrow),
B(Ldar), R(12),
/* 26 E> */ B(JumpLoop), U8(68), I8(0), U8(12),
B(LdaSmi), I8(-1),
B(Star9),
B(Star8),
B(Jump), U8(8),
B(Star9),
B(LdaZero),
B(Star8),
B(LdaTheHole),
B(SetPendingMessage),
B(Star10),
B(Ldar), R(7),
B(JumpIfToBooleanTrue), U8(35),
B(Mov), R(context), R(12),
B(GetNamedProperty), R(6), U8(4), U8(13),
B(JumpIfUndefinedOrNull), U8(26),
B(Star13),
B(CallProperty0), R(13), R(6), U8(15),
B(JumpIfJSReceiver), U8(19),
B(Star14),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(14), U8(1),
B(Jump), U8(11),
B(Star12),
B(LdaZero),
B(TestReferenceEqual), R(8),
B(JumpIfTrue), U8(5),
B(Ldar), R(12),
B(ReThrow),
B(LdaZero),
B(TestReferenceEqual), R(8),
B(JumpIfFalse), U8(8),
B(Ldar), R(10),
B(SetPendingMessage),
B(Ldar), R(9),
B(ReThrow),
B(LdaUndefined),
B(Star6),
B(Mov), R(0), R(5),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(5), U8(2),
/* 54 S> */ B(Return),
B(Star6),
B(LdaTheHole),
B(SetPendingMessage),
B(Mov), R(0), R(5),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(5), U8(2),
B(Return),
]
constant pool: [
Smi [83],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["return"],
]
handlers: [
[18, 177, 177],
[35, 107, 113],
[126, 145, 147],
]

View File

@ -0,0 +1,64 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
return function(){ }
"
frame size: 0
parameter count: 1
bytecode array length: 5
bytecodes: [
/* 34 S> */ B(CreateClosure), U8(0), U8(0), U8(2),
/* 54 S> */ B(Return),
]
constant pool: [
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
return (function(){ })()
"
frame size: 1
parameter count: 1
bytecode array length: 9
bytecodes: [
/* 34 S> */ B(CreateClosure), U8(0), U8(0), U8(2),
B(Star0),
/* 56 E> */ B(CallUndefinedReceiver0), R(0), U8(0),
/* 58 S> */ B(Return),
]
constant pool: [
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
return (function(x){ return x; })(1)
"
frame size: 2
parameter count: 1
bytecode array length: 13
bytecodes: [
/* 34 S> */ B(CreateClosure), U8(0), U8(0), U8(2),
B(Star0),
B(LdaSmi), I8(1),
B(Star1),
/* 67 E> */ B(CallUndefinedReceiver1), R(0), R(1), U8(0),
/* 70 S> */ B(Return),
]
constant pool: [
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]

View File

@ -0,0 +1,235 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
var obj_a = {val:1};
var b = 10;
if (obj_a == null) { b = 20;}
return b;
"
frame size: 2
parameter count: 1
bytecode array length: 19
bytecodes: [
/* 46 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star0),
/* 63 S> */ B(LdaSmi), I8(10),
B(Star1),
/* 67 S> */ B(Ldar), R(0),
B(TestUndetectable),
B(JumpIfFalse), U8(5),
/* 88 S> */ B(LdaSmi), I8(20),
B(Star1),
/* 97 S> */ B(Ldar), R(1),
/* 106 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
var obj_a = {val:1};
var b = 10;
if (obj_a == undefined) { b = 20;}
return b;
"
frame size: 2
parameter count: 1
bytecode array length: 19
bytecodes: [
/* 46 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star0),
/* 63 S> */ B(LdaSmi), I8(10),
B(Star1),
/* 67 S> */ B(Ldar), R(0),
B(TestUndetectable),
B(JumpIfFalse), U8(5),
/* 93 S> */ B(LdaSmi), I8(20),
B(Star1),
/* 102 S> */ B(Ldar), R(1),
/* 111 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
var obj_a = {val:1};
var b = 10;
if (obj_a != null) { b = 20;}
return b;
"
frame size: 2
parameter count: 1
bytecode array length: 19
bytecodes: [
/* 46 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star0),
/* 63 S> */ B(LdaSmi), I8(10),
B(Star1),
/* 67 S> */ B(Ldar), R(0),
B(TestUndetectable),
B(JumpIfTrue), U8(5),
/* 88 S> */ B(LdaSmi), I8(20),
B(Star1),
/* 97 S> */ B(Ldar), R(1),
/* 106 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
var obj_a = {val:1};
var b = 10;
if (obj_a != undefined) { b = 20;}
return b;
"
frame size: 2
parameter count: 1
bytecode array length: 19
bytecodes: [
/* 46 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star0),
/* 63 S> */ B(LdaSmi), I8(10),
B(Star1),
/* 67 S> */ B(Ldar), R(0),
B(TestUndetectable),
B(JumpIfTrue), U8(5),
/* 93 S> */ B(LdaSmi), I8(20),
B(Star1),
/* 102 S> */ B(Ldar), R(1),
/* 111 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
var obj_a = {val:1};
var b = 10;
if (obj_a === null) { b = 20;}
return b;
"
frame size: 2
parameter count: 1
bytecode array length: 18
bytecodes: [
/* 46 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star0),
/* 63 S> */ B(LdaSmi), I8(10),
B(Star1),
/* 67 S> */ B(Ldar), R(0),
B(JumpIfNotNull), U8(5),
/* 89 S> */ B(LdaSmi), I8(20),
B(Star1),
/* 98 S> */ B(Ldar), R(1),
/* 107 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
var obj_a = {val:1};
var b = 10;
if (obj_a === undefined) { b = 20;}
return b;
"
frame size: 2
parameter count: 1
bytecode array length: 18
bytecodes: [
/* 46 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star0),
/* 63 S> */ B(LdaSmi), I8(10),
B(Star1),
/* 67 S> */ B(Ldar), R(0),
B(JumpIfNotUndefined), U8(5),
/* 94 S> */ B(LdaSmi), I8(20),
B(Star1),
/* 103 S> */ B(Ldar), R(1),
/* 112 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
var obj_a = {val:1};
var b = 10;
if (obj_a !== null) { b = 20;}
return b;
"
frame size: 2
parameter count: 1
bytecode array length: 18
bytecodes: [
/* 46 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star0),
/* 63 S> */ B(LdaSmi), I8(10),
B(Star1),
/* 67 S> */ B(Ldar), R(0),
B(JumpIfNull), U8(5),
/* 89 S> */ B(LdaSmi), I8(20),
B(Star1),
/* 98 S> */ B(Ldar), R(1),
/* 107 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
var obj_a = {val:1};
var b = 10;
if (obj_a !== undefined) { b = 20;}
return b;
"
frame size: 2
parameter count: 1
bytecode array length: 18
bytecodes: [
/* 46 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star0),
/* 63 S> */ B(LdaSmi), I8(10),
B(Star1),
/* 67 S> */ B(Ldar), R(0),
B(JumpIfUndefined), U8(5),
/* 94 S> */ B(LdaSmi), I8(20),
B(Star1),
/* 103 S> */ B(Ldar), R(1),
/* 112 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]

View File

@ -0,0 +1,316 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: f
---
snippet: "
function* f() { }
f();
"
frame size: 3
parameter count: 1
bytecode array length: 41
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(Mov), R(closure), R(1),
B(Mov), R(this), R(2),
/* 11 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(1), U8(2),
B(Star0),
/* 11 E> */ B(SuspendGenerator), R(0), R(0), U8(1), U8(0),
B(ResumeGenerator), R(0), R(0), U8(1),
B(Star1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
B(Ldar), R(1),
/* 11 E> */ B(Throw),
B(Ldar), R(1),
B(Return),
B(LdaUndefined),
/* 16 S> */ B(Return),
]
constant pool: [
Smi [20],
Smi [10],
Smi [7],
]
handlers: [
]
---
snippet: "
function* f() { yield 42 }
f();
"
frame size: 3
parameter count: 1
bytecode array length: 74
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(1),
B(Mov), R(this), R(2),
/* 11 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(1), U8(2),
B(Star0),
/* 11 E> */ B(SuspendGenerator), R(0), R(0), U8(1), U8(0),
B(ResumeGenerator), R(0), R(0), U8(1),
B(Star1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(1),
/* 11 E> */ B(Throw),
B(Ldar), R(1),
B(Return),
/* 16 S> */ B(LdaSmi), I8(42),
B(Star1),
B(LdaFalse),
B(Star2),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(1), U8(2),
/* 16 E> */ B(SuspendGenerator), R(0), R(0), U8(1), U8(1),
B(ResumeGenerator), R(0), R(0), U8(1),
B(Star1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(4), U8(2), I8(0),
B(Ldar), R(1),
/* 16 E> */ B(Throw),
B(Ldar), R(1),
B(Return),
B(LdaUndefined),
/* 25 S> */ B(Return),
]
constant pool: [
Smi [20],
Smi [53],
Smi [10],
Smi [7],
Smi [10],
Smi [7],
]
handlers: [
]
---
snippet: "
function* f() { for (let x of [42]) yield x }
f();
"
frame size: 14
parameter count: 1
bytecode array length: 203
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(4),
B(Mov), R(this), R(5),
/* 11 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
B(Star0),
/* 11 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0),
B(ResumeGenerator), R(0), R(0), U8(4),
B(Star4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(4),
/* 11 E> */ B(Throw),
B(Ldar), R(4),
B(Return),
/* 30 S> */ B(CreateArrayLiteral), U8(4), U8(0), U8(37),
B(Star6),
B(GetIterator), R(6), U8(1), U8(3),
B(Star5),
B(GetNamedProperty), R(5), U8(5), U8(5),
B(Star4),
B(LdaFalse),
B(Star6),
B(LdaTheHole),
B(Star9),
B(Mov), R(context), R(10),
B(LdaTrue),
B(Star6),
/* 25 S> */ B(CallProperty0), R(4), R(5), U8(7),
B(Star11),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(11), U8(1),
B(GetNamedProperty), R(11), U8(6), U8(9),
B(JumpIfToBooleanTrue), U8(56),
B(GetNamedProperty), R(11), U8(7), U8(11),
B(Star11),
B(LdaFalse),
B(Star6),
B(Mov), R(11), R(1),
/* 25 S> */ B(Mov), R(1), R(3),
/* 36 S> */ B(LdaFalse),
B(Star12),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(11), U8(2),
/* 36 E> */ B(SuspendGenerator), R(0), R(0), U8(11), U8(1),
B(ResumeGenerator), R(0), R(0), U8(11),
B(Star11),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(8), U8(2), I8(0),
B(Ldar), R(11),
/* 36 E> */ B(Throw),
B(LdaSmi), I8(1),
B(Star7),
B(Mov), R(11), R(8),
B(Jump), U8(20),
B(Ldar), R(11),
/* 16 E> */ B(JumpLoop), U8(70), I8(0), U8(13),
B(LdaSmi), I8(-1),
B(Star8),
B(Star7),
B(Jump), U8(8),
B(Star8),
B(LdaZero),
B(Star7),
B(LdaTheHole),
B(SetPendingMessage),
B(Star9),
B(Ldar), R(6),
B(JumpIfToBooleanTrue), U8(35),
B(Mov), R(context), R(11),
B(GetNamedProperty), R(5), U8(10), U8(14),
B(JumpIfUndefinedOrNull), U8(26),
B(Star12),
B(CallProperty0), R(12), R(5), U8(16),
B(JumpIfJSReceiver), U8(19),
B(Star13),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(13), U8(1),
B(Jump), U8(11),
B(Star11),
B(LdaZero),
B(TestReferenceEqual), R(7),
B(JumpIfTrue), U8(5),
B(Ldar), R(11),
B(ReThrow),
B(Ldar), R(7),
B(SwitchOnSmiNoFeedback), U8(11), U8(2), I8(0),
B(Jump), U8(11),
B(Ldar), R(9),
B(SetPendingMessage),
B(Ldar), R(8),
B(ReThrow),
B(Ldar), R(8),
B(Return),
B(LdaUndefined),
/* 44 S> */ B(Return),
]
constant pool: [
Smi [20],
Smi [105],
Smi [10],
Smi [7],
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
Smi [15],
Smi [7],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["return"],
Smi [6],
Smi [12],
]
handlers: [
[61, 135, 141],
[154, 173, 175],
]
---
snippet: "
function* g() { yield 42 }
function* f() { yield* g() }
f();
"
frame size: 7
parameter count: 1
bytecode array length: 182
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(1),
B(Mov), R(this), R(2),
/* 38 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(1), U8(2),
B(Star0),
/* 38 E> */ B(SuspendGenerator), R(0), R(0), U8(1), U8(0),
B(ResumeGenerator), R(0), R(0), U8(1),
B(Star1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(1),
/* 38 E> */ B(Throw),
B(Ldar), R(1),
B(Return),
/* 43 S> */ B(LdaGlobal), U8(4), U8(0),
B(Star5),
/* 50 E> */ B(CallUndefinedReceiver0), R(5), U8(2),
B(Star6),
B(GetIterator), R(6), U8(4), U8(6),
B(Star3),
B(GetNamedProperty), R(3), U8(5), U8(8),
B(Star5),
B(LdaUndefined),
B(Star4),
B(LdaZero),
B(Star2),
B(Ldar), R(2),
B(SwitchOnSmiNoFeedback), U8(6), U8(2), I8(1),
B(CallProperty1), R(5), R(3), R(4), U8(10),
B(Jump), U8(59),
B(GetNamedProperty), R(3), U8(8), U8(12),
B(JumpIfUndefinedOrNull), U8(10),
B(Star6),
B(CallProperty1), R(6), R(3), R(4), U8(14),
B(Jump), U8(45),
B(Ldar), R(4),
B(Return),
B(GetNamedProperty), R(3), U8(9), U8(16),
B(JumpIfUndefinedOrNull), U8(10),
B(Star6),
B(CallProperty1), R(6), R(3), R(4), U8(18),
B(Jump), U8(28),
B(GetNamedProperty), R(3), U8(8), U8(20),
B(JumpIfUndefinedOrNull), U8(17),
B(Star6),
B(CallProperty0), R(6), R(3), U8(22),
B(Jump), U8(2),
B(JumpIfJSReceiver), U8(8),
B(Star6),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
B(CallRuntime), U16(Runtime::kThrowThrowMethodMissing), R(0), U8(0),
B(Star1),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(1), U8(1),
B(GetNamedProperty), R(1), U8(10), U8(24),
B(JumpIfToBooleanTrue), U8(23),
B(Ldar), R(1),
/* 43 E> */ B(SuspendGenerator), R(0), R(0), U8(6), U8(1),
B(ResumeGenerator), R(0), R(0), U8(6),
B(Star4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star2),
B(JumpLoop), U8(101), I8(0), U8(26),
B(GetNamedProperty), R(1), U8(11), U8(27),
B(Star3),
B(LdaSmi), I8(1),
B(TestReferenceEqual), R(2),
B(JumpIfFalse), U8(5),
B(Ldar), R(3),
B(Return),
B(LdaUndefined),
/* 54 S> */ B(Return),
]
constant pool: [
Smi [20],
Smi [152],
Smi [10],
Smi [7],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["g"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
Smi [11],
Smi [28],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["return"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["throw"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
]
handlers: [
]

View File

@ -0,0 +1,54 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: f
---
snippet: "
var global = 1;
function f() { return global &= 1; }
f();
"
frame size: 1
parameter count: 1
bytecode array length: 13
bytecodes: [
/* 31 S> */ B(LdaGlobal), U8(0), U8(0),
B(BitwiseAndSmi), I8(1), U8(2),
B(Star0),
/* 45 E> */ B(StaGlobal), U8(0), U8(3),
B(Ldar), R(0),
/* 50 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["global"],
]
handlers: [
]
---
snippet: "
unallocated = 1;
function f() { return unallocated += 1; }
f();
"
frame size: 1
parameter count: 1
bytecode array length: 13
bytecodes: [
/* 32 S> */ B(LdaGlobal), U8(0), U8(0),
B(AddSmi), I8(1), U8(2),
B(Star0),
/* 51 E> */ B(StaGlobal), U8(0), U8(3),
B(Ldar), R(0),
/* 56 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["unallocated"],
]
handlers: [
]

View File

@ -0,0 +1,104 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: f
---
snippet: "
var global = 1;
function f() { return ++global; }
f();
"
frame size: 1
parameter count: 1
bytecode array length: 12
bytecodes: [
/* 31 S> */ B(LdaGlobal), U8(0), U8(0),
B(Inc), U8(2),
B(Star0),
/* 40 E> */ B(StaGlobal), U8(0), U8(3),
B(Ldar), R(0),
/* 47 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["global"],
]
handlers: [
]
---
snippet: "
var global = 1;
function f() { return global--; }
f();
"
frame size: 2
parameter count: 1
bytecode array length: 15
bytecodes: [
/* 31 S> */ B(LdaGlobal), U8(0), U8(0),
B(ToNumeric), U8(2),
B(Star0),
B(Dec), U8(2),
B(Star1),
/* 44 E> */ B(StaGlobal), U8(0), U8(3),
B(Ldar), R(0),
/* 47 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["global"],
]
handlers: [
]
---
snippet: "
unallocated = 1;
function f() { 'use strict'; return --unallocated; }
f();
"
frame size: 1
parameter count: 1
bytecode array length: 12
bytecodes: [
/* 46 S> */ B(LdaGlobal), U8(0), U8(0),
B(Dec), U8(2),
B(Star0),
/* 55 E> */ B(StaGlobal), U8(0), U8(3),
B(Ldar), R(0),
/* 67 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["unallocated"],
]
handlers: [
]
---
snippet: "
unallocated = 1;
function f() { return unallocated++; }
f();
"
frame size: 2
parameter count: 1
bytecode array length: 15
bytecodes: [
/* 32 S> */ B(LdaGlobal), U8(0), U8(0),
B(ToNumeric), U8(2),
B(Star0),
B(Inc), U8(2),
B(Star1),
/* 50 E> */ B(StaGlobal), U8(0), U8(3),
B(Ldar), R(0),
/* 53 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["unallocated"],
]
handlers: [
]

View File

@ -0,0 +1,104 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: f
---
snippet: "
var a = {x:13, y:14};
function f() {
return delete a.x;
};
f();
"
frame size: 1
parameter count: 1
bytecode array length: 9
bytecodes: [
/* 39 S> */ B(LdaGlobal), U8(0), U8(0),
B(Star0),
B(LdaConstant), U8(1),
B(DeletePropertySloppy), R(0),
/* 57 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["a"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["x"],
]
handlers: [
]
---
snippet: "
a = {1:13, 2:14};
function f() {
'use strict';
return delete a[1];
};
f();
"
frame size: 1
parameter count: 1
bytecode array length: 9
bytecodes: [
/* 51 S> */ B(LdaGlobal), U8(0), U8(0),
B(Star0),
B(LdaSmi), I8(1),
B(DeletePropertyStrict), R(0),
/* 70 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["a"],
]
handlers: [
]
---
snippet: "
var a = {x:13, y:14};
function f() {
return delete a;
};
f();
"
frame size: 1
parameter count: 1
bytecode array length: 9
bytecodes: [
/* 39 S> */ B(LdaConstant), U8(0),
B(Star0),
B(CallRuntime), U16(Runtime::kDeleteLookupSlot), R(0), U8(1),
/* 55 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["a"],
]
handlers: [
]
---
snippet: "
b = 30;
function f() {
return delete b;
};
f();
"
frame size: 1
parameter count: 1
bytecode array length: 9
bytecodes: [
/* 25 S> */ B(LdaConstant), U8(0),
B(Star0),
B(CallRuntime), U16(Runtime::kDeleteLookupSlot), R(0), U8(1),
/* 41 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["b"],
]
handlers: [
]

View File

@ -0,0 +1,63 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
return 1.2;
"
frame size: 0
parameter count: 1
bytecode array length: 3
bytecodes: [
/* 34 S> */ B(LdaConstant), U8(0),
/* 45 S> */ B(Return),
]
constant pool: [
HEAP_NUMBER_TYPE [1.2],
]
handlers: [
]
---
snippet: "
var a = 1.2; return 2.6;
"
frame size: 1
parameter count: 1
bytecode array length: 6
bytecodes: [
/* 42 S> */ B(LdaConstant), U8(0),
B(Star0),
/* 47 S> */ B(LdaConstant), U8(1),
/* 58 S> */ B(Return),
]
constant pool: [
HEAP_NUMBER_TYPE [1.2],
HEAP_NUMBER_TYPE [2.6],
]
handlers: [
]
---
snippet: "
var a = 3.14; return 3.14;
"
frame size: 1
parameter count: 1
bytecode array length: 6
bytecodes: [
/* 42 S> */ B(LdaConstant), U8(0),
B(Star0),
/* 48 S> */ B(LdaConstant), U8(0),
/* 60 S> */ B(Return),
]
constant pool: [
HEAP_NUMBER_TYPE [3.14],
]
handlers: [
]

View File

@ -0,0 +1,287 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
top level: yes
print callee: yes
---
snippet: "
(function() {
l = {};
l.a = 2;
l.b = l.a;
return arguments.callee;
})();
"
frame size: 3
parameter count: 1
bytecode array length: 37
bytecodes: [
/* 16 E> */ B(CreateMappedArguments),
B(Star0),
/* 29 S> */ B(CreateEmptyObjectLiteral),
/* 31 E> */ B(StaGlobal), U8(0), U8(0),
/* 45 S> */ B(LdaGlobal), U8(0), U8(2),
B(Star1),
B(LdaSmi), I8(2),
/* 49 E> */ B(SetNamedProperty), R(1), U8(1), U8(4),
/* 62 S> */ B(LdaGlobal), U8(0), U8(2),
B(Star1),
/* 68 E> */ B(LdaGlobal), U8(0), U8(2),
B(Star2),
/* 70 E> */ B(GetNamedProperty), R(2), U8(1), U8(6),
/* 66 E> */ B(SetNamedProperty), R(1), U8(2), U8(8),
/* 98 S> */ B(GetNamedProperty), R(0), U8(3), U8(10),
/* 105 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["l"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["a"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["b"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["callee"],
]
handlers: [
]
---
snippet: "
(function() {
l = {
'a': 4.3,
'b': 3.4
};
if (l.a < 3) {
l.a = 3;
} else {
l.a = l.b;
}
return arguments.callee;
})();
"
frame size: 3
parameter count: 1
bytecode array length: 58
bytecodes: [
/* 16 E> */ B(CreateMappedArguments),
B(Star0),
/* 29 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
/* 31 E> */ B(StaGlobal), U8(1), U8(1),
/* 93 S> */ B(LdaGlobal), U8(1), U8(3),
B(Star1),
/* 99 E> */ B(GetNamedProperty), R(1), U8(2), U8(5),
B(Star1),
B(LdaSmi), I8(3),
/* 101 E> */ B(TestLessThan), R(1), U8(7),
B(JumpIfFalse), U8(14),
/* 118 S> */ B(LdaGlobal), U8(1), U8(3),
B(Star1),
B(LdaSmi), I8(3),
/* 122 E> */ B(SetNamedProperty), R(1), U8(2), U8(8),
B(Jump), U8(18),
/* 154 S> */ B(LdaGlobal), U8(1), U8(3),
B(Star1),
/* 160 E> */ B(LdaGlobal), U8(1), U8(3),
B(Star2),
/* 162 E> */ B(GetNamedProperty), R(2), U8(3), U8(10),
/* 158 E> */ B(SetNamedProperty), R(1), U8(2), U8(8),
/* 200 S> */ B(GetNamedProperty), R(0), U8(4), U8(12),
/* 207 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["l"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["a"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["b"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["callee"],
]
handlers: [
]
---
snippet: "
this.f0 = function() {};
this.f1 = function(a) {};
this.f2 = function(a, b) {};
this.f3 = function(a, b, c) {};
this.f4 = function(a, b, c, d) {};
this.f5 = function(a, b, c, d, e) {};
(function() {
this.f0();
this.f1(1);
this.f2(1, 2);
this.f3(1, 2, 3);
this.f4(1, 2, 3, 4);
this.f5(1, 2, 3, 4, 5);
return arguments.callee;
})();
"
frame size: 8
parameter count: 1
bytecode array length: 121
bytecodes: [
/* 237 E> */ B(CreateMappedArguments),
B(Star0),
/* 255 S> */ B(GetNamedProperty), R(this), U8(0), U8(0),
B(Star1),
/* 255 E> */ B(CallProperty0), R(1), R(this), U8(2),
/* 274 S> */ B(GetNamedProperty), R(this), U8(1), U8(4),
B(Star1),
B(LdaSmi), I8(1),
B(Star3),
/* 274 E> */ B(CallProperty1), R(1), R(this), R(3), U8(6),
/* 294 S> */ B(GetNamedProperty), R(this), U8(2), U8(8),
B(Star1),
B(LdaSmi), I8(1),
B(Star3),
B(LdaSmi), I8(2),
B(Star4),
/* 294 E> */ B(CallProperty2), R(1), R(this), R(3), R(4), U8(10),
/* 317 S> */ B(GetNamedProperty), R(this), U8(3), U8(12),
B(Star1),
B(LdaSmi), I8(1),
B(Star3),
B(LdaSmi), I8(2),
B(Star4),
B(LdaSmi), I8(3),
B(Star5),
B(Mov), R(this), R(2),
/* 317 E> */ B(CallProperty), R(1), R(2), U8(4), U8(14),
/* 343 S> */ B(GetNamedProperty), R(this), U8(4), U8(16),
B(Star1),
B(LdaSmi), I8(1),
B(Star3),
B(LdaSmi), I8(2),
B(Star4),
B(LdaSmi), I8(3),
B(Star5),
B(LdaSmi), I8(4),
B(Star6),
B(Mov), R(this), R(2),
/* 343 E> */ B(CallProperty), R(1), R(2), U8(5), U8(18),
/* 372 S> */ B(GetNamedProperty), R(this), U8(5), U8(20),
B(Star1),
B(LdaSmi), I8(1),
B(Star3),
B(LdaSmi), I8(2),
B(Star4),
B(LdaSmi), I8(3),
B(Star5),
B(LdaSmi), I8(4),
B(Star6),
B(LdaSmi), I8(5),
B(Star7),
B(Mov), R(this), R(2),
/* 372 E> */ B(CallProperty), R(1), R(2), U8(6), U8(22),
/* 416 S> */ B(GetNamedProperty), R(0), U8(6), U8(24),
/* 423 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["f0"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["f1"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["f2"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["f3"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["f4"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["f5"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["callee"],
]
handlers: [
]
---
snippet: "
function f0() {}
function f1(a) {}
function f2(a, b) {}
function f3(a, b, c) {}
function f4(a, b, c, d) {}
function f5(a, b, c, d, e) {}
(function() {
f0();
f1(1);
f2(1, 2);
f3(1, 2, 3);
f4(1, 2, 3, 4);
f5(1, 2, 3, 4, 5);
return arguments.callee;
})();
"
frame size: 7
parameter count: 1
bytecode array length: 103
bytecodes: [
/* 189 E> */ B(CreateMappedArguments),
B(Star0),
/* 202 S> */ B(LdaGlobal), U8(0), U8(0),
B(Star1),
/* 202 E> */ B(CallUndefinedReceiver0), R(1), U8(2),
/* 216 S> */ B(LdaGlobal), U8(1), U8(4),
B(Star1),
B(LdaSmi), I8(1),
B(Star2),
/* 216 E> */ B(CallUndefinedReceiver1), R(1), R(2), U8(6),
/* 231 S> */ B(LdaGlobal), U8(2), U8(8),
B(Star1),
B(LdaSmi), I8(1),
B(Star2),
B(LdaSmi), I8(2),
B(Star3),
/* 231 E> */ B(CallUndefinedReceiver2), R(1), R(2), R(3), U8(10),
/* 249 S> */ B(LdaGlobal), U8(3), U8(12),
B(Star1),
B(LdaSmi), I8(1),
B(Star2),
B(LdaSmi), I8(2),
B(Star3),
B(LdaSmi), I8(3),
B(Star4),
/* 249 E> */ B(CallUndefinedReceiver), R(1), R(2), U8(3), U8(14),
/* 270 S> */ B(LdaGlobal), U8(4), U8(16),
B(Star1),
B(LdaSmi), I8(1),
B(Star2),
B(LdaSmi), I8(2),
B(Star3),
B(LdaSmi), I8(3),
B(Star4),
B(LdaSmi), I8(4),
B(Star5),
/* 270 E> */ B(CallUndefinedReceiver), R(1), R(2), U8(4), U8(18),
/* 294 S> */ B(LdaGlobal), U8(5), U8(20),
B(Star1),
B(LdaSmi), I8(1),
B(Star2),
B(LdaSmi), I8(2),
B(Star3),
B(LdaSmi), I8(3),
B(Star4),
B(LdaSmi), I8(4),
B(Star5),
B(LdaSmi), I8(5),
B(Star6),
/* 294 E> */ B(CallUndefinedReceiver), R(1), R(2), U8(5), U8(22),
/* 338 S> */ B(GetNamedProperty), R(0), U8(6), U8(24),
/* 345 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["f0"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["f1"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["f2"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["f3"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["f4"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["f5"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["callee"],
]
handlers: [
]

View File

@ -0,0 +1,503 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: f
---
snippet: "
function f() {
if (0) {
return 1;
} else {
return -1;
}
};
f();
"
frame size: 0
parameter count: 1
bytecode array length: 3
bytecodes: [
/* 55 S> */ B(LdaSmi), I8(-1),
/* 65 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function f() {
if ('lucky') {
return 1;
} else {
return -1;
}
};
f();
"
frame size: 0
parameter count: 1
bytecode array length: 3
bytecodes: [
/* 36 S> */ B(LdaSmi), I8(1),
/* 45 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function f() {
if (false) {
return 1;
} else {
return -1;
}
};
f();
"
frame size: 0
parameter count: 1
bytecode array length: 3
bytecodes: [
/* 59 S> */ B(LdaSmi), I8(-1),
/* 69 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function f() {
if (false) {
return 1;
}
};
f();
"
frame size: 0
parameter count: 1
bytecode array length: 2
bytecodes: [
/* 17 S> */ B(LdaUndefined),
/* 48 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function f() {
var a = 1;
if (a) {
a += 1;
} else {
return 2;
}
};
f();
"
frame size: 1
parameter count: 1
bytecode array length: 18
bytecodes: [
/* 25 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 30 S> */ B(JumpIfToBooleanFalse), U8(10),
/* 43 S> */ B(Ldar), R(0),
B(AddSmi), I8(1), U8(0),
B(Star0),
B(Jump), U8(5),
/* 66 S> */ B(LdaSmi), I8(2),
/* 75 S> */ B(Return),
B(LdaUndefined),
/* 80 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function f(a) {
if (a <= 0) {
return 200;
} else {
return -200;
}
};
f(99);
"
frame size: 0
parameter count: 2
bytecode array length: 16
bytecodes: [
/* 18 S> */ B(LdaZero),
/* 24 E> */ B(TestLessThanOrEqual), R(arg0), U8(0),
B(JumpIfFalse), U8(7),
/* 36 S> */ B(Wide), B(LdaSmi), I16(200),
/* 47 S> */ B(Return),
/* 63 S> */ B(Wide), B(LdaSmi), I16(-200),
/* 75 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function f(a, b) { if (a in b) { return 200; } }f('prop', { prop: 'yes'});
"
frame size: 0
parameter count: 3
bytecode array length: 14
bytecodes: [
/* 19 S> */ B(Ldar), R(arg1),
/* 25 E> */ B(TestIn), R(arg0), U8(0),
B(JumpIfFalse), U8(7),
/* 33 S> */ B(Wide), B(LdaSmi), I16(200),
/* 44 S> */ B(Return),
B(LdaUndefined),
/* 47 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function f(z) { var a = 0; var b = 0; if (a === 0.01) {
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
return 200; } else { return -200; } } f(0.001);
"
frame size: 2
parameter count: 2
bytecode array length: 24
bytecodes: [
/* 24 S> */ B(LdaZero),
B(Star0),
/* 35 S> */ B(LdaZero),
B(Star1),
/* 38 S> */ B(LdaConstant), U8(0),
/* 44 E> */ B(TestEqualStrict), R(0), U8(0),
B(JumpIfFalse), U8(10),
/* 58 S> */ B(Mov), R(0), R(1),
/* 1081 S> */ B(Wide), B(LdaSmi), I16(200),
/* 1092 S> */ B(Return),
/* 1102 S> */ B(Wide), B(LdaSmi), I16(-200),
/* 1114 S> */ B(Return),
]
constant pool: [
HEAP_NUMBER_TYPE [0.01],
]
handlers: [
]
---
snippet: "
function f() {
var a = 0; var b = 0;
if (a) {
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
b = a; a = b;
return 200; } else { return -200; }
};
f();
"
frame size: 2
parameter count: 1
bytecode array length: 21
bytecodes: [
/* 25 S> */ B(LdaZero),
B(Star0),
/* 36 S> */ B(LdaZero),
B(Star1),
/* 41 S> */ B(Ldar), R(0),
B(JumpIfToBooleanFalse), U8(10),
/* 52 S> */ B(Mov), R(0), R(1),
/* 1076 S> */ B(Wide), B(LdaSmi), I16(200),
/* 1087 S> */ B(Return),
/* 1097 S> */ B(Wide), B(LdaSmi), I16(-200),
/* 1109 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function f(a, b) {
if (a == b) { return 1; }
if (a === b) { return 1; }
if (a < b) { return 1; }
if (a > b) { return 1; }
if (a <= b) { return 1; }
if (a >= b) { return 1; }
if (a in b) { return 1; }
if (a instanceof b) { return 1; }
return 0;
}
f(1, 1);
"
frame size: 0
parameter count: 3
bytecode array length: 82
bytecodes: [
/* 21 S> */ B(Ldar), R(arg1),
/* 27 E> */ B(TestEqual), R(arg0), U8(0),
B(JumpIfFalse), U8(5),
/* 35 S> */ B(LdaSmi), I8(1),
/* 44 S> */ B(Return),
/* 49 S> */ B(Ldar), R(arg1),
/* 55 E> */ B(TestEqualStrict), R(arg0), U8(1),
B(JumpIfFalse), U8(5),
/* 64 S> */ B(LdaSmi), I8(1),
/* 73 S> */ B(Return),
/* 78 S> */ B(Ldar), R(arg1),
/* 84 E> */ B(TestLessThan), R(arg0), U8(2),
B(JumpIfFalse), U8(5),
/* 91 S> */ B(LdaSmi), I8(1),
/* 100 S> */ B(Return),
/* 105 S> */ B(Ldar), R(arg1),
/* 111 E> */ B(TestGreaterThan), R(arg0), U8(3),
B(JumpIfFalse), U8(5),
/* 118 S> */ B(LdaSmi), I8(1),
/* 127 S> */ B(Return),
/* 132 S> */ B(Ldar), R(arg1),
/* 138 E> */ B(TestLessThanOrEqual), R(arg0), U8(4),
B(JumpIfFalse), U8(5),
/* 146 S> */ B(LdaSmi), I8(1),
/* 155 S> */ B(Return),
/* 160 S> */ B(Ldar), R(arg1),
/* 166 E> */ B(TestGreaterThanOrEqual), R(arg0), U8(5),
B(JumpIfFalse), U8(5),
/* 174 S> */ B(LdaSmi), I8(1),
/* 183 S> */ B(Return),
/* 188 S> */ B(Ldar), R(arg1),
/* 194 E> */ B(TestIn), R(arg0), U8(6),
B(JumpIfFalse), U8(5),
/* 202 S> */ B(LdaSmi), I8(1),
/* 211 S> */ B(Return),
/* 216 S> */ B(Ldar), R(arg1),
/* 222 E> */ B(TestInstanceOf), R(arg0), U8(8),
B(JumpIfFalse), U8(5),
/* 238 S> */ B(LdaSmi), I8(1),
/* 247 S> */ B(Return),
/* 252 S> */ B(LdaZero),
/* 261 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function f() {
var a = 0;
if (a) {
return 20;
} else {
return -20;
}
};
f();
"
frame size: 1
parameter count: 1
bytecode array length: 10
bytecodes: [
/* 25 S> */ B(LdaZero),
B(Star0),
/* 30 S> */ B(JumpIfToBooleanFalse), U8(5),
/* 43 S> */ B(LdaSmi), I8(20),
/* 53 S> */ B(Return),
/* 69 S> */ B(LdaSmi), I8(-20),
/* 80 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function f(a, b) {
if (a == b || a < 0) {
return 1;
} else if (a > 0 && b > 0) {
return 0;
} else {
return -1;
}
};
f(-1, 1);
"
frame size: 0
parameter count: 3
bytecode array length: 33
bytecodes: [
/* 21 S> */ B(Ldar), R(arg1),
/* 27 E> */ B(TestEqual), R(arg0), U8(0),
B(JumpIfTrue), U8(8),
B(LdaZero),
/* 37 E> */ B(TestLessThan), R(arg0), U8(1),
B(JumpIfFalse), U8(5),
/* 48 S> */ B(LdaSmi), I8(1),
/* 57 S> */ B(Return),
/* 67 S> */ B(LdaZero),
/* 73 E> */ B(TestGreaterThan), R(arg0), U8(2),
B(JumpIfFalse), U8(10),
B(LdaZero),
/* 82 E> */ B(TestGreaterThan), R(arg1), U8(3),
B(JumpIfFalse), U8(4),
/* 93 S> */ B(LdaZero),
/* 102 S> */ B(Return),
/* 118 S> */ B(LdaSmi), I8(-1),
/* 128 S> */ B(Return),
]
constant pool: [
]
handlers: [
]

View File

@ -0,0 +1,59 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
return 12345678;
"
frame size: 0
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 34 S> */ B(ExtraWide), B(LdaSmi), I32(12345678),
/* 50 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 1234; return 5678;
"
frame size: 1
parameter count: 1
bytecode array length: 10
bytecodes: [
/* 42 S> */ B(Wide), B(LdaSmi), I16(1234),
B(Star0),
/* 48 S> */ B(Wide), B(LdaSmi), I16(5678),
/* 60 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 1234; return 1234;
"
frame size: 1
parameter count: 1
bytecode array length: 10
bytecodes: [
/* 42 S> */ B(Wide), B(LdaSmi), I16(1234),
B(Star0),
/* 48 S> */ B(Wide), B(LdaSmi), I16(1234),
/* 60 S> */ B(Return),
]
constant pool: [
]
handlers: [
]

View File

@ -0,0 +1,86 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
let x = 10;
"
frame size: 1
parameter count: 1
bytecode array length: 5
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(10),
B(Star0),
B(LdaUndefined),
/* 46 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
let x = 10; return x;
"
frame size: 1
parameter count: 1
bytecode array length: 4
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(10),
B(Star0),
/* 55 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
let x = (x = 20);
"
frame size: 2
parameter count: 1
bytecode array length: 14
bytecodes: [
B(LdaTheHole),
B(Star0),
/* 42 S> */ B(LdaSmi), I8(20),
B(Star1),
B(Ldar), R(0),
/* 45 E> */ B(ThrowReferenceErrorIfHole), U8(0),
B(Mov), R(1), R(0),
B(LdaUndefined),
/* 52 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["x"],
]
handlers: [
]
---
snippet: "
let x = 10; x = 20;
"
frame size: 1
parameter count: 1
bytecode array length: 8
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(10),
B(Star0),
/* 46 S> */ B(LdaSmi), I8(20),
B(Star0),
B(LdaUndefined),
/* 54 S> */ B(Return),
]
constant pool: [
]
handlers: [
]

View File

@ -0,0 +1,107 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
let x = 10; function f1() {return x;}
"
frame size: 1
parameter count: 1
bytecode array length: 14
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(0),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
/* 42 S> */ B(LdaSmi), I8(10),
/* 42 E> */ B(StaCurrentContextSlot), U8(2),
B(LdaUndefined),
/* 72 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
]
handlers: [
]
---
snippet: "
let x = 10; function f1() {return x;} return x;
"
frame size: 1
parameter count: 1
bytecode array length: 15
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(0),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
/* 42 S> */ B(LdaSmi), I8(10),
/* 42 E> */ B(StaCurrentContextSlot), U8(2),
/* 72 S> */ B(LdaImmutableCurrentContextSlot), U8(2),
/* 81 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
]
handlers: [
]
---
snippet: "
let x = (x = 20); function f1() {return x;}
"
frame size: 2
parameter count: 1
bytecode array length: 23
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(0),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
/* 42 S> */ B(LdaSmi), I8(20),
B(Star1),
B(LdaCurrentContextSlot), U8(2),
/* 45 E> */ B(ThrowReferenceErrorIfHole), U8(1),
B(Ldar), R(1),
B(StaCurrentContextSlot), U8(2),
/* 42 E> */ B(StaCurrentContextSlot), U8(2),
B(LdaUndefined),
/* 78 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["x"],
]
handlers: [
]
---
snippet: "
let x = 10; x = 20; function f1() {return x;}
"
frame size: 1
parameter count: 1
bytecode array length: 18
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(0),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
/* 42 S> */ B(LdaSmi), I8(10),
/* 42 E> */ B(StaCurrentContextSlot), U8(2),
/* 46 S> */ B(LdaSmi), I8(20),
/* 48 E> */ B(StaCurrentContextSlot), U8(2),
B(LdaUndefined),
/* 80 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
]
handlers: [
]

View File

@ -0,0 +1,473 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: f
---
snippet: "
var a = 1;
function f() { return a; }
f()
"
frame size: 0
parameter count: 1
bytecode array length: 4
bytecodes: [
/* 26 S> */ B(LdaGlobal), U8(0), U8(0),
/* 35 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["a"],
]
handlers: [
]
---
snippet: "
function t() { }
function f() { return t; }
f()
"
frame size: 0
parameter count: 1
bytecode array length: 4
bytecodes: [
/* 32 S> */ B(LdaGlobal), U8(0), U8(0),
/* 41 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["t"],
]
handlers: [
]
---
snippet: "
a = 1;
function f() { return a; }
f()
"
frame size: 0
parameter count: 1
bytecode array length: 4
bytecodes: [
/* 22 S> */ B(LdaGlobal), U8(0), U8(0),
/* 31 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["a"],
]
handlers: [
]
---
snippet: "
a = 1;
function f(c) {
var b = {};
b.name512;
b.name513;
b.name514;
b.name515;
b.name516;
b.name517;
b.name518;
b.name519;
b.name520;
b.name521;
b.name522;
b.name523;
b.name524;
b.name525;
b.name526;
b.name527;
b.name528;
b.name529;
b.name530;
b.name531;
b.name532;
b.name533;
b.name534;
b.name535;
b.name536;
b.name537;
b.name538;
b.name539;
b.name540;
b.name541;
b.name542;
b.name543;
b.name544;
b.name545;
b.name546;
b.name547;
b.name548;
b.name549;
b.name550;
b.name551;
b.name552;
b.name553;
b.name554;
b.name555;
b.name556;
b.name557;
b.name558;
b.name559;
b.name560;
b.name561;
b.name562;
b.name563;
b.name564;
b.name565;
b.name566;
b.name567;
b.name568;
b.name569;
b.name570;
b.name571;
b.name572;
b.name573;
b.name574;
b.name575;
b.name576;
b.name577;
b.name578;
b.name579;
b.name580;
b.name581;
b.name582;
b.name583;
b.name584;
b.name585;
b.name586;
b.name587;
b.name588;
b.name589;
b.name590;
b.name591;
b.name592;
b.name593;
b.name594;
b.name595;
b.name596;
b.name597;
b.name598;
b.name599;
b.name600;
b.name601;
b.name602;
b.name603;
b.name604;
b.name605;
b.name606;
b.name607;
b.name608;
b.name609;
b.name610;
b.name611;
b.name612;
b.name613;
b.name614;
b.name615;
b.name616;
b.name617;
b.name618;
b.name619;
b.name620;
b.name621;
b.name622;
b.name623;
b.name624;
b.name625;
b.name626;
b.name627;
b.name628;
b.name629;
b.name630;
b.name631;
b.name632;
b.name633;
b.name634;
b.name635;
b.name636;
b.name637;
b.name638;
b.name639;
return a;
}
f({name: 1});
"
frame size: 1
parameter count: 2
bytecode array length: 521
bytecodes: [
/* 33 S> */ B(CreateEmptyObjectLiteral),
B(Star0),
/* 41 S> */ B(GetNamedProperty), R(0), U8(0), U8(0),
/* 54 S> */ B(GetNamedProperty), R(0), U8(1), U8(2),
/* 67 S> */ B(GetNamedProperty), R(0), U8(2), U8(4),
/* 80 S> */ B(GetNamedProperty), R(0), U8(3), U8(6),
/* 93 S> */ B(GetNamedProperty), R(0), U8(4), U8(8),
/* 106 S> */ B(GetNamedProperty), R(0), U8(5), U8(10),
/* 119 S> */ B(GetNamedProperty), R(0), U8(6), U8(12),
/* 132 S> */ B(GetNamedProperty), R(0), U8(7), U8(14),
/* 145 S> */ B(GetNamedProperty), R(0), U8(8), U8(16),
/* 158 S> */ B(GetNamedProperty), R(0), U8(9), U8(18),
/* 171 S> */ B(GetNamedProperty), R(0), U8(10), U8(20),
/* 184 S> */ B(GetNamedProperty), R(0), U8(11), U8(22),
/* 197 S> */ B(GetNamedProperty), R(0), U8(12), U8(24),
/* 210 S> */ B(GetNamedProperty), R(0), U8(13), U8(26),
/* 223 S> */ B(GetNamedProperty), R(0), U8(14), U8(28),
/* 236 S> */ B(GetNamedProperty), R(0), U8(15), U8(30),
/* 249 S> */ B(GetNamedProperty), R(0), U8(16), U8(32),
/* 262 S> */ B(GetNamedProperty), R(0), U8(17), U8(34),
/* 275 S> */ B(GetNamedProperty), R(0), U8(18), U8(36),
/* 288 S> */ B(GetNamedProperty), R(0), U8(19), U8(38),
/* 301 S> */ B(GetNamedProperty), R(0), U8(20), U8(40),
/* 314 S> */ B(GetNamedProperty), R(0), U8(21), U8(42),
/* 327 S> */ B(GetNamedProperty), R(0), U8(22), U8(44),
/* 340 S> */ B(GetNamedProperty), R(0), U8(23), U8(46),
/* 353 S> */ B(GetNamedProperty), R(0), U8(24), U8(48),
/* 366 S> */ B(GetNamedProperty), R(0), U8(25), U8(50),
/* 379 S> */ B(GetNamedProperty), R(0), U8(26), U8(52),
/* 392 S> */ B(GetNamedProperty), R(0), U8(27), U8(54),
/* 405 S> */ B(GetNamedProperty), R(0), U8(28), U8(56),
/* 418 S> */ B(GetNamedProperty), R(0), U8(29), U8(58),
/* 431 S> */ B(GetNamedProperty), R(0), U8(30), U8(60),
/* 444 S> */ B(GetNamedProperty), R(0), U8(31), U8(62),
/* 457 S> */ B(GetNamedProperty), R(0), U8(32), U8(64),
/* 470 S> */ B(GetNamedProperty), R(0), U8(33), U8(66),
/* 483 S> */ B(GetNamedProperty), R(0), U8(34), U8(68),
/* 496 S> */ B(GetNamedProperty), R(0), U8(35), U8(70),
/* 509 S> */ B(GetNamedProperty), R(0), U8(36), U8(72),
/* 522 S> */ B(GetNamedProperty), R(0), U8(37), U8(74),
/* 535 S> */ B(GetNamedProperty), R(0), U8(38), U8(76),
/* 548 S> */ B(GetNamedProperty), R(0), U8(39), U8(78),
/* 561 S> */ B(GetNamedProperty), R(0), U8(40), U8(80),
/* 574 S> */ B(GetNamedProperty), R(0), U8(41), U8(82),
/* 587 S> */ B(GetNamedProperty), R(0), U8(42), U8(84),
/* 600 S> */ B(GetNamedProperty), R(0), U8(43), U8(86),
/* 613 S> */ B(GetNamedProperty), R(0), U8(44), U8(88),
/* 626 S> */ B(GetNamedProperty), R(0), U8(45), U8(90),
/* 639 S> */ B(GetNamedProperty), R(0), U8(46), U8(92),
/* 652 S> */ B(GetNamedProperty), R(0), U8(47), U8(94),
/* 665 S> */ B(GetNamedProperty), R(0), U8(48), U8(96),
/* 678 S> */ B(GetNamedProperty), R(0), U8(49), U8(98),
/* 691 S> */ B(GetNamedProperty), R(0), U8(50), U8(100),
/* 704 S> */ B(GetNamedProperty), R(0), U8(51), U8(102),
/* 717 S> */ B(GetNamedProperty), R(0), U8(52), U8(104),
/* 730 S> */ B(GetNamedProperty), R(0), U8(53), U8(106),
/* 743 S> */ B(GetNamedProperty), R(0), U8(54), U8(108),
/* 756 S> */ B(GetNamedProperty), R(0), U8(55), U8(110),
/* 769 S> */ B(GetNamedProperty), R(0), U8(56), U8(112),
/* 782 S> */ B(GetNamedProperty), R(0), U8(57), U8(114),
/* 795 S> */ B(GetNamedProperty), R(0), U8(58), U8(116),
/* 808 S> */ B(GetNamedProperty), R(0), U8(59), U8(118),
/* 821 S> */ B(GetNamedProperty), R(0), U8(60), U8(120),
/* 834 S> */ B(GetNamedProperty), R(0), U8(61), U8(122),
/* 847 S> */ B(GetNamedProperty), R(0), U8(62), U8(124),
/* 860 S> */ B(GetNamedProperty), R(0), U8(63), U8(126),
/* 873 S> */ B(GetNamedProperty), R(0), U8(64), U8(128),
/* 886 S> */ B(GetNamedProperty), R(0), U8(65), U8(130),
/* 899 S> */ B(GetNamedProperty), R(0), U8(66), U8(132),
/* 912 S> */ B(GetNamedProperty), R(0), U8(67), U8(134),
/* 925 S> */ B(GetNamedProperty), R(0), U8(68), U8(136),
/* 938 S> */ B(GetNamedProperty), R(0), U8(69), U8(138),
/* 951 S> */ B(GetNamedProperty), R(0), U8(70), U8(140),
/* 964 S> */ B(GetNamedProperty), R(0), U8(71), U8(142),
/* 977 S> */ B(GetNamedProperty), R(0), U8(72), U8(144),
/* 990 S> */ B(GetNamedProperty), R(0), U8(73), U8(146),
/* 1003 S> */ B(GetNamedProperty), R(0), U8(74), U8(148),
/* 1016 S> */ B(GetNamedProperty), R(0), U8(75), U8(150),
/* 1029 S> */ B(GetNamedProperty), R(0), U8(76), U8(152),
/* 1042 S> */ B(GetNamedProperty), R(0), U8(77), U8(154),
/* 1055 S> */ B(GetNamedProperty), R(0), U8(78), U8(156),
/* 1068 S> */ B(GetNamedProperty), R(0), U8(79), U8(158),
/* 1081 S> */ B(GetNamedProperty), R(0), U8(80), U8(160),
/* 1094 S> */ B(GetNamedProperty), R(0), U8(81), U8(162),
/* 1107 S> */ B(GetNamedProperty), R(0), U8(82), U8(164),
/* 1120 S> */ B(GetNamedProperty), R(0), U8(83), U8(166),
/* 1133 S> */ B(GetNamedProperty), R(0), U8(84), U8(168),
/* 1146 S> */ B(GetNamedProperty), R(0), U8(85), U8(170),
/* 1159 S> */ B(GetNamedProperty), R(0), U8(86), U8(172),
/* 1172 S> */ B(GetNamedProperty), R(0), U8(87), U8(174),
/* 1185 S> */ B(GetNamedProperty), R(0), U8(88), U8(176),
/* 1198 S> */ B(GetNamedProperty), R(0), U8(89), U8(178),
/* 1211 S> */ B(GetNamedProperty), R(0), U8(90), U8(180),
/* 1224 S> */ B(GetNamedProperty), R(0), U8(91), U8(182),
/* 1237 S> */ B(GetNamedProperty), R(0), U8(92), U8(184),
/* 1250 S> */ B(GetNamedProperty), R(0), U8(93), U8(186),
/* 1263 S> */ B(GetNamedProperty), R(0), U8(94), U8(188),
/* 1276 S> */ B(GetNamedProperty), R(0), U8(95), U8(190),
/* 1289 S> */ B(GetNamedProperty), R(0), U8(96), U8(192),
/* 1302 S> */ B(GetNamedProperty), R(0), U8(97), U8(194),
/* 1315 S> */ B(GetNamedProperty), R(0), U8(98), U8(196),
/* 1328 S> */ B(GetNamedProperty), R(0), U8(99), U8(198),
/* 1341 S> */ B(GetNamedProperty), R(0), U8(100), U8(200),
/* 1354 S> */ B(GetNamedProperty), R(0), U8(101), U8(202),
/* 1367 S> */ B(GetNamedProperty), R(0), U8(102), U8(204),
/* 1380 S> */ B(GetNamedProperty), R(0), U8(103), U8(206),
/* 1393 S> */ B(GetNamedProperty), R(0), U8(104), U8(208),
/* 1406 S> */ B(GetNamedProperty), R(0), U8(105), U8(210),
/* 1419 S> */ B(GetNamedProperty), R(0), U8(106), U8(212),
/* 1432 S> */ B(GetNamedProperty), R(0), U8(107), U8(214),
/* 1445 S> */ B(GetNamedProperty), R(0), U8(108), U8(216),
/* 1458 S> */ B(GetNamedProperty), R(0), U8(109), U8(218),
/* 1471 S> */ B(GetNamedProperty), R(0), U8(110), U8(220),
/* 1484 S> */ B(GetNamedProperty), R(0), U8(111), U8(222),
/* 1497 S> */ B(GetNamedProperty), R(0), U8(112), U8(224),
/* 1510 S> */ B(GetNamedProperty), R(0), U8(113), U8(226),
/* 1523 S> */ B(GetNamedProperty), R(0), U8(114), U8(228),
/* 1536 S> */ B(GetNamedProperty), R(0), U8(115), U8(230),
/* 1549 S> */ B(GetNamedProperty), R(0), U8(116), U8(232),
/* 1562 S> */ B(GetNamedProperty), R(0), U8(117), U8(234),
/* 1575 S> */ B(GetNamedProperty), R(0), U8(118), U8(236),
/* 1588 S> */ B(GetNamedProperty), R(0), U8(119), U8(238),
/* 1601 S> */ B(GetNamedProperty), R(0), U8(120), U8(240),
/* 1614 S> */ B(GetNamedProperty), R(0), U8(121), U8(242),
/* 1627 S> */ B(GetNamedProperty), R(0), U8(122), U8(244),
/* 1640 S> */ B(GetNamedProperty), R(0), U8(123), U8(246),
/* 1653 S> */ B(GetNamedProperty), R(0), U8(124), U8(248),
/* 1666 S> */ B(GetNamedProperty), R(0), U8(125), U8(250),
/* 1679 S> */ B(GetNamedProperty), R(0), U8(126), U8(252),
/* 1692 S> */ B(GetNamedProperty), R(0), U8(127), U8(254),
/* 1703 S> */ B(Wide), B(LdaGlobal), U16(128), U16(256),
/* 1712 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name512"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name513"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name514"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name515"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name516"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name517"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name518"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name519"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name520"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name521"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name522"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name523"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name524"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name525"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name526"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name527"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name528"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name529"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name530"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name531"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name532"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name533"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name534"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name535"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name536"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name537"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name538"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name539"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name540"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name541"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name542"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name543"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name544"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name545"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name546"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name547"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name548"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name549"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name550"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name551"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name552"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name553"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name554"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name555"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name556"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name557"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name558"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name559"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name560"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name561"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name562"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name563"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name564"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name565"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name566"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name567"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name568"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name569"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name570"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name571"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name572"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name573"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name574"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name575"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name576"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name577"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name578"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name579"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name580"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name581"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name582"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name583"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name584"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name585"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name586"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name587"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name588"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name589"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name590"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name591"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name592"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name593"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name594"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name595"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name596"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name597"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name598"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name599"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name600"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name601"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name602"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name603"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name604"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name605"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name606"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name607"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name608"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name609"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name610"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name611"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name612"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name613"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name614"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name615"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name616"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name617"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name618"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name619"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name620"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name621"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name622"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name623"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name624"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name625"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name626"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name627"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name628"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name629"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name630"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name631"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name632"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name633"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name634"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name635"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name636"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name637"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name638"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name639"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["a"],
]
handlers: [
]

View File

@ -0,0 +1,924 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
var x = 0; return x || 3;
"
frame size: 1
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 45 S> */ B(JumpIfToBooleanTrue), U8(4),
B(LdaSmi), I8(3),
/* 59 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0; return (x == 1) || 3;
"
frame size: 1
parameter count: 1
bytecode array length: 12
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 45 S> */ B(LdaSmi), I8(1),
/* 55 E> */ B(TestEqual), R(0), U8(0),
B(JumpIfTrue), U8(4),
B(LdaSmi), I8(3),
/* 66 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0; return x && 3;
"
frame size: 1
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 45 S> */ B(JumpIfToBooleanFalse), U8(4),
B(LdaSmi), I8(3),
/* 59 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0; return (x == 0) && 3;
"
frame size: 1
parameter count: 1
bytecode array length: 11
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 45 S> */ B(LdaZero),
/* 55 E> */ B(TestEqual), R(0), U8(0),
B(JumpIfFalse), U8(4),
B(LdaSmi), I8(3),
/* 66 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0; return x || (1, 2, 3);
"
frame size: 1
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 45 S> */ B(JumpIfToBooleanTrue), U8(4),
/* 64 S> */ B(LdaSmi), I8(3),
/* 67 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 2, b = 3, c = 4; return a || (a, b, a, b, c = 5, 3);
"
frame size: 3
parameter count: 1
bytecode array length: 19
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 49 S> */ B(LdaSmi), I8(3),
B(Star1),
/* 56 S> */ B(LdaSmi), I8(4),
B(Star2),
/* 59 S> */ B(Ldar), R(0),
B(JumpIfToBooleanTrue), U8(7),
/* 86 S> */ B(LdaSmi), I8(5),
B(Star2),
/* 91 S> */ B(LdaSmi), I8(3),
/* 94 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 1; var a = 2, b = 3; return x || (
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2, 3);
"
frame size: 3
parameter count: 1
bytecode array length: 208
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 53 S> */ B(LdaSmi), I8(2),
B(Star1),
/* 60 S> */ B(LdaSmi), I8(3),
B(Star2),
/* 63 S> */ B(Ldar), R(0),
B(JumpIfToBooleanTrue), U8(196),
B(LdaSmi), I8(1),
B(Star1),
/* 88 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 98 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 105 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 115 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 122 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 132 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 139 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 149 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 156 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 166 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 173 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 183 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 190 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 200 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 207 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 217 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 224 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 234 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 241 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 251 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 258 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 268 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 275 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 285 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 292 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 302 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 309 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 319 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 326 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 336 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 343 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 353 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 360 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 370 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 377 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 387 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 394 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 404 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 411 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 421 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 428 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 438 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 445 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 455 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 462 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 472 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 479 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 489 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 496 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 506 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 513 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 523 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 530 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 540 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 547 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 557 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 564 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 574 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 581 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 591 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 598 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 608 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 615 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 620 S> */ B(LdaSmi), I8(3),
/* 623 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0; var a = 2, b = 3; return x && (
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2, 3);
"
frame size: 3
parameter count: 1
bytecode array length: 207
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 53 S> */ B(LdaSmi), I8(2),
B(Star1),
/* 60 S> */ B(LdaSmi), I8(3),
B(Star2),
/* 63 S> */ B(Ldar), R(0),
B(JumpIfToBooleanFalse), U8(196),
B(LdaSmi), I8(1),
B(Star1),
/* 88 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 98 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 105 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 115 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 122 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 132 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 139 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 149 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 156 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 166 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 173 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 183 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 190 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 200 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 207 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 217 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 224 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 234 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 241 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 251 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 258 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 268 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 275 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 285 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 292 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 302 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 309 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 319 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 326 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 336 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 343 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 353 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 360 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 370 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 377 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 387 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 394 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 404 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 411 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 421 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 428 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 438 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 445 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 455 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 462 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 472 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 479 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 489 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 496 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 506 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 513 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 523 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 530 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 540 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 547 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 557 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 564 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 574 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 581 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 591 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 598 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 608 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 615 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 620 S> */ B(LdaSmi), I8(3),
/* 623 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 1; var a = 2, b = 3; return (x > 3) || (
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2, 3);
"
frame size: 3
parameter count: 1
bytecode array length: 211
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 53 S> */ B(LdaSmi), I8(2),
B(Star1),
/* 60 S> */ B(LdaSmi), I8(3),
B(Star2),
/* 63 S> */ B(LdaSmi), I8(3),
/* 73 E> */ B(TestGreaterThan), R(0), U8(0),
B(JumpIfTrue), U8(196),
B(LdaSmi), I8(1),
B(Star1),
/* 94 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 104 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 111 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 121 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 128 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 138 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 145 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 155 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 162 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 172 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 179 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 189 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 196 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 206 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 213 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 223 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 230 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 240 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 247 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 257 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 264 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 274 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 281 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 291 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 298 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 308 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 315 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 325 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 332 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 342 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 349 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 359 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 366 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 376 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 383 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 393 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 400 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 410 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 417 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 427 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 434 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 444 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 451 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 461 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 468 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 478 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 485 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 495 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 502 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 512 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 519 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 529 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 536 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 546 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 553 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 563 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 570 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 580 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 587 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 597 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 604 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 614 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 621 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 626 S> */ B(LdaSmi), I8(3),
/* 629 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0; var a = 2, b = 3; return (x < 5) && (
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2,
a = 1, b = 2, 3);
"
frame size: 3
parameter count: 1
bytecode array length: 210
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 53 S> */ B(LdaSmi), I8(2),
B(Star1),
/* 60 S> */ B(LdaSmi), I8(3),
B(Star2),
/* 63 S> */ B(LdaSmi), I8(5),
/* 73 E> */ B(TestLessThan), R(0), U8(0),
B(JumpIfFalse), U8(196),
B(LdaSmi), I8(1),
B(Star1),
/* 94 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 104 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 111 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 121 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 128 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 138 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 145 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 155 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 162 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 172 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 179 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 189 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 196 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 206 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 213 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 223 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 230 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 240 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 247 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 257 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 264 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 274 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 281 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 291 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 298 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 308 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 315 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 325 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 332 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 342 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 349 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 359 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 366 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 376 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 383 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 393 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 400 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 410 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 417 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 427 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 434 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 444 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 451 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 461 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 468 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 478 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 485 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 495 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 502 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 512 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 519 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 529 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 536 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 546 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 553 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 563 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 570 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 580 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 587 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 597 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 604 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 614 S> */ B(LdaSmi), I8(1),
B(Star1),
/* 621 S> */ B(LdaSmi), I8(2),
B(Star2),
/* 626 S> */ B(LdaSmi), I8(3),
/* 629 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
return 0 && 3;
"
frame size: 0
parameter count: 1
bytecode array length: 2
bytecodes: [
/* 34 S> */ B(LdaZero),
/* 48 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
return 1 || 3;
"
frame size: 0
parameter count: 1
bytecode array length: 3
bytecodes: [
/* 34 S> */ B(LdaSmi), I8(1),
/* 48 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 1; return x && 3 || 0, 1;
"
frame size: 1
parameter count: 1
bytecode array length: 13
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(JumpIfToBooleanFalse), U8(4),
B(LdaSmi), I8(3),
B(JumpIfToBooleanTrue), U8(3),
B(LdaZero),
/* 65 S> */ B(LdaSmi), I8(1),
/* 67 S> */ B(Return),
]
constant pool: [
]
handlers: [
]

View File

@ -0,0 +1,240 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
test function name: f
---
snippet: "
eval('var x = 10;'); return x;
"
frame size: 10
parameter count: 1
bytecode array length: 56
bytecodes: [
/* 10 E> */ B(CreateFunctionContext), U8(0), U8(4),
B(PushContext), R(1),
B(Ldar), R(this),
B(StaCurrentContextSlot), U8(3),
B(CreateMappedArguments),
B(StaCurrentContextSlot), U8(5),
B(Ldar), R(0),
B(StaCurrentContextSlot), U8(4),
/* 14 S> */ B(LdaLookupGlobalSlot), U8(1), U8(0), U8(1),
B(Star2),
B(LdaConstant), U8(2),
B(Star3),
B(LdaZero),
B(Star7),
B(LdaSmi), I8(2),
B(Star8),
B(LdaSmi), I8(14),
B(Star9),
B(Mov), R(2), R(4),
B(Mov), R(3), R(5),
B(Mov), R(closure), R(6),
B(CallRuntime), U16(Runtime::kResolvePossiblyDirectEval), R(4), U8(6),
B(Star2),
/* 14 E> */ B(CallUndefinedReceiver1), R(2), R(3), U8(2),
/* 35 S> */ B(LdaLookupGlobalSlot), U8(3), U8(4), U8(1),
/* 44 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["eval"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["var x = 10;"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["x"],
]
handlers: [
]
---
snippet: "
eval('var x = 10;'); return typeof x;
"
frame size: 10
parameter count: 1
bytecode array length: 58
bytecodes: [
/* 10 E> */ B(CreateFunctionContext), U8(0), U8(4),
B(PushContext), R(1),
B(Ldar), R(this),
B(StaCurrentContextSlot), U8(3),
B(CreateMappedArguments),
B(StaCurrentContextSlot), U8(5),
B(Ldar), R(0),
B(StaCurrentContextSlot), U8(4),
/* 14 S> */ B(LdaLookupGlobalSlot), U8(1), U8(0), U8(1),
B(Star2),
B(LdaConstant), U8(2),
B(Star3),
B(LdaZero),
B(Star7),
B(LdaSmi), I8(2),
B(Star8),
B(LdaSmi), I8(14),
B(Star9),
B(Mov), R(2), R(4),
B(Mov), R(3), R(5),
B(Mov), R(closure), R(6),
B(CallRuntime), U16(Runtime::kResolvePossiblyDirectEval), R(4), U8(6),
B(Star2),
/* 14 E> */ B(CallUndefinedReceiver1), R(2), R(3), U8(2),
/* 35 S> */ B(LdaLookupGlobalSlotInsideTypeof), U8(3), U8(4), U8(1),
B(TypeOf), U8(6),
/* 51 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["eval"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["var x = 10;"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["x"],
]
handlers: [
]
---
snippet: "
x = 20; return eval('');
"
frame size: 10
parameter count: 1
bytecode array length: 57
bytecodes: [
/* 10 E> */ B(CreateFunctionContext), U8(0), U8(4),
B(PushContext), R(1),
B(Ldar), R(this),
B(StaCurrentContextSlot), U8(3),
B(CreateMappedArguments),
B(StaCurrentContextSlot), U8(5),
B(Ldar), R(0),
B(StaCurrentContextSlot), U8(4),
/* 14 S> */ B(LdaSmi), I8(20),
/* 16 E> */ B(StaLookupSlot), U8(1), U8(0),
/* 22 S> */ B(LdaLookupGlobalSlot), U8(2), U8(0), U8(1),
B(Star2),
B(LdaConstant), U8(3),
B(Star3),
B(LdaZero),
B(Star7),
B(LdaSmi), I8(2),
B(Star8),
B(LdaSmi), I8(29),
B(Star9),
B(Mov), R(2), R(4),
B(Mov), R(3), R(5),
B(Mov), R(closure), R(6),
B(CallRuntime), U16(Runtime::kResolvePossiblyDirectEval), R(4), U8(6),
B(Star2),
/* 29 E> */ B(CallUndefinedReceiver1), R(2), R(3), U8(2),
/* 38 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["x"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["eval"],
INTERNALIZED_ONE_BYTE_STRING_TYPE [""],
]
handlers: [
]
---
snippet: "
var x = 20;
f = function(){
eval('var x = 10');
return x;
}
f();
"
frame size: 10
parameter count: 1
bytecode array length: 56
bytecodes: [
/* 38 E> */ B(CreateFunctionContext), U8(0), U8(4),
B(PushContext), R(1),
B(Ldar), R(this),
B(StaCurrentContextSlot), U8(3),
B(CreateMappedArguments),
B(StaCurrentContextSlot), U8(5),
B(Ldar), R(0),
B(StaCurrentContextSlot), U8(4),
/* 44 S> */ B(LdaLookupGlobalSlot), U8(1), U8(0), U8(1),
B(Star2),
B(LdaConstant), U8(2),
B(Star3),
B(LdaZero),
B(Star7),
B(LdaSmi), I8(3),
B(Star8),
B(LdaSmi), I8(44),
B(Star9),
B(Mov), R(2), R(4),
B(Mov), R(3), R(5),
B(Mov), R(closure), R(6),
B(CallRuntime), U16(Runtime::kResolvePossiblyDirectEval), R(4), U8(6),
B(Star2),
/* 44 E> */ B(CallUndefinedReceiver1), R(2), R(3), U8(2),
/* 66 S> */ B(LdaLookupContextSlot), U8(3), U8(4), U8(1),
/* 75 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["eval"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["var x = 10"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["x"],
]
handlers: [
]
---
snippet: "
x = 20;
f = function(){
eval('var x = 10');
return x;
}
f();
"
frame size: 10
parameter count: 1
bytecode array length: 56
bytecodes: [
/* 34 E> */ B(CreateFunctionContext), U8(0), U8(4),
B(PushContext), R(1),
B(Ldar), R(this),
B(StaCurrentContextSlot), U8(3),
B(CreateMappedArguments),
B(StaCurrentContextSlot), U8(5),
B(Ldar), R(0),
B(StaCurrentContextSlot), U8(4),
/* 40 S> */ B(LdaLookupGlobalSlot), U8(1), U8(0), U8(1),
B(Star2),
B(LdaConstant), U8(2),
B(Star3),
B(LdaZero),
B(Star7),
B(LdaSmi), I8(3),
B(Star8),
B(LdaSmi), I8(40),
B(Star9),
B(Mov), R(2), R(4),
B(Mov), R(3), R(5),
B(Mov), R(closure), R(6),
B(CallRuntime), U16(Runtime::kResolvePossiblyDirectEval), R(4), U8(6),
B(Star2),
/* 40 E> */ B(CallUndefinedReceiver1), R(2), R(3), U8(2),
/* 62 S> */ B(LdaLookupGlobalSlot), U8(3), U8(4), U8(1),
/* 71 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["eval"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["var x = 10"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["x"],
]
handlers: [
]

View File

@ -0,0 +1,101 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: f
---
snippet: "
var f;
var x = 1;
function f1() {
eval(\"function t() { return x; }; f = t; f();\");
}
f1();
"
frame size: 0
parameter count: 1
bytecode array length: 5
bytecodes: [
/* 15 S> */ B(LdaLookupGlobalSlot), U8(0), U8(0), U8(1),
/* 24 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["x"],
]
handlers: [
]
---
snippet: "
var f;
var x = 1;
function f1() {
eval(\"function t() { x = 10; }; f = t; f();\");
}
f1();
"
frame size: 0
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 15 S> */ B(LdaSmi), I8(10),
/* 17 E> */ B(StaLookupSlot), U8(0), U8(0),
B(LdaUndefined),
/* 23 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["x"],
]
handlers: [
]
---
snippet: "
var f;
var x = 1;
function f1() {
eval(\"function t() { 'use strict'; x = 10; }; f = t; f();\");
}
f1();
"
frame size: 0
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 29 S> */ B(LdaSmi), I8(10),
/* 31 E> */ B(StaLookupSlot), U8(0), U8(1),
B(LdaUndefined),
/* 37 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["x"],
]
handlers: [
]
---
snippet: "
var f;
var x = 1;
function f1() {
eval(\"function t() { return typeof x; }; f = t; f();\");
}
f1();
"
frame size: 0
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 15 S> */ B(LdaLookupGlobalSlotInsideTypeof), U8(0), U8(0), U8(1),
B(TypeOf), U8(2),
/* 31 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["x"],
]
handlers: [
]

View File

@ -0,0 +1,476 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
module: yes
top level: yes
---
snippet: "
import \"bar\";
"
frame size: 3
parameter count: 1
bytecode array length: 41
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(Mov), R(closure), R(1),
B(Mov), R(this), R(2),
/* 0 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(1), U8(2),
B(Star0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(1), U8(0),
B(ResumeGenerator), R(0), R(0), U8(1),
B(Star1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
B(Ldar), R(1),
/* 0 E> */ B(Throw),
B(Ldar), R(1),
B(Return),
B(LdaUndefined),
/* 14 S> */ B(Return),
]
constant pool: [
Smi [20],
Smi [10],
Smi [7],
]
handlers: [
]
---
snippet: "
import {foo} from \"bar\";
"
frame size: 3
parameter count: 1
bytecode array length: 41
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(Mov), R(closure), R(1),
B(Mov), R(this), R(2),
/* 0 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(1), U8(2),
B(Star0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(1), U8(0),
B(ResumeGenerator), R(0), R(0), U8(1),
B(Star1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
B(Ldar), R(1),
/* 0 E> */ B(Throw),
B(Ldar), R(1),
B(Return),
B(LdaUndefined),
/* 25 S> */ B(Return),
]
constant pool: [
Smi [20],
Smi [10],
Smi [7],
]
handlers: [
]
---
snippet: "
import {foo as goo} from \"bar\";
goo(42);
{ let x; { goo(42) } };
"
frame size: 4
parameter count: 1
bytecode array length: 67
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(Mov), R(closure), R(2),
B(Mov), R(this), R(3),
/* 0 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(2), U8(2),
B(Star0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0),
B(ResumeGenerator), R(0), R(0), U8(2),
B(Star2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
B(Ldar), R(2),
/* 0 E> */ B(Throw),
B(Ldar), R(2),
B(Return),
/* 32 S> */ B(LdaModuleVariable), I8(-1), U8(0),
B(ThrowReferenceErrorIfHole), U8(3),
B(Star2),
B(LdaSmi), I8(42),
B(Star3),
/* 32 E> */ B(CallUndefinedReceiver1), R(2), R(3), U8(0),
/* 47 S> */ B(LdaUndefined),
B(Star1),
/* 52 S> */ B(LdaModuleVariable), I8(-1), U8(0),
B(Star2),
B(LdaSmi), I8(42),
B(Star3),
/* 52 E> */ B(CallUndefinedReceiver1), R(2), R(3), U8(2),
B(LdaUndefined),
/* 65 S> */ B(Return),
]
constant pool: [
Smi [20],
Smi [10],
Smi [7],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["goo"],
]
handlers: [
]
---
snippet: "
export var foo = 42;
foo++;
{ let x; { foo++ } };
"
frame size: 4
parameter count: 1
bytecode array length: 64
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(Mov), R(closure), R(2),
B(Mov), R(this), R(3),
/* 0 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(2), U8(2),
B(Star0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0),
B(ResumeGenerator), R(0), R(0), U8(2),
B(Star2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
B(Ldar), R(2),
/* 0 E> */ B(Throw),
B(Ldar), R(2),
B(Return),
/* 17 S> */ B(LdaSmi), I8(42),
/* 17 E> */ B(StaModuleVariable), I8(1), U8(0),
/* 21 S> */ B(LdaModuleVariable), I8(1), U8(0),
B(Inc), U8(0),
/* 24 E> */ B(StaModuleVariable), I8(1), U8(0),
/* 34 S> */ B(LdaUndefined),
B(Star1),
/* 39 S> */ B(LdaModuleVariable), I8(1), U8(0),
B(Inc), U8(1),
/* 42 E> */ B(StaModuleVariable), I8(1), U8(0),
B(LdaUndefined),
/* 50 S> */ B(Return),
]
constant pool: [
Smi [20],
Smi [10],
Smi [7],
]
handlers: [
]
---
snippet: "
export let foo = 42;
foo++;
{ let x; { foo++ } };
"
frame size: 4
parameter count: 1
bytecode array length: 77
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(Mov), R(closure), R(2),
B(Mov), R(this), R(3),
/* 0 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(2), U8(2),
B(Star0),
B(LdaConstant), U8(1),
B(Star2),
B(Mov), R(closure), R(3),
B(CallRuntime), U16(Runtime::kDeclareModuleExports), R(2), U8(2),
B(Ldar), R(0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0),
B(ResumeGenerator), R(0), R(0), U8(2),
B(Star2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(2),
/* 0 E> */ B(Throw),
B(Ldar), R(2),
B(Return),
/* 17 S> */ B(LdaSmi), I8(42),
/* 17 E> */ B(StaModuleVariable), I8(1), U8(0),
/* 21 S> */ B(LdaModuleVariable), I8(1), U8(0),
B(Inc), U8(0),
/* 24 E> */ B(StaModuleVariable), I8(1), U8(0),
/* 34 S> */ B(LdaUndefined),
B(Star1),
/* 39 S> */ B(LdaModuleVariable), I8(1), U8(0),
B(Inc), U8(1),
/* 42 E> */ B(StaModuleVariable), I8(1), U8(0),
B(LdaUndefined),
/* 50 S> */ B(Return),
]
constant pool: [
Smi [33],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
]
handlers: [
]
---
snippet: "
export const foo = 42;
foo++;
{ let x; { foo++ } };
"
frame size: 4
parameter count: 1
bytecode array length: 81
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(Mov), R(closure), R(2),
B(Mov), R(this), R(3),
/* 0 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(2), U8(2),
B(Star0),
B(LdaConstant), U8(1),
B(Star2),
B(Mov), R(closure), R(3),
B(CallRuntime), U16(Runtime::kDeclareModuleExports), R(2), U8(2),
B(Ldar), R(0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0),
B(ResumeGenerator), R(0), R(0), U8(2),
B(Star2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(2),
/* 0 E> */ B(Throw),
B(Ldar), R(2),
B(Return),
/* 19 S> */ B(LdaSmi), I8(42),
/* 19 E> */ B(StaModuleVariable), I8(1), U8(0),
/* 23 S> */ B(LdaModuleVariable), I8(1), U8(0),
B(Inc), U8(0),
/* 26 E> */ B(CallRuntime), U16(Runtime::kThrowConstAssignError), R(0), U8(0),
/* 36 S> */ B(LdaUndefined),
B(Star1),
/* 41 S> */ B(LdaModuleVariable), I8(1), U8(0),
B(Inc), U8(1),
/* 44 E> */ B(CallRuntime), U16(Runtime::kThrowConstAssignError), R(0), U8(0),
B(LdaUndefined),
/* 52 S> */ B(Return),
]
constant pool: [
Smi [33],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
]
handlers: [
]
---
snippet: "
export default (function () {});
"
frame size: 3
parameter count: 1
bytecode array length: 61
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(Mov), R(closure), R(1),
B(Mov), R(this), R(2),
/* 0 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(1), U8(2),
B(Star0),
B(LdaConstant), U8(1),
B(Star1),
B(Mov), R(closure), R(2),
B(CallRuntime), U16(Runtime::kDeclareModuleExports), R(1), U8(2),
B(Ldar), R(0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(1), U8(0),
B(ResumeGenerator), R(0), R(0), U8(1),
B(Star1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(1),
/* 0 E> */ B(Throw),
B(Ldar), R(1),
B(Return),
B(CreateClosure), U8(4), U8(0), U8(0),
B(StaModuleVariable), I8(1), U8(0),
B(LdaUndefined),
/* 33 S> */ B(Return),
]
constant pool: [
Smi [33],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
export default (class {});
"
frame size: 5
parameter count: 1
bytecode array length: 77
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(Mov), R(closure), R(1),
B(Mov), R(this), R(2),
/* 0 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(1), U8(2),
B(Star0),
B(LdaConstant), U8(1),
B(Star1),
B(Mov), R(closure), R(2),
B(CallRuntime), U16(Runtime::kDeclareModuleExports), R(1), U8(2),
B(Ldar), R(0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(1), U8(0),
B(ResumeGenerator), R(0), R(0), U8(1),
B(Star1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(1),
/* 0 E> */ B(Throw),
B(Ldar), R(1),
B(Return),
B(LdaTheHole),
B(Star4),
B(CreateClosure), U8(5), U8(0), U8(0),
B(Star1),
B(LdaConstant), U8(4),
B(Star2),
B(Mov), R(1), R(3),
B(CallRuntime), U16(Runtime::kDefineClass), R(2), U8(3),
B(Ldar), R(3),
B(StaModuleVariable), I8(1), U8(0),
B(LdaUndefined),
/* 27 S> */ B(Return),
]
constant pool: [
Smi [33],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
export {foo as goo} from \"bar\"
"
frame size: 3
parameter count: 1
bytecode array length: 41
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(Mov), R(closure), R(1),
B(Mov), R(this), R(2),
/* 0 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(1), U8(2),
B(Star0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(1), U8(0),
B(ResumeGenerator), R(0), R(0), U8(1),
B(Star1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
B(Ldar), R(1),
/* 0 E> */ B(Throw),
B(Ldar), R(1),
B(Return),
B(LdaUndefined),
/* 31 S> */ B(Return),
]
constant pool: [
Smi [20],
Smi [10],
Smi [7],
]
handlers: [
]
---
snippet: "
export * from \"bar\"
"
frame size: 3
parameter count: 1
bytecode array length: 41
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(Mov), R(closure), R(1),
B(Mov), R(this), R(2),
/* 0 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(1), U8(2),
B(Star0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(1), U8(0),
B(ResumeGenerator), R(0), R(0), U8(1),
B(Star1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
B(Ldar), R(1),
/* 0 E> */ B(Throw),
B(Ldar), R(1),
B(Return),
B(LdaUndefined),
/* 20 S> */ B(Return),
]
constant pool: [
Smi [20],
Smi [10],
Smi [7],
]
handlers: [
]
---
snippet: "
import * as foo from \"bar\"
foo.f(foo, foo.x);
"
frame size: 6
parameter count: 1
bytecode array length: 67
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(Mov), R(closure), R(2),
B(Mov), R(this), R(3),
/* 0 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(2), U8(2),
B(Star0),
B(LdaZero),
B(Star2),
B(CallRuntime), U16(Runtime::kGetModuleNamespace), R(2), U8(1),
B(Star1),
B(Ldar), R(0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0),
B(ResumeGenerator), R(0), R(0), U8(2),
B(Star2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
B(Ldar), R(2),
/* 0 E> */ B(Throw),
B(Ldar), R(2),
B(Return),
/* 31 S> */ B(GetNamedProperty), R(1), U8(3), U8(0),
B(Star2),
/* 42 E> */ B(GetNamedProperty), R(1), U8(4), U8(2),
B(Star5),
/* 31 E> */ B(CallProperty2), R(2), R(1), R(1), R(5), U8(4),
B(LdaUndefined),
/* 46 S> */ B(Return),
]
constant pool: [
Smi [30],
Smi [10],
Smi [7],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["f"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["x"],
]
handlers: [
]

View File

@ -0,0 +1,146 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
class A { constructor(...args) { this.args = args; } }
new A(...[1, 2, 3]);
"
frame size: 6
parameter count: 1
bytecode array length: 41
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(1),
B(LdaTheHole),
B(Star5),
B(CreateClosure), U8(2), U8(0), U8(2),
B(Star2),
B(LdaConstant), U8(1),
B(Star3),
B(Mov), R(2), R(4),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(3),
B(PopContext), R(1),
B(Mov), R(4), R(0),
/* 89 S> */ B(CreateArrayLiteral), U8(3), U8(0), U8(37),
B(Star2),
B(Ldar), R(0),
/* 89 E> */ B(ConstructWithSpread), R(0), R(2), U8(1), U8(1),
B(LdaUndefined),
/* 110 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
class A { constructor(...args) { this.args = args; } }
new A(0, ...[1, 2, 3]);
"
frame size: 6
parameter count: 1
bytecode array length: 43
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(1),
B(LdaTheHole),
B(Star5),
B(CreateClosure), U8(2), U8(0), U8(2),
B(Star2),
B(LdaConstant), U8(1),
B(Star3),
B(Mov), R(2), R(4),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(3),
B(PopContext), R(1),
B(Mov), R(4), R(0),
/* 89 S> */ B(LdaZero),
B(Star2),
B(CreateArrayLiteral), U8(3), U8(0), U8(37),
B(Star3),
B(Ldar), R(0),
/* 89 E> */ B(ConstructWithSpread), R(0), R(2), U8(2), U8(1),
B(LdaUndefined),
/* 113 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
class A { constructor(...args) { this.args = args; } }
new A(0, ...[1, 2, 3], 4);
"
frame size: 7
parameter count: 1
bytecode array length: 100
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(1),
B(LdaTheHole),
B(Star5),
B(CreateClosure), U8(2), U8(0), U8(2),
B(Star2),
B(LdaConstant), U8(1),
B(Star3),
B(Mov), R(2), R(4),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(3),
B(PopContext), R(1),
B(Mov), R(4), R(0),
/* 89 S> */ B(CreateArrayLiteral), U8(3), U8(0), U8(37),
B(Star2),
B(LdaSmi), I8(1),
B(Star3),
/* 101 E> */ B(CreateArrayLiteral), U8(4), U8(1), U8(37),
B(Star6),
/* 101 E> */ B(GetIterator), R(6), U8(2), U8(4),
B(Star5),
B(GetNamedProperty), R(5), U8(5), U8(6),
B(Star4),
B(Mov), R(0), R(1),
B(CallProperty0), R(4), R(5), U8(15),
B(Star6),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
B(GetNamedProperty), R(6), U8(6), U8(17),
B(JumpIfToBooleanTrue), U8(19),
B(GetNamedProperty), R(6), U8(7), U8(8),
B(StaInArrayLiteral), R(2), R(3), U8(13),
B(Ldar), R(3),
B(Inc), U8(12),
B(Star3),
B(JumpLoop), U8(31), I8(0), U8(19),
B(LdaSmi), I8(4),
B(StaInArrayLiteral), R(2), R(3), U8(13),
/* 89 E> */ B(CallJSRuntime), U8(%reflect_construct), R(1), U8(2),
B(LdaUndefined),
/* 116 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
]
handlers: [
]

View File

@ -0,0 +1,39 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
return new.target;
"
frame size: 1
parameter count: 1
bytecode array length: 3
bytecodes: [
/* 34 S> */ B(Ldar), R(0),
/* 52 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
new.target;
"
frame size: 1
parameter count: 1
bytecode array length: 2
bytecodes: [
/* 34 S> */ B(LdaUndefined),
/* 46 S> */ B(Return),
]
constant pool: [
]
handlers: [
]

View File

@ -0,0 +1,405 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
return { };
"
frame size: 0
parameter count: 1
bytecode array length: 2
bytecodes: [
/* 34 S> */ B(CreateEmptyObjectLiteral),
/* 45 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
return { name: 'string', val: 9.2 };
"
frame size: 0
parameter count: 1
bytecode array length: 5
bytecodes: [
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
/* 70 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
var a = 1; return { name: 'string', val: a };
"
frame size: 2
parameter count: 1
bytecode array length: 17
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star1),
B(Ldar), R(0),
/* 75 E> */ B(DefineNamedOwnProperty), R(1), U8(1), U8(1),
B(Ldar), R(1),
/* 79 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["val"],
]
handlers: [
]
---
snippet: "
var a = 1; return { val: a, val: a + 1 };
"
frame size: 2
parameter count: 1
bytecode array length: 20
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star1),
B(Ldar), R(0),
/* 69 E> */ B(AddSmi), I8(1), U8(1),
B(DefineNamedOwnProperty), R(1), U8(1), U8(2),
B(Ldar), R(1),
/* 75 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["val"],
]
handlers: [
]
---
snippet: "
return { func: function() { } };
"
frame size: 1
parameter count: 1
bytecode array length: 16
bytecodes: [
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star0),
/* 49 E> */ B(CreateClosure), U8(1), U8(0), U8(2),
B(DefineNamedOwnProperty), R(0), U8(2), U8(1),
B(Ldar), R(0),
/* 66 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
SHARED_FUNCTION_INFO_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["func"],
]
handlers: [
]
---
snippet: "
return { func(a) { return a; } };
"
frame size: 1
parameter count: 1
bytecode array length: 16
bytecodes: [
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star0),
/* 43 E> */ B(CreateClosure), U8(1), U8(0), U8(2),
B(DefineNamedOwnProperty), R(0), U8(2), U8(1),
B(Ldar), R(0),
/* 67 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
SHARED_FUNCTION_INFO_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["func"],
]
handlers: [
]
---
snippet: "
return { get a() { return 2; } };
"
frame size: 6
parameter count: 1
bytecode array length: 28
bytecodes: [
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star0),
B(LdaConstant), U8(1),
B(Star2),
B(CreateClosure), U8(2), U8(0), U8(2),
B(Star3),
B(LdaNull),
B(Star4),
B(LdaZero),
B(Star5),
B(Mov), R(0), R(1),
B(CallRuntime), U16(Runtime::kDefineAccessorPropertyUnchecked), R(1), U8(5),
B(Ldar), R(1),
/* 67 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["a"],
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
return { get a() { return this.x; }, set a(val) { this.x = val } };
"
frame size: 6
parameter count: 1
bytecode array length: 31
bytecodes: [
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star0),
B(LdaConstant), U8(1),
B(Star2),
B(CreateClosure), U8(2), U8(0), U8(2),
B(Star3),
B(CreateClosure), U8(3), U8(1), U8(2),
B(Star4),
B(LdaZero),
B(Star5),
B(Mov), R(0), R(1),
B(CallRuntime), U16(Runtime::kDefineAccessorPropertyUnchecked), R(1), U8(5),
B(Ldar), R(1),
/* 101 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["a"],
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
return { set b(val) { this.y = val } };
"
frame size: 6
parameter count: 1
bytecode array length: 28
bytecodes: [
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star0),
B(LdaConstant), U8(1),
B(Star2),
B(LdaNull),
B(Star3),
B(CreateClosure), U8(2), U8(0), U8(2),
B(Star4),
B(LdaZero),
B(Star5),
B(Mov), R(0), R(1),
B(CallRuntime), U16(Runtime::kDefineAccessorPropertyUnchecked), R(1), U8(5),
B(Ldar), R(1),
/* 73 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["b"],
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
var a = 1; return { 1: a };
"
frame size: 3
parameter count: 1
bytecode array length: 21
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star1),
B(LdaSmi), I8(1),
B(Star2),
B(Ldar), R(0),
/* 57 E> */ B(DefineKeyedOwnProperty), R(1), R(2), U8(0), U8(1),
B(Ldar), R(1),
/* 61 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
return { __proto__: null };
"
frame size: 0
parameter count: 1
bytecode array length: 5
bytecodes: [
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(57),
/* 61 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
var a = 'test'; return { [a]: 1 };
"
frame size: 3
parameter count: 1
bytecode array length: 22
bytecodes: [
/* 42 S> */ B(LdaConstant), U8(0),
B(Star0),
/* 50 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(41),
B(Star1),
B(Ldar), R(0),
/* 60 E> */ B(ToName),
B(Star2),
B(LdaSmi), I8(1),
/* 64 E> */ B(DefineKeyedOwnPropertyInLiteral), R(1), R(2), U8(0), U8(1),
B(Ldar), R(1),
/* 68 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["test"],
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
var a = 'test'; return { val: a, [a]: 1 };
"
frame size: 3
parameter count: 1
bytecode array length: 28
bytecodes: [
/* 42 S> */ B(LdaConstant), U8(0),
B(Star0),
/* 50 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(41),
B(Star1),
B(Ldar), R(0),
/* 64 E> */ B(DefineNamedOwnProperty), R(1), U8(2), U8(1),
B(Ldar), R(0),
/* 68 E> */ B(ToName),
B(Star2),
B(LdaSmi), I8(1),
/* 72 E> */ B(DefineKeyedOwnPropertyInLiteral), R(1), R(2), U8(0), U8(3),
B(Ldar), R(1),
/* 76 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["test"],
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["val"],
]
handlers: [
]
---
snippet: "
var a = 'test'; return { [a]: 1, __proto__: {} };
"
frame size: 4
parameter count: 1
bytecode array length: 32
bytecodes: [
/* 42 S> */ B(LdaConstant), U8(0),
B(Star0),
/* 50 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(41),
B(Star1),
B(Ldar), R(0),
/* 60 E> */ B(ToName),
B(Star2),
B(LdaSmi), I8(1),
/* 64 E> */ B(DefineKeyedOwnPropertyInLiteral), R(1), R(2), U8(0), U8(1),
/* 78 E> */ B(CreateEmptyObjectLiteral),
B(Star3),
B(Mov), R(1), R(2),
B(CallRuntime), U16(Runtime::kInternalSetPrototype), R(2), U8(2),
B(Ldar), R(2),
/* 83 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["test"],
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]
---
snippet: "
var n = 'name'; return { [n]: 'val', get a() { }, set a(b) {} };
"
frame size: 6
parameter count: 1
bytecode array length: 55
bytecodes: [
/* 42 S> */ B(LdaConstant), U8(0),
B(Star0),
/* 50 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(41),
B(Star1),
B(Ldar), R(0),
/* 60 E> */ B(ToName),
B(Star2),
B(LdaConstant), U8(2),
/* 64 E> */ B(DefineKeyedOwnPropertyInLiteral), R(1), R(2), U8(0), U8(1),
B(LdaConstant), U8(3),
B(Star3),
/* 71 E> */ B(CreateClosure), U8(4), U8(0), U8(2),
B(Star4),
B(LdaZero),
B(Star5),
B(Mov), R(1), R(2),
B(CallRuntime), U16(Runtime::kDefineGetterPropertyUnchecked), R(2), U8(4),
B(LdaConstant), U8(3),
B(Star3),
/* 84 E> */ B(CreateClosure), U8(5), U8(1), U8(2),
B(Star4),
B(LdaZero),
B(Star5),
B(CallRuntime), U16(Runtime::kDefineSetterPropertyUnchecked), R(2), U8(4),
B(Ldar), R(2),
/* 98 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name"],
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["val"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["a"],
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]

View File

@ -0,0 +1,61 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: f
---
snippet: "
function Outer() {
var outerVar = 1;
function Inner(innerArg) {
this.innerFunc = function() { return outerVar * innerArg; }
}
this.getInnerFunc = function() { return new Inner(1).innerFunc; }
}
var f = new Outer().getInnerFunc();
f();
"
frame size: 1
parameter count: 1
bytecode array length: 11
bytecodes: [
/* 102 S> */ B(LdaImmutableContextSlot), R(context), U8(2), U8(1),
B(Star0),
B(LdaImmutableCurrentContextSlot), U8(2),
/* 118 E> */ B(Mul), R(0), U8(0),
/* 129 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function Outer() {
var outerVar = 1;
function Inner(innerArg) {
this.innerFunc = function() { outerVar = innerArg; }
}
this.getInnerFunc = function() { return new Inner(1).innerFunc; }
}
var f = new Outer().getInnerFunc();
f();
"
frame size: 0
parameter count: 1
bytecode array length: 8
bytecodes: [
/* 102 S> */ B(LdaImmutableCurrentContextSlot), U8(2),
/* 111 E> */ B(StaContextSlot), R(context), U8(2), U8(1),
B(LdaUndefined),
/* 123 S> */ B(Return),
]
constant pool: [
]
handlers: [
]

View File

@ -0,0 +1,131 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: f
---
snippet: "
function f() { return this; }
f();
"
frame size: 0
parameter count: 1
bytecode array length: 3
bytecodes: [
/* 15 S> */ B(Ldar), R(this),
/* 27 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function f(arg1) { return arg1; }
f();
"
frame size: 0
parameter count: 2
bytecode array length: 3
bytecodes: [
/* 19 S> */ B(Ldar), R(arg0),
/* 31 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function f(arg1) { return this; }
f();
"
frame size: 0
parameter count: 2
bytecode array length: 3
bytecodes: [
/* 19 S> */ B(Ldar), R(this),
/* 31 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function f(arg1, arg2, arg3, arg4, arg5, arg6, arg7) { return arg4; }
f();
"
frame size: 0
parameter count: 8
bytecode array length: 3
bytecodes: [
/* 55 S> */ B(Ldar), R(arg3),
/* 67 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function f(arg1, arg2, arg3, arg4, arg5, arg6, arg7) { return this; }
f();
"
frame size: 0
parameter count: 8
bytecode array length: 3
bytecodes: [
/* 55 S> */ B(Ldar), R(this),
/* 67 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function f(arg1) { arg1 = 1; }
f();
"
frame size: 0
parameter count: 2
bytecode array length: 6
bytecodes: [
/* 19 S> */ B(LdaSmi), I8(1),
B(Star), R(arg0),
B(LdaUndefined),
/* 29 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function f(arg1, arg2, arg3, arg4) { arg2 = 1; }
f();
"
frame size: 0
parameter count: 5
bytecode array length: 6
bytecodes: [
/* 37 S> */ B(LdaSmi), I8(1),
B(Star), R(arg1),
B(LdaUndefined),
/* 47 S> */ B(Return),
]
constant pool: [
]
handlers: [
]

View File

@ -0,0 +1,459 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
var x = 0; return x;
"
frame size: 1
parameter count: 1
bytecode array length: 3
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 54 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0; return x + 3;
"
frame size: 1
parameter count: 1
bytecode array length: 6
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 54 S> */ B(AddSmi), I8(3), U8(0),
/* 58 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0; return 3 + x;
"
frame size: 2
parameter count: 1
bytecode array length: 11
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 45 S> */ B(LdaSmi), I8(3),
B(Star1),
B(Ldar), R(0),
/* 54 E> */ B(Add), R(1), U8(0),
/* 58 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0; return x - 3;
"
frame size: 1
parameter count: 1
bytecode array length: 6
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 54 S> */ B(SubSmi), I8(3), U8(0),
/* 58 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0; return 3 - x;
"
frame size: 2
parameter count: 1
bytecode array length: 11
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 45 S> */ B(LdaSmi), I8(3),
B(Star1),
B(Ldar), R(0),
/* 54 E> */ B(Sub), R(1), U8(0),
/* 58 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 4; return x * 3;
"
frame size: 1
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(4),
B(Star0),
/* 54 S> */ B(MulSmi), I8(3), U8(0),
/* 58 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 4; return 3 * x;
"
frame size: 1
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(4),
B(Star0),
/* 54 S> */ B(MulSmi), I8(3), U8(0),
/* 58 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 4; return x / 3;
"
frame size: 1
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(4),
B(Star0),
/* 54 S> */ B(DivSmi), I8(3), U8(0),
/* 58 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 4; return 3 / x;
"
frame size: 2
parameter count: 1
bytecode array length: 12
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(4),
B(Star0),
/* 45 S> */ B(LdaSmi), I8(3),
B(Star1),
B(Ldar), R(0),
/* 54 E> */ B(Div), R(1), U8(0),
/* 58 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 4; return x % 3;
"
frame size: 1
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(4),
B(Star0),
/* 54 S> */ B(ModSmi), I8(3), U8(0),
/* 58 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 4; return 3 % x;
"
frame size: 2
parameter count: 1
bytecode array length: 12
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(4),
B(Star0),
/* 45 S> */ B(LdaSmi), I8(3),
B(Star1),
B(Ldar), R(0),
/* 54 E> */ B(Mod), R(1), U8(0),
/* 58 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 1; return x | 2;
"
frame size: 1
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 54 S> */ B(BitwiseOrSmi), I8(2), U8(0),
/* 58 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 1; return 2 | x;
"
frame size: 1
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 54 S> */ B(BitwiseOrSmi), I8(2), U8(0),
/* 58 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 1; return x ^ 2;
"
frame size: 1
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 54 S> */ B(BitwiseXorSmi), I8(2), U8(0),
/* 58 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 1; return 2 ^ x;
"
frame size: 1
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 54 S> */ B(BitwiseXorSmi), I8(2), U8(0),
/* 58 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 1; return x & 2;
"
frame size: 1
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 54 S> */ B(BitwiseAndSmi), I8(2), U8(0),
/* 58 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 1; return 2 & x;
"
frame size: 1
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 54 S> */ B(BitwiseAndSmi), I8(2), U8(0),
/* 58 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 10; return x << 3;
"
frame size: 1
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(10),
B(Star0),
/* 55 S> */ B(ShiftLeftSmi), I8(3), U8(0),
/* 60 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 10; return 3 << x;
"
frame size: 2
parameter count: 1
bytecode array length: 12
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(10),
B(Star0),
/* 46 S> */ B(LdaSmi), I8(3),
B(Star1),
B(Ldar), R(0),
/* 55 E> */ B(ShiftLeft), R(1), U8(0),
/* 60 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 10; return x >> 3;
"
frame size: 1
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(10),
B(Star0),
/* 55 S> */ B(ShiftRightSmi), I8(3), U8(0),
/* 60 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 10; return 3 >> x;
"
frame size: 2
parameter count: 1
bytecode array length: 12
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(10),
B(Star0),
/* 46 S> */ B(LdaSmi), I8(3),
B(Star1),
B(Ldar), R(0),
/* 55 E> */ B(ShiftRight), R(1), U8(0),
/* 60 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 10; return x >>> 3;
"
frame size: 1
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(10),
B(Star0),
/* 55 S> */ B(ShiftRightLogicalSmi), I8(3), U8(0),
/* 61 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 10; return 3 >>> x;
"
frame size: 2
parameter count: 1
bytecode array length: 12
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(10),
B(Star0),
/* 46 S> */ B(LdaSmi), I8(3),
B(Star1),
B(Ldar), R(0),
/* 55 E> */ B(ShiftRightLogical), R(1), U8(0),
/* 61 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0; return (x, 3);
"
frame size: 1
parameter count: 1
bytecode array length: 5
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star0),
/* 56 S> */ B(LdaSmi), I8(3),
/* 59 S> */ B(Return),
]
constant pool: [
]
handlers: [
]

View File

@ -0,0 +1,182 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
"
frame size: 0
parameter count: 1
bytecode array length: 2
bytecodes: [
B(LdaUndefined),
/* 34 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
return;
"
frame size: 0
parameter count: 1
bytecode array length: 2
bytecodes: [
/* 34 S> */ B(LdaUndefined),
/* 41 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
return null;
"
frame size: 0
parameter count: 1
bytecode array length: 2
bytecodes: [
/* 34 S> */ B(LdaNull),
/* 46 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
return true;
"
frame size: 0
parameter count: 1
bytecode array length: 2
bytecodes: [
/* 34 S> */ B(LdaTrue),
/* 46 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
return false;
"
frame size: 0
parameter count: 1
bytecode array length: 2
bytecodes: [
/* 34 S> */ B(LdaFalse),
/* 47 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
return 0;
"
frame size: 0
parameter count: 1
bytecode array length: 2
bytecodes: [
/* 34 S> */ B(LdaZero),
/* 43 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
return +1;
"
frame size: 0
parameter count: 1
bytecode array length: 3
bytecodes: [
/* 34 S> */ B(LdaSmi), I8(1),
/* 44 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
return -1;
"
frame size: 0
parameter count: 1
bytecode array length: 3
bytecodes: [
/* 34 S> */ B(LdaSmi), I8(-1),
/* 44 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
return +127;
"
frame size: 0
parameter count: 1
bytecode array length: 3
bytecodes: [
/* 34 S> */ B(LdaSmi), I8(127),
/* 46 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
return -128;
"
frame size: 0
parameter count: 1
bytecode array length: 3
bytecodes: [
/* 34 S> */ B(LdaSmi), I8(-128),
/* 46 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
return 2.0;
"
frame size: 0
parameter count: 1
bytecode array length: 3
bytecodes: [
/* 34 S> */ B(LdaSmi), I8(2),
/* 45 S> */ B(Return),
]
constant pool: [
]
handlers: [
]

View File

@ -0,0 +1,196 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: test
---
snippet: "
class A {
get #a() { return 1; }
set #a(val) { }
constructor() {
this.#a++;
this.#a = 1;
return this.#a;
}
}
var test = A;
new test;
"
frame size: 5
parameter count: 1
bytecode array length: 83
bytecodes: [
B(LdaImmutableCurrentContextSlot), U8(3),
B(Star0),
B(Ldar), R(context),
/* 67 E> */ B(DefineKeyedOwnProperty), R(this), R(0), U8(0), U8(0),
/* 76 S> */ B(LdaImmutableCurrentContextSlot), U8(2),
B(Star2),
B(LdaImmutableCurrentContextSlot), U8(3),
/* 81 E> */ B(GetKeyedProperty), R(this), U8(2),
B(CallRuntime), U16(Runtime::kLoadPrivateGetter), R(2), U8(1),
B(Star3),
B(CallProperty0), R(3), R(this), U8(4),
B(Inc), U8(6),
B(Star3),
/* 83 E> */ B(CallRuntime), U16(Runtime::kLoadPrivateSetter), R(2), U8(1),
B(Star4),
B(CallProperty1), R(4), R(this), R(3), U8(7),
/* 91 S> */ B(LdaImmutableCurrentContextSlot), U8(2),
B(Star2),
B(LdaSmi), I8(1),
B(Star3),
B(LdaImmutableCurrentContextSlot), U8(3),
/* 96 E> */ B(GetKeyedProperty), R(this), U8(9),
B(CallRuntime), U16(Runtime::kLoadPrivateSetter), R(2), U8(1),
B(Star4),
B(CallProperty1), R(4), R(this), R(3), U8(11),
/* 108 S> */ B(LdaImmutableCurrentContextSlot), U8(2),
B(Star2),
B(LdaImmutableCurrentContextSlot), U8(3),
/* 120 E> */ B(GetKeyedProperty), R(this), U8(13),
B(CallRuntime), U16(Runtime::kLoadPrivateGetter), R(2), U8(1),
B(Star3),
B(CallProperty0), R(3), R(this), U8(15),
/* 123 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
class B {
get #b() { return 1; }
constructor() { this.#b++; }
}
var test = B;
new test;
"
frame size: 4
parameter count: 1
bytecode array length: 29
bytecodes: [
B(LdaImmutableCurrentContextSlot), U8(3),
B(Star0),
B(Ldar), R(context),
/* 48 E> */ B(DefineKeyedOwnProperty), R(this), R(0), U8(0), U8(0),
/* 53 S> */ B(LdaImmutableCurrentContextSlot), U8(3),
/* 58 E> */ B(GetKeyedProperty), R(this), U8(2),
B(Wide), B(LdaSmi), I16(331),
B(Star2),
B(LdaConstant), U8(0),
B(Star3),
B(CallRuntime), U16(Runtime::kNewTypeError), R(2), U8(2),
B(Throw),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["#b"],
]
handlers: [
]
---
snippet: "
class C {
set #c(val) { }
constructor() { this.#c++; }
}
var test = C;
new test;
"
frame size: 4
parameter count: 1
bytecode array length: 29
bytecodes: [
B(LdaImmutableCurrentContextSlot), U8(3),
B(Star0),
B(Ldar), R(context),
/* 41 E> */ B(DefineKeyedOwnProperty), R(this), R(0), U8(0), U8(0),
/* 46 S> */ B(LdaImmutableCurrentContextSlot), U8(3),
/* 51 E> */ B(GetKeyedProperty), R(this), U8(2),
B(Wide), B(LdaSmi), I16(330),
B(Star2),
B(LdaConstant), U8(0),
B(Star3),
B(CallRuntime), U16(Runtime::kNewTypeError), R(2), U8(2),
B(Throw),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["#c"],
]
handlers: [
]
---
snippet: "
class D {
get #d() { return 1; }
constructor() { this.#d = 1; }
}
var test = D;
new test;
"
frame size: 5
parameter count: 1
bytecode array length: 32
bytecodes: [
B(LdaImmutableCurrentContextSlot), U8(3),
B(Star0),
B(Ldar), R(context),
/* 48 E> */ B(DefineKeyedOwnProperty), R(this), R(0), U8(0), U8(0),
/* 53 S> */ B(LdaImmutableCurrentContextSlot), U8(2),
B(Star2),
B(LdaImmutableCurrentContextSlot), U8(3),
/* 58 E> */ B(GetKeyedProperty), R(this), U8(2),
B(Wide), B(LdaSmi), I16(331),
B(Star3),
B(LdaConstant), U8(0),
B(Star4),
B(CallRuntime), U16(Runtime::kNewTypeError), R(3), U8(2),
B(Throw),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["#d"],
]
handlers: [
]
---
snippet: "
class E {
set #e(val) { }
constructor() { this.#e; }
}
var test = E;
new test;
"
frame size: 4
parameter count: 1
bytecode array length: 29
bytecodes: [
B(LdaImmutableCurrentContextSlot), U8(3),
B(Star0),
B(Ldar), R(context),
/* 41 E> */ B(DefineKeyedOwnProperty), R(this), R(0), U8(0), U8(0),
/* 46 S> */ B(LdaImmutableCurrentContextSlot), U8(3),
/* 51 E> */ B(GetKeyedProperty), R(this), U8(2),
B(Wide), B(LdaSmi), I16(330),
B(Star2),
B(LdaConstant), U8(0),
B(Star3),
B(CallRuntime), U16(Runtime::kNewTypeError), R(2), U8(2),
B(Throw),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["#e"],
]
handlers: [
]

View File

@ -0,0 +1,373 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
{
class A {
get #a() { return 1; }
set #a(val) { }
}
}
"
frame size: 6
parameter count: 1
bytecode array length: 56
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(1),
B(LdaConstant), U8(2),
B(Star3),
B(CallRuntime), U16(Runtime::kCreatePrivateBrandSymbol), R(3), U8(1),
B(StaCurrentContextSlot), U8(3),
B(LdaTheHole),
B(Star5),
B(CreateClosure), U8(3), U8(0), U8(2),
B(Star2),
B(LdaConstant), U8(1),
B(Star3),
B(Mov), R(2), R(4),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(3),
B(CreateClosure), U8(4), U8(1), U8(2),
B(Star3),
B(CreateClosure), U8(5), U8(2), U8(2),
B(Star4),
B(CallRuntime), U16(Runtime::kCreatePrivateAccessors), R(3), U8(2),
B(StaCurrentContextSlot), U8(2),
B(PopContext), R(1),
B(Mov), R(2), R(0),
B(LdaUndefined),
/* 101 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["A"],
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
{
class B {
get #b() { return 1; }
}
}
"
frame size: 6
parameter count: 1
bytecode array length: 53
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(1),
B(LdaConstant), U8(2),
B(Star3),
B(CallRuntime), U16(Runtime::kCreatePrivateBrandSymbol), R(3), U8(1),
B(StaCurrentContextSlot), U8(3),
B(LdaTheHole),
B(Star5),
B(CreateClosure), U8(3), U8(0), U8(2),
B(Star2),
B(LdaConstant), U8(1),
B(Star3),
B(Mov), R(2), R(4),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(3),
B(CreateClosure), U8(4), U8(1), U8(2),
B(Star3),
B(LdaNull),
B(Star4),
B(CallRuntime), U16(Runtime::kCreatePrivateAccessors), R(3), U8(2),
B(StaCurrentContextSlot), U8(2),
B(PopContext), R(1),
B(Mov), R(2), R(0),
B(LdaUndefined),
/* 81 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["B"],
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
{
class C {
set #c(val) { }
}
}
"
frame size: 6
parameter count: 1
bytecode array length: 53
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(1),
B(LdaConstant), U8(2),
B(Star3),
B(CallRuntime), U16(Runtime::kCreatePrivateBrandSymbol), R(3), U8(1),
B(StaCurrentContextSlot), U8(3),
B(LdaTheHole),
B(Star5),
B(CreateClosure), U8(3), U8(0), U8(2),
B(Star2),
B(LdaConstant), U8(1),
B(Star3),
B(Mov), R(2), R(4),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(3),
B(LdaNull),
B(Star3),
B(CreateClosure), U8(4), U8(1), U8(2),
B(Star4),
B(CallRuntime), U16(Runtime::kCreatePrivateAccessors), R(3), U8(2),
B(StaCurrentContextSlot), U8(2),
B(PopContext), R(1),
B(Mov), R(2), R(0),
B(LdaUndefined),
/* 74 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["C"],
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
{
class D {
get #d() { return 1; }
set #d(val) { }
}
class E extends D {
get #e() { return 2; }
set #e(val) { }
}
}
"
frame size: 7
parameter count: 1
bytecode array length: 111
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(2),
B(LdaConstant), U8(2),
B(Star4),
B(CallRuntime), U16(Runtime::kCreatePrivateBrandSymbol), R(4), U8(1),
B(StaCurrentContextSlot), U8(3),
B(LdaTheHole),
B(Star6),
B(CreateClosure), U8(3), U8(0), U8(2),
B(Star3),
B(LdaConstant), U8(1),
B(Star4),
B(Mov), R(3), R(5),
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(3),
B(CreateClosure), U8(4), U8(1), U8(2),
B(Star4),
B(CreateClosure), U8(5), U8(2), U8(2),
B(Star5),
B(CallRuntime), U16(Runtime::kCreatePrivateAccessors), R(4), U8(2),
B(StaCurrentContextSlot), U8(2),
B(PopContext), R(2),
B(Mov), R(3), R(0),
/* 38 E> */ B(CreateBlockContext), U8(6),
B(PushContext), R(2),
B(LdaConstant), U8(8),
B(Star4),
B(CallRuntime), U16(Runtime::kCreatePrivateBrandSymbol), R(4), U8(1),
B(StaCurrentContextSlot), U8(3),
/* 118 E> */ B(CreateClosure), U8(9), U8(3), U8(2),
B(Star3),
B(LdaConstant), U8(7),
B(Star4),
B(Mov), R(3), R(5),
B(Mov), R(0), R(6),
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(3),
B(CreateClosure), U8(10), U8(4), U8(2),
B(Star4),
B(CreateClosure), U8(11), U8(5), U8(2),
B(Star5),
B(CallRuntime), U16(Runtime::kCreatePrivateAccessors), R(4), U8(2),
B(StaCurrentContextSlot), U8(2),
B(PopContext), R(2),
B(Mov), R(3), R(1),
B(LdaUndefined),
/* 175 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["D"],
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["E"],
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
{
class A { foo() {} }
class C extends A {
get #a() { return super.foo; }
}
new C();
}
"
frame size: 8
parameter count: 1
bytecode array length: 99
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(2),
B(LdaTheHole),
B(Star6),
B(CreateClosure), U8(2), U8(0), U8(2),
B(Star3),
B(LdaConstant), U8(1),
B(Star4),
B(CreateClosure), U8(3), U8(1), U8(2),
B(Star7),
B(Mov), R(3), R(5),
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4),
B(PopContext), R(2),
B(Mov), R(5), R(0),
/* 38 E> */ B(CreateBlockContext), U8(4),
B(PushContext), R(2),
B(LdaConstant), U8(6),
B(Star4),
B(CallRuntime), U16(Runtime::kCreatePrivateBrandSymbol), R(4), U8(1),
B(StaCurrentContextSlot), U8(3),
/* 77 E> */ B(CreateClosure), U8(7), U8(2), U8(2),
B(Star3),
B(LdaConstant), U8(5),
B(Star4),
B(Mov), R(3), R(5),
B(Mov), R(0), R(6),
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(3),
B(StaCurrentContextSlot), U8(4),
B(Ldar), R(5),
B(StaCurrentContextSlot), U8(5),
B(CreateClosure), U8(8), U8(3), U8(2),
B(Star4),
B(LdaNull),
B(Star5),
B(CallRuntime), U16(Runtime::kCreatePrivateAccessors), R(4), U8(2),
B(StaCurrentContextSlot), U8(2),
B(PopContext), R(2),
B(Mov), R(3), R(1),
/* 122 S> */ B(Ldar), R(1),
/* 122 E> */ B(Construct), R(1), R(0), U8(0), U8(0),
B(LdaUndefined),
/* 133 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["C"],
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
{
class A { foo(val) {} }
class C extends A {
set #a(val) { super.foo(val); }
}
new C();
}
"
frame size: 8
parameter count: 1
bytecode array length: 99
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(2),
B(LdaTheHole),
B(Star6),
B(CreateClosure), U8(2), U8(0), U8(2),
B(Star3),
B(LdaConstant), U8(1),
B(Star4),
B(CreateClosure), U8(3), U8(1), U8(2),
B(Star7),
B(Mov), R(3), R(5),
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4),
B(PopContext), R(2),
B(Mov), R(5), R(0),
/* 38 E> */ B(CreateBlockContext), U8(4),
B(PushContext), R(2),
B(LdaConstant), U8(6),
B(Star4),
B(CallRuntime), U16(Runtime::kCreatePrivateBrandSymbol), R(4), U8(1),
B(StaCurrentContextSlot), U8(3),
/* 80 E> */ B(CreateClosure), U8(7), U8(2), U8(2),
B(Star3),
B(LdaConstant), U8(5),
B(Star4),
B(Mov), R(3), R(5),
B(Mov), R(0), R(6),
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(3),
B(StaCurrentContextSlot), U8(4),
B(Ldar), R(5),
B(StaCurrentContextSlot), U8(5),
B(LdaNull),
B(Star4),
B(CreateClosure), U8(8), U8(3), U8(2),
B(Star5),
B(CallRuntime), U16(Runtime::kCreatePrivateAccessors), R(4), U8(2),
B(StaCurrentContextSlot), U8(2),
B(PopContext), R(2),
B(Mov), R(3), R(1),
/* 126 S> */ B(Ldar), R(1),
/* 126 E> */ B(Construct), R(1), R(0), U8(0), U8(0),
B(LdaUndefined),
/* 137 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["C"],
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]

View File

@ -0,0 +1,83 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: test
---
snippet: "
class A {
#a;
#b;
constructor() {
this.#a = this.#b;
}
}
var test = A;
new test;
"
frame size: 4
parameter count: 1
bytecode array length: 28
bytecodes: [
/* 35 E> */ B(GetNamedProperty), R(closure), U8(0), U8(0),
B(JumpIfUndefined), U8(10),
B(Star1),
B(CallProperty0), R(1), R(this), U8(2),
B(Mov), R(this), R(0),
/* 44 S> */ B(LdaImmutableCurrentContextSlot), U8(2),
B(Star3),
B(LdaImmutableCurrentContextSlot), U8(3),
/* 59 E> */ B(GetKeyedProperty), R(this), U8(4),
/* 52 E> */ B(SetKeyedProperty), R(this), R(3), U8(6),
B(LdaUndefined),
/* 65 S> */ B(Return),
]
constant pool: [
SYMBOL_TYPE,
]
handlers: [
]
---
snippet: "
class B {
#a;
#b;
constructor() {
this.#a = this.#b;
}
force(str) {
eval(str);
}
}
var test = B;
new test;
"
frame size: 4
parameter count: 1
bytecode array length: 28
bytecodes: [
/* 35 E> */ B(GetNamedProperty), R(closure), U8(0), U8(0),
B(JumpIfUndefined), U8(10),
B(Star1),
B(CallProperty0), R(1), R(this), U8(2),
B(Mov), R(this), R(0),
/* 44 S> */ B(LdaImmutableCurrentContextSlot), U8(2),
B(Star3),
B(LdaImmutableCurrentContextSlot), U8(3),
/* 59 E> */ B(GetKeyedProperty), R(this), U8(4),
/* 52 E> */ B(SetKeyedProperty), R(this), R(3), U8(6),
B(LdaUndefined),
/* 65 S> */ B(Return),
]
constant pool: [
SYMBOL_TYPE,
]
handlers: [
]

View File

@ -0,0 +1,247 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
{
class A {
#a;
constructor() {
this.#a = 1;
}
}
class B {
#a = 1;
}
new A;
new B;
}
"
frame size: 7
parameter count: 1
bytecode array length: 112
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(2),
B(LdaConstant), U8(2),
B(Star4),
B(LdaConstant), U8(2),
B(Star4),
B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(4), U8(1),
B(StaCurrentContextSlot), U8(2),
B(LdaTheHole),
B(Star6),
B(CreateClosure), U8(3), U8(0), U8(2),
B(Star3),
B(LdaConstant), U8(1),
B(Star4),
B(Mov), R(3), R(5),
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(3),
B(CreateClosure), U8(4), U8(1), U8(2),
B(SetNamedProperty), R(3), U8(5), U8(0),
B(PopContext), R(2),
B(Mov), R(5), R(0),
/* 38 E> */ B(CreateBlockContext), U8(6),
B(PushContext), R(2),
B(LdaConstant), U8(2),
B(Star4),
B(LdaConstant), U8(2),
B(Star4),
B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(4), U8(1),
B(StaCurrentContextSlot), U8(2),
B(LdaTheHole),
B(Star6),
B(CreateClosure), U8(8), U8(2), U8(2),
B(Star3),
B(LdaConstant), U8(7),
B(Star4),
B(Mov), R(3), R(5),
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(3),
B(CreateClosure), U8(9), U8(3), U8(2),
B(SetNamedProperty), R(3), U8(5), U8(2),
B(PopContext), R(2),
B(Mov), R(5), R(1),
/* 136 S> */ B(Ldar), R(0),
/* 136 E> */ B(Construct), R(0), R(0), U8(0), U8(4),
/* 145 S> */ B(Ldar), R(1),
/* 145 E> */ B(Construct), R(1), R(0), U8(0), U8(6),
B(LdaUndefined),
/* 154 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["#a"],
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SYMBOL_TYPE,
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
{
class A extends class {} {
#a;
constructor() {
super();
this.#a = 1;
}
}
class B extends class {} {
#a = 1;
#b = this.#a;
foo() { return this.#a; }
bar(v) { this.#b = v; }
constructor() {
super();
this.foo();
this.bar(3);
}
}
class C extends B {
#a = 2;
constructor() {
(() => super())();
}
}
new A;
new B;
new C;
};
"
frame size: 12
parameter count: 1
bytecode array length: 229
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(3),
B(LdaConstant), U8(2),
B(Star5),
B(LdaConstant), U8(2),
B(Star5),
B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(5), U8(1),
B(StaCurrentContextSlot), U8(2),
B(LdaTheHole),
B(Star11),
B(CreateClosure), U8(4), U8(0), U8(2),
B(Star8),
B(LdaConstant), U8(3),
B(Star9),
B(Mov), R(8), R(10),
B(CallRuntime), U16(Runtime::kDefineClass), R(9), U8(3),
B(CreateClosure), U8(5), U8(1), U8(2),
B(Star4),
B(LdaConstant), U8(1),
B(Star5),
B(Mov), R(4), R(6),
B(Mov), R(10), R(7),
B(CallRuntime), U16(Runtime::kDefineClass), R(5), U8(3),
B(CreateClosure), U8(6), U8(2), U8(2),
B(SetNamedProperty), R(4), U8(7), U8(0),
B(PopContext), R(3),
B(Mov), R(6), R(0),
/* 38 E> */ B(CreateBlockContext), U8(8),
B(PushContext), R(3),
B(LdaConstant), U8(2),
B(Star5),
B(LdaConstant), U8(2),
B(Star5),
B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(5), U8(1),
B(StaCurrentContextSlot), U8(2),
B(LdaConstant), U8(10),
B(Star5),
B(LdaConstant), U8(10),
B(Star5),
B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(5), U8(1),
B(StaCurrentContextSlot), U8(3),
B(LdaTheHole),
B(Star11),
B(CreateClosure), U8(12), U8(3), U8(2),
B(Star8),
B(LdaConstant), U8(11),
B(Star9),
B(Mov), R(8), R(10),
B(CallRuntime), U16(Runtime::kDefineClass), R(9), U8(3),
B(CreateClosure), U8(13), U8(4), U8(2),
B(Star4),
B(LdaConstant), U8(9),
B(Star5),
B(CreateClosure), U8(14), U8(5), U8(2),
B(Star8),
B(CreateClosure), U8(15), U8(6), U8(2),
B(Star9),
B(Mov), R(4), R(6),
B(Mov), R(10), R(7),
B(CallRuntime), U16(Runtime::kDefineClass), R(5), U8(5),
B(CreateClosure), U8(16), U8(7), U8(2),
B(SetNamedProperty), R(4), U8(7), U8(2),
B(PopContext), R(3),
B(Mov), R(6), R(1),
/* 140 E> */ B(CreateBlockContext), U8(17),
B(PushContext), R(3),
B(LdaConstant), U8(2),
B(Star5),
B(LdaConstant), U8(2),
B(Star5),
B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(5), U8(1),
B(StaCurrentContextSlot), U8(2),
/* 356 E> */ B(CreateClosure), U8(19), U8(8), U8(2),
B(Star4),
B(LdaConstant), U8(18),
B(Star5),
B(Mov), R(4), R(6),
B(Mov), R(1), R(7),
B(CallRuntime), U16(Runtime::kDefineClass), R(5), U8(3),
B(CreateClosure), U8(20), U8(9), U8(2),
B(SetNamedProperty), R(4), U8(7), U8(4),
B(PopContext), R(3),
B(Mov), R(6), R(2),
/* 430 S> */ B(Ldar), R(0),
/* 430 E> */ B(Construct), R(0), R(0), U8(0), U8(6),
/* 439 S> */ B(Ldar), R(1),
/* 439 E> */ B(Construct), R(1), R(0), U8(0), U8(8),
/* 448 S> */ B(Ldar), R(2),
/* 448 E> */ B(Construct), R(2), R(0), U8(0), U8(10),
B(LdaUndefined),
/* 458 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["#a"],
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SYMBOL_TYPE,
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["#b"],
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]

View File

@ -0,0 +1,301 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: test
---
snippet: "
class A {
#a() { return 1; }
constructor() { return this.#a(); }
}
var test = A;
new A;
"
frame size: 2
parameter count: 1
bytecode array length: 24
bytecodes: [
B(LdaImmutableCurrentContextSlot), U8(3),
B(Star0),
B(Ldar), R(context),
/* 44 E> */ B(DefineKeyedOwnProperty), R(this), R(0), U8(0), U8(0),
/* 49 S> */ B(LdaImmutableCurrentContextSlot), U8(3),
/* 61 E> */ B(GetKeyedProperty), R(this), U8(2),
B(LdaImmutableCurrentContextSlot), U8(2),
B(Star1),
/* 63 E> */ B(CallAnyReceiver), R(1), R(this), U8(1), U8(4),
/* 66 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
class B {
#b() { return 1; }
constructor() { this.#b = 1; }
}
var test = B;
new test;
"
frame size: 5
parameter count: 1
bytecode array length: 32
bytecodes: [
B(LdaImmutableCurrentContextSlot), U8(3),
B(Star0),
B(Ldar), R(context),
/* 44 E> */ B(DefineKeyedOwnProperty), R(this), R(0), U8(0), U8(0),
/* 49 S> */ B(LdaImmutableCurrentContextSlot), U8(2),
B(Star2),
B(LdaImmutableCurrentContextSlot), U8(3),
/* 54 E> */ B(GetKeyedProperty), R(this), U8(2),
B(Wide), B(LdaSmi), I16(329),
B(Star3),
B(LdaConstant), U8(0),
B(Star4),
B(CallRuntime), U16(Runtime::kNewTypeError), R(3), U8(2),
B(Throw),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["#b"],
]
handlers: [
]
---
snippet: "
class C {
#c() { return 1; }
constructor() { this.#c++; }
}
var test = C;
new test;
"
frame size: 4
parameter count: 1
bytecode array length: 29
bytecodes: [
B(LdaImmutableCurrentContextSlot), U8(3),
B(Star0),
B(Ldar), R(context),
/* 44 E> */ B(DefineKeyedOwnProperty), R(this), R(0), U8(0), U8(0),
/* 49 S> */ B(LdaImmutableCurrentContextSlot), U8(3),
/* 54 E> */ B(GetKeyedProperty), R(this), U8(2),
B(Wide), B(LdaSmi), I16(329),
B(Star2),
B(LdaConstant), U8(0),
B(Star3),
B(CallRuntime), U16(Runtime::kNewTypeError), R(2), U8(2),
B(Throw),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["#c"],
]
handlers: [
]
---
snippet: "
class D {
#d() { return 1; }
constructor() { (() => this)().#d(); }
}
var test = D;
new test;
"
frame size: 4
parameter count: 1
bytecode array length: 49
bytecodes: [
/* 44 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(0),
B(Ldar), R(this),
B(StaCurrentContextSlot), U8(2),
B(LdaImmutableContextSlot), R(0), U8(3), U8(0),
B(Star1),
B(Ldar), R(0),
B(DefineKeyedOwnProperty), R(this), R(1), U8(0), U8(0),
/* 49 S> */ B(CreateClosure), U8(1), U8(0), U8(2),
B(Star3),
/* 61 E> */ B(CallUndefinedReceiver0), R(3), U8(2),
B(Star3),
B(LdaImmutableContextSlot), R(0), U8(3), U8(0),
/* 63 E> */ B(GetKeyedProperty), R(3), U8(4),
B(LdaImmutableContextSlot), R(0), U8(2), U8(0),
B(Star2),
/* 66 E> */ B(CallAnyReceiver), R(2), R(3), U8(1), U8(6),
B(LdaUndefined),
/* 70 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
var test;
class F extends class {} {
#method() { }
constructor() {
(test = () => super())();
this.#method();
}
};
new F;
"
frame size: 8
parameter count: 1
bytecode array length: 63
bytecodes: [
/* 89 S> */ B(LdaImmutableCurrentContextSlot), U8(4),
B(Star0),
B(LdaImmutableCurrentContextSlot), U8(3),
B(Star2),
B(Ldar), R(0),
/* 89 E> */ B(GetSuperConstructor), R(1),
B(ThrowIfNotSuperConstructor), R(1),
B(Ldar), R(2),
/* 89 E> */ B(Construct), R(1), R(0), U8(0), U8(0),
B(Star1),
B(LdaCurrentContextSlot), U8(2),
B(ThrowSuperAlreadyCalledIfNotHole),
B(Ldar), R(1),
B(StaCurrentContextSlot), U8(2),
B(LdaImmutableContextSlot), R(context), U8(3), U8(1),
B(Star3),
B(LdaSmi), I8(1),
B(Star5),
B(Mov), R(1), R(2),
B(Mov), R(context), R(4),
B(CallRuntime), U16(Runtime::kAddPrivateBrand), R(2), U8(4),
B(GetNamedProperty), R(0), U8(0), U8(2),
B(JumpIfUndefined), U8(10),
B(Star7),
B(CallProperty0), R(7), R(1), U8(4),
B(Mov), R(1), R(6),
B(Ldar), R(1),
/* 96 S> */ B(Return),
]
constant pool: [
SYMBOL_TYPE,
]
handlers: [
]
---
snippet: "
var test;
class G extends class {} {
#method() { }
constructor() {
test = () => super();
test();
this.#method();
}
};
new G();
"
frame size: 8
parameter count: 1
bytecode array length: 63
bytecodes: [
/* 88 S> */ B(LdaImmutableCurrentContextSlot), U8(4),
B(Star0),
B(LdaImmutableCurrentContextSlot), U8(3),
B(Star2),
B(Ldar), R(0),
/* 88 E> */ B(GetSuperConstructor), R(1),
B(ThrowIfNotSuperConstructor), R(1),
B(Ldar), R(2),
/* 88 E> */ B(Construct), R(1), R(0), U8(0), U8(0),
B(Star1),
B(LdaCurrentContextSlot), U8(2),
B(ThrowSuperAlreadyCalledIfNotHole),
B(Ldar), R(1),
B(StaCurrentContextSlot), U8(2),
B(LdaImmutableContextSlot), R(context), U8(3), U8(1),
B(Star3),
B(LdaSmi), I8(1),
B(Star5),
B(Mov), R(1), R(2),
B(Mov), R(context), R(4),
B(CallRuntime), U16(Runtime::kAddPrivateBrand), R(2), U8(4),
B(GetNamedProperty), R(0), U8(0), U8(2),
B(JumpIfUndefined), U8(10),
B(Star7),
B(CallProperty0), R(7), R(1), U8(4),
B(Mov), R(1), R(6),
B(Ldar), R(1),
/* 95 S> */ B(Return),
]
constant pool: [
SYMBOL_TYPE,
]
handlers: [
]
---
snippet: "
var test;
class H extends class {} {
#method() { }
constructor(str) {
eval(str);
this.#method();
}
};
new test('test = () => super(); test()');
"
frame size: 8
parameter count: 1
bytecode array length: 63
bytecodes: [
/* 88 S> */ B(LdaImmutableCurrentContextSlot), U8(4),
B(Star0),
B(LdaImmutableCurrentContextSlot), U8(3),
B(Star2),
B(Ldar), R(0),
/* 88 E> */ B(GetSuperConstructor), R(1),
B(ThrowIfNotSuperConstructor), R(1),
B(Ldar), R(2),
/* 88 E> */ B(Construct), R(1), R(0), U8(0), U8(0),
B(Star1),
B(LdaCurrentContextSlot), U8(2),
B(ThrowSuperAlreadyCalledIfNotHole),
B(Ldar), R(1),
B(StaCurrentContextSlot), U8(2),
B(LdaImmutableContextSlot), R(context), U8(3), U8(1),
B(Star3),
B(LdaSmi), I8(1),
B(Star5),
B(Mov), R(1), R(2),
B(Mov), R(context), R(4),
B(CallRuntime), U16(Runtime::kAddPrivateBrand), R(2), U8(4),
B(GetNamedProperty), R(0), U8(0), U8(2),
B(JumpIfUndefined), U8(10),
B(Star7),
B(CallProperty0), R(7), R(1), U8(4),
B(Mov), R(1), R(6),
B(Ldar), R(1),
/* 95 S> */ B(Return),
]
constant pool: [
SYMBOL_TYPE,
]
handlers: [
]

View File

@ -0,0 +1,182 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
{
class A {
#a() { return 1; }
}
}
"
frame size: 6
parameter count: 1
bytecode array length: 45
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(1),
B(LdaConstant), U8(2),
B(Star3),
B(CallRuntime), U16(Runtime::kCreatePrivateBrandSymbol), R(3), U8(1),
B(StaCurrentContextSlot), U8(3),
B(CreateClosure), U8(3), U8(0), U8(2),
B(StaCurrentContextSlot), U8(2),
B(LdaTheHole),
B(Star5),
B(CreateClosure), U8(4), U8(1), U8(2),
B(Star2),
B(LdaConstant), U8(1),
B(Star3),
B(Mov), R(2), R(4),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(3),
B(PopContext), R(1),
B(Mov), R(4), R(0),
B(LdaUndefined),
/* 77 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["A"],
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
{
class D {
#d() { return 1; }
}
class E extends D {
#e() { return 2; }
}
}
"
frame size: 7
parameter count: 1
bytecode array length: 89
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(2),
B(LdaConstant), U8(2),
B(Star4),
B(CallRuntime), U16(Runtime::kCreatePrivateBrandSymbol), R(4), U8(1),
B(StaCurrentContextSlot), U8(3),
B(CreateClosure), U8(3), U8(0), U8(2),
B(StaCurrentContextSlot), U8(2),
B(LdaTheHole),
B(Star6),
B(CreateClosure), U8(4), U8(1), U8(2),
B(Star3),
B(LdaConstant), U8(1),
B(Star4),
B(Mov), R(3), R(5),
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(3),
B(PopContext), R(2),
B(Mov), R(5), R(0),
/* 38 E> */ B(CreateBlockContext), U8(5),
B(PushContext), R(2),
B(LdaConstant), U8(7),
B(Star4),
B(CallRuntime), U16(Runtime::kCreatePrivateBrandSymbol), R(4), U8(1),
B(StaCurrentContextSlot), U8(3),
B(CreateClosure), U8(8), U8(2), U8(2),
B(StaCurrentContextSlot), U8(2),
/* 93 E> */ B(CreateClosure), U8(9), U8(3), U8(2),
B(Star3),
B(LdaConstant), U8(6),
B(Star4),
B(Mov), R(3), R(5),
B(Mov), R(0), R(6),
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(3),
B(PopContext), R(2),
B(Mov), R(5), R(1),
B(LdaUndefined),
/* 126 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["D"],
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["E"],
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
{
class A { foo() {} }
class C extends A {
#m() { return super.foo; }
}
}
"
frame size: 8
parameter count: 1
bytecode array length: 82
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(2),
B(LdaTheHole),
B(Star6),
B(CreateClosure), U8(2), U8(0), U8(2),
B(Star3),
B(LdaConstant), U8(1),
B(Star4),
B(CreateClosure), U8(3), U8(1), U8(2),
B(Star7),
B(Mov), R(3), R(5),
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4),
B(PopContext), R(2),
B(Mov), R(5), R(0),
/* 38 E> */ B(CreateBlockContext), U8(4),
B(PushContext), R(2),
B(LdaConstant), U8(6),
B(Star4),
B(CallRuntime), U16(Runtime::kCreatePrivateBrandSymbol), R(4), U8(1),
B(StaCurrentContextSlot), U8(3),
B(CreateClosure), U8(7), U8(2), U8(2),
B(StaCurrentContextSlot), U8(2),
/* 77 E> */ B(CreateClosure), U8(8), U8(3), U8(2),
B(Star3),
B(LdaConstant), U8(5),
B(Star4),
B(Mov), R(3), R(5),
B(Mov), R(0), R(6),
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(3),
B(StaCurrentContextSlot), U8(4),
B(Ldar), R(5),
B(StaCurrentContextSlot), U8(5),
B(PopContext), R(2),
B(Star1),
B(LdaUndefined),
/* 118 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["C"],
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]

View File

@ -0,0 +1,515 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: f
---
snippet: "
function f(a) { return a.func(); }
f(new (function Obj() { this.func = function() { return; }})())
"
frame size: 1
parameter count: 2
bytecode array length: 10
bytecodes: [
/* 25 S> */ B(GetNamedProperty), R(arg0), U8(0), U8(0),
B(Star0),
/* 25 E> */ B(CallProperty0), R(0), R(arg0), U8(2),
/* 32 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["func"],
]
handlers: [
]
---
snippet: "
function f(a, b, c) { return a.func(b, c); }
f(new (function Obj() { this.func = function() { return; }})(), 1, 2)
"
frame size: 1
parameter count: 4
bytecode array length: 12
bytecodes: [
/* 31 S> */ B(GetNamedProperty), R(arg0), U8(0), U8(0),
B(Star0),
/* 31 E> */ B(CallProperty2), R(0), R(arg0), R(arg1), R(arg2), U8(2),
/* 42 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["func"],
]
handlers: [
]
---
snippet: "
function f(a, b) { return a.func(b + b, b); }
f(new (function Obj() { this.func = function() { return; }})(), 1)
"
frame size: 3
parameter count: 3
bytecode array length: 18
bytecodes: [
/* 28 S> */ B(GetNamedProperty), R(arg0), U8(0), U8(0),
B(Star0),
B(Ldar), R(arg1),
/* 35 E> */ B(Add), R(arg1), U8(2),
B(Star2),
/* 28 E> */ B(CallProperty2), R(0), R(arg0), R(2), R(arg1), U8(3),
/* 43 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["func"],
]
handlers: [
]
---
snippet: "
function f(a) {
var b = {};
b.name384;
b.name385;
b.name386;
b.name387;
b.name388;
b.name389;
b.name390;
b.name391;
b.name392;
b.name393;
b.name394;
b.name395;
b.name396;
b.name397;
b.name398;
b.name399;
b.name400;
b.name401;
b.name402;
b.name403;
b.name404;
b.name405;
b.name406;
b.name407;
b.name408;
b.name409;
b.name410;
b.name411;
b.name412;
b.name413;
b.name414;
b.name415;
b.name416;
b.name417;
b.name418;
b.name419;
b.name420;
b.name421;
b.name422;
b.name423;
b.name424;
b.name425;
b.name426;
b.name427;
b.name428;
b.name429;
b.name430;
b.name431;
b.name432;
b.name433;
b.name434;
b.name435;
b.name436;
b.name437;
b.name438;
b.name439;
b.name440;
b.name441;
b.name442;
b.name443;
b.name444;
b.name445;
b.name446;
b.name447;
b.name448;
b.name449;
b.name450;
b.name451;
b.name452;
b.name453;
b.name454;
b.name455;
b.name456;
b.name457;
b.name458;
b.name459;
b.name460;
b.name461;
b.name462;
b.name463;
b.name464;
b.name465;
b.name466;
b.name467;
b.name468;
b.name469;
b.name470;
b.name471;
b.name472;
b.name473;
b.name474;
b.name475;
b.name476;
b.name477;
b.name478;
b.name479;
b.name480;
b.name481;
b.name482;
b.name483;
b.name484;
b.name485;
b.name486;
b.name487;
b.name488;
b.name489;
b.name490;
b.name491;
b.name492;
b.name493;
b.name494;
b.name495;
b.name496;
b.name497;
b.name498;
b.name499;
b.name500;
b.name501;
b.name502;
b.name503;
b.name504;
b.name505;
b.name506;
b.name507;
b.name508;
b.name509;
b.name510;
b.name511;
a.func;
return a.func(); }
f(new (function Obj() { this.func = function() { return; }})())
"
frame size: 2
parameter count: 2
bytecode array length: 540
bytecodes: [
/* 26 S> */ B(CreateEmptyObjectLiteral),
B(Star0),
/* 34 S> */ B(GetNamedProperty), R(0), U8(0), U8(0),
/* 47 S> */ B(GetNamedProperty), R(0), U8(1), U8(2),
/* 60 S> */ B(GetNamedProperty), R(0), U8(2), U8(4),
/* 73 S> */ B(GetNamedProperty), R(0), U8(3), U8(6),
/* 86 S> */ B(GetNamedProperty), R(0), U8(4), U8(8),
/* 99 S> */ B(GetNamedProperty), R(0), U8(5), U8(10),
/* 112 S> */ B(GetNamedProperty), R(0), U8(6), U8(12),
/* 125 S> */ B(GetNamedProperty), R(0), U8(7), U8(14),
/* 138 S> */ B(GetNamedProperty), R(0), U8(8), U8(16),
/* 151 S> */ B(GetNamedProperty), R(0), U8(9), U8(18),
/* 164 S> */ B(GetNamedProperty), R(0), U8(10), U8(20),
/* 177 S> */ B(GetNamedProperty), R(0), U8(11), U8(22),
/* 190 S> */ B(GetNamedProperty), R(0), U8(12), U8(24),
/* 203 S> */ B(GetNamedProperty), R(0), U8(13), U8(26),
/* 216 S> */ B(GetNamedProperty), R(0), U8(14), U8(28),
/* 229 S> */ B(GetNamedProperty), R(0), U8(15), U8(30),
/* 242 S> */ B(GetNamedProperty), R(0), U8(16), U8(32),
/* 255 S> */ B(GetNamedProperty), R(0), U8(17), U8(34),
/* 268 S> */ B(GetNamedProperty), R(0), U8(18), U8(36),
/* 281 S> */ B(GetNamedProperty), R(0), U8(19), U8(38),
/* 294 S> */ B(GetNamedProperty), R(0), U8(20), U8(40),
/* 307 S> */ B(GetNamedProperty), R(0), U8(21), U8(42),
/* 320 S> */ B(GetNamedProperty), R(0), U8(22), U8(44),
/* 333 S> */ B(GetNamedProperty), R(0), U8(23), U8(46),
/* 346 S> */ B(GetNamedProperty), R(0), U8(24), U8(48),
/* 359 S> */ B(GetNamedProperty), R(0), U8(25), U8(50),
/* 372 S> */ B(GetNamedProperty), R(0), U8(26), U8(52),
/* 385 S> */ B(GetNamedProperty), R(0), U8(27), U8(54),
/* 398 S> */ B(GetNamedProperty), R(0), U8(28), U8(56),
/* 411 S> */ B(GetNamedProperty), R(0), U8(29), U8(58),
/* 424 S> */ B(GetNamedProperty), R(0), U8(30), U8(60),
/* 437 S> */ B(GetNamedProperty), R(0), U8(31), U8(62),
/* 450 S> */ B(GetNamedProperty), R(0), U8(32), U8(64),
/* 463 S> */ B(GetNamedProperty), R(0), U8(33), U8(66),
/* 476 S> */ B(GetNamedProperty), R(0), U8(34), U8(68),
/* 489 S> */ B(GetNamedProperty), R(0), U8(35), U8(70),
/* 502 S> */ B(GetNamedProperty), R(0), U8(36), U8(72),
/* 515 S> */ B(GetNamedProperty), R(0), U8(37), U8(74),
/* 528 S> */ B(GetNamedProperty), R(0), U8(38), U8(76),
/* 541 S> */ B(GetNamedProperty), R(0), U8(39), U8(78),
/* 554 S> */ B(GetNamedProperty), R(0), U8(40), U8(80),
/* 567 S> */ B(GetNamedProperty), R(0), U8(41), U8(82),
/* 580 S> */ B(GetNamedProperty), R(0), U8(42), U8(84),
/* 593 S> */ B(GetNamedProperty), R(0), U8(43), U8(86),
/* 606 S> */ B(GetNamedProperty), R(0), U8(44), U8(88),
/* 619 S> */ B(GetNamedProperty), R(0), U8(45), U8(90),
/* 632 S> */ B(GetNamedProperty), R(0), U8(46), U8(92),
/* 645 S> */ B(GetNamedProperty), R(0), U8(47), U8(94),
/* 658 S> */ B(GetNamedProperty), R(0), U8(48), U8(96),
/* 671 S> */ B(GetNamedProperty), R(0), U8(49), U8(98),
/* 684 S> */ B(GetNamedProperty), R(0), U8(50), U8(100),
/* 697 S> */ B(GetNamedProperty), R(0), U8(51), U8(102),
/* 710 S> */ B(GetNamedProperty), R(0), U8(52), U8(104),
/* 723 S> */ B(GetNamedProperty), R(0), U8(53), U8(106),
/* 736 S> */ B(GetNamedProperty), R(0), U8(54), U8(108),
/* 749 S> */ B(GetNamedProperty), R(0), U8(55), U8(110),
/* 762 S> */ B(GetNamedProperty), R(0), U8(56), U8(112),
/* 775 S> */ B(GetNamedProperty), R(0), U8(57), U8(114),
/* 788 S> */ B(GetNamedProperty), R(0), U8(58), U8(116),
/* 801 S> */ B(GetNamedProperty), R(0), U8(59), U8(118),
/* 814 S> */ B(GetNamedProperty), R(0), U8(60), U8(120),
/* 827 S> */ B(GetNamedProperty), R(0), U8(61), U8(122),
/* 840 S> */ B(GetNamedProperty), R(0), U8(62), U8(124),
/* 853 S> */ B(GetNamedProperty), R(0), U8(63), U8(126),
/* 866 S> */ B(GetNamedProperty), R(0), U8(64), U8(128),
/* 879 S> */ B(GetNamedProperty), R(0), U8(65), U8(130),
/* 892 S> */ B(GetNamedProperty), R(0), U8(66), U8(132),
/* 905 S> */ B(GetNamedProperty), R(0), U8(67), U8(134),
/* 918 S> */ B(GetNamedProperty), R(0), U8(68), U8(136),
/* 931 S> */ B(GetNamedProperty), R(0), U8(69), U8(138),
/* 944 S> */ B(GetNamedProperty), R(0), U8(70), U8(140),
/* 957 S> */ B(GetNamedProperty), R(0), U8(71), U8(142),
/* 970 S> */ B(GetNamedProperty), R(0), U8(72), U8(144),
/* 983 S> */ B(GetNamedProperty), R(0), U8(73), U8(146),
/* 996 S> */ B(GetNamedProperty), R(0), U8(74), U8(148),
/* 1009 S> */ B(GetNamedProperty), R(0), U8(75), U8(150),
/* 1022 S> */ B(GetNamedProperty), R(0), U8(76), U8(152),
/* 1035 S> */ B(GetNamedProperty), R(0), U8(77), U8(154),
/* 1048 S> */ B(GetNamedProperty), R(0), U8(78), U8(156),
/* 1061 S> */ B(GetNamedProperty), R(0), U8(79), U8(158),
/* 1074 S> */ B(GetNamedProperty), R(0), U8(80), U8(160),
/* 1087 S> */ B(GetNamedProperty), R(0), U8(81), U8(162),
/* 1100 S> */ B(GetNamedProperty), R(0), U8(82), U8(164),
/* 1113 S> */ B(GetNamedProperty), R(0), U8(83), U8(166),
/* 1126 S> */ B(GetNamedProperty), R(0), U8(84), U8(168),
/* 1139 S> */ B(GetNamedProperty), R(0), U8(85), U8(170),
/* 1152 S> */ B(GetNamedProperty), R(0), U8(86), U8(172),
/* 1165 S> */ B(GetNamedProperty), R(0), U8(87), U8(174),
/* 1178 S> */ B(GetNamedProperty), R(0), U8(88), U8(176),
/* 1191 S> */ B(GetNamedProperty), R(0), U8(89), U8(178),
/* 1204 S> */ B(GetNamedProperty), R(0), U8(90), U8(180),
/* 1217 S> */ B(GetNamedProperty), R(0), U8(91), U8(182),
/* 1230 S> */ B(GetNamedProperty), R(0), U8(92), U8(184),
/* 1243 S> */ B(GetNamedProperty), R(0), U8(93), U8(186),
/* 1256 S> */ B(GetNamedProperty), R(0), U8(94), U8(188),
/* 1269 S> */ B(GetNamedProperty), R(0), U8(95), U8(190),
/* 1282 S> */ B(GetNamedProperty), R(0), U8(96), U8(192),
/* 1295 S> */ B(GetNamedProperty), R(0), U8(97), U8(194),
/* 1308 S> */ B(GetNamedProperty), R(0), U8(98), U8(196),
/* 1321 S> */ B(GetNamedProperty), R(0), U8(99), U8(198),
/* 1334 S> */ B(GetNamedProperty), R(0), U8(100), U8(200),
/* 1347 S> */ B(GetNamedProperty), R(0), U8(101), U8(202),
/* 1360 S> */ B(GetNamedProperty), R(0), U8(102), U8(204),
/* 1373 S> */ B(GetNamedProperty), R(0), U8(103), U8(206),
/* 1386 S> */ B(GetNamedProperty), R(0), U8(104), U8(208),
/* 1399 S> */ B(GetNamedProperty), R(0), U8(105), U8(210),
/* 1412 S> */ B(GetNamedProperty), R(0), U8(106), U8(212),
/* 1425 S> */ B(GetNamedProperty), R(0), U8(107), U8(214),
/* 1438 S> */ B(GetNamedProperty), R(0), U8(108), U8(216),
/* 1451 S> */ B(GetNamedProperty), R(0), U8(109), U8(218),
/* 1464 S> */ B(GetNamedProperty), R(0), U8(110), U8(220),
/* 1477 S> */ B(GetNamedProperty), R(0), U8(111), U8(222),
/* 1490 S> */ B(GetNamedProperty), R(0), U8(112), U8(224),
/* 1503 S> */ B(GetNamedProperty), R(0), U8(113), U8(226),
/* 1516 S> */ B(GetNamedProperty), R(0), U8(114), U8(228),
/* 1529 S> */ B(GetNamedProperty), R(0), U8(115), U8(230),
/* 1542 S> */ B(GetNamedProperty), R(0), U8(116), U8(232),
/* 1555 S> */ B(GetNamedProperty), R(0), U8(117), U8(234),
/* 1568 S> */ B(GetNamedProperty), R(0), U8(118), U8(236),
/* 1581 S> */ B(GetNamedProperty), R(0), U8(119), U8(238),
/* 1594 S> */ B(GetNamedProperty), R(0), U8(120), U8(240),
/* 1607 S> */ B(GetNamedProperty), R(0), U8(121), U8(242),
/* 1620 S> */ B(GetNamedProperty), R(0), U8(122), U8(244),
/* 1633 S> */ B(GetNamedProperty), R(0), U8(123), U8(246),
/* 1646 S> */ B(GetNamedProperty), R(0), U8(124), U8(248),
/* 1659 S> */ B(GetNamedProperty), R(0), U8(125), U8(250),
/* 1672 S> */ B(GetNamedProperty), R(0), U8(126), U8(252),
/* 1685 S> */ B(GetNamedProperty), R(0), U8(127), U8(254),
/* 1698 S> */ B(Wide), B(GetNamedProperty), R16(arg0), U16(128), U16(256),
/* 1715 S> */ B(Wide), B(GetNamedProperty), R16(arg0), U16(128), U16(256),
B(Star1),
/* 1715 E> */ B(Wide), B(CallProperty0), R16(1), R16(arg0), U16(258),
/* 1722 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name384"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name385"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name386"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name387"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name388"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name389"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name390"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name391"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name392"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name393"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name394"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name395"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name396"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name397"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name398"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name399"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name400"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name401"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name402"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name403"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name404"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name405"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name406"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name407"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name408"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name409"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name410"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name411"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name412"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name413"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name414"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name415"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name416"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name417"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name418"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name419"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name420"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name421"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name422"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name423"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name424"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name425"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name426"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name427"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name428"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name429"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name430"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name431"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name432"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name433"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name434"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name435"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name436"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name437"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name438"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name439"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name440"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name441"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name442"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name443"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name444"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name445"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name446"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name447"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name448"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name449"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name450"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name451"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name452"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name453"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name454"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name455"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name456"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name457"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name458"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name459"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name460"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name461"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name462"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name463"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name464"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name465"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name466"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name467"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name468"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name469"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name470"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name471"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name472"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name473"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name474"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name475"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name476"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name477"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name478"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name479"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name480"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name481"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name482"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name483"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name484"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name485"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name486"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name487"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name488"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name489"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name490"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name491"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name492"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name493"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name494"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name495"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name496"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name497"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name498"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name499"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name500"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name501"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name502"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name503"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name504"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name505"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name506"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name507"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name508"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name509"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name510"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name511"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["func"],
]
handlers: [
]
---
snippet: "
function f(a) { return a.func(1).func(2).func(3); }
f(new (function Obj() { this.func = function(a) { return this; }})())
"
frame size: 5
parameter count: 2
bytecode array length: 42
bytecodes: [
/* 25 S> */ B(GetNamedProperty), R(arg0), U8(0), U8(0),
B(Star2),
B(LdaSmi), I8(1),
B(Star4),
/* 25 E> */ B(CallProperty1), R(2), R(arg0), R(4), U8(2),
B(Star2),
/* 32 E> */ B(GetNamedProperty), R(2), U8(0), U8(4),
B(Star1),
B(LdaSmi), I8(2),
B(Star3),
/* 33 E> */ B(CallProperty1), R(1), R(2), R(3), U8(6),
B(Star1),
/* 40 E> */ B(GetNamedProperty), R(1), U8(0), U8(8),
B(Star0),
B(LdaSmi), I8(3),
B(Star2),
/* 41 E> */ B(CallProperty1), R(0), R(1), R(2), U8(10),
/* 49 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["func"],
]
handlers: [
]

View File

@ -0,0 +1,115 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
top level: yes
---
snippet: "
l = {
'aa': 1.1,
'bb': 2.2
};
v = l['aa'] + l['bb'];
l['bb'] = 7;
l['aa'] = l['bb'];
"
frame size: 3
parameter count: 1
bytecode array length: 63
bytecodes: [
/* 7 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
/* 9 E> */ B(StaGlobal), U8(1), U8(1),
/* 66 S> */ B(LdaGlobal), U8(1), U8(4),
B(Star1),
/* 71 E> */ B(GetNamedProperty), R(1), U8(2), U8(6),
B(Star1),
/* 80 E> */ B(LdaGlobal), U8(1), U8(4),
B(Star2),
/* 81 E> */ B(GetNamedProperty), R(2), U8(3), U8(8),
/* 78 E> */ B(Add), R(1), U8(3),
/* 68 E> */ B(StaGlobal), U8(4), U8(10),
/* 95 S> */ B(LdaGlobal), U8(1), U8(4),
B(Star1),
B(LdaSmi), I8(7),
/* 103 E> */ B(SetNamedProperty), R(1), U8(3), U8(12),
/* 114 S> */ B(LdaGlobal), U8(1), U8(4),
B(Star1),
/* 124 E> */ B(LdaGlobal), U8(1), U8(4),
B(Star2),
/* 125 E> */ B(GetNamedProperty), R(2), U8(3), U8(8),
B(Star2),
/* 122 E> */ B(SetNamedProperty), R(1), U8(2), U8(14),
B(Mov), R(2), R(0),
B(Ldar), R(0),
/* 139 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["l"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["aa"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["bb"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["v"],
]
handlers: [
]
---
snippet: "
l = {
'cc': 3.1,
'dd': 4.2
};
if (l['cc'] < 3) {
l['cc'] = 3;
} else {
l['dd'] = 3;
}
"
frame size: 3
parameter count: 1
bytecode array length: 60
bytecodes: [
/* 7 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
/* 9 E> */ B(StaGlobal), U8(1), U8(1),
/* 65 S> */ B(LdaGlobal), U8(1), U8(3),
B(Star1),
/* 70 E> */ B(GetNamedProperty), R(1), U8(2), U8(5),
B(Star1),
B(LdaSmi), I8(3),
/* 77 E> */ B(TestLessThan), R(1), U8(7),
B(JumpIfFalse), U8(20),
/* 92 S> */ B(LdaGlobal), U8(1), U8(3),
B(Star1),
B(LdaSmi), I8(3),
B(Star2),
/* 100 E> */ B(SetNamedProperty), R(1), U8(2), U8(8),
B(Mov), R(2), R(0),
B(Ldar), R(2),
B(Jump), U8(18),
/* 128 S> */ B(LdaGlobal), U8(1), U8(3),
B(Star1),
B(LdaSmi), I8(3),
B(Star2),
/* 136 E> */ B(SetNamedProperty), R(1), U8(3), U8(10),
B(Mov), R(2), R(0),
B(Ldar), R(2),
B(Ldar), R(0),
/* 155 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["l"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["cc"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["dd"],
]
handlers: [
]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,226 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
{
class A {
a;
['b'];
}
class B {
a = 1;
['b'] = this.a;
}
new A;
new B;
}
"
frame size: 8
parameter count: 1
bytecode array length: 102
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(2),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
B(LdaTheHole),
B(Star6),
B(CreateClosure), U8(2), U8(0), U8(2),
B(Star3),
B(LdaConstant), U8(1),
B(Star4),
/* 60 S> */ B(LdaConstant), U8(3),
B(StaCurrentContextSlot), U8(2),
B(Star7),
B(Mov), R(3), R(5),
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4),
B(CreateClosure), U8(4), U8(1), U8(2),
B(SetNamedProperty), R(3), U8(5), U8(0),
B(PopContext), R(2),
B(Mov), R(5), R(0),
/* 38 E> */ B(CreateBlockContext), U8(6),
B(PushContext), R(2),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
B(LdaTheHole),
B(Star6),
B(CreateClosure), U8(8), U8(2), U8(2),
B(Star3),
B(LdaConstant), U8(7),
B(Star4),
/* 99 S> */ B(LdaConstant), U8(3),
B(StaCurrentContextSlot), U8(2),
B(Star7),
B(Mov), R(3), R(5),
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4),
B(CreateClosure), U8(9), U8(3), U8(2),
B(SetNamedProperty), R(3), U8(5), U8(2),
B(PopContext), R(2),
B(Mov), R(5), R(1),
/* 120 S> */ B(Ldar), R(0),
/* 120 E> */ B(Construct), R(0), R(0), U8(0), U8(4),
/* 129 S> */ B(Ldar), R(1),
/* 129 E> */ B(Construct), R(1), R(0), U8(0), U8(6),
B(LdaUndefined),
/* 138 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["b"],
SHARED_FUNCTION_INFO_TYPE,
SYMBOL_TYPE,
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
{
class A extends class {} {
a;
['b'];
}
class B extends class {} {
a = 1;
['b'] = this.a;
foo() { return 1; }
constructor() {
super();
}
}
class C extends B {
a = 1;
['b'] = this.a;
constructor() {
(() => super())();
}
}
new A;
new B;
new C;
}
"
frame size: 12
parameter count: 1
bytecode array length: 196
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(3),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
B(LdaTheHole),
B(Star11),
B(CreateClosure), U8(3), U8(0), U8(2),
B(Star8),
B(LdaConstant), U8(2),
B(Star9),
B(Mov), R(8), R(10),
B(CallRuntime), U16(Runtime::kDefineClass), R(9), U8(3),
B(CreateClosure), U8(4), U8(1), U8(2),
B(Star4),
B(LdaConstant), U8(1),
B(Star5),
/* 77 S> */ B(LdaConstant), U8(5),
B(StaCurrentContextSlot), U8(2),
B(Star8),
B(Mov), R(4), R(6),
B(Mov), R(10), R(7),
B(CallRuntime), U16(Runtime::kDefineClass), R(5), U8(4),
B(CreateClosure), U8(6), U8(2), U8(2),
B(SetNamedProperty), R(4), U8(7), U8(0),
B(PopContext), R(3),
B(Mov), R(6), R(0),
/* 38 E> */ B(CreateBlockContext), U8(8),
B(PushContext), R(3),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
B(LdaTheHole),
B(Star11),
B(CreateClosure), U8(11), U8(3), U8(2),
B(Star8),
B(LdaConstant), U8(10),
B(Star9),
B(Mov), R(8), R(10),
B(CallRuntime), U16(Runtime::kDefineClass), R(9), U8(3),
B(CreateClosure), U8(12), U8(4), U8(2),
B(Star4),
B(LdaConstant), U8(9),
B(Star5),
/* 133 S> */ B(LdaConstant), U8(5),
B(StaCurrentContextSlot), U8(2),
B(Star8),
B(CreateClosure), U8(13), U8(5), U8(2),
B(Star9),
B(Mov), R(4), R(6),
B(Mov), R(10), R(7),
B(CallRuntime), U16(Runtime::kDefineClass), R(5), U8(5),
B(CreateClosure), U8(14), U8(6), U8(2),
B(SetNamedProperty), R(4), U8(7), U8(2),
B(PopContext), R(3),
B(Mov), R(6), R(1),
/* 90 E> */ B(CreateBlockContext), U8(15),
B(PushContext), R(3),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
/* 236 E> */ B(CreateClosure), U8(17), U8(7), U8(2),
B(Star4),
B(LdaConstant), U8(16),
B(Star5),
/* 256 S> */ B(LdaConstant), U8(5),
B(StaCurrentContextSlot), U8(2),
B(Star8),
B(Mov), R(4), R(6),
B(Mov), R(1), R(7),
B(CallRuntime), U16(Runtime::kDefineClass), R(5), U8(4),
B(CreateClosure), U8(18), U8(8), U8(2),
B(SetNamedProperty), R(4), U8(7), U8(4),
B(PopContext), R(3),
B(Mov), R(6), R(2),
/* 329 S> */ B(Ldar), R(0),
/* 329 E> */ B(Construct), R(0), R(0), U8(0), U8(6),
/* 338 S> */ B(Ldar), R(1),
/* 338 E> */ B(Construct), R(1), R(0), U8(0), U8(8),
/* 347 S> */ B(Ldar), R(2),
/* 347 E> */ B(Construct), R(2), R(0), U8(0), U8(10),
B(LdaUndefined),
/* 356 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["b"],
SHARED_FUNCTION_INFO_TYPE,
SYMBOL_TYPE,
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]

View File

@ -0,0 +1,66 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
return /ab+d/;
"
frame size: 0
parameter count: 1
bytecode array length: 6
bytecodes: [
/* 34 S> */ B(CreateRegExpLiteral), U8(0), U8(0), U16(0),
/* 48 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["ab+d"],
]
handlers: [
]
---
snippet: "
return /(\\w+)\\s(\\w+)/i;
"
frame size: 0
parameter count: 1
bytecode array length: 6
bytecodes: [
/* 34 S> */ B(CreateRegExpLiteral), U8(0), U8(0), U16(2),
/* 57 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["(\u005cw+)\u005cs(\u005cw+)"],
]
handlers: [
]
---
snippet: "
return /ab+d/.exec('abdd');
"
frame size: 3
parameter count: 1
bytecode array length: 20
bytecodes: [
/* 34 S> */ B(CreateRegExpLiteral), U8(0), U8(0), U16(0),
B(Star1),
/* 48 E> */ B(GetNamedProperty), R(1), U8(1), U8(1),
B(Star0),
B(LdaConstant), U8(2),
B(Star2),
/* 48 E> */ B(CallProperty1), R(0), R(1), R(2), U8(3),
/* 61 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["ab+d"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["exec"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["abdd"],
]
handlers: [
]

View File

@ -0,0 +1,88 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
var ld_a = 1;
while(true) {
ld_a = ld_a + ld_a;
if (ld_a > 10) break;
}
return ld_a;
"
frame size: 1
parameter count: 1
bytecode array length: 25
bytecodes: [
/* 45 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 64 S> */ B(Ldar), R(0),
/* 76 E> */ B(Add), R(0), U8(0),
B(Star0),
/* 86 S> */ B(LdaSmi), I8(10),
/* 95 E> */ B(TestGreaterThan), R(0), U8(1),
B(JumpIfFalse), U8(4),
/* 101 S> */ B(Jump), U8(6),
/* 48 E> */ B(JumpLoop), U8(15), I8(0), U8(2),
/* 110 S> */ B(Ldar), R(0),
/* 122 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var ld_a = 1;
do {
ld_a = ld_a + ld_a;
if (ld_a > 10) continue;
} while(false);
return ld_a;
"
frame size: 1
parameter count: 1
bytecode array length: 19
bytecodes: [
/* 45 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 67 S> */ B(Add), R(0), U8(0),
B(Star0),
/* 77 S> */ B(LdaSmi), I8(10),
/* 86 E> */ B(TestGreaterThan), R(0), U8(1),
B(JumpIfFalse), U8(4),
/* 92 S> */ B(Jump), U8(2),
/* 118 S> */ B(Ldar), R(0),
/* 130 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var ld_a = 1;
ld_a = ld_a + ld_a;
return ld_a;
"
frame size: 1
parameter count: 1
bytecode array length: 8
bytecodes: [
/* 45 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 62 S> */ B(Add), R(0), U8(0),
B(Star0),
/* 84 S> */ B(Return),
]
constant pool: [
]
handlers: [
]

View File

@ -0,0 +1,452 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: f
---
snippet: "
function f() {
for (let x = 0; x < 10; ++x) { let y = x; }
}
f();
"
frame size: 2
parameter count: 1
bytecode array length: 23
bytecodes: [
/* 30 S> */ B(LdaZero),
B(Star0),
/* 35 S> */ B(LdaSmi), I8(10),
/* 35 E> */ B(TestLessThan), R(0), U8(0),
B(JumpIfFalse), U8(14),
/* 56 S> */ B(Mov), R(0), R(1),
/* 43 S> */ B(Ldar), R(1),
B(Inc), U8(1),
B(Star0),
/* 17 E> */ B(JumpLoop), U8(15), I8(0), U8(2),
B(LdaUndefined),
/* 61 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
function f() {
for (let x = 0; x < 10; ++x) { eval('1'); }
}
f();
"
frame size: 15
parameter count: 1
bytecode array length: 151
bytecodes: [
/* 10 E> */ B(CreateFunctionContext), U8(0), U8(4),
B(PushContext), R(4),
B(Ldar), R(this),
B(StaCurrentContextSlot), U8(3),
B(CreateMappedArguments),
B(StaCurrentContextSlot), U8(5),
B(Ldar), R(3),
B(StaCurrentContextSlot), U8(4),
B(CreateBlockContext), U8(1),
B(PushContext), R(5),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
/* 30 S> */ B(LdaZero),
/* 30 E> */ B(StaCurrentContextSlot), U8(2),
B(LdaCurrentContextSlot), U8(2),
B(Star0),
B(LdaSmi), I8(1),
B(Star1),
/* 59 E> */ B(CreateBlockContext), U8(2),
B(PushContext), R(6),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
B(Ldar), R(0),
B(StaCurrentContextSlot), U8(2),
B(LdaSmi), I8(1),
B(TestEqual), R(1), U8(0),
B(JumpIfFalse), U8(6),
B(LdaZero),
B(Star1),
B(Jump), U8(8),
/* 43 S> */ B(LdaCurrentContextSlot), U8(2),
B(Inc), U8(1),
/* 43 E> */ B(StaCurrentContextSlot), U8(2),
B(LdaSmi), I8(1),
B(Star2),
/* 35 S> */ B(LdaCurrentContextSlot), U8(2),
B(Star7),
B(LdaSmi), I8(10),
/* 35 E> */ B(TestLessThan), R(7), U8(2),
B(JumpIfFalse), U8(4),
B(Jump), U8(6),
B(PopContext), R(6),
B(Jump), U8(70),
B(LdaSmi), I8(1),
B(TestEqual), R(2), U8(3),
B(JumpIfFalse), U8(46),
/* 48 S> */ B(LdaLookupGlobalSlot), U8(3), U8(4), U8(3),
B(Star7),
B(LdaConstant), U8(4),
B(Star8),
B(LdaZero),
B(Star12),
B(LdaSmi), I8(2),
B(Star13),
B(LdaSmi), I8(48),
B(Star14),
B(Mov), R(7), R(9),
B(Mov), R(8), R(10),
B(Mov), R(closure), R(11),
B(CallRuntime), U16(Runtime::kResolvePossiblyDirectEval), R(9), U8(6),
B(Star7),
/* 48 E> */ B(CallUndefinedReceiver1), R(7), R(8), U8(6),
B(LdaZero),
B(Star2),
B(LdaCurrentContextSlot), U8(2),
B(Star0),
/* 17 E> */ B(JumpLoop), U8(47), I8(1), U8(8),
B(LdaSmi), I8(1),
B(TestEqual), R(2), U8(9),
B(JumpIfFalse), U8(6),
B(PopContext), R(6),
B(Jump), U8(8),
B(PopContext), R(6),
B(JumpLoop), U8(111), I8(0), U8(10),
B(PopContext), R(5),
B(LdaUndefined),
/* 61 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
SCOPE_INFO_TYPE,
SCOPE_INFO_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["eval"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["1"],
]
handlers: [
]
---
snippet: "
function f() {
for (let x = 0; x < 10; ++x) { (function() { return x; })(); }
}
f();
"
frame size: 6
parameter count: 1
bytecode array length: 96
bytecodes: [
/* 30 S> */ B(LdaZero),
B(Star3),
B(Star0),
B(LdaSmi), I8(1),
B(Star1),
/* 78 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(4),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
B(Ldar), R(0),
B(StaCurrentContextSlot), U8(2),
B(LdaSmi), I8(1),
B(TestEqual), R(1), U8(0),
B(JumpIfFalse), U8(6),
B(LdaZero),
B(Star1),
B(Jump), U8(8),
/* 43 S> */ B(LdaCurrentContextSlot), U8(2),
B(Inc), U8(1),
/* 43 E> */ B(StaCurrentContextSlot), U8(2),
B(LdaSmi), I8(1),
B(Star2),
/* 35 S> */ B(LdaCurrentContextSlot), U8(2),
B(Star5),
B(LdaSmi), I8(10),
/* 35 E> */ B(TestLessThan), R(5), U8(2),
B(JumpIfFalse), U8(4),
B(Jump), U8(6),
B(PopContext), R(4),
B(Jump), U8(43),
B(LdaSmi), I8(1),
B(TestEqual), R(2), U8(3),
B(JumpIfFalse), U8(19),
/* 48 S> */ B(CreateClosure), U8(1), U8(0), U8(2),
B(Star5),
/* 74 E> */ B(CallUndefinedReceiver0), R(5), U8(4),
B(LdaZero),
B(Star2),
B(LdaCurrentContextSlot), U8(2),
B(Star0),
/* 17 E> */ B(JumpLoop), U8(20), I8(1), U8(6),
B(LdaSmi), I8(1),
B(TestEqual), R(2), U8(7),
B(JumpIfFalse), U8(6),
B(PopContext), R(4),
B(Jump), U8(8),
B(PopContext), R(4),
B(JumpLoop), U8(84), I8(0), U8(8),
B(LdaUndefined),
/* 80 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
function f() {
for (let { x, y } = { x: 0, y: 3 }; y > 0; --y) { let z = x + y; }
}
f();
"
frame size: 4
parameter count: 1
bytecode array length: 38
bytecodes: [
/* 37 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star3),
/* 28 E> */ B(GetNamedProperty), R(3), U8(1), U8(1),
B(Star0),
/* 31 E> */ B(GetNamedProperty), R(3), U8(2), U8(3),
B(Star1),
/* 55 S> */ B(LdaZero),
/* 55 E> */ B(TestGreaterThan), R(1), U8(5),
B(JumpIfFalse), U8(17),
/* 75 S> */ B(Ldar), R(1),
/* 77 E> */ B(Add), R(0), U8(6),
B(Star2),
/* 62 S> */ B(Ldar), R(1),
B(Dec), U8(7),
B(Star1),
/* 17 E> */ B(JumpLoop), U8(17), I8(0), U8(8),
B(LdaUndefined),
/* 84 S> */ B(Return),
]
constant pool: [
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["x"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["y"],
]
handlers: [
]
---
snippet: "
function* f() {
for (let x = 0; x < 10; ++x) { let y = x; }
}
f();
"
frame size: 5
parameter count: 1
bytecode array length: 62
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(Mov), R(closure), R(3),
B(Mov), R(this), R(4),
/* 11 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(3), U8(2),
B(Star0),
/* 11 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
B(Ldar), R(3),
/* 11 E> */ B(Throw),
B(Ldar), R(3),
B(Return),
/* 31 S> */ B(LdaZero),
B(Star1),
/* 36 S> */ B(LdaSmi), I8(10),
/* 36 E> */ B(TestLessThan), R(1), U8(0),
B(JumpIfFalse), U8(14),
/* 57 S> */ B(Mov), R(1), R(2),
/* 44 S> */ B(Ldar), R(2),
B(Inc), U8(1),
B(Star1),
/* 18 E> */ B(JumpLoop), U8(15), I8(0), U8(2),
B(LdaUndefined),
/* 62 S> */ B(Return),
]
constant pool: [
Smi [20],
Smi [10],
Smi [7],
]
handlers: [
]
---
snippet: "
function* f() {
for (let x = 0; x < 10; ++x) yield x;
}
f();
"
frame size: 4
parameter count: 1
bytecode array length: 92
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(2),
B(Mov), R(this), R(3),
/* 11 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(2), U8(2),
B(Star0),
/* 11 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0),
B(ResumeGenerator), R(0), R(0), U8(2),
B(Star2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(2),
/* 11 E> */ B(Throw),
B(Ldar), R(2),
B(Return),
/* 31 S> */ B(LdaZero),
B(Star1),
/* 36 S> */ B(LdaSmi), I8(10),
/* 36 E> */ B(TestLessThan), R(1), U8(0),
B(JumpIfFalse), U8(44),
/* 47 S> */ B(LdaFalse),
B(Star3),
B(Mov), R(1), 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),
B(Star2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(4), U8(2), I8(0),
B(Ldar), R(2),
/* 47 E> */ B(Throw),
B(Ldar), R(2),
B(Return),
/* 44 S> */ B(Ldar), R(1),
B(Inc), U8(1),
B(Star1),
/* 18 E> */ B(JumpLoop), U8(45), I8(0), U8(2),
B(LdaUndefined),
/* 56 S> */ B(Return),
]
constant pool: [
Smi [20],
Smi [62],
Smi [10],
Smi [7],
Smi [10],
Smi [7],
]
handlers: [
]
---
snippet: "
async function f() {
for (let x = 0; x < 10; ++x) { let y = x; }
}
f();
"
frame size: 6
parameter count: 1
bytecode array length: 56
bytecodes: [
B(Mov), R(closure), R(3),
B(Mov), R(this), R(4),
/* 16 E> */ B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(3), U8(2),
B(Star0),
B(Mov), R(context), R(3),
/* 36 S> */ B(LdaZero),
B(Star1),
/* 41 S> */ B(LdaSmi), I8(10),
/* 41 E> */ B(TestLessThan), R(1), U8(0),
B(JumpIfFalse), U8(14),
/* 62 S> */ B(Mov), R(1), R(2),
/* 49 S> */ B(Ldar), R(2),
B(Inc), U8(1),
B(Star1),
/* 23 E> */ B(JumpLoop), U8(15), I8(0), U8(2),
B(LdaUndefined),
B(Star5),
B(Mov), R(0), R(4),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(4), U8(2),
/* 67 S> */ B(Return),
B(Star5),
B(LdaTheHole),
B(SetPendingMessage),
B(Mov), R(0), R(4),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(4), U8(2),
B(Return),
]
constant pool: [
]
handlers: [
[14, 45, 45],
]
---
snippet: "
async function f() {
for (let x = 0; x < 10; ++x) await x;
}
f();
"
frame size: 5
parameter count: 1
bytecode array length: 90
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(Mov), R(closure), R(2),
B(Mov), R(this), R(3),
/* 16 E> */ B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(2), U8(2),
B(Star0),
B(Mov), R(context), R(2),
/* 36 S> */ B(LdaZero),
B(Star1),
/* 41 S> */ B(LdaSmi), I8(10),
/* 41 E> */ B(TestLessThan), R(1), U8(0),
B(JumpIfFalse), U8(44),
/* 52 S> */ B(Mov), R(0), R(3),
B(Mov), R(1), R(4),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwait), R(3), U8(2),
/* 52 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star4),
B(LdaZero),
B(TestReferenceEqual), R(4),
B(JumpIfTrue), U8(5),
B(Ldar), R(3),
B(ReThrow),
/* 49 S> */ B(Ldar), R(1),
B(Inc), U8(1),
B(Star1),
/* 23 E> */ B(JumpLoop), U8(45), I8(0), U8(2),
B(LdaUndefined),
B(Star4),
B(Mov), R(0), R(3),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(3), U8(2),
/* 61 S> */ B(Return),
B(Star4),
B(LdaTheHole),
B(SetPendingMessage),
B(Mov), R(0), R(3),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(3), U8(2),
B(Return),
]
constant pool: [
Smi [42],
]
handlers: [
[18, 79, 79],
]

View File

@ -0,0 +1,313 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
{
class A {
a;
['b'];
static c;
static ['d'];
}
class B {
a = 1;
['b'] = this.a;
static c = 3;
static ['d'] = this.c;
}
new A;
new B;
}
"
frame size: 9
parameter count: 1
bytecode array length: 164
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(2),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(3),
B(LdaTheHole),
B(Star6),
B(CreateClosure), U8(2), U8(0), U8(2),
B(Star3),
B(LdaConstant), U8(1),
B(Star4),
/* 60 S> */ B(LdaConstant), U8(3),
B(StaCurrentContextSlot), U8(2),
B(Star7),
/* 92 S> */ B(LdaConstant), U8(4),
B(Star8),
B(LdaConstant), U8(5),
B(TestEqualStrict), R(8), U8(0),
B(Mov), R(3), R(5),
B(JumpIfFalse), U8(7),
B(CallRuntime), U16(Runtime::kThrowStaticPrototypeError), R(0), U8(0),
B(Ldar), R(8),
B(StaCurrentContextSlot), U8(3),
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(5),
B(CreateClosure), U8(6), U8(1), U8(2),
B(SetNamedProperty), R(3), U8(7), U8(1),
B(CreateClosure), U8(8), U8(2), U8(2),
B(Star5),
B(CallProperty0), R(5), R(3), U8(3),
B(PopContext), R(2),
B(Mov), R(3), R(0),
/* 38 E> */ B(CreateBlockContext), U8(9),
B(PushContext), R(2),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(3),
B(LdaTheHole),
B(Star6),
B(CreateClosure), U8(11), U8(3), U8(2),
B(Star3),
B(LdaConstant), U8(10),
B(Star4),
/* 131 S> */ B(LdaConstant), U8(3),
B(StaCurrentContextSlot), U8(2),
B(Star7),
/* 176 S> */ B(LdaConstant), U8(4),
B(Star8),
B(LdaConstant), U8(5),
B(TestEqualStrict), R(8), U8(0),
B(Mov), R(3), R(5),
B(JumpIfFalse), U8(7),
B(CallRuntime), U16(Runtime::kThrowStaticPrototypeError), R(0), U8(0),
B(Ldar), R(8),
B(StaCurrentContextSlot), U8(3),
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(5),
B(CreateClosure), U8(12), U8(4), U8(2),
B(SetNamedProperty), R(3), U8(7), U8(5),
B(CreateClosure), U8(13), U8(5), U8(2),
B(Star5),
B(CallProperty0), R(5), R(3), U8(7),
B(PopContext), R(2),
B(Mov), R(3), R(1),
/* 197 S> */ B(Ldar), R(0),
/* 197 E> */ B(Construct), R(0), R(0), U8(0), U8(9),
/* 206 S> */ B(Ldar), R(1),
/* 206 E> */ B(Construct), R(1), R(0), U8(0), U8(11),
B(LdaUndefined),
/* 215 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["b"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["d"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["prototype"],
SHARED_FUNCTION_INFO_TYPE,
SYMBOL_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
{
class A extends class {} {
a;
['b'];
static c;
static ['d'];
}
class B extends class {} {
a = 1;
['b'] = this.a;
static c = 3;
static ['d'] = this.c;
foo() { return 1; }
constructor() {
super();
}
}
class C extends B {
a = 1;
['b'] = this.a;
static c = 3;
static ['d'] = super.foo();
constructor() {
(() => super())();
}
}
new A;
new B;
new C;
}
"
frame size: 12
parameter count: 1
bytecode array length: 295
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(3),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(3),
B(LdaTheHole),
B(Star11),
B(CreateClosure), U8(3), U8(0), U8(2),
B(Star8),
B(LdaConstant), U8(2),
B(Star9),
B(Mov), R(8), R(10),
B(CallRuntime), U16(Runtime::kDefineClass), R(9), U8(3),
B(CreateClosure), U8(4), U8(1), U8(2),
B(Star4),
B(LdaConstant), U8(1),
B(Star5),
/* 77 S> */ B(LdaConstant), U8(5),
B(StaCurrentContextSlot), U8(2),
B(Star8),
/* 109 S> */ B(LdaConstant), U8(6),
B(Star9),
B(LdaConstant), U8(7),
B(TestEqualStrict), R(9), U8(0),
B(Mov), R(10), R(7),
B(Mov), R(4), R(6),
B(JumpIfFalse), U8(7),
B(CallRuntime), U16(Runtime::kThrowStaticPrototypeError), R(0), U8(0),
B(Ldar), R(9),
B(StaCurrentContextSlot), U8(3),
B(CallRuntime), U16(Runtime::kDefineClass), R(5), U8(5),
B(CreateClosure), U8(8), U8(2), U8(2),
B(SetNamedProperty), R(4), U8(9), U8(1),
B(CreateClosure), U8(10), U8(3), U8(2),
B(Star6),
B(CallProperty0), R(6), R(4), U8(3),
B(PopContext), R(3),
B(Mov), R(4), R(0),
/* 38 E> */ B(CreateBlockContext), U8(11),
B(PushContext), R(3),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(3),
B(LdaTheHole),
B(Star11),
B(CreateClosure), U8(14), U8(4), U8(2),
B(Star8),
B(LdaConstant), U8(13),
B(Star9),
B(Mov), R(8), R(10),
B(CallRuntime), U16(Runtime::kDefineClass), R(9), U8(3),
B(CreateClosure), U8(15), U8(5), U8(2),
B(Star4),
B(LdaConstant), U8(12),
B(Star5),
/* 165 S> */ B(LdaConstant), U8(5),
B(StaCurrentContextSlot), U8(2),
B(Star8),
/* 210 S> */ B(LdaConstant), U8(6),
B(Star9),
B(LdaConstant), U8(7),
B(TestEqualStrict), R(9), U8(0),
B(Mov), R(4), R(6),
B(Mov), R(10), R(7),
B(JumpIfFalse), U8(7),
B(CallRuntime), U16(Runtime::kThrowStaticPrototypeError), R(0), U8(0),
B(Ldar), R(9),
B(StaCurrentContextSlot), U8(3),
B(CreateClosure), U8(16), U8(6), U8(2),
B(Star10),
B(CallRuntime), U16(Runtime::kDefineClass), R(5), U8(6),
B(CreateClosure), U8(17), U8(7), U8(2),
B(SetNamedProperty), R(4), U8(9), U8(5),
B(CreateClosure), U8(18), U8(8), U8(2),
B(Star6),
B(CallProperty0), R(6), R(4), U8(7),
B(PopContext), R(3),
B(Mov), R(4), R(1),
/* 122 E> */ B(CreateBlockContext), U8(19),
B(PushContext), R(3),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(3),
/* 313 E> */ B(CreateClosure), U8(21), U8(9), U8(2),
B(Star4),
B(LdaConstant), U8(20),
B(Star5),
/* 333 S> */ B(LdaConstant), U8(5),
B(StaCurrentContextSlot), U8(2),
B(Star8),
/* 378 S> */ B(LdaConstant), U8(6),
B(Star9),
B(LdaConstant), U8(7),
B(TestEqualStrict), R(9), U8(0),
B(Mov), R(4), R(6),
B(Mov), R(1), R(7),
B(JumpIfFalse), U8(7),
B(CallRuntime), U16(Runtime::kThrowStaticPrototypeError), R(0), U8(0),
B(Ldar), R(9),
B(StaCurrentContextSlot), U8(3),
B(CallRuntime), U16(Runtime::kDefineClass), R(5), U8(5),
B(StaCurrentContextSlot), U8(4),
B(Ldar), R(4),
B(StaCurrentContextSlot), U8(5),
B(CreateClosure), U8(22), U8(10), U8(2),
B(SetNamedProperty), R(4), U8(9), U8(9),
B(CreateClosure), U8(23), U8(11), U8(2),
B(Star6),
B(CallProperty0), R(6), R(4), U8(11),
B(PopContext), R(3),
B(Mov), R(4), R(2),
/* 456 S> */ B(Ldar), R(0),
/* 456 E> */ B(Construct), R(0), R(0), U8(0), U8(13),
/* 465 S> */ B(Ldar), R(1),
/* 465 E> */ B(Construct), R(1), R(0), U8(0), U8(15),
/* 474 S> */ B(Ldar), R(2),
/* 474 E> */ B(Construct), R(2), R(0), U8(0), U8(17),
B(LdaUndefined),
/* 483 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["b"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["d"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["prototype"],
SHARED_FUNCTION_INFO_TYPE,
SYMBOL_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]

View File

@ -0,0 +1,342 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: test
---
snippet: "
class A {
static #a() { return 1; }
static test() { return this.#a(); }
}
var test = A.test;
test();
"
frame size: 4
parameter count: 1
bytecode array length: 32
bytecodes: [
/* 56 S> */ B(LdaCurrentContextSlot), U8(3),
B(TestReferenceEqual), R(this),
B(Mov), R(this), R(1),
B(JumpIfTrue), U8(16),
B(Wide), B(LdaSmi), I16(323),
B(Star2),
B(LdaConstant), U8(0),
B(Star3),
/* 68 E> */ B(CallRuntime), U16(Runtime::kNewTypeError), R(2), U8(2),
B(Throw),
B(LdaImmutableCurrentContextSlot), U8(2),
B(Star0),
/* 70 E> */ B(CallAnyReceiver), R(0), R(1), U8(1), U8(0),
/* 73 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["A"],
]
handlers: [
]
---
snippet: "
class B {
static #b() { return 1; }
static test() { this.#b = 1; }
}
var test = B.test;
test();
"
frame size: 4
parameter count: 1
bytecode array length: 40
bytecodes: [
/* 56 S> */ B(LdaImmutableCurrentContextSlot), U8(2),
B(Star1),
B(LdaCurrentContextSlot), U8(3),
B(TestReferenceEqual), R(this),
B(Mov), R(this), R(0),
B(JumpIfTrue), U8(16),
B(Wide), B(LdaSmi), I16(323),
B(Star2),
B(LdaConstant), U8(0),
B(Star3),
/* 61 E> */ B(CallRuntime), U16(Runtime::kNewTypeError), R(2), U8(2),
B(Throw),
B(Wide), B(LdaSmi), I16(329),
B(Star2),
B(LdaConstant), U8(1),
B(Star3),
B(CallRuntime), U16(Runtime::kNewTypeError), R(2), U8(2),
B(Throw),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["B"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["#b"],
]
handlers: [
]
---
snippet: "
class C {
static #c() { return 1; }
static test() { this.#c++; }
}
var test = C.test;
test();
"
frame size: 3
parameter count: 1
bytecode array length: 37
bytecodes: [
/* 56 S> */ B(LdaCurrentContextSlot), U8(3),
B(TestReferenceEqual), R(this),
B(Mov), R(this), R(0),
B(JumpIfTrue), U8(16),
B(Wide), B(LdaSmi), I16(323),
B(Star1),
B(LdaConstant), U8(0),
B(Star2),
/* 61 E> */ B(CallRuntime), U16(Runtime::kNewTypeError), R(1), U8(2),
B(Throw),
B(Wide), B(LdaSmi), I16(329),
B(Star1),
B(LdaConstant), U8(1),
B(Star2),
B(CallRuntime), U16(Runtime::kNewTypeError), R(1), U8(2),
B(Throw),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["C"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["#c"],
]
handlers: [
]
---
snippet: "
class D {
static get #d() { return 1; }
static set #d(val) { }
static test() {
this.#d++;
this.#d = 1;
return this.#d;
}
}
var test = D.test;
test();
"
frame size: 5
parameter count: 1
bytecode array length: 127
bytecodes: [
/* 90 S> */ B(LdaImmutableCurrentContextSlot), U8(2),
B(Star1),
B(LdaCurrentContextSlot), U8(3),
B(TestReferenceEqual), R(this),
B(Mov), R(this), R(0),
B(JumpIfTrue), U8(16),
B(Wide), B(LdaSmi), I16(323),
B(Star2),
B(LdaConstant), U8(0),
B(Star3),
/* 95 E> */ B(CallRuntime), U16(Runtime::kNewTypeError), R(2), U8(2),
B(Throw),
B(CallRuntime), U16(Runtime::kLoadPrivateGetter), R(1), U8(1),
B(Star2),
B(CallProperty0), R(2), R(0), U8(0),
B(Inc), U8(2),
B(Star2),
/* 97 E> */ B(CallRuntime), U16(Runtime::kLoadPrivateSetter), R(1), U8(1),
B(Star3),
B(CallProperty1), R(3), R(0), R(2), U8(3),
/* 105 S> */ B(LdaImmutableCurrentContextSlot), U8(2),
B(Star1),
B(LdaSmi), I8(1),
B(Star2),
B(LdaCurrentContextSlot), U8(3),
B(TestReferenceEqual), R(this),
B(Mov), R(this), R(0),
B(JumpIfTrue), U8(16),
B(Wide), B(LdaSmi), I16(323),
B(Star3),
B(LdaConstant), U8(0),
B(Star4),
/* 110 E> */ B(CallRuntime), U16(Runtime::kNewTypeError), R(3), U8(2),
B(Throw),
B(CallRuntime), U16(Runtime::kLoadPrivateSetter), R(1), U8(1),
B(Star3),
B(CallProperty1), R(3), R(0), R(2), U8(5),
/* 122 S> */ B(LdaImmutableCurrentContextSlot), U8(2),
B(Star1),
B(LdaCurrentContextSlot), U8(3),
B(TestReferenceEqual), R(this),
B(Mov), R(this), R(0),
B(JumpIfTrue), U8(16),
B(Wide), B(LdaSmi), I16(323),
B(Star2),
B(LdaConstant), U8(0),
B(Star3),
/* 134 E> */ B(CallRuntime), U16(Runtime::kNewTypeError), R(2), U8(2),
B(Throw),
B(CallRuntime), U16(Runtime::kLoadPrivateGetter), R(1), U8(1),
B(Star2),
B(CallProperty0), R(2), R(0), U8(7),
/* 137 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["D"],
]
handlers: [
]
---
snippet: "
class E {
static get #e() { return 1; }
static test() { this.#e++; }
}
var test = E.test;
test();
"
frame size: 3
parameter count: 1
bytecode array length: 37
bytecodes: [
/* 60 S> */ B(LdaCurrentContextSlot), U8(3),
B(TestReferenceEqual), R(this),
B(Mov), R(this), R(0),
B(JumpIfTrue), U8(16),
B(Wide), B(LdaSmi), I16(323),
B(Star1),
B(LdaConstant), U8(0),
B(Star2),
/* 65 E> */ B(CallRuntime), U16(Runtime::kNewTypeError), R(1), U8(2),
B(Throw),
B(Wide), B(LdaSmi), I16(331),
B(Star1),
B(LdaConstant), U8(1),
B(Star2),
B(CallRuntime), U16(Runtime::kNewTypeError), R(1), U8(2),
B(Throw),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["E"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["#e"],
]
handlers: [
]
---
snippet: "
class F {
static set #f(val) { }
static test() { this.#f++; }
}
var test = F.test;
test();
"
frame size: 3
parameter count: 1
bytecode array length: 37
bytecodes: [
/* 53 S> */ B(LdaCurrentContextSlot), U8(3),
B(TestReferenceEqual), R(this),
B(Mov), R(this), R(0),
B(JumpIfTrue), U8(16),
B(Wide), B(LdaSmi), I16(323),
B(Star1),
B(LdaConstant), U8(0),
B(Star2),
/* 58 E> */ B(CallRuntime), U16(Runtime::kNewTypeError), R(1), U8(2),
B(Throw),
B(Wide), B(LdaSmi), I16(330),
B(Star1),
B(LdaConstant), U8(1),
B(Star2),
B(CallRuntime), U16(Runtime::kNewTypeError), R(1), U8(2),
B(Throw),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["F"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["#f"],
]
handlers: [
]
---
snippet: "
class G {
static get #d() { return 1; }
static test() { this.#d = 1; }
}
var test = G.test;
test();
"
frame size: 4
parameter count: 1
bytecode array length: 40
bytecodes: [
/* 60 S> */ B(LdaImmutableCurrentContextSlot), U8(2),
B(Star1),
B(LdaCurrentContextSlot), U8(3),
B(TestReferenceEqual), R(this),
B(Mov), R(this), R(0),
B(JumpIfTrue), U8(16),
B(Wide), B(LdaSmi), I16(323),
B(Star2),
B(LdaConstant), U8(0),
B(Star3),
/* 65 E> */ B(CallRuntime), U16(Runtime::kNewTypeError), R(2), U8(2),
B(Throw),
B(Wide), B(LdaSmi), I16(331),
B(Star2),
B(LdaConstant), U8(1),
B(Star3),
B(CallRuntime), U16(Runtime::kNewTypeError), R(2), U8(2),
B(Throw),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["G"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["#d"],
]
handlers: [
]
---
snippet: "
class H {
set #h(val) { }
static test() { this.#h; }
}
var test = H.test;
test();
"
frame size: 3
parameter count: 1
bytecode array length: 19
bytecodes: [
/* 46 S> */ B(LdaImmutableCurrentContextSlot), U8(3),
/* 51 E> */ B(GetKeyedProperty), R(this), U8(0),
B(Wide), B(LdaSmi), I16(330),
B(Star1),
B(LdaConstant), U8(0),
B(Star2),
B(CallRuntime), U16(Runtime::kNewTypeError), R(1), U8(2),
B(Throw),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["#h"],
]
handlers: [
]

View File

@ -0,0 +1,220 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
{
class A {
static #a() { return 1; }
}
}
"
frame size: 6
parameter count: 1
bytecode array length: 35
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(1),
B(CreateClosure), U8(2), U8(0), U8(2),
B(StaCurrentContextSlot), U8(2),
B(LdaTheHole),
B(Star5),
B(CreateClosure), U8(3), U8(1), U8(2),
B(Star2),
B(LdaConstant), U8(1),
B(Star3),
B(Mov), R(2), R(4),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(3),
B(PopContext), R(1),
B(Mov), R(4), R(0),
B(LdaUndefined),
/* 84 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
{
class A {
static get #a() { return 1; }
}
}
"
frame size: 6
parameter count: 1
bytecode array length: 43
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(1),
B(LdaTheHole),
B(Star5),
B(CreateClosure), U8(2), U8(0), U8(2),
B(Star2),
B(LdaConstant), U8(1),
B(Star3),
B(Mov), R(2), R(4),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(3),
B(CreateClosure), U8(3), U8(1), U8(2),
B(Star3),
B(LdaNull),
B(Star4),
B(CallRuntime), U16(Runtime::kCreatePrivateAccessors), R(3), U8(2),
B(StaCurrentContextSlot), U8(2),
B(PopContext), R(1),
B(Mov), R(2), R(0),
B(LdaUndefined),
/* 88 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
{
class A {
static set #a(val) { }
}
}
"
frame size: 6
parameter count: 1
bytecode array length: 43
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(1),
B(LdaTheHole),
B(Star5),
B(CreateClosure), U8(2), U8(0), U8(2),
B(Star2),
B(LdaConstant), U8(1),
B(Star3),
B(Mov), R(2), R(4),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(3),
B(LdaNull),
B(Star3),
B(CreateClosure), U8(3), U8(1), U8(2),
B(Star4),
B(CallRuntime), U16(Runtime::kCreatePrivateAccessors), R(3), U8(2),
B(StaCurrentContextSlot), U8(2),
B(PopContext), R(1),
B(Mov), R(2), R(0),
B(LdaUndefined),
/* 81 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
{
class A {
static get #a() { return 1; }
static set #a(val) { }
}
}
"
frame size: 6
parameter count: 1
bytecode array length: 46
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(1),
B(LdaTheHole),
B(Star5),
B(CreateClosure), U8(2), U8(0), U8(2),
B(Star2),
B(LdaConstant), U8(1),
B(Star3),
B(Mov), R(2), R(4),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(3),
B(CreateClosure), U8(3), U8(1), U8(2),
B(Star3),
B(CreateClosure), U8(4), U8(2), U8(2),
B(Star4),
B(CallRuntime), U16(Runtime::kCreatePrivateAccessors), R(3), U8(2),
B(StaCurrentContextSlot), U8(2),
B(PopContext), R(1),
B(Mov), R(2), R(0),
B(LdaUndefined),
/* 115 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
{
class A {
static #a() { }
#b() { }
}
}
"
frame size: 6
parameter count: 1
bytecode array length: 51
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(1),
B(LdaConstant), U8(2),
B(Star3),
B(CallRuntime), U16(Runtime::kCreatePrivateBrandSymbol), R(3), U8(1),
B(StaCurrentContextSlot), U8(4),
B(CreateClosure), U8(3), U8(0), U8(2),
B(StaCurrentContextSlot), U8(2),
B(CreateClosure), U8(4), U8(1), U8(2),
B(StaCurrentContextSlot), U8(3),
B(LdaTheHole),
B(Star5),
B(CreateClosure), U8(5), U8(2), U8(2),
B(Star2),
B(LdaConstant), U8(1),
B(Star3),
B(Mov), R(2), R(4),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(3),
B(PopContext), R(1),
B(Mov), R(4), R(0),
B(LdaUndefined),
/* 87 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
CLASS_BOILERPLATE_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["A"],
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]

View File

@ -0,0 +1,912 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: f
---
snippet: "
var a = 1;
function f() { a = 2; }
f();
"
frame size: 0
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 26 S> */ B(LdaSmi), I8(2),
/* 28 E> */ B(StaGlobal), U8(0), U8(0),
B(LdaUndefined),
/* 33 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["a"],
]
handlers: [
]
---
snippet: "
var a = \"test\"; function f(b) { a = b; }
f(\"global\");
"
frame size: 0
parameter count: 2
bytecode array length: 7
bytecodes: [
/* 32 S> */ B(Ldar), R(arg0),
/* 34 E> */ B(StaGlobal), U8(0), U8(0),
B(LdaUndefined),
/* 39 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["a"],
]
handlers: [
]
---
snippet: "
'use strict'; var a = 1;
function f() { a = 2; }
f();
"
frame size: 0
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 40 S> */ B(LdaSmi), I8(2),
/* 42 E> */ B(StaGlobal), U8(0), U8(0),
B(LdaUndefined),
/* 47 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["a"],
]
handlers: [
]
---
snippet: "
a = 1;
function f() { a = 2; }
f();
"
frame size: 0
parameter count: 1
bytecode array length: 7
bytecodes: [
/* 22 S> */ B(LdaSmi), I8(2),
/* 24 E> */ B(StaGlobal), U8(0), U8(0),
B(LdaUndefined),
/* 29 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["a"],
]
handlers: [
]
---
snippet: "
a = 1;
function f(c) {
var b = {};
b.name640;
b.name641;
b.name642;
b.name643;
b.name644;
b.name645;
b.name646;
b.name647;
b.name648;
b.name649;
b.name650;
b.name651;
b.name652;
b.name653;
b.name654;
b.name655;
b.name656;
b.name657;
b.name658;
b.name659;
b.name660;
b.name661;
b.name662;
b.name663;
b.name664;
b.name665;
b.name666;
b.name667;
b.name668;
b.name669;
b.name670;
b.name671;
b.name672;
b.name673;
b.name674;
b.name675;
b.name676;
b.name677;
b.name678;
b.name679;
b.name680;
b.name681;
b.name682;
b.name683;
b.name684;
b.name685;
b.name686;
b.name687;
b.name688;
b.name689;
b.name690;
b.name691;
b.name692;
b.name693;
b.name694;
b.name695;
b.name696;
b.name697;
b.name698;
b.name699;
b.name700;
b.name701;
b.name702;
b.name703;
b.name704;
b.name705;
b.name706;
b.name707;
b.name708;
b.name709;
b.name710;
b.name711;
b.name712;
b.name713;
b.name714;
b.name715;
b.name716;
b.name717;
b.name718;
b.name719;
b.name720;
b.name721;
b.name722;
b.name723;
b.name724;
b.name725;
b.name726;
b.name727;
b.name728;
b.name729;
b.name730;
b.name731;
b.name732;
b.name733;
b.name734;
b.name735;
b.name736;
b.name737;
b.name738;
b.name739;
b.name740;
b.name741;
b.name742;
b.name743;
b.name744;
b.name745;
b.name746;
b.name747;
b.name748;
b.name749;
b.name750;
b.name751;
b.name752;
b.name753;
b.name754;
b.name755;
b.name756;
b.name757;
b.name758;
b.name759;
b.name760;
b.name761;
b.name762;
b.name763;
b.name764;
b.name765;
b.name766;
b.name767;
a = 2;
}
f({name: 1});
"
frame size: 1
parameter count: 2
bytecode array length: 524
bytecodes: [
/* 33 S> */ B(CreateEmptyObjectLiteral),
B(Star0),
/* 41 S> */ B(GetNamedProperty), R(0), U8(0), U8(0),
/* 54 S> */ B(GetNamedProperty), R(0), U8(1), U8(2),
/* 67 S> */ B(GetNamedProperty), R(0), U8(2), U8(4),
/* 80 S> */ B(GetNamedProperty), R(0), U8(3), U8(6),
/* 93 S> */ B(GetNamedProperty), R(0), U8(4), U8(8),
/* 106 S> */ B(GetNamedProperty), R(0), U8(5), U8(10),
/* 119 S> */ B(GetNamedProperty), R(0), U8(6), U8(12),
/* 132 S> */ B(GetNamedProperty), R(0), U8(7), U8(14),
/* 145 S> */ B(GetNamedProperty), R(0), U8(8), U8(16),
/* 158 S> */ B(GetNamedProperty), R(0), U8(9), U8(18),
/* 171 S> */ B(GetNamedProperty), R(0), U8(10), U8(20),
/* 184 S> */ B(GetNamedProperty), R(0), U8(11), U8(22),
/* 197 S> */ B(GetNamedProperty), R(0), U8(12), U8(24),
/* 210 S> */ B(GetNamedProperty), R(0), U8(13), U8(26),
/* 223 S> */ B(GetNamedProperty), R(0), U8(14), U8(28),
/* 236 S> */ B(GetNamedProperty), R(0), U8(15), U8(30),
/* 249 S> */ B(GetNamedProperty), R(0), U8(16), U8(32),
/* 262 S> */ B(GetNamedProperty), R(0), U8(17), U8(34),
/* 275 S> */ B(GetNamedProperty), R(0), U8(18), U8(36),
/* 288 S> */ B(GetNamedProperty), R(0), U8(19), U8(38),
/* 301 S> */ B(GetNamedProperty), R(0), U8(20), U8(40),
/* 314 S> */ B(GetNamedProperty), R(0), U8(21), U8(42),
/* 327 S> */ B(GetNamedProperty), R(0), U8(22), U8(44),
/* 340 S> */ B(GetNamedProperty), R(0), U8(23), U8(46),
/* 353 S> */ B(GetNamedProperty), R(0), U8(24), U8(48),
/* 366 S> */ B(GetNamedProperty), R(0), U8(25), U8(50),
/* 379 S> */ B(GetNamedProperty), R(0), U8(26), U8(52),
/* 392 S> */ B(GetNamedProperty), R(0), U8(27), U8(54),
/* 405 S> */ B(GetNamedProperty), R(0), U8(28), U8(56),
/* 418 S> */ B(GetNamedProperty), R(0), U8(29), U8(58),
/* 431 S> */ B(GetNamedProperty), R(0), U8(30), U8(60),
/* 444 S> */ B(GetNamedProperty), R(0), U8(31), U8(62),
/* 457 S> */ B(GetNamedProperty), R(0), U8(32), U8(64),
/* 470 S> */ B(GetNamedProperty), R(0), U8(33), U8(66),
/* 483 S> */ B(GetNamedProperty), R(0), U8(34), U8(68),
/* 496 S> */ B(GetNamedProperty), R(0), U8(35), U8(70),
/* 509 S> */ B(GetNamedProperty), R(0), U8(36), U8(72),
/* 522 S> */ B(GetNamedProperty), R(0), U8(37), U8(74),
/* 535 S> */ B(GetNamedProperty), R(0), U8(38), U8(76),
/* 548 S> */ B(GetNamedProperty), R(0), U8(39), U8(78),
/* 561 S> */ B(GetNamedProperty), R(0), U8(40), U8(80),
/* 574 S> */ B(GetNamedProperty), R(0), U8(41), U8(82),
/* 587 S> */ B(GetNamedProperty), R(0), U8(42), U8(84),
/* 600 S> */ B(GetNamedProperty), R(0), U8(43), U8(86),
/* 613 S> */ B(GetNamedProperty), R(0), U8(44), U8(88),
/* 626 S> */ B(GetNamedProperty), R(0), U8(45), U8(90),
/* 639 S> */ B(GetNamedProperty), R(0), U8(46), U8(92),
/* 652 S> */ B(GetNamedProperty), R(0), U8(47), U8(94),
/* 665 S> */ B(GetNamedProperty), R(0), U8(48), U8(96),
/* 678 S> */ B(GetNamedProperty), R(0), U8(49), U8(98),
/* 691 S> */ B(GetNamedProperty), R(0), U8(50), U8(100),
/* 704 S> */ B(GetNamedProperty), R(0), U8(51), U8(102),
/* 717 S> */ B(GetNamedProperty), R(0), U8(52), U8(104),
/* 730 S> */ B(GetNamedProperty), R(0), U8(53), U8(106),
/* 743 S> */ B(GetNamedProperty), R(0), U8(54), U8(108),
/* 756 S> */ B(GetNamedProperty), R(0), U8(55), U8(110),
/* 769 S> */ B(GetNamedProperty), R(0), U8(56), U8(112),
/* 782 S> */ B(GetNamedProperty), R(0), U8(57), U8(114),
/* 795 S> */ B(GetNamedProperty), R(0), U8(58), U8(116),
/* 808 S> */ B(GetNamedProperty), R(0), U8(59), U8(118),
/* 821 S> */ B(GetNamedProperty), R(0), U8(60), U8(120),
/* 834 S> */ B(GetNamedProperty), R(0), U8(61), U8(122),
/* 847 S> */ B(GetNamedProperty), R(0), U8(62), U8(124),
/* 860 S> */ B(GetNamedProperty), R(0), U8(63), U8(126),
/* 873 S> */ B(GetNamedProperty), R(0), U8(64), U8(128),
/* 886 S> */ B(GetNamedProperty), R(0), U8(65), U8(130),
/* 899 S> */ B(GetNamedProperty), R(0), U8(66), U8(132),
/* 912 S> */ B(GetNamedProperty), R(0), U8(67), U8(134),
/* 925 S> */ B(GetNamedProperty), R(0), U8(68), U8(136),
/* 938 S> */ B(GetNamedProperty), R(0), U8(69), U8(138),
/* 951 S> */ B(GetNamedProperty), R(0), U8(70), U8(140),
/* 964 S> */ B(GetNamedProperty), R(0), U8(71), U8(142),
/* 977 S> */ B(GetNamedProperty), R(0), U8(72), U8(144),
/* 990 S> */ B(GetNamedProperty), R(0), U8(73), U8(146),
/* 1003 S> */ B(GetNamedProperty), R(0), U8(74), U8(148),
/* 1016 S> */ B(GetNamedProperty), R(0), U8(75), U8(150),
/* 1029 S> */ B(GetNamedProperty), R(0), U8(76), U8(152),
/* 1042 S> */ B(GetNamedProperty), R(0), U8(77), U8(154),
/* 1055 S> */ B(GetNamedProperty), R(0), U8(78), U8(156),
/* 1068 S> */ B(GetNamedProperty), R(0), U8(79), U8(158),
/* 1081 S> */ B(GetNamedProperty), R(0), U8(80), U8(160),
/* 1094 S> */ B(GetNamedProperty), R(0), U8(81), U8(162),
/* 1107 S> */ B(GetNamedProperty), R(0), U8(82), U8(164),
/* 1120 S> */ B(GetNamedProperty), R(0), U8(83), U8(166),
/* 1133 S> */ B(GetNamedProperty), R(0), U8(84), U8(168),
/* 1146 S> */ B(GetNamedProperty), R(0), U8(85), U8(170),
/* 1159 S> */ B(GetNamedProperty), R(0), U8(86), U8(172),
/* 1172 S> */ B(GetNamedProperty), R(0), U8(87), U8(174),
/* 1185 S> */ B(GetNamedProperty), R(0), U8(88), U8(176),
/* 1198 S> */ B(GetNamedProperty), R(0), U8(89), U8(178),
/* 1211 S> */ B(GetNamedProperty), R(0), U8(90), U8(180),
/* 1224 S> */ B(GetNamedProperty), R(0), U8(91), U8(182),
/* 1237 S> */ B(GetNamedProperty), R(0), U8(92), U8(184),
/* 1250 S> */ B(GetNamedProperty), R(0), U8(93), U8(186),
/* 1263 S> */ B(GetNamedProperty), R(0), U8(94), U8(188),
/* 1276 S> */ B(GetNamedProperty), R(0), U8(95), U8(190),
/* 1289 S> */ B(GetNamedProperty), R(0), U8(96), U8(192),
/* 1302 S> */ B(GetNamedProperty), R(0), U8(97), U8(194),
/* 1315 S> */ B(GetNamedProperty), R(0), U8(98), U8(196),
/* 1328 S> */ B(GetNamedProperty), R(0), U8(99), U8(198),
/* 1341 S> */ B(GetNamedProperty), R(0), U8(100), U8(200),
/* 1354 S> */ B(GetNamedProperty), R(0), U8(101), U8(202),
/* 1367 S> */ B(GetNamedProperty), R(0), U8(102), U8(204),
/* 1380 S> */ B(GetNamedProperty), R(0), U8(103), U8(206),
/* 1393 S> */ B(GetNamedProperty), R(0), U8(104), U8(208),
/* 1406 S> */ B(GetNamedProperty), R(0), U8(105), U8(210),
/* 1419 S> */ B(GetNamedProperty), R(0), U8(106), U8(212),
/* 1432 S> */ B(GetNamedProperty), R(0), U8(107), U8(214),
/* 1445 S> */ B(GetNamedProperty), R(0), U8(108), U8(216),
/* 1458 S> */ B(GetNamedProperty), R(0), U8(109), U8(218),
/* 1471 S> */ B(GetNamedProperty), R(0), U8(110), U8(220),
/* 1484 S> */ B(GetNamedProperty), R(0), U8(111), U8(222),
/* 1497 S> */ B(GetNamedProperty), R(0), U8(112), U8(224),
/* 1510 S> */ B(GetNamedProperty), R(0), U8(113), U8(226),
/* 1523 S> */ B(GetNamedProperty), R(0), U8(114), U8(228),
/* 1536 S> */ B(GetNamedProperty), R(0), U8(115), U8(230),
/* 1549 S> */ B(GetNamedProperty), R(0), U8(116), U8(232),
/* 1562 S> */ B(GetNamedProperty), R(0), U8(117), U8(234),
/* 1575 S> */ B(GetNamedProperty), R(0), U8(118), U8(236),
/* 1588 S> */ B(GetNamedProperty), R(0), U8(119), U8(238),
/* 1601 S> */ B(GetNamedProperty), R(0), U8(120), U8(240),
/* 1614 S> */ B(GetNamedProperty), R(0), U8(121), U8(242),
/* 1627 S> */ B(GetNamedProperty), R(0), U8(122), U8(244),
/* 1640 S> */ B(GetNamedProperty), R(0), U8(123), U8(246),
/* 1653 S> */ B(GetNamedProperty), R(0), U8(124), U8(248),
/* 1666 S> */ B(GetNamedProperty), R(0), U8(125), U8(250),
/* 1679 S> */ B(GetNamedProperty), R(0), U8(126), U8(252),
/* 1692 S> */ B(GetNamedProperty), R(0), U8(127), U8(254),
/* 1703 S> */ B(LdaSmi), I8(2),
/* 1705 E> */ B(Wide), B(StaGlobal), U16(128), U16(256),
B(LdaUndefined),
/* 1710 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name640"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name641"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name642"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name643"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name644"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name645"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name646"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name647"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name648"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name649"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name650"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name651"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name652"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name653"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name654"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name655"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name656"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name657"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name658"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name659"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name660"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name661"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name662"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name663"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name664"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name665"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name666"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name667"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name668"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name669"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name670"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name671"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name672"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name673"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name674"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name675"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name676"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name677"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name678"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name679"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name680"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name681"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name682"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name683"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name684"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name685"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name686"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name687"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name688"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name689"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name690"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name691"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name692"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name693"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name694"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name695"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name696"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name697"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name698"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name699"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name700"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name701"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name702"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name703"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name704"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name705"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name706"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name707"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name708"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name709"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name710"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name711"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name712"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name713"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name714"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name715"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name716"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name717"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name718"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name719"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name720"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name721"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name722"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name723"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name724"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name725"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name726"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name727"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name728"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name729"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name730"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name731"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name732"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name733"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name734"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name735"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name736"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name737"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name738"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name739"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name740"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name741"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name742"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name743"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name744"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name745"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name746"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name747"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name748"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name749"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name750"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name751"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name752"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name753"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name754"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name755"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name756"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name757"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name758"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name759"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name760"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name761"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name762"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name763"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name764"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name765"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name766"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name767"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["a"],
]
handlers: [
]
---
snippet: "
a = 1;
function f(c) {
'use strict';
var b = {};
b.name768;
b.name769;
b.name770;
b.name771;
b.name772;
b.name773;
b.name774;
b.name775;
b.name776;
b.name777;
b.name778;
b.name779;
b.name780;
b.name781;
b.name782;
b.name783;
b.name784;
b.name785;
b.name786;
b.name787;
b.name788;
b.name789;
b.name790;
b.name791;
b.name792;
b.name793;
b.name794;
b.name795;
b.name796;
b.name797;
b.name798;
b.name799;
b.name800;
b.name801;
b.name802;
b.name803;
b.name804;
b.name805;
b.name806;
b.name807;
b.name808;
b.name809;
b.name810;
b.name811;
b.name812;
b.name813;
b.name814;
b.name815;
b.name816;
b.name817;
b.name818;
b.name819;
b.name820;
b.name821;
b.name822;
b.name823;
b.name824;
b.name825;
b.name826;
b.name827;
b.name828;
b.name829;
b.name830;
b.name831;
b.name832;
b.name833;
b.name834;
b.name835;
b.name836;
b.name837;
b.name838;
b.name839;
b.name840;
b.name841;
b.name842;
b.name843;
b.name844;
b.name845;
b.name846;
b.name847;
b.name848;
b.name849;
b.name850;
b.name851;
b.name852;
b.name853;
b.name854;
b.name855;
b.name856;
b.name857;
b.name858;
b.name859;
b.name860;
b.name861;
b.name862;
b.name863;
b.name864;
b.name865;
b.name866;
b.name867;
b.name868;
b.name869;
b.name870;
b.name871;
b.name872;
b.name873;
b.name874;
b.name875;
b.name876;
b.name877;
b.name878;
b.name879;
b.name880;
b.name881;
b.name882;
b.name883;
b.name884;
b.name885;
b.name886;
b.name887;
b.name888;
b.name889;
b.name890;
b.name891;
b.name892;
b.name893;
b.name894;
b.name895;
a = 2;
}
f({name: 1});
"
frame size: 1
parameter count: 2
bytecode array length: 524
bytecodes: [
/* 49 S> */ B(CreateEmptyObjectLiteral),
B(Star0),
/* 57 S> */ B(GetNamedProperty), R(0), U8(0), U8(0),
/* 70 S> */ B(GetNamedProperty), R(0), U8(1), U8(2),
/* 83 S> */ B(GetNamedProperty), R(0), U8(2), U8(4),
/* 96 S> */ B(GetNamedProperty), R(0), U8(3), U8(6),
/* 109 S> */ B(GetNamedProperty), R(0), U8(4), U8(8),
/* 122 S> */ B(GetNamedProperty), R(0), U8(5), U8(10),
/* 135 S> */ B(GetNamedProperty), R(0), U8(6), U8(12),
/* 148 S> */ B(GetNamedProperty), R(0), U8(7), U8(14),
/* 161 S> */ B(GetNamedProperty), R(0), U8(8), U8(16),
/* 174 S> */ B(GetNamedProperty), R(0), U8(9), U8(18),
/* 187 S> */ B(GetNamedProperty), R(0), U8(10), U8(20),
/* 200 S> */ B(GetNamedProperty), R(0), U8(11), U8(22),
/* 213 S> */ B(GetNamedProperty), R(0), U8(12), U8(24),
/* 226 S> */ B(GetNamedProperty), R(0), U8(13), U8(26),
/* 239 S> */ B(GetNamedProperty), R(0), U8(14), U8(28),
/* 252 S> */ B(GetNamedProperty), R(0), U8(15), U8(30),
/* 265 S> */ B(GetNamedProperty), R(0), U8(16), U8(32),
/* 278 S> */ B(GetNamedProperty), R(0), U8(17), U8(34),
/* 291 S> */ B(GetNamedProperty), R(0), U8(18), U8(36),
/* 304 S> */ B(GetNamedProperty), R(0), U8(19), U8(38),
/* 317 S> */ B(GetNamedProperty), R(0), U8(20), U8(40),
/* 330 S> */ B(GetNamedProperty), R(0), U8(21), U8(42),
/* 343 S> */ B(GetNamedProperty), R(0), U8(22), U8(44),
/* 356 S> */ B(GetNamedProperty), R(0), U8(23), U8(46),
/* 369 S> */ B(GetNamedProperty), R(0), U8(24), U8(48),
/* 382 S> */ B(GetNamedProperty), R(0), U8(25), U8(50),
/* 395 S> */ B(GetNamedProperty), R(0), U8(26), U8(52),
/* 408 S> */ B(GetNamedProperty), R(0), U8(27), U8(54),
/* 421 S> */ B(GetNamedProperty), R(0), U8(28), U8(56),
/* 434 S> */ B(GetNamedProperty), R(0), U8(29), U8(58),
/* 447 S> */ B(GetNamedProperty), R(0), U8(30), U8(60),
/* 460 S> */ B(GetNamedProperty), R(0), U8(31), U8(62),
/* 473 S> */ B(GetNamedProperty), R(0), U8(32), U8(64),
/* 486 S> */ B(GetNamedProperty), R(0), U8(33), U8(66),
/* 499 S> */ B(GetNamedProperty), R(0), U8(34), U8(68),
/* 512 S> */ B(GetNamedProperty), R(0), U8(35), U8(70),
/* 525 S> */ B(GetNamedProperty), R(0), U8(36), U8(72),
/* 538 S> */ B(GetNamedProperty), R(0), U8(37), U8(74),
/* 551 S> */ B(GetNamedProperty), R(0), U8(38), U8(76),
/* 564 S> */ B(GetNamedProperty), R(0), U8(39), U8(78),
/* 577 S> */ B(GetNamedProperty), R(0), U8(40), U8(80),
/* 590 S> */ B(GetNamedProperty), R(0), U8(41), U8(82),
/* 603 S> */ B(GetNamedProperty), R(0), U8(42), U8(84),
/* 616 S> */ B(GetNamedProperty), R(0), U8(43), U8(86),
/* 629 S> */ B(GetNamedProperty), R(0), U8(44), U8(88),
/* 642 S> */ B(GetNamedProperty), R(0), U8(45), U8(90),
/* 655 S> */ B(GetNamedProperty), R(0), U8(46), U8(92),
/* 668 S> */ B(GetNamedProperty), R(0), U8(47), U8(94),
/* 681 S> */ B(GetNamedProperty), R(0), U8(48), U8(96),
/* 694 S> */ B(GetNamedProperty), R(0), U8(49), U8(98),
/* 707 S> */ B(GetNamedProperty), R(0), U8(50), U8(100),
/* 720 S> */ B(GetNamedProperty), R(0), U8(51), U8(102),
/* 733 S> */ B(GetNamedProperty), R(0), U8(52), U8(104),
/* 746 S> */ B(GetNamedProperty), R(0), U8(53), U8(106),
/* 759 S> */ B(GetNamedProperty), R(0), U8(54), U8(108),
/* 772 S> */ B(GetNamedProperty), R(0), U8(55), U8(110),
/* 785 S> */ B(GetNamedProperty), R(0), U8(56), U8(112),
/* 798 S> */ B(GetNamedProperty), R(0), U8(57), U8(114),
/* 811 S> */ B(GetNamedProperty), R(0), U8(58), U8(116),
/* 824 S> */ B(GetNamedProperty), R(0), U8(59), U8(118),
/* 837 S> */ B(GetNamedProperty), R(0), U8(60), U8(120),
/* 850 S> */ B(GetNamedProperty), R(0), U8(61), U8(122),
/* 863 S> */ B(GetNamedProperty), R(0), U8(62), U8(124),
/* 876 S> */ B(GetNamedProperty), R(0), U8(63), U8(126),
/* 889 S> */ B(GetNamedProperty), R(0), U8(64), U8(128),
/* 902 S> */ B(GetNamedProperty), R(0), U8(65), U8(130),
/* 915 S> */ B(GetNamedProperty), R(0), U8(66), U8(132),
/* 928 S> */ B(GetNamedProperty), R(0), U8(67), U8(134),
/* 941 S> */ B(GetNamedProperty), R(0), U8(68), U8(136),
/* 954 S> */ B(GetNamedProperty), R(0), U8(69), U8(138),
/* 967 S> */ B(GetNamedProperty), R(0), U8(70), U8(140),
/* 980 S> */ B(GetNamedProperty), R(0), U8(71), U8(142),
/* 993 S> */ B(GetNamedProperty), R(0), U8(72), U8(144),
/* 1006 S> */ B(GetNamedProperty), R(0), U8(73), U8(146),
/* 1019 S> */ B(GetNamedProperty), R(0), U8(74), U8(148),
/* 1032 S> */ B(GetNamedProperty), R(0), U8(75), U8(150),
/* 1045 S> */ B(GetNamedProperty), R(0), U8(76), U8(152),
/* 1058 S> */ B(GetNamedProperty), R(0), U8(77), U8(154),
/* 1071 S> */ B(GetNamedProperty), R(0), U8(78), U8(156),
/* 1084 S> */ B(GetNamedProperty), R(0), U8(79), U8(158),
/* 1097 S> */ B(GetNamedProperty), R(0), U8(80), U8(160),
/* 1110 S> */ B(GetNamedProperty), R(0), U8(81), U8(162),
/* 1123 S> */ B(GetNamedProperty), R(0), U8(82), U8(164),
/* 1136 S> */ B(GetNamedProperty), R(0), U8(83), U8(166),
/* 1149 S> */ B(GetNamedProperty), R(0), U8(84), U8(168),
/* 1162 S> */ B(GetNamedProperty), R(0), U8(85), U8(170),
/* 1175 S> */ B(GetNamedProperty), R(0), U8(86), U8(172),
/* 1188 S> */ B(GetNamedProperty), R(0), U8(87), U8(174),
/* 1201 S> */ B(GetNamedProperty), R(0), U8(88), U8(176),
/* 1214 S> */ B(GetNamedProperty), R(0), U8(89), U8(178),
/* 1227 S> */ B(GetNamedProperty), R(0), U8(90), U8(180),
/* 1240 S> */ B(GetNamedProperty), R(0), U8(91), U8(182),
/* 1253 S> */ B(GetNamedProperty), R(0), U8(92), U8(184),
/* 1266 S> */ B(GetNamedProperty), R(0), U8(93), U8(186),
/* 1279 S> */ B(GetNamedProperty), R(0), U8(94), U8(188),
/* 1292 S> */ B(GetNamedProperty), R(0), U8(95), U8(190),
/* 1305 S> */ B(GetNamedProperty), R(0), U8(96), U8(192),
/* 1318 S> */ B(GetNamedProperty), R(0), U8(97), U8(194),
/* 1331 S> */ B(GetNamedProperty), R(0), U8(98), U8(196),
/* 1344 S> */ B(GetNamedProperty), R(0), U8(99), U8(198),
/* 1357 S> */ B(GetNamedProperty), R(0), U8(100), U8(200),
/* 1370 S> */ B(GetNamedProperty), R(0), U8(101), U8(202),
/* 1383 S> */ B(GetNamedProperty), R(0), U8(102), U8(204),
/* 1396 S> */ B(GetNamedProperty), R(0), U8(103), U8(206),
/* 1409 S> */ B(GetNamedProperty), R(0), U8(104), U8(208),
/* 1422 S> */ B(GetNamedProperty), R(0), U8(105), U8(210),
/* 1435 S> */ B(GetNamedProperty), R(0), U8(106), U8(212),
/* 1448 S> */ B(GetNamedProperty), R(0), U8(107), U8(214),
/* 1461 S> */ B(GetNamedProperty), R(0), U8(108), U8(216),
/* 1474 S> */ B(GetNamedProperty), R(0), U8(109), U8(218),
/* 1487 S> */ B(GetNamedProperty), R(0), U8(110), U8(220),
/* 1500 S> */ B(GetNamedProperty), R(0), U8(111), U8(222),
/* 1513 S> */ B(GetNamedProperty), R(0), U8(112), U8(224),
/* 1526 S> */ B(GetNamedProperty), R(0), U8(113), U8(226),
/* 1539 S> */ B(GetNamedProperty), R(0), U8(114), U8(228),
/* 1552 S> */ B(GetNamedProperty), R(0), U8(115), U8(230),
/* 1565 S> */ B(GetNamedProperty), R(0), U8(116), U8(232),
/* 1578 S> */ B(GetNamedProperty), R(0), U8(117), U8(234),
/* 1591 S> */ B(GetNamedProperty), R(0), U8(118), U8(236),
/* 1604 S> */ B(GetNamedProperty), R(0), U8(119), U8(238),
/* 1617 S> */ B(GetNamedProperty), R(0), U8(120), U8(240),
/* 1630 S> */ B(GetNamedProperty), R(0), U8(121), U8(242),
/* 1643 S> */ B(GetNamedProperty), R(0), U8(122), U8(244),
/* 1656 S> */ B(GetNamedProperty), R(0), U8(123), U8(246),
/* 1669 S> */ B(GetNamedProperty), R(0), U8(124), U8(248),
/* 1682 S> */ B(GetNamedProperty), R(0), U8(125), U8(250),
/* 1695 S> */ B(GetNamedProperty), R(0), U8(126), U8(252),
/* 1708 S> */ B(GetNamedProperty), R(0), U8(127), U8(254),
/* 1719 S> */ B(LdaSmi), I8(2),
/* 1721 E> */ B(Wide), B(StaGlobal), U16(128), U16(256),
B(LdaUndefined),
/* 1726 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name768"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name769"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name770"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name771"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name772"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name773"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name774"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name775"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name776"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name777"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name778"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name779"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name780"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name781"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name782"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name783"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name784"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name785"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name786"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name787"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name788"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name789"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name790"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name791"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name792"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name793"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name794"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name795"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name796"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name797"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name798"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name799"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name800"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name801"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name802"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name803"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name804"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name805"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name806"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name807"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name808"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name809"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name810"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name811"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name812"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name813"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name814"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name815"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name816"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name817"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name818"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name819"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name820"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name821"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name822"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name823"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name824"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name825"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name826"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name827"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name828"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name829"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name830"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name831"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name832"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name833"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name834"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name835"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name836"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name837"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name838"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name839"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name840"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name841"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name842"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name843"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name844"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name845"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name846"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name847"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name848"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name849"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name850"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name851"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name852"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name853"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name854"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name855"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name856"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name857"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name858"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name859"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name860"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name861"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name862"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name863"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name864"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name865"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name866"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name867"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name868"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name869"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name870"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name871"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name872"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name873"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name874"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name875"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name876"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name877"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name878"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name879"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name880"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name881"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name882"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name883"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name884"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name885"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name886"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name887"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name888"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name889"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name890"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name891"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name892"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name893"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name894"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["name895"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["a"],
]
handlers: [
]

View File

@ -0,0 +1,194 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
var a = 1;
var b = 2;
return a + b + 'string';
"
frame size: 3
parameter count: 1
bytecode array length: 18
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 53 S> */ B(LdaSmi), I8(2),
B(Star1),
/* 56 S> */ B(Ldar), R(1),
/* 65 E> */ B(Add), R(0), U8(0),
B(Star2),
B(LdaConstant), U8(0),
/* 69 E> */ B(Add), R(2), U8(1),
/* 80 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["string"],
]
handlers: [
]
---
snippet: "
var a = 1;
var b = 2;
return 'string' + a + b;
"
frame size: 3
parameter count: 1
bytecode array length: 21
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 53 S> */ B(LdaSmi), I8(2),
B(Star1),
/* 56 S> */ B(LdaConstant), U8(0),
B(Star2),
B(Ldar), R(0),
/* 72 E> */ B(Add), R(2), U8(0),
B(Star2),
B(Ldar), R(1),
/* 76 E> */ B(Add), R(2), U8(1),
/* 80 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["string"],
]
handlers: [
]
---
snippet: "
var a = 1;
var b = 2;
return a + 'string' + b;
"
frame size: 3
parameter count: 1
bytecode array length: 18
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 53 S> */ B(LdaSmi), I8(2),
B(Star1),
/* 56 S> */ B(LdaConstant), U8(0),
/* 65 E> */ B(Add), R(0), U8(0),
B(Star2),
B(Ldar), R(1),
/* 76 E> */ B(Add), R(2), U8(1),
/* 80 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["string"],
]
handlers: [
]
---
snippet: "
var a = 1;
var b = 2;
return 'foo' + a + 'bar' + b + 'baz' + 1;
"
frame size: 3
parameter count: 1
bytecode array length: 36
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 53 S> */ B(LdaSmi), I8(2),
B(Star1),
/* 56 S> */ B(LdaConstant), U8(0),
B(Star2),
B(Ldar), R(0),
/* 69 E> */ B(Add), R(2), U8(0),
B(Star2),
B(LdaConstant), U8(1),
/* 73 E> */ B(Add), R(2), U8(1),
B(Star2),
B(Ldar), R(1),
/* 81 E> */ B(Add), R(2), U8(2),
B(Star2),
B(LdaConstant), U8(2),
/* 85 E> */ B(Add), R(2), U8(3),
/* 93 E> */ B(AddSmi), I8(1), U8(4),
/* 97 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["foo"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["bar"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["baz"],
]
handlers: [
]
---
snippet: "
var a = 1;
var b = 2;
return (a + 'string') + ('string' + b);
"
frame size: 4
parameter count: 1
bytecode array length: 24
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 53 S> */ B(LdaSmi), I8(2),
B(Star1),
/* 56 S> */ B(LdaConstant), U8(0),
/* 66 E> */ B(Add), R(0), U8(0),
B(Star2),
B(LdaConstant), U8(0),
B(Star3),
B(Ldar), R(1),
/* 90 E> */ B(Add), R(3), U8(1),
/* 78 E> */ B(Add), R(2), U8(2),
/* 95 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["string"],
]
handlers: [
]
---
snippet: "
var a = 1;
var b = 2;
function foo(a, b) { };
return 'string' + foo(a, b) + a + b;
"
frame size: 4
parameter count: 1
bytecode array length: 35
bytecodes: [
/* 30 E> */ B(CreateClosure), U8(0), U8(0), U8(2),
B(Star2),
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 53 S> */ B(LdaSmi), I8(2),
B(Star1),
/* 80 S> */ B(LdaConstant), U8(1),
B(Star3),
/* 98 E> */ B(CallUndefinedReceiver2), R(2), R(0), R(1), U8(0),
/* 96 E> */ B(Add), R(3), U8(2),
B(Star3),
B(Ldar), R(0),
/* 108 E> */ B(Add), R(3), U8(3),
B(Star3),
B(Ldar), R(1),
/* 112 E> */ B(Add), R(3), U8(4),
/* 116 S> */ B(Return),
]
constant pool: [
SHARED_FUNCTION_INFO_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["string"],
]
handlers: [
]

View File

@ -0,0 +1,63 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
return \"This is a string\";
"
frame size: 0
parameter count: 1
bytecode array length: 3
bytecodes: [
/* 34 S> */ B(LdaConstant), U8(0),
/* 60 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["This is a string"],
]
handlers: [
]
---
snippet: "
var a = \"First string\"; return \"Second string\";
"
frame size: 1
parameter count: 1
bytecode array length: 6
bytecodes: [
/* 42 S> */ B(LdaConstant), U8(0),
B(Star0),
/* 58 S> */ B(LdaConstant), U8(1),
/* 81 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["First string"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["Second string"],
]
handlers: [
]
---
snippet: "
var a = \"Same string\"; return \"Same string\";
"
frame size: 1
parameter count: 1
bytecode array length: 6
bytecodes: [
/* 42 S> */ B(LdaConstant), U8(0),
B(Star0),
/* 57 S> */ B(LdaConstant), U8(0),
/* 78 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["Same string"],
]
handlers: [
]

View File

@ -0,0 +1,156 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: no
test function name: test
---
snippet: "
var test;
(function() {
class A {
constructor(...args) { this.baseArgs = args; }
}
class B extends A {}
test = new B(1, 2, 3).constructor;
})();
"
frame size: 7
parameter count: 1
bytecode array length: 31
bytecodes: [
B(Mov), R(closure), R(1),
/* 93 S> */ B(FindNonDefaultConstructorOrConstruct), R(1), R(0), R(5),
B(Ldar), R(5),
B(Mov), R(1), R(2),
B(Mov), R(0), R(3),
B(Mov), R(6), R(4),
B(JumpIfTrue), U8(10),
B(ThrowIfNotSuperConstructor), R(4),
B(Ldar), R(3),
/* 93 E> */ B(ConstructForwardAllArgs), R(4), U8(0),
B(Star4),
B(Ldar), R(4),
/* 93 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var test;
(function() {
class A {
constructor(...args) { this.baseArgs = args; }
}
class B extends A {
constructor(...args) { super(1, ...args); }
}
test = new B(1, 2, 3).constructor;
})();
"
frame size: 12
parameter count: 1
bytecode array length: 51
bytecodes: [
/* 128 E> */ B(CreateRestParameter),
B(Star3),
B(Mov), R(closure), R(1),
B(Mov), R(3), R(2),
/* 140 S> */ B(LdaSmi), I8(1),
B(Star7),
/* 140 E> */ B(FindNonDefaultConstructorOrConstruct), R(closure), R(0), R(10),
B(Mov), R(3), R(8),
B(Ldar), R(10),
B(Mov), R(1), R(5),
B(Mov), R(0), R(9),
B(Mov), R(11), R(6),
B(JumpIfTrue), U8(12),
B(ThrowIfNotSuperConstructor), R(6),
B(Ldar), R(9),
/* 140 E> */ B(ConstructWithSpread), R(6), R(7), U8(2), U8(0),
B(Star6),
B(Ldar), R(this),
B(ThrowSuperAlreadyCalledIfNotHole),
B(Mov), R(6), R(this),
B(Ldar), R(this),
B(ThrowSuperNotCalledIfHole),
/* 159 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var test;
(function() {
class A {
constructor(...args) { this.baseArgs = args; }
}
class B extends A {
constructor(...args) { super(1, ...args, 1); }
}
test = new B(1, 2, 3).constructor;
})();
"
frame size: 12
parameter count: 1
bytecode array length: 101
bytecodes: [
/* 128 E> */ B(CreateRestParameter),
B(Star3),
B(Mov), R(closure), R(1),
B(Mov), R(3), R(2),
/* 140 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
B(Star7),
B(LdaSmi), I8(1),
B(Star8),
/* 152 E> */ B(GetIterator), R(3), U8(1), U8(3),
B(Star10),
B(GetNamedProperty), R(10), U8(1), U8(5),
B(Star9),
B(Mov), R(1), R(5),
B(CallProperty0), R(9), R(10), U8(14),
B(Star11),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(11), U8(1),
B(GetNamedProperty), R(11), U8(2), U8(16),
B(JumpIfToBooleanTrue), U8(19),
B(GetNamedProperty), R(11), U8(3), U8(7),
B(StaInArrayLiteral), R(7), R(8), U8(12),
B(Ldar), R(8),
B(Inc), U8(11),
B(Star8),
B(JumpLoop), U8(31), I8(0), U8(18),
B(LdaSmi), I8(1),
B(StaInArrayLiteral), R(7), R(8), U8(12),
/* 140 E> */ B(FindNonDefaultConstructorOrConstruct), R(5), R(0), R(9),
B(Ldar), R(9),
B(Mov), R(0), R(8),
B(Mov), R(10), R(6),
B(JumpIfTrue), U8(9),
B(ThrowIfNotSuperConstructor), R(6),
B(CallJSRuntime), U8(%reflect_construct), R(6), U8(3),
B(Star6),
B(Ldar), R(this),
B(ThrowSuperAlreadyCalledIfNotHole),
B(Mov), R(6), R(this),
B(Ldar), R(this),
B(ThrowSuperNotCalledIfHole),
/* 162 S> */ B(Return),
]
constant pool: [
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["next"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["done"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["value"],
]
handlers: [
]

View File

@ -0,0 +1,500 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
var a = 1;
switch(a) {
case 1: return 2;
case 2: return 3;
}
"
frame size: 2
parameter count: 1
bytecode array length: 30
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(LdaSmi), I8(1),
B(TestEqualStrict), R(0), U8(0),
B(Mov), R(0), R(1),
B(JumpIfTrue), U8(11),
B(LdaSmi), I8(2),
B(TestEqualStrict), R(1), U8(0),
B(JumpIfTrue), U8(7),
B(Jump), U8(8),
/* 66 S> */ B(LdaSmi), I8(2),
/* 75 S> */ B(Return),
/* 85 S> */ B(LdaSmi), I8(3),
/* 94 S> */ B(Return),
B(LdaUndefined),
/* 97 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 1;
switch(a) {
case 1: a = 2; break;
case 2: a = 3; break;
}
"
frame size: 2
parameter count: 1
bytecode array length: 34
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(LdaSmi), I8(1),
B(TestEqualStrict), R(0), U8(0),
B(Mov), R(0), R(1),
B(JumpIfTrue), U8(11),
B(LdaSmi), I8(2),
B(TestEqualStrict), R(1), U8(0),
B(JumpIfTrue), U8(9),
B(Jump), U8(12),
/* 66 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 73 S> */ B(Jump), U8(7),
/* 89 S> */ B(LdaSmi), I8(3),
B(Star0),
/* 96 S> */ B(Jump), U8(2),
B(LdaUndefined),
/* 105 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 1;
switch(a) {
case 1: a = 2; // fall-through
case 2: a = 3; break;
}
"
frame size: 2
parameter count: 1
bytecode array length: 32
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(LdaSmi), I8(1),
B(TestEqualStrict), R(0), U8(0),
B(Mov), R(0), R(1),
B(JumpIfTrue), U8(11),
B(LdaSmi), I8(2),
B(TestEqualStrict), R(1), U8(0),
B(JumpIfTrue), U8(7),
B(Jump), U8(10),
/* 66 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 98 S> */ B(LdaSmi), I8(3),
B(Star0),
/* 105 S> */ B(Jump), U8(2),
B(LdaUndefined),
/* 114 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 1;
switch(a) {
case 2: break;
case 3: break;
default: a = 1; break;
}
"
frame size: 2
parameter count: 1
bytecode array length: 33
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(LdaSmi), I8(2),
B(TestEqualStrict), R(0), U8(0),
B(Mov), R(0), R(1),
B(JumpIfTrue), U8(11),
B(LdaSmi), I8(3),
B(TestEqualStrict), R(1), U8(0),
B(JumpIfTrue), U8(6),
B(Jump), U8(6),
/* 66 S> */ B(Jump), U8(9),
/* 82 S> */ B(Jump), U8(7),
/* 99 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 106 S> */ B(Jump), U8(2),
B(LdaUndefined),
/* 115 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 1;
switch(typeof(a)) {
case 2: a = 1; break;
case 3: a = 2; break;
default: a = 3; break;
}
"
frame size: 2
parameter count: 1
bytecode array length: 39
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(TypeOf), U8(0),
B(Star1),
B(LdaSmi), I8(2),
B(TestEqualStrict), R(1), U8(1),
B(JumpIfTrue), U8(11),
B(LdaSmi), I8(3),
B(TestEqualStrict), R(1), U8(1),
B(JumpIfTrue), U8(9),
B(Jump), U8(12),
/* 74 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 81 S> */ B(Jump), U8(12),
/* 97 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 104 S> */ B(Jump), U8(7),
/* 121 S> */ B(LdaSmi), I8(3),
B(Star0),
/* 128 S> */ B(Jump), U8(2),
B(LdaUndefined),
/* 137 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 1;
switch(a) {
case typeof(a): a = 1; break;
default: a = 2; break;
}
"
frame size: 2
parameter count: 1
bytecode array length: 27
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(TypeOf), U8(1),
B(TestEqualStrict), R(0), U8(0),
B(Mov), R(0), R(1),
B(JumpIfTrue), U8(4),
B(Jump), U8(7),
/* 74 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 81 S> */ B(Jump), U8(7),
/* 98 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 105 S> */ B(Jump), U8(2),
B(LdaUndefined),
/* 114 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 1;
switch(a) {
case 1:
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
a = 2;
break;
case 2:
a = 3;
break;
}
"
frame size: 2
parameter count: 1
bytecode array length: 223
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(LdaSmi), I8(1),
B(TestEqualStrict), R(0), U8(0),
B(Mov), R(0), R(1),
B(JumpIfTrue), U8(11),
B(LdaSmi), I8(2),
B(TestEqualStrict), R(1), U8(0),
B(JumpIfTrue), U8(198),
B(Jump), U8(201),
/* 68 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 77 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 86 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 95 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 104 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 113 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 122 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 131 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 140 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 149 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 158 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 167 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 176 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 185 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 194 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 203 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 212 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 221 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 230 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 239 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 248 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 257 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 266 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 275 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 284 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 293 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 302 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 311 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 320 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 329 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 338 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 347 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 356 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 365 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 374 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 383 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 392 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 401 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 410 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 419 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 428 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 437 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 446 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 455 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 464 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 473 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 482 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 491 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 500 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 509 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 518 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 527 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 536 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 545 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 554 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 563 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 572 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 581 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 590 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 599 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 608 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 617 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 626 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 635 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 644 S> */ B(Jump), U8(7),
/* 662 S> */ B(LdaSmi), I8(3),
B(Star0),
/* 671 S> */ B(Jump), U8(2),
B(LdaUndefined),
/* 680 S> */ B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 1;
switch(a) {
case 1:
switch(a + 1) {
case 2 : a = 1; break;
default : a = 2; break;
} // fall-through
case 2: a = 3;
}
"
frame size: 2
parameter count: 1
bytecode array length: 52
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 45 S> */ B(LdaSmi), I8(1),
B(TestEqualStrict), R(0), U8(0),
B(Mov), R(0), R(1),
B(JumpIfTrue), U8(11),
B(LdaSmi), I8(2),
B(TestEqualStrict), R(1), U8(0),
B(JumpIfTrue), U8(29),
B(Jump), U8(30),
/* 70 S> */ B(Ldar), R(0),
/* 79 E> */ B(AddSmi), I8(1), U8(1),
B(Star1),
B(LdaSmi), I8(2),
B(TestEqualStrict), R(1), U8(2),
B(JumpIfTrue), U8(4),
B(Jump), U8(7),
/* 101 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 108 S> */ B(Jump), U8(7),
/* 131 S> */ B(LdaSmi), I8(2),
B(Star0),
/* 138 S> */ B(Jump), U8(2),
/* 176 S> */ B(LdaSmi), I8(3),
B(Star0),
B(LdaUndefined),
/* 185 S> */ B(Return),
]
constant pool: [
]
handlers: [
]

View File

@ -0,0 +1,216 @@
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
var a = 1;
var b = 2;
return `${a}${b}string`;
"
frame size: 3
parameter count: 1
bytecode array length: 23
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 53 S> */ B(LdaSmi), I8(2),
B(Star1),
/* 56 S> */ B(Ldar), R(0),
B(ToString),
B(Star2),
B(Ldar), R(1),
/* 70 E> */ B(ToString),
B(Add), R(2), U8(0),
B(Star2),
B(LdaConstant), U8(0),
B(Add), R(2), U8(0),
/* 80 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["string"],
]
handlers: [
]
---
snippet: "
var a = 1;
var b = 2;
return `string${a}${b}`;
"
frame size: 3
parameter count: 1
bytecode array length: 23
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 53 S> */ B(LdaSmi), I8(2),
B(Star1),
/* 56 S> */ B(LdaConstant), U8(0),
B(Star2),
B(Ldar), R(0),
/* 72 E> */ B(ToString),
B(Add), R(2), U8(0),
B(Star2),
B(Ldar), R(1),
/* 76 E> */ B(ToString),
B(Add), R(2), U8(0),
/* 80 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["string"],
]
handlers: [
]
---
snippet: "
var a = 1;
var b = 2;
return `${a}string${b}`;
"
frame size: 3
parameter count: 1
bytecode array length: 23
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 53 S> */ B(LdaSmi), I8(2),
B(Star1),
/* 56 S> */ B(Ldar), R(0),
B(ToString),
B(Star2),
B(LdaConstant), U8(0),
B(Add), R(2), U8(0),
B(Star2),
B(Ldar), R(1),
/* 76 E> */ B(ToString),
B(Add), R(2), U8(0),
/* 80 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["string"],
]
handlers: [
]
---
snippet: "
var a = 1;
var b = 2;
return `foo${a}bar${b}baz${1}`;
"
frame size: 3
parameter count: 1
bytecode array length: 42
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 53 S> */ B(LdaSmi), I8(2),
B(Star1),
/* 56 S> */ B(LdaConstant), U8(0),
B(Star2),
B(Ldar), R(0),
/* 69 E> */ B(ToString),
B(Add), R(2), U8(0),
B(Star2),
B(LdaConstant), U8(1),
B(Add), R(2), U8(0),
B(Star2),
B(Ldar), R(1),
/* 76 E> */ B(ToString),
B(Add), R(2), U8(0),
B(Star2),
B(LdaConstant), U8(2),
B(Add), R(2), U8(0),
B(Star2),
B(LdaSmi), I8(1),
B(ToString),
B(Add), R(2), U8(0),
/* 87 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["foo"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["bar"],
INTERNALIZED_ONE_BYTE_STRING_TYPE ["baz"],
]
handlers: [
]
---
snippet: "
var a = 1;
var b = 2;
return `${a}string` + `string${b}`;
"
frame size: 4
parameter count: 1
bytecode array length: 29
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 53 S> */ B(LdaSmi), I8(2),
B(Star1),
/* 56 S> */ B(Ldar), R(0),
B(ToString),
B(Star2),
B(LdaConstant), U8(0),
B(Add), R(2), U8(1),
B(Star2),
B(LdaConstant), U8(0),
B(Star3),
B(Ldar), R(1),
/* 87 E> */ B(ToString),
B(Add), R(3), U8(2),
/* 76 E> */ B(Add), R(2), U8(0),
/* 91 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["string"],
]
handlers: [
]
---
snippet: "
var a = 1;
var b = 2;
function foo(a, b) { };
return `string${foo(a, b)}${a}${b}`;
"
frame size: 4
parameter count: 1
bytecode array length: 38
bytecodes: [
/* 30 E> */ B(CreateClosure), U8(0), U8(0), U8(2),
B(Star2),
/* 42 S> */ B(LdaSmi), I8(1),
B(Star0),
/* 53 S> */ B(LdaSmi), I8(2),
B(Star1),
/* 80 S> */ B(LdaConstant), U8(1),
B(Star3),
/* 96 E> */ B(CallUndefinedReceiver2), R(2), R(0), R(1), U8(1),
B(ToString),
B(Add), R(3), U8(0),
B(Star3),
B(Ldar), R(0),
/* 108 E> */ B(ToString),
B(Add), R(3), U8(0),
B(Star3),
B(Ldar), R(1),
/* 112 E> */ B(ToString),
B(Add), R(3), U8(0),
/* 116 S> */ B(Return),
]
constant pool: [
SHARED_FUNCTION_INFO_TYPE,
INTERNALIZED_ONE_BYTE_STRING_TYPE ["string"],
]
handlers: [
]

Some files were not shown because too many files have changed in this diff Show More