392a1217de
This is a reland ofc48096d442
Original change's description: > Reland "[runtime] Remove extension slots from context objects" > > This is a reland ofc07c02e1c4
> > Original change's description: > > [runtime] Remove extension slots from context objects > > > > Context objects have an extension slot, which contains further > > additional data that depends on the type of the context. > > > > This CL removes the extension slot from contexts that don't need > > them, hence reducing memory. > > > > The following contexts will still have an extension slot: native, > > module, await, block and with contexts. See objects/contexts.h for > > what the slot is used for. > > The following contexts will not have an extension slot anymore (they > > were not used before): script, catch and builtin contexts. > > Eval and function contexts only have the extension slot if they > > contain a sloppy eval. > > > > Bug: v8:9744 > > Change-Id: I8ca56c22fa02437bbac392ea72174ebfca80e030 > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1863191 > > Commit-Queue: Victor Gomes <victorgomes@google.com> > > Reviewed-by: Toon Verwaest <verwaest@chromium.org> > > Reviewed-by: Jakob Gruber <jgruber@chromium.org> > > Reviewed-by: Ulan Degenbaev <ulan@chromium.org> > > Reviewed-by: Leszek Swirski <leszeks@chromium.org> > > Reviewed-by: Peter Marshall <petermarshall@chromium.org> > > Auto-Submit: Victor Gomes <victorgomes@google.com> > > Cr-Commit-Position: refs/heads/master@{#64372} > > TBR=verwaest@chromium.org,jgruber@chromium.org,ulan@chromium.org,leszeks@chromium.org,petermarshall@chromium.org > > Bug: v8:9744 > Change-Id: I0749cc2d8f59940c25841736634a70047116d647 > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1869192 > Reviewed-by: Leszek Swirski <leszeks@chromium.org> > Reviewed-by: Peter Marshall <petermarshall@chromium.org> > Commit-Queue: Leszek Swirski <leszeks@chromium.org> > Commit-Queue: Peter Marshall <petermarshall@chromium.org> > Auto-Submit: Victor Gomes <victorgomes@google.com> > Cr-Commit-Position: refs/heads/master@{#64380} TBR=verwaest@chromium.org,jgruber@chromium.org,ulan@chromium.org,leszeks@chromium.org,petermarshall@chromium.org Bug: v8:9744 Change-Id: I621ffe98722f8c4defaf277b8d1666484ba2963f Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1872400 Reviewed-by: Leszek Swirski <leszeks@chromium.org> Reviewed-by: Peter Marshall <petermarshall@chromium.org> Commit-Queue: Victor Gomes <victorgomes@google.com> Cr-Commit-Position: refs/heads/master@{#64451}
493 lines
15 KiB
Plaintext
493 lines
15 KiB
Plaintext
#
|
|
# 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: 26
|
|
bytecodes: [
|
|
/* 10 E> */ B(StackCheck),
|
|
/* 30 S> */ B(LdaZero),
|
|
B(Star), R(0),
|
|
/* 35 S> */ B(LdaSmi), I8(10),
|
|
/* 35 E> */ B(TestLessThan), R(0), U8(0),
|
|
B(JumpIfFalse), U8(15),
|
|
/* 17 E> */ B(StackCheck),
|
|
/* 56 S> */ B(Mov), R(0), R(1),
|
|
/* 43 S> */ B(Ldar), R(1),
|
|
B(Inc), U8(1),
|
|
B(Star), R(0),
|
|
B(JumpLoop), U8(17), I8(0),
|
|
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: 165
|
|
bytecodes: [
|
|
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),
|
|
/* 10 E> */ B(StackCheck),
|
|
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(Star), R(0),
|
|
B(LdaSmi), I8(1),
|
|
B(Star), R(1),
|
|
/* 59 E> */ B(StackCheck),
|
|
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(7),
|
|
B(LdaZero),
|
|
B(Star), R(1),
|
|
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(Star), R(2),
|
|
/* 35 S> */ B(LdaCurrentContextSlot), U8(2),
|
|
B(Star), R(7),
|
|
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(77),
|
|
B(LdaSmi), I8(1),
|
|
B(TestEqual), R(2), U8(3),
|
|
B(JumpIfFalse), U8(54),
|
|
/* 17 E> */ B(StackCheck),
|
|
/* 48 S> */ B(LdaLookupGlobalSlot), U8(3), U8(4), U8(3),
|
|
B(Star), R(7),
|
|
B(LdaConstant), U8(4),
|
|
B(Star), R(8),
|
|
B(LdaZero),
|
|
B(Star), R(12),
|
|
B(LdaSmi), I8(31),
|
|
B(Star), R(13),
|
|
B(LdaSmi), I8(48),
|
|
B(Star), R(14),
|
|
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(Star), R(7),
|
|
/* 48 E> */ B(CallUndefinedReceiver1), R(7), R(8), U8(6),
|
|
B(LdaZero),
|
|
B(Star), R(2),
|
|
B(LdaCurrentContextSlot), U8(2),
|
|
B(Star), R(0),
|
|
B(JumpLoop), U8(56), I8(1),
|
|
B(LdaSmi), I8(1),
|
|
/* 59 E> */ B(TestEqual), R(2), U8(8),
|
|
B(JumpIfFalse), U8(6),
|
|
B(PopContext), R(6),
|
|
B(Jump), U8(7),
|
|
B(PopContext), R(6),
|
|
B(JumpLoop), U8(123), I8(0),
|
|
B(PopContext), R(5),
|
|
B(LdaUndefined),
|
|
/* 61 S> */ B(Return),
|
|
]
|
|
constant pool: [
|
|
SCOPE_INFO_TYPE,
|
|
SCOPE_INFO_TYPE,
|
|
SCOPE_INFO_TYPE,
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["eval"],
|
|
ONE_BYTE_INTERNALIZED_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: 106
|
|
bytecodes: [
|
|
/* 10 E> */ B(StackCheck),
|
|
/* 30 S> */ B(LdaZero),
|
|
B(Star), R(3),
|
|
B(Star), R(0),
|
|
B(LdaSmi), I8(1),
|
|
B(Star), R(1),
|
|
/* 78 E> */ B(StackCheck),
|
|
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(7),
|
|
B(LdaZero),
|
|
B(Star), R(1),
|
|
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(Star), R(2),
|
|
/* 35 S> */ B(LdaCurrentContextSlot), U8(2),
|
|
B(Star), R(5),
|
|
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(45),
|
|
B(LdaSmi), I8(1),
|
|
B(TestEqual), R(2), U8(3),
|
|
B(JumpIfFalse), U8(22),
|
|
/* 17 E> */ B(StackCheck),
|
|
/* 48 S> */ B(CreateClosure), U8(1), U8(0), U8(2),
|
|
B(Star), R(5),
|
|
/* 74 E> */ B(CallUndefinedReceiver0), R(5), U8(4),
|
|
B(LdaZero),
|
|
B(Star), R(2),
|
|
B(LdaCurrentContextSlot), U8(2),
|
|
B(Star), R(0),
|
|
B(JumpLoop), U8(24), I8(1),
|
|
B(LdaSmi), I8(1),
|
|
/* 78 E> */ B(TestEqual), R(2), U8(6),
|
|
B(JumpIfFalse), U8(6),
|
|
B(PopContext), R(4),
|
|
B(Jump), U8(7),
|
|
B(PopContext), R(4),
|
|
B(JumpLoop), U8(91), I8(0),
|
|
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: 44
|
|
bytecodes: [
|
|
/* 10 E> */ B(StackCheck),
|
|
/* 37 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
|
|
B(Star), R(3),
|
|
/* 28 S> */ B(LdaNamedProperty), R(3), U8(1), U8(1),
|
|
B(Star), R(0),
|
|
/* 31 S> */ B(LdaNamedProperty), R(3), U8(2), U8(3),
|
|
B(Star), R(1),
|
|
/* 55 S> */ B(LdaZero),
|
|
/* 55 E> */ B(TestGreaterThan), R(1), U8(5),
|
|
B(JumpIfFalse), U8(19),
|
|
/* 17 E> */ B(StackCheck),
|
|
/* 75 S> */ B(Ldar), R(1),
|
|
/* 77 E> */ B(Add), R(0), U8(6),
|
|
B(Star), R(2),
|
|
/* 62 S> */ B(Ldar), R(1),
|
|
B(Dec), U8(7),
|
|
B(Star), R(1),
|
|
B(JumpLoop), U8(20), I8(0),
|
|
B(LdaUndefined),
|
|
/* 84 S> */ B(Return),
|
|
]
|
|
constant pool: [
|
|
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["x"],
|
|
ONE_BYTE_INTERNALIZED_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: 67
|
|
bytecodes: [
|
|
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
|
|
B(Mov), R(closure), R(3),
|
|
B(Mov), R(this), R(4),
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(3), U8(2),
|
|
B(Star), R(0),
|
|
/* 11 E> */ B(StackCheck),
|
|
/* 11 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
|
|
B(ResumeGenerator), R(0), R(0), U8(3),
|
|
B(Star), R(3),
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
|
|
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
|
|
B(Ldar), R(3),
|
|
/* 11 E> */ B(Throw),
|
|
B(Ldar), R(3),
|
|
/* 62 S> */ B(Return),
|
|
/* 31 S> */ B(LdaZero),
|
|
B(Star), R(1),
|
|
/* 36 S> */ B(LdaSmi), I8(10),
|
|
/* 36 E> */ B(TestLessThan), R(1), U8(0),
|
|
B(JumpIfFalse), U8(15),
|
|
/* 18 E> */ B(StackCheck),
|
|
/* 57 S> */ B(Mov), R(1), R(2),
|
|
/* 44 S> */ B(Ldar), R(2),
|
|
B(Inc), U8(1),
|
|
B(Star), R(1),
|
|
B(JumpLoop), U8(17), I8(0),
|
|
B(LdaUndefined),
|
|
/* 62 S> */ B(Return),
|
|
]
|
|
constant pool: [
|
|
Smi [22],
|
|
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: 99
|
|
bytecodes: [
|
|
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
|
|
B(Mov), R(closure), R(2),
|
|
B(Mov), R(this), R(3),
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(2), U8(2),
|
|
B(Star), R(0),
|
|
/* 11 E> */ B(StackCheck),
|
|
/* 11 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0),
|
|
B(ResumeGenerator), R(0), R(0), U8(2),
|
|
B(Star), R(2),
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
|
|
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
|
|
B(Ldar), R(2),
|
|
/* 11 E> */ B(Throw),
|
|
B(Ldar), R(2),
|
|
/* 56 S> */ B(Return),
|
|
/* 31 S> */ B(LdaZero),
|
|
B(Star), R(1),
|
|
/* 36 S> */ B(LdaSmi), I8(10),
|
|
/* 36 E> */ B(TestLessThan), R(1), U8(0),
|
|
B(JumpIfFalse), U8(47),
|
|
/* 18 E> */ B(StackCheck),
|
|
/* 47 S> */ B(LdaFalse),
|
|
B(Star), R(3),
|
|
B(Mov), R(1), R(2),
|
|
B(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(Star), R(2),
|
|
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),
|
|
/* 56 S> */ B(Return),
|
|
/* 44 S> */ B(Ldar), R(1),
|
|
B(Inc), U8(1),
|
|
B(Star), R(1),
|
|
B(JumpLoop), U8(49), I8(0),
|
|
B(LdaUndefined),
|
|
/* 56 S> */ B(Return),
|
|
]
|
|
constant pool: [
|
|
Smi [22],
|
|
Smi [68],
|
|
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: 8
|
|
parameter count: 1
|
|
bytecode array length: 81
|
|
bytecodes: [
|
|
B(Mov), R(closure), R(3),
|
|
B(Mov), R(this), R(4),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(3), U8(2),
|
|
B(Star), R(0),
|
|
/* 16 E> */ B(StackCheck),
|
|
B(Mov), R(context), R(3),
|
|
/* 36 S> */ B(LdaZero),
|
|
B(Star), R(1),
|
|
/* 41 S> */ B(LdaSmi), I8(10),
|
|
/* 41 E> */ B(TestLessThan), R(1), U8(0),
|
|
B(JumpIfFalse), U8(15),
|
|
/* 23 E> */ B(StackCheck),
|
|
/* 62 S> */ B(Mov), R(1), R(2),
|
|
/* 49 S> */ B(Ldar), R(2),
|
|
B(Inc), U8(1),
|
|
B(Star), R(1),
|
|
B(JumpLoop), U8(17), I8(0),
|
|
B(LdaUndefined),
|
|
B(Star), R(5),
|
|
B(LdaFalse),
|
|
B(Star), R(6),
|
|
B(Mov), R(0), R(4),
|
|
/* 49 E> */ B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(4), U8(3),
|
|
/* 67 S> */ B(Return),
|
|
B(Star), R(4),
|
|
B(CreateCatchContext), R(4), U8(0),
|
|
B(Star), R(3),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(3),
|
|
B(PushContext), R(4),
|
|
B(LdaImmutableCurrentContextSlot), U8(2),
|
|
B(Star), R(6),
|
|
B(LdaFalse),
|
|
B(Star), R(7),
|
|
B(Mov), R(0), R(5),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(5), U8(3),
|
|
/* 67 S> */ B(Return),
|
|
]
|
|
constant pool: [
|
|
SCOPE_INFO_TYPE,
|
|
]
|
|
handlers: [
|
|
[16, 53, 53],
|
|
]
|
|
|
|
---
|
|
snippet: "
|
|
async function f() {
|
|
for (let x = 0; x < 10; ++x) await x;
|
|
}
|
|
f();
|
|
"
|
|
frame size: 7
|
|
parameter count: 1
|
|
bytecode array length: 117
|
|
bytecodes: [
|
|
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
|
|
B(Mov), R(closure), R(2),
|
|
B(Mov), R(this), R(3),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(2), U8(2),
|
|
B(Star), R(0),
|
|
/* 16 E> */ B(StackCheck),
|
|
B(Mov), R(context), R(2),
|
|
/* 36 S> */ B(LdaZero),
|
|
B(Star), R(1),
|
|
/* 41 S> */ B(LdaSmi), I8(10),
|
|
/* 41 E> */ B(TestLessThan), R(1), U8(0),
|
|
B(JumpIfFalse), U8(47),
|
|
/* 23 E> */ B(StackCheck),
|
|
/* 52 S> */ B(Mov), R(0), R(3),
|
|
B(Mov), R(1), R(4),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwaitUncaught), R(3), U8(2),
|
|
/* 52 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
|
|
B(ResumeGenerator), R(0), R(0), U8(3),
|
|
B(Star), R(3),
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
|
|
B(Star), R(4),
|
|
B(LdaZero),
|
|
B(TestReferenceEqual), R(4),
|
|
B(JumpIfTrue), U8(5),
|
|
B(Ldar), R(3),
|
|
B(ReThrow),
|
|
/* 49 S> */ B(Ldar), R(1),
|
|
B(Inc), U8(1),
|
|
B(Star), R(1),
|
|
B(JumpLoop), U8(49), I8(0),
|
|
B(LdaUndefined),
|
|
B(Star), R(4),
|
|
B(LdaTrue),
|
|
B(Star), R(5),
|
|
B(Mov), R(0), R(3),
|
|
/* 49 E> */ B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(3), U8(3),
|
|
/* 61 S> */ B(Return),
|
|
B(Star), R(3),
|
|
B(CreateCatchContext), R(3), U8(1),
|
|
B(Star), R(2),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(2),
|
|
B(PushContext), R(3),
|
|
B(LdaImmutableCurrentContextSlot), U8(2),
|
|
B(Star), R(5),
|
|
B(LdaTrue),
|
|
B(Star), R(6),
|
|
B(Mov), R(0), R(4),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(4), U8(3),
|
|
/* 61 S> */ B(Return),
|
|
]
|
|
constant pool: [
|
|
Smi [46],
|
|
SCOPE_INFO_TYPE,
|
|
]
|
|
handlers: [
|
|
[20, 89, 89],
|
|
]
|
|
|