summaryrefslogtreecommitdiff
path: root/deps/v8/test/cctest/interpreter/bytecode_expectations/ConstVariableContextSlot.golden
blob: 73e7e0d8e0c9569b172ef5b97d11c1d5d5db5554 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#
# Autogenerated by generate-bytecode-expectations.
#

---
wrap: yes

---
snippet: "
  const x = 10; function f1() {return x;}
"
frame size: 2
parameter count: 1
bytecode array length: 21
bytecodes: [
                B(CreateFunctionContext), U8(0), U8(1),
                B(PushContext), R(1),
                B(LdaTheHole),
                B(StaCurrentContextSlot), U8(4),
                B(CreateClosure), U8(1), U8(0), U8(2),
                B(Star), R(0),
  /*   30 E> */ B(StackCheck),
  /*   44 S> */ B(LdaSmi), I8(10),
  /*   44 E> */ B(StaCurrentContextSlot), U8(4),
                B(LdaUndefined),
  /*   74 S> */ B(Return),
]
constant pool: [
  SCOPE_INFO_TYPE,
  SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]

---
snippet: "
  const x = 10; function f1() {return x;} return x;
"
frame size: 2
parameter count: 1
bytecode array length: 22
bytecodes: [
                B(CreateFunctionContext), U8(0), U8(1),
                B(PushContext), R(1),
                B(LdaTheHole),
                B(StaCurrentContextSlot), U8(4),
                B(CreateClosure), U8(1), U8(0), U8(2),
                B(Star), R(0),
  /*   30 E> */ B(StackCheck),
  /*   44 S> */ B(LdaSmi), I8(10),
  /*   44 E> */ B(StaCurrentContextSlot), U8(4),
  /*   74 S> */ B(LdaImmutableCurrentContextSlot), U8(4),
  /*   83 S> */ B(Return),
]
constant pool: [
  SCOPE_INFO_TYPE,
  SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]

---
snippet: "
  const x = (x = 20); function f1() {return x;}
"
frame size: 3
parameter count: 1
bytecode array length: 32
bytecodes: [
                B(CreateFunctionContext), U8(0), U8(1),
                B(PushContext), R(1),
                B(LdaTheHole),
                B(StaCurrentContextSlot), U8(4),
                B(CreateClosure), U8(1), U8(0), U8(2),
                B(Star), R(0),
  /*   30 E> */ B(StackCheck),
  /*   44 S> */ B(LdaSmi), I8(20),
                B(Star), R(2),
                B(LdaCurrentContextSlot), U8(4),
  /*   47 E> */ B(ThrowReferenceErrorIfHole), U8(2),
                B(CallRuntime), U16(Runtime::kThrowConstAssignError), R(0), U8(0),
  /*   44 E> */ B(StaCurrentContextSlot), U8(4),
                B(LdaUndefined),
  /*   80 S> */ B(Return),
]
constant pool: [
  SCOPE_INFO_TYPE,
  SHARED_FUNCTION_INFO_TYPE,
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["x"],
]
handlers: [
]

---
snippet: "
  const x = 10; x = 20; function f1() {return x;}
"
frame size: 2
parameter count: 1
bytecode array length: 28
bytecodes: [
                B(CreateFunctionContext), U8(0), U8(1),
                B(PushContext), R(1),
                B(LdaTheHole),
                B(StaCurrentContextSlot), U8(4),
                B(CreateClosure), U8(1), U8(0), U8(2),
                B(Star), R(0),
  /*   30 E> */ B(StackCheck),
  /*   44 S> */ B(LdaSmi), I8(10),
  /*   44 E> */ B(StaCurrentContextSlot), U8(4),
  /*   48 S> */ B(LdaSmi), I8(20),
  /*   50 E> */ B(CallRuntime), U16(Runtime::kThrowConstAssignError), R(0), U8(0),
                B(LdaUndefined),
  /*   82 S> */ B(Return),
]
constant pool: [
  SCOPE_INFO_TYPE,
  SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]