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

---
wrap: yes

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

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

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

---
snippet: "
  const x = 10; x = 20; function f1() {return x;}
"
95
frame size: 2
96
parameter count: 1
97
bytecode array length: 27
98
bytecodes: [
99
                B(CreateFunctionContext), U8(1),
100 101
                B(PushContext), R(1),
                B(LdaTheHole),
102
                B(StaCurrentContextSlot), U8(4),
103
                B(CreateClosure), U8(0), U8(0), U8(2),
104 105
                B(Star), R(0),
  /*   30 E> */ B(StackCheck),
106
  /*   44 S> */ B(LdaSmi), I8(10),
107
  /*   44 E> */ B(StaCurrentContextSlot), U8(4),
108
  /*   48 S> */ B(LdaSmi), I8(20),
109
  /*   50 E> */ B(CallRuntime), U16(Runtime::kThrowConstAssignError), R(0), U8(0),
110 111
                B(LdaUndefined),
  /*   82 S> */ B(Return),
112 113
]
constant pool: [
114
  SHARED_FUNCTION_INFO_TYPE,
115 116 117 118
]
handlers: [
]