ConstVariableContextSlot.golden 2.58 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
#
# Autogenerated by generate-bytecode-expectations.
#

---
wrap: yes

---
snippet: "
  const x = 10; function f1() {return x;}
"
12
frame size: 1
13
parameter count: 1
14
bytecode array length: 15
15
bytecodes: [
16
                B(CreateFunctionContext), U8(0), U8(1),
17
                B(PushContext), R(0),
18
                B(LdaTheHole),
19
                B(StaCurrentContextSlot), U8(4),
20
  /*   30 E> */ B(StackCheck),
21
  /*   44 S> */ B(LdaSmi), I8(10),
22
  /*   44 E> */ B(StaCurrentContextSlot), U8(4),
23 24
                B(LdaUndefined),
  /*   74 S> */ B(Return),
25 26
]
constant pool: [
27
  SCOPE_INFO_TYPE,
28 29 30 31 32 33 34 35
]
handlers: [
]

---
snippet: "
  const x = 10; function f1() {return x;} return x;
"
36
frame size: 1
37
parameter count: 1
38
bytecode array length: 16
39
bytecodes: [
40
                B(CreateFunctionContext), U8(0), U8(1),
41
                B(PushContext), R(0),
42
                B(LdaTheHole),
43
                B(StaCurrentContextSlot), U8(4),
44
  /*   30 E> */ B(StackCheck),
45
  /*   44 S> */ B(LdaSmi), I8(10),
46
  /*   44 E> */ B(StaCurrentContextSlot), U8(4),
47
  /*   74 S> */ B(LdaImmutableCurrentContextSlot), U8(4),
48
  /*   83 S> */ B(Return),
49 50
]
constant pool: [
51
  SCOPE_INFO_TYPE,
52 53 54 55 56 57 58 59
]
handlers: [
]

---
snippet: "
  const x = (x = 20); function f1() {return x;}
"
60
frame size: 2
61
parameter count: 1
62
bytecode array length: 26
63
bytecodes: [
64
                B(CreateFunctionContext), U8(0), U8(1),
65
                B(PushContext), R(0),
66
                B(LdaTheHole),
67
                B(StaCurrentContextSlot), U8(4),
68
  /*   30 E> */ B(StackCheck),
69
  /*   44 S> */ B(LdaSmi), I8(20),
70
                B(Star), R(1),
71
                B(LdaCurrentContextSlot), U8(4),
72
  /*   47 E> */ B(ThrowReferenceErrorIfHole), U8(1),
73
                B(CallRuntime), U16(Runtime::kThrowConstAssignError), R(0), U8(0),
74
  /*   44 E> */ B(StaCurrentContextSlot), U8(4),
75 76
                B(LdaUndefined),
  /*   80 S> */ B(Return),
77 78
]
constant pool: [
79
  SCOPE_INFO_TYPE,
80
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["x"],
81 82 83 84 85 86 87 88
]
handlers: [
]

---
snippet: "
  const x = 10; x = 20; function f1() {return x;}
"
89
frame size: 1
90
parameter count: 1
91
bytecode array length: 22
92
bytecodes: [
93
                B(CreateFunctionContext), U8(0), U8(1),
94
                B(PushContext), R(0),
95
                B(LdaTheHole),
96
                B(StaCurrentContextSlot), U8(4),
97
  /*   30 E> */ B(StackCheck),
98
  /*   44 S> */ B(LdaSmi), I8(10),
99
  /*   44 E> */ B(StaCurrentContextSlot), U8(4),
100
  /*   48 S> */ B(LdaSmi), I8(20),
101
  /*   50 E> */ B(CallRuntime), U16(Runtime::kThrowConstAssignError), R(0), U8(0),
102 103
                B(LdaUndefined),
  /*   82 S> */ B(Return),
104 105
]
constant pool: [
106
  SCOPE_INFO_TYPE,
107 108 109 110
]
handlers: [
]