Files
Kmake/deps/v8/test/unittests/interpreter/bytecode_expectations/ClassAndSuperClass.golden
2026-05-26 23:36:42 -07:00

165 lines
3.9 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: 1
parameter count: 1
bytecode array length: 16
bytecodes: [
/* 104 S> */ B(LdaImmutableCurrentContextSlot), U8(2),
/* 117 E> */ B(GetNamedPropertyFromSuper), R(this), U8(0), U8(1),
B(Star0),
/* 117 E> */ B(CallAnyReceiver), R(0), R(this), U8(1), U8(3),
/* 126 E> */ B(AddSmi), I8(1), U8(0),
/* 130 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_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: 4
parameter count: 1
bytecode array length: 24
bytecodes: [
/* 130 S> */ B(LdaImmutableCurrentContextSlot), U8(2),
B(Star1),
B(LdaConstant), U8(0),
B(Star2),
B(LdaSmi), I8(2),
B(Star3),
B(Mov), R(this), R(0),
/* 138 E> */ B(CallRuntime), U16(Runtime::kStoreToSuper), R(0), U8(4),
/* 143 S> */ B(LdaImmutableCurrentContextSlot), U8(2),
/* 156 E> */ B(GetNamedPropertyFromSuper), R(this), U8(0), U8(0),
/* 158 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_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: 9
parameter count: 1
bytecode array length: 49
bytecodes: [
B(Mov), R(closure), R(1),
/* 118 S> */ B(LdaSmi), I8(1),
B(Star5),
/* 118 E> */ B(FindNonDefaultConstructorOrConstruct), R(1), R(0), R(7),
B(Ldar), R(7),
B(Mov), R(1), R(3),
B(Mov), R(0), R(6),
B(Mov), R(8), R(4),
B(JumpIfTrue), U8(12),
B(ThrowIfNotSuperConstructor), R(4),
B(Ldar), R(6),
/* 118 E> */ B(Construct), R(4), R(5), U8(1), U8(0),
B(Star4),
B(Ldar), R(this),
B(ThrowSuperAlreadyCalledIfNotHole),
B(Mov), R(4), R(this),
/* 128 S> */ B(LdaSmi), I8(2),
/* 136 E> */ B(SetNamedProperty), R(this), U8(0), U8(2),
B(Ldar), R(this),
B(ThrowSuperNotCalledIfHole),
/* 141 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_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: 8
parameter count: 1
bytecode array length: 46
bytecodes: [
B(Mov), R(closure), R(1),
/* 117 S> */ B(FindNonDefaultConstructorOrConstruct), R(1), R(0), R(6),
B(Ldar), R(6),
B(Mov), R(1), R(3),
B(Mov), R(0), R(5),
B(Mov), R(7), R(4),
B(JumpIfTrue), U8(12),
B(ThrowIfNotSuperConstructor), R(4),
B(Ldar), R(5),
/* 117 E> */ B(Construct), R(4), R(0), U8(0), U8(0),
B(Star4),
B(Ldar), R(this),
B(ThrowSuperAlreadyCalledIfNotHole),
B(Mov), R(4), R(this),
/* 126 S> */ B(LdaSmi), I8(2),
/* 134 E> */ B(SetNamedProperty), R(this), U8(0), U8(2),
B(Ldar), R(this),
B(ThrowSuperNotCalledIfHole),
/* 139 S> */ B(Return),
]
constant pool: [
INTERNALIZED_ONE_BYTE_STRING_TYPE ["y_"],
]
handlers: [
]