v8/test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden
leszeks 1c0c5fda26 [Interpreter] Move context chain search loop to handler
Moves the context chain search loop out of generated bytecode, and into
the (Lda|Ldr|Sda)ContextSlot handler, by passing the context depth in as
an additional operand. This should decrease the bytecode size and
increase performance for deep context chain searches, at the cost of
slightly increasing bytecode size for shallow context access.

Review-Url: https://codereview.chromium.org/2336643002
Cr-Commit-Position: refs/heads/master@{#39378}
2016-09-13 11:09:33 +00:00

240 lines
7.4 KiB
Plaintext

#
# Autogenerated by generate-bytecode-expectations.
#
---
execute: yes
wrap: yes
---
snippet: "
class Person {
constructor(name) { this.name = name; }
speak() { console.log(this.name + ' is speaking.'); }
}
"
frame size: 10
parameter count: 1
bytecode array length: 74
bytecodes: [
B(LdaTheHole),
B(Star), R(2),
/* 30 E> */ B(StackCheck),
B(LdaTheHole),
B(Star), R(0),
/* 34 S> */ B(LdaTheHole),
B(Star), R(3),
B(CreateClosure), U8(0), U8(2),
B(Star), R(4),
B(LdaSmi), U8(34),
B(Star), R(5),
B(Wide), B(LdaSmi), U16(148),
B(Star), R(6),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(4),
B(Star), R(3),
B(LdrNamedProperty), R(3), U8(1), U8(1), R(4),
B(LdaConstant), U8(2),
B(ToName), R(6),
B(CreateClosure), U8(3), U8(2),
B(Star), R(7),
B(LdaSmi), U8(2),
B(Star), R(8),
B(LdaZero),
B(Star), R(9),
B(Mov), R(4), R(5),
B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(5), U8(5),
B(CallRuntime), U16(Runtime::kToFastProperties), R(3), U8(1),
B(Star), R(0),
B(Star), R(1),
B(Star), R(2),
B(LdaUndefined),
/* 149 S> */ B(Return),
]
constant pool: [
SHARED_FUNCTION_INFO_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["prototype"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["speak"],
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
class person {
constructor(name) { this.name = name; }
speak() { console.log(this.name + ' is speaking.'); }
}
"
frame size: 10
parameter count: 1
bytecode array length: 74
bytecodes: [
B(LdaTheHole),
B(Star), R(2),
/* 30 E> */ B(StackCheck),
B(LdaTheHole),
B(Star), R(0),
/* 34 S> */ B(LdaTheHole),
B(Star), R(3),
B(CreateClosure), U8(0), U8(2),
B(Star), R(4),
B(LdaSmi), U8(34),
B(Star), R(5),
B(Wide), B(LdaSmi), U16(148),
B(Star), R(6),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(4),
B(Star), R(3),
B(LdrNamedProperty), R(3), U8(1), U8(1), R(4),
B(LdaConstant), U8(2),
B(ToName), R(6),
B(CreateClosure), U8(3), U8(2),
B(Star), R(7),
B(LdaSmi), U8(2),
B(Star), R(8),
B(LdaZero),
B(Star), R(9),
B(Mov), R(4), R(5),
B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(5), U8(5),
B(CallRuntime), U16(Runtime::kToFastProperties), R(3), U8(1),
B(Star), R(0),
B(Star), R(1),
B(Star), R(2),
B(LdaUndefined),
/* 149 S> */ B(Return),
]
constant pool: [
SHARED_FUNCTION_INFO_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["prototype"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["speak"],
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: 128
bytecodes: [
B(CreateFunctionContext), U8(2),
B(PushContext), R(3),
B(LdaTheHole),
B(Star), R(2),
/* 30 E> */ B(StackCheck),
/* 43 S> */ B(LdaConstant), U8(0),
/* 43 E> */ B(StaContextSlot), R(context), U8(4), U8(0),
/* 57 S> */ B(LdaConstant), U8(1),
/* 57 E> */ B(StaContextSlot), R(context), U8(5), U8(0),
B(LdaTheHole),
B(Star), R(0),
/* 62 S> */ B(LdaTheHole),
B(Star), R(4),
B(CreateClosure), U8(2), U8(2),
B(Star), R(5),
B(LdaSmi), U8(62),
B(Star), R(6),
B(Wide), B(LdaSmi), U16(128),
B(Star), R(7),
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4),
B(Star), R(4),
B(LdrNamedProperty), R(4), U8(3), U8(1), R(5),
/* 75 E> */ B(LdaContextSlot), R(context), U8(4), U8(0),
B(ToName), R(7),
B(CreateClosure), U8(4), U8(2),
B(Star), R(8),
B(LdaSmi), U8(2),
B(Star), R(9),
B(LdaSmi), U8(1),
B(Star), R(10),
B(Mov), R(5), R(6),
B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(6), U8(5),
/* 106 E> */ B(LdaContextSlot), R(context), U8(5), U8(0),
B(ToName), R(7),
B(LdaConstant), U8(3),
B(TestEqualStrict), R(7), U8(0),
B(Mov), R(4), R(6),
B(JumpIfToBooleanFalse), U8(7),
B(CallRuntime), U16(Runtime::kThrowStaticPrototypeError), R(0), U8(0),
B(CreateClosure), U8(5), U8(2),
B(Star), R(8),
B(LdaSmi), U8(1),
B(Star), R(10),
B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(6), U8(5),
B(CallRuntime), U16(Runtime::kToFastProperties), R(4), U8(1),
B(Star), R(0),
B(Star), R(1),
B(Star), R(2),
B(LdaUndefined),
/* 129 S> */ B(Return),
]
constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE ["a"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["b"],
SHARED_FUNCTION_INFO_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["prototype"],
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]
---
snippet: "
var count = 0;
class C { constructor() { count++; }}
return new C();
"
frame size: 8
parameter count: 1
bytecode array length: 74
bytecodes: [
B(CreateFunctionContext), U8(1),
B(PushContext), R(3),
B(LdaTheHole),
B(Star), R(2),
/* 30 E> */ B(StackCheck),
/* 46 S> */ B(LdaZero),
/* 46 E> */ B(StaContextSlot), R(context), U8(4), U8(0),
B(LdaTheHole),
B(Star), R(0),
/* 49 S> */ B(LdaTheHole),
B(Star), R(4),
B(CreateClosure), U8(0), U8(2),
B(Star), R(5),
B(LdaSmi), U8(49),
B(Star), R(6),
B(LdaSmi), U8(86),
B(Star), R(7),
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4),
B(Star), R(4),
B(LdrNamedProperty), R(4), U8(1), U8(1), R(5),
B(CallRuntime), U16(Runtime::kToFastProperties), R(4), U8(1),
B(Star), R(0),
B(Star), R(1),
B(Star), R(2),
/* 87 S> */ B(JumpIfNotHole), U8(11),
B(LdaConstant), U8(2),
B(Star), R(5),
B(CallRuntime), U16(Runtime::kThrowReferenceError), R(5), U8(1),
B(Star), R(4),
/* 94 E> */ B(New), R(4), R(0), U8(0), U8(3),
/* 103 S> */ B(Return),
]
constant pool: [
SHARED_FUNCTION_INFO_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["prototype"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["C"],
]
handlers: [
]