6ae030590d
Bytecode expectations have been moved to external (.golden) files, one per test. Each test in the suite builds a representation of the the compiled bytecode using BytecodeExpectationsPrinter. The output is then compared to the golden file. If the comparision fails, a textual diff can be used to identify the discrepancies. Only the test snippets are left in the cc file, which also allows to make it more compact and meaningful. Leaving the snippets in the cc file was a deliberate choice to allow keeping the "truth" about the tests in the cc file, which will rarely change, as opposed to golden files. Golden files can be generated and kept up to date using generate-bytecode-expectations, which also means that the test suite can be batch updated whenever the bytecode or golden format changes. The golden format has been slightly amended (no more comments about `void*`, add size of the bytecode array) following the consideration made while converting the tests. There is also a fix: BytecodeExpectationsPrinter::top_level_ was left uninitialized, leading to undefined behaviour. BUG=v8:4280 LOG=N Review URL: https://codereview.chromium.org/1717293002 Cr-Commit-Position: refs/heads/master@{#34285}
90 lines
1.2 KiB
Plaintext
90 lines
1.2 KiB
Plaintext
#
|
|
# Autogenerated by generate-bytecode-expectations.
|
|
#
|
|
|
|
---
|
|
pool type: string
|
|
execute: yes
|
|
wrap: no
|
|
test function name: f
|
|
|
|
---
|
|
snippet: "
|
|
var f;
|
|
var x = 1;
|
|
z = 10;
|
|
function f1() {
|
|
var y;
|
|
eval(\"function t() { delete x; }; f = t; f();\");
|
|
}
|
|
f1();
|
|
"
|
|
frame size: 1
|
|
parameter count: 1
|
|
bytecode array length: 12
|
|
bytecodes: [
|
|
B(StackCheck),
|
|
B(LdaConstant), U8(0),
|
|
B(Star), R(0),
|
|
B(CallRuntime), U16(Runtime::kDeleteLookupSlot), R(0), U8(1),
|
|
B(LdaUndefined),
|
|
B(Return),
|
|
]
|
|
constant pool: [
|
|
"x",
|
|
]
|
|
handlers: [
|
|
]
|
|
|
|
---
|
|
snippet: "
|
|
var f;
|
|
var x = 1;
|
|
z = 10;
|
|
function f1() {
|
|
var y;
|
|
eval(\"function t() { return delete y; }; f = t; f();\");
|
|
}
|
|
f1();
|
|
"
|
|
frame size: 0
|
|
parameter count: 1
|
|
bytecode array length: 3
|
|
bytecodes: [
|
|
B(StackCheck),
|
|
B(LdaFalse),
|
|
B(Return),
|
|
]
|
|
constant pool: [
|
|
]
|
|
handlers: [
|
|
]
|
|
|
|
---
|
|
snippet: "
|
|
var f;
|
|
var x = 1;
|
|
z = 10;
|
|
function f1() {
|
|
var y;
|
|
eval(\"function t() { return delete z; }; f = t; f();\");
|
|
}
|
|
f1();
|
|
"
|
|
frame size: 1
|
|
parameter count: 1
|
|
bytecode array length: 11
|
|
bytecodes: [
|
|
B(StackCheck),
|
|
B(LdaConstant), U8(0),
|
|
B(Star), R(0),
|
|
B(CallRuntime), U16(Runtime::kDeleteLookupSlot), R(0), U8(1),
|
|
B(Return),
|
|
]
|
|
constant pool: [
|
|
"z",
|
|
]
|
|
handlers: [
|
|
]
|
|
|