57afd0bb07
Adds a collection of call bytecodes which have an implicit undefined receiver argument, for cases such as global calls where we know that the receiver has to be undefined. This way we can skip an LdaUndefined, decrease bytecode register pressure, and set a more accurate ConvertReceiverMode on the interpreter and TurboFan call. As a side effect, the "normal" Call bytecode now becomes a rare case (only with calls and super property calls), so we get rid of its 0-2 argument special cases and modify CallProperty[N] to use the NotNullOrUndefined ConvertReceiverMode. Reland of https://chromium-review.googlesource.com/c/463287 after fixing tests in https://codereview.chromium.org/2813873002. Change-Id: I314d69c7643ceec6a5750ffdab60dad38dad09e5 Reviewed-on: https://chromium-review.googlesource.com/474752 Reviewed-by: Michael Achenbach <machenbach@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Commit-Queue: Leszek Swirski <leszeks@chromium.org> Cr-Commit-Position: refs/heads/master@{#44582}
192 lines
5.0 KiB
Plaintext
192 lines
5.0 KiB
Plaintext
#
|
|
# 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: 6
|
|
parameter count: 1
|
|
bytecode array length: 34
|
|
bytecodes: [
|
|
B(Mov), R(closure), R(0),
|
|
/* 99 E> */ B(StackCheck),
|
|
/* 104 S> */ B(LdaConstant), U8(0),
|
|
/* 111 E> */ B(LdaKeyedProperty), R(closure), U8(4),
|
|
B(Star), R(4),
|
|
B(LdaConstant), U8(1),
|
|
B(Star), R(5),
|
|
B(Mov), R(this), R(3),
|
|
B(CallRuntime), U16(Runtime::kLoadFromSuper), R(3), U8(3),
|
|
B(Star), R(1),
|
|
/* 117 E> */ B(CallAnyReceiver), R(1), R(this), U8(1), U8(2),
|
|
/* 126 E> */ B(AddSmi), I8(1), U8(8),
|
|
/* 131 S> */ B(Return),
|
|
]
|
|
constant pool: [
|
|
SYMBOL_TYPE,
|
|
ONE_BYTE_INTERNALIZED_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: 5
|
|
parameter count: 1
|
|
bytecode array length: 47
|
|
bytecodes: [
|
|
B(Mov), R(closure), R(0),
|
|
/* 125 E> */ B(StackCheck),
|
|
/* 130 S> */ B(LdaConstant), U8(0),
|
|
/* 130 E> */ B(LdaKeyedProperty), R(closure), U8(2),
|
|
B(Star), R(2),
|
|
B(LdaConstant), U8(1),
|
|
B(Star), R(3),
|
|
B(LdaSmi), I8(2),
|
|
B(Star), R(4),
|
|
B(Mov), R(this), R(1),
|
|
/* 138 E> */ B(CallRuntime), U16(Runtime::kStoreToSuper_Strict), R(1), U8(4),
|
|
/* 143 S> */ B(LdaConstant), U8(0),
|
|
/* 150 E> */ B(LdaKeyedProperty), R(closure), U8(4),
|
|
B(Star), R(2),
|
|
B(LdaConstant), U8(1),
|
|
B(Star), R(3),
|
|
B(Mov), R(this), R(1),
|
|
B(CallRuntime), U16(Runtime::kLoadFromSuper), R(1), U8(3),
|
|
/* 159 S> */ B(Return),
|
|
]
|
|
constant pool: [
|
|
SYMBOL_TYPE,
|
|
ONE_BYTE_INTERNALIZED_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: 4
|
|
parameter count: 1
|
|
bytecode array length: 67
|
|
bytecodes: [
|
|
B(Mov), R(closure), R(1),
|
|
B(Mov), R(new_target), R(0),
|
|
B(Ldar), R(new_target),
|
|
/* 113 E> */ B(StackCheck),
|
|
/* 118 S> */ B(Ldar), R(1),
|
|
B(GetSuperConstructor), R(2),
|
|
B(LdaSmi), I8(1),
|
|
B(Star), R(3),
|
|
B(Ldar), R(0),
|
|
/* 118 E> */ B(Construct), R(2), R(3), U8(1), U8(2),
|
|
B(Star), R(2),
|
|
B(Ldar), R(this),
|
|
B(JumpIfNotHole), U8(4),
|
|
B(Jump), U8(7),
|
|
/* 118 E> */ B(CallRuntime), U16(Runtime::kThrowSuperAlreadyCalledError), R(0), U8(0),
|
|
B(Mov), R(2), R(this),
|
|
/* 128 S> */ B(Ldar), R(this),
|
|
B(JumpIfNotHole), U8(7),
|
|
B(CallRuntime), U16(Runtime::kThrowSuperNotCalled), R(0), U8(0),
|
|
B(Star), R(2),
|
|
B(LdaSmi), I8(2),
|
|
/* 136 E> */ B(StaNamedPropertyStrict), R(2), U8(0), U8(4),
|
|
B(Ldar), R(this),
|
|
B(JumpIfNotHole), U8(7),
|
|
B(CallRuntime), U16(Runtime::kThrowSuperNotCalled), R(0), U8(0),
|
|
/* 141 S> */ B(Return),
|
|
]
|
|
constant pool: [
|
|
ONE_BYTE_INTERNALIZED_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: 3
|
|
parameter count: 1
|
|
bytecode array length: 63
|
|
bytecodes: [
|
|
B(Mov), R(closure), R(1),
|
|
B(Mov), R(new_target), R(0),
|
|
B(Ldar), R(new_target),
|
|
/* 112 E> */ B(StackCheck),
|
|
/* 117 S> */ B(Ldar), R(1),
|
|
B(GetSuperConstructor), R(2),
|
|
B(Ldar), R(0),
|
|
/* 117 E> */ B(Construct), R(2), R(0), U8(0), U8(2),
|
|
B(Star), R(2),
|
|
B(Ldar), R(this),
|
|
B(JumpIfNotHole), U8(4),
|
|
B(Jump), U8(7),
|
|
/* 117 E> */ B(CallRuntime), U16(Runtime::kThrowSuperAlreadyCalledError), R(0), U8(0),
|
|
B(Mov), R(2), R(this),
|
|
/* 126 S> */ B(Ldar), R(this),
|
|
B(JumpIfNotHole), U8(7),
|
|
B(CallRuntime), U16(Runtime::kThrowSuperNotCalled), R(0), U8(0),
|
|
B(Star), R(2),
|
|
B(LdaSmi), I8(2),
|
|
/* 134 E> */ B(StaNamedPropertyStrict), R(2), U8(0), U8(4),
|
|
B(Ldar), R(this),
|
|
B(JumpIfNotHole), U8(7),
|
|
B(CallRuntime), U16(Runtime::kThrowSuperNotCalled), R(0), U8(0),
|
|
/* 139 S> */ B(Return),
|
|
]
|
|
constant pool: [
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["y_"],
|
|
]
|
|
handlers: [
|
|
]
|
|
|