v8/test/cctest/interpreter/bytecode_expectations/TemplateLiterals.golden
Caitlin Potter 470db43c7b [cctest] add bytecode generator tests for template literals
Just copies the StringConcat tests and refactors them to exercise
template literals rather than simple string addition.

BUG=v8:7415
R=rmcilroy@chromium.org

Change-Id: I79cf24ee33e64b1d57221eb0291d9958634130ec
Reviewed-on: https://chromium-review.googlesource.com/951968
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Cr-Commit-Position: refs/heads/master@{#51788}
2018-03-07 15:17:32 +00:00

213 lines
5.4 KiB
Plaintext

#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
var a = 1;
var b = 2;
return `${a}${b}string`;
"
frame size: 3
parameter count: 1
bytecode array length: 30
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), I8(1),
B(Star), R(0),
/* 53 S> */ B(LdaSmi), I8(2),
B(Star), R(1),
/* 56 S> */ B(InvokeIntrinsic), U8(Runtime::k_ToString), R(0), U8(1),
B(Star), R(2),
/* 70 E> */ B(InvokeIntrinsic), U8(Runtime::k_ToString), R(1), U8(1),
/* 70 E> */ B(Add), R(2), U8(0),
B(Star), R(2),
B(LdaConstant), U8(0),
/* 70 E> */ B(Add), R(2), U8(1),
/* 80 S> */ B(Return),
]
constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE ["string"],
]
handlers: [
]
---
snippet: "
var a = 1;
var b = 2;
return `string${a}${b}`;
"
frame size: 3
parameter count: 1
bytecode array length: 30
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), I8(1),
B(Star), R(0),
/* 53 S> */ B(LdaSmi), I8(2),
B(Star), R(1),
/* 56 S> */ B(LdaConstant), U8(0),
B(Star), R(2),
/* 72 E> */ B(InvokeIntrinsic), U8(Runtime::k_ToString), R(0), U8(1),
/* 72 E> */ B(Add), R(2), U8(0),
B(Star), R(2),
/* 76 E> */ B(InvokeIntrinsic), U8(Runtime::k_ToString), R(1), U8(1),
/* 76 E> */ B(Add), R(2), U8(1),
/* 80 S> */ B(Return),
]
constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE ["string"],
]
handlers: [
]
---
snippet: "
var a = 1;
var b = 2;
return `${a}string${b}`;
"
frame size: 3
parameter count: 1
bytecode array length: 30
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), I8(1),
B(Star), R(0),
/* 53 S> */ B(LdaSmi), I8(2),
B(Star), R(1),
/* 56 S> */ B(InvokeIntrinsic), U8(Runtime::k_ToString), R(0), U8(1),
B(Star), R(2),
B(LdaConstant), U8(0),
/* 66 E> */ B(Add), R(2), U8(0),
B(Star), R(2),
/* 76 E> */ B(InvokeIntrinsic), U8(Runtime::k_ToString), R(1), U8(1),
/* 76 E> */ B(Add), R(2), U8(1),
/* 80 S> */ B(Return),
]
constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE ["string"],
]
handlers: [
]
---
snippet: "
var a = 1;
var b = 2;
return `foo${a}bar${b}baz${1}`;
"
frame size: 4
parameter count: 1
bytecode array length: 57
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), I8(1),
B(Star), R(0),
/* 53 S> */ B(LdaSmi), I8(2),
B(Star), R(1),
/* 56 S> */ B(LdaConstant), U8(0),
B(Star), R(2),
/* 69 E> */ B(InvokeIntrinsic), U8(Runtime::k_ToString), R(0), U8(1),
/* 69 E> */ B(Add), R(2), U8(0),
B(Star), R(2),
B(LdaConstant), U8(1),
/* 69 E> */ B(Add), R(2), U8(1),
B(Star), R(2),
/* 76 E> */ B(InvokeIntrinsic), U8(Runtime::k_ToString), R(1), U8(1),
/* 76 E> */ B(Add), R(2), U8(2),
B(Star), R(2),
B(LdaConstant), U8(2),
/* 76 E> */ B(Add), R(2), U8(3),
B(Star), R(2),
B(LdaSmi), I8(1),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_ToString), R(3), U8(1),
/* 83 E> */ B(Add), R(2), U8(4),
/* 87 S> */ B(Return),
]
constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE ["foo"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["bar"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["baz"],
]
handlers: [
]
---
snippet: "
var a = 1;
var b = 2;
return `${a}string` + `string${b}`;
"
frame size: 4
parameter count: 1
bytecode array length: 37
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), I8(1),
B(Star), R(0),
/* 53 S> */ B(LdaSmi), I8(2),
B(Star), R(1),
/* 56 S> */ B(InvokeIntrinsic), U8(Runtime::k_ToString), R(0), U8(1),
B(Star), R(2),
B(LdaConstant), U8(0),
/* 66 E> */ B(Add), R(2), U8(0),
B(Star), R(2),
B(LdaConstant), U8(0),
B(Star), R(3),
/* 87 E> */ B(InvokeIntrinsic), U8(Runtime::k_ToString), R(1), U8(1),
/* 87 E> */ B(Add), R(3), U8(1),
/* 76 E> */ B(Add), R(2), U8(2),
/* 91 S> */ B(Return),
]
constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE ["string"],
]
handlers: [
]
---
snippet: "
var a = 1;
var b = 2;
function foo(a, b) { };
return `string${foo(a, b)}${a}${b}`;
"
frame size: 5
parameter count: 1
bytecode array length: 52
bytecodes: [
B(CreateClosure), U8(0), U8(0), U8(2),
B(Star), R(2),
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), I8(1),
B(Star), R(0),
/* 53 S> */ B(LdaSmi), I8(2),
B(Star), R(1),
/* 80 S> */ B(LdaConstant), U8(1),
B(Star), R(3),
/* 96 E> */ B(CallUndefinedReceiver2), R(2), R(0), R(1), U8(1),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_ToString), R(4), U8(1),
/* 96 E> */ B(Add), R(3), U8(3),
B(Star), R(3),
/* 108 E> */ B(InvokeIntrinsic), U8(Runtime::k_ToString), R(0), U8(1),
/* 108 E> */ B(Add), R(3), U8(4),
B(Star), R(3),
/* 112 E> */ B(InvokeIntrinsic), U8(Runtime::k_ToString), R(1), U8(1),
/* 112 E> */ B(Add), R(3), U8(5),
/* 116 S> */ B(Return),
]
constant pool: [
SHARED_FUNCTION_INFO_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["string"],
]
handlers: [
]