ac8acab28f
This is the first in a series of changes to reduce the number of bytecodes generated for the iteration protocol based operations. The GetIterator bytecode introduced in this change currently loads the @@iterator symbol from an object that was previously done using the LdaNamedProperty bytecode. This change uses builtin-based mechanism that would be extended to perform additional operations in the future on absorbing the bytecodes associated with the GetIterator operation from the iteration protocol. Bug: v8:9489 Change-Id: I83b8b55c27bae8260bf227f355eeca1ba80cd8f0 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1701852 Commit-Queue: Swapnil Gaikwad <swapnilgaikwad@google.com> Reviewed-by: Michael Stanton <mvstanton@chromium.org> Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Reviewed-by: Leszek Swirski <leszeks@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Cr-Commit-Position: refs/heads/master@{#63139}
217 lines
5.5 KiB
Plaintext
217 lines
5.5 KiB
Plaintext
#
|
|
# Autogenerated by generate-bytecode-expectations.
|
|
#
|
|
|
|
---
|
|
wrap: yes
|
|
|
|
---
|
|
snippet: "
|
|
return [ 1, 2 ];
|
|
"
|
|
frame size: 0
|
|
parameter count: 1
|
|
bytecode array length: 6
|
|
bytecodes: [
|
|
/* 30 E> */ B(StackCheck),
|
|
/* 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: 36
|
|
bytecodes: [
|
|
/* 30 E> */ B(StackCheck),
|
|
/* 42 S> */ B(LdaSmi), I8(1),
|
|
B(Star), R(0),
|
|
/* 45 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
|
|
B(Star), R(2),
|
|
B(LdaZero),
|
|
B(Star), R(1),
|
|
B(Ldar), R(0),
|
|
/* 54 E> */ B(StaInArrayLiteral), R(2), R(1), U8(1),
|
|
B(LdaSmi), I8(1),
|
|
B(Star), R(1),
|
|
B(Ldar), R(0),
|
|
/* 59 E> */ B(AddSmi), I8(1), U8(3),
|
|
B(StaInArrayLiteral), R(2), R(1), U8(1),
|
|
B(Ldar), R(2),
|
|
/* 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: 6
|
|
bytecodes: [
|
|
/* 30 E> */ B(StackCheck),
|
|
/* 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: 66
|
|
bytecodes: [
|
|
/* 30 E> */ B(StackCheck),
|
|
/* 42 S> */ B(LdaSmi), I8(1),
|
|
B(Star), R(0),
|
|
/* 45 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(4),
|
|
B(Star), R(2),
|
|
B(LdaZero),
|
|
B(Star), R(1),
|
|
B(CreateArrayLiteral), U8(1), U8(1), U8(37),
|
|
B(Star), R(4),
|
|
B(LdaZero),
|
|
B(Star), R(3),
|
|
B(Ldar), R(0),
|
|
/* 56 E> */ B(StaInArrayLiteral), R(4), R(3), U8(2),
|
|
B(Ldar), R(4),
|
|
B(StaInArrayLiteral), R(2), R(1), U8(4),
|
|
B(LdaSmi), I8(1),
|
|
B(Star), R(1),
|
|
B(CreateArrayLiteral), U8(2), U8(6), U8(37),
|
|
B(Star), R(4),
|
|
B(LdaZero),
|
|
B(Star), R(3),
|
|
B(Ldar), R(0),
|
|
/* 68 E> */ B(AddSmi), I8(2), U8(7),
|
|
B(StaInArrayLiteral), R(4), R(3), U8(8),
|
|
B(Ldar), R(4),
|
|
B(StaInArrayLiteral), R(2), R(1), U8(4),
|
|
B(Ldar), R(2),
|
|
/* 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: 9
|
|
bytecodes: [
|
|
/* 30 E> */ B(StackCheck),
|
|
/* 42 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
|
|
B(Star), R(0),
|
|
/* 52 S> */ B(CreateArrayFromIterable),
|
|
/* 68 S> */ B(Return),
|
|
]
|
|
constant pool: [
|
|
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
|
|
]
|
|
handlers: [
|
|
]
|
|
|
|
---
|
|
snippet: "
|
|
var a = [ 1, 2 ]; return [ 0, ...a ];
|
|
"
|
|
frame size: 8
|
|
parameter count: 1
|
|
bytecode array length: 83
|
|
bytecodes: [
|
|
/* 30 E> */ B(StackCheck),
|
|
/* 42 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
|
|
B(Star), R(0),
|
|
/* 52 S> */ B(CreateArrayLiteral), U8(1), U8(1), U8(37),
|
|
B(Star), R(2),
|
|
B(LdaConstant), U8(2),
|
|
/* 67 S> */ B(Star), R(1),
|
|
B(GetIterator), R(0), U8(2),
|
|
B(Star), R(6),
|
|
B(CallProperty0), R(6), R(0), U8(4),
|
|
B(Mov), R(0), R(5),
|
|
B(JumpIfJSReceiver), U8(7),
|
|
B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
|
|
B(Star), R(4),
|
|
B(LdaNamedProperty), R(4), U8(3), U8(6),
|
|
B(Star), R(3),
|
|
B(CallProperty0), R(3), R(4), U8(15),
|
|
B(Star), R(7),
|
|
B(JumpIfJSReceiver), U8(7),
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(7), U8(1),
|
|
B(LdaNamedProperty), R(7), U8(4), U8(17),
|
|
B(JumpIfToBooleanTrue), U8(19),
|
|
B(LdaNamedProperty), R(7), U8(5), U8(8),
|
|
B(StaInArrayLiteral), R(2), R(1), U8(13),
|
|
B(Ldar), R(1),
|
|
B(Inc), U8(12),
|
|
B(Star), R(1),
|
|
B(JumpLoop), U8(33), I8(0),
|
|
B(Ldar), R(2),
|
|
/* 71 S> */ B(Return),
|
|
]
|
|
constant pool: [
|
|
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
|
|
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
|
|
Smi [1],
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
|
|
]
|
|
handlers: [
|
|
]
|
|
|
|
---
|
|
snippet: "
|
|
var a = [ 1, 2 ]; return [ ...a, 3 ];
|
|
"
|
|
frame size: 3
|
|
parameter count: 1
|
|
bytecode array length: 25
|
|
bytecodes: [
|
|
/* 30 E> */ B(StackCheck),
|
|
/* 42 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
|
|
B(Star), R(0),
|
|
/* 52 S> */ B(CreateArrayFromIterable),
|
|
B(Star), R(2),
|
|
B(LdaNamedProperty), R(2), U8(1), U8(1),
|
|
B(Star), R(1),
|
|
B(LdaSmi), I8(3),
|
|
B(StaInArrayLiteral), R(2), R(1), U8(3),
|
|
B(Ldar), R(2),
|
|
/* 71 S> */ B(Return),
|
|
]
|
|
constant pool: [
|
|
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["length"],
|
|
]
|
|
handlers: [
|
|
]
|
|
|