v8/test/cctest/interpreter/bytecode_expectations/ClassAndSuperClass.golden
Jakob Gruber cebfde6769 [interpreter] Move function-entry stack check to start of bytecode array
The function-entry stack check should dominate all other
instructions in a function. Prior to this CL it was possible to create
paths not including a stack check due to SwitchOnGeneratorState: the
generator-creation branch had a stack check, while generator-resume
branches did not.

  0 : af fb 00 01       SwitchOnGeneratorState r0, [0], [1] { 0: @22 }
  4 : 27 fe fa          Mov <closure>, r1
  7 : 27 02 f9          Mov <this>, r2
 10 : 64 0a fa 02       InvokeIntrinsic [_CreateJSGeneratorObject], r1-r2
 14 : 26 fb             Star r0
 16 : a7                StackCheck
 17 : b0 fb fb 01 00    SuspendGenerator r0, r0-r0, [0]
 22 : b1 fb fb 01       ResumeGenerator r0, r0-r0
                        [... no stack check here ...]

This CL moves the stack check to the beginning of the bytecode array,
i.e. before SwitchOnGeneratorState.

Bug: chromium:1020031
Change-Id: I8ba8cba99611ddbe50c76023129d926cc84b1d5e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1903440
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64888}
2019-11-11 15:00:09 +00:00

178 lines
4.3 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: [
/* 99 E> */ B(StackCheck),
B(Mov), R(closure), R(0),
/* 104 S> */ B(LdaConstant), U8(0),
/* 111 E> */ B(LdaKeyedProperty), R(closure), U8(1),
B(Star), R(4),
B(LdaConstant), U8(1),
B(Star), R(5),
B(Mov), R(this), R(3),
/* 117 E> */ B(CallRuntime), U16(Runtime::kLoadFromSuper), R(3), U8(3),
B(Star), R(1),
/* 117 E> */ B(CallAnyReceiver), R(1), R(this), U8(1), U8(3),
/* 126 E> */ B(AddSmi), I8(1), U8(0),
/* 130 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: [
/* 125 E> */ B(StackCheck),
B(Mov), R(closure), R(0),
/* 130 S> */ B(LdaConstant), U8(0),
/* 130 E> */ B(LdaKeyedProperty), R(closure), U8(0),
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), R(1), U8(4),
/* 143 S> */ B(LdaConstant), U8(0),
/* 150 E> */ B(LdaKeyedProperty), R(closure), U8(2),
B(Star), R(2),
B(LdaConstant), U8(1),
B(Star), R(3),
B(Mov), R(this), R(1),
/* 156 E> */ B(CallRuntime), U16(Runtime::kLoadFromSuper), R(1), U8(3),
/* 158 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: 6
parameter count: 1
bytecode array length: 40
bytecodes: [
/* 113 E> */ B(StackCheck),
B(Mov), R(closure), R(1),
/* 118 S> */ B(Ldar), R(1),
B(GetSuperConstructor), R(3),
B(LdaSmi), I8(1),
B(Star), R(4),
B(Ldar), R(0),
/* 118 E> */ B(Construct), R(3), R(4), U8(1), U8(0),
B(Star), R(5),
B(Ldar), R(this),
B(ThrowSuperAlreadyCalledIfNotHole),
B(Mov), R(5), R(this),
/* 128 S> */ B(Ldar), R(this),
B(ThrowSuperNotCalledIfHole),
B(LdaSmi), I8(2),
/* 136 E> */ B(StaNamedProperty), R(this), U8(0), U8(2),
B(Ldar), R(this),
B(ThrowSuperNotCalledIfHole),
/* 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: 5
parameter count: 1
bytecode array length: 36
bytecodes: [
/* 112 E> */ B(StackCheck),
B(Mov), R(closure), R(1),
/* 117 S> */ B(Ldar), R(1),
B(GetSuperConstructor), R(3),
B(Ldar), R(0),
/* 117 E> */ B(Construct), R(3), R(0), U8(0), U8(0),
B(Star), R(4),
B(Ldar), R(this),
B(ThrowSuperAlreadyCalledIfNotHole),
B(Mov), R(4), R(this),
/* 126 S> */ B(Ldar), R(this),
B(ThrowSuperNotCalledIfHole),
B(LdaSmi), I8(2),
/* 134 E> */ B(StaNamedProperty), R(this), U8(0), U8(2),
B(Ldar), R(this),
B(ThrowSuperNotCalledIfHole),
/* 139 S> */ B(Return),
]
constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE ["y_"],
]
handlers: [
]