91e3243d60
Current GetIterator bytecode loads and calls @@iterator property on a given object. This change extends the bytecode functionality to check whether the value returned after calling @@iterator property is a valid JSReceiver. The bytecode throws SymbolIteratorInvalid exception if the returned value is not a valid JSReceiver. This change absorbs the functionality of additional two bytecodes - JumpIfJSReceiver and CallRuntime, that are part of the iterator protocol in the GetIterator bytecode. Bug: v8:9489 Change-Id: I9e84cfe85eeb9a1b8a97ca0595375ac26ba1bbfd Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1792905 Reviewed-by: Leszek Swirski <leszeks@chromium.org> Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Commit-Queue: Swapnil Gaikwad <swapnilgaikwad@google.com> Cr-Commit-Position: refs/heads/master@{#63704}
152 lines
4.1 KiB
Plaintext
152 lines
4.1 KiB
Plaintext
#
|
|
# 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: 5
|
|
parameter count: 1
|
|
bytecode array length: 19
|
|
bytecodes: [
|
|
B(CreateRestParameter),
|
|
B(Star), R(2),
|
|
B(Mov), R(closure), R(1),
|
|
/* 93 E> */ B(StackCheck),
|
|
/* 93 S> */ B(Ldar), R(1),
|
|
B(GetSuperConstructor), R(4),
|
|
B(Ldar), R(0),
|
|
/* 93 E> */ B(ConstructWithSpread), R(4), R(2), U8(1), U8(0),
|
|
/* 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: 9
|
|
parameter count: 1
|
|
bytecode array length: 40
|
|
bytecodes: [
|
|
B(CreateRestParameter),
|
|
B(Star), R(3),
|
|
B(Mov), R(closure), R(1),
|
|
/* 128 E> */ B(StackCheck),
|
|
B(Mov), R(3), R(2),
|
|
/* 140 S> */ B(Ldar), R(closure),
|
|
B(GetSuperConstructor), R(5),
|
|
B(LdaSmi), I8(1),
|
|
B(Star), R(6),
|
|
B(Ldar), R(0),
|
|
B(Mov), R(3), R(7),
|
|
/* 140 E> */ B(ConstructWithSpread), R(5), R(6), U8(2), U8(0),
|
|
B(Star), R(8),
|
|
B(Ldar), R(this),
|
|
B(ThrowSuperAlreadyCalledIfNotHole),
|
|
B(Mov), R(8), 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: 11
|
|
parameter count: 1
|
|
bytecode array length: 112
|
|
bytecodes: [
|
|
B(CreateRestParameter),
|
|
B(Star), R(3),
|
|
B(Mov), R(closure), R(1),
|
|
/* 128 E> */ B(StackCheck),
|
|
B(Mov), R(3), R(2),
|
|
/* 140 S> */ B(Ldar), R(closure),
|
|
B(GetSuperConstructor), R(5),
|
|
B(CreateEmptyArrayLiteral), U8(0),
|
|
B(Star), R(7),
|
|
B(LdaZero),
|
|
B(Star), R(6),
|
|
B(LdaSmi), I8(1),
|
|
B(StaInArrayLiteral), R(7), R(6), U8(1),
|
|
B(Ldar), R(6),
|
|
B(Inc), U8(3),
|
|
/* 152 S> */ B(Star), R(6),
|
|
B(GetIterator), R(3), U8(4), U8(6),
|
|
B(Star), R(9),
|
|
B(LdaNamedProperty), R(9), U8(0), U8(8),
|
|
B(Star), R(8),
|
|
B(Mov), R(1), R(4),
|
|
B(CallProperty0), R(8), R(9), U8(14),
|
|
B(Star), R(10),
|
|
B(JumpIfJSReceiver), U8(7),
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
|
|
B(LdaNamedProperty), R(10), U8(1), U8(16),
|
|
B(JumpIfToBooleanTrue), U8(19),
|
|
B(LdaNamedProperty), R(10), U8(2), U8(10),
|
|
B(StaInArrayLiteral), R(7), R(6), U8(1),
|
|
B(Ldar), R(6),
|
|
B(Inc), U8(3),
|
|
B(Star), R(6),
|
|
B(JumpLoop), U8(33), I8(0),
|
|
B(LdaSmi), I8(1),
|
|
B(StaInArrayLiteral), R(7), R(6), U8(1),
|
|
B(Mov), R(5), R(6),
|
|
B(Mov), R(0), R(8),
|
|
/* 140 E> */ B(CallJSRuntime), U8(%reflect_construct), R(6), U8(3),
|
|
B(Star), R(9),
|
|
B(Ldar), R(this),
|
|
B(ThrowSuperAlreadyCalledIfNotHole),
|
|
B(Mov), R(9), R(this),
|
|
B(Ldar), R(this),
|
|
B(ThrowSuperNotCalledIfHole),
|
|
/* 162 S> */ B(Return),
|
|
]
|
|
constant pool: [
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
|
|
]
|
|
handlers: [
|
|
]
|
|
|