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

---
wrap: yes

---
snippet: "
  var a = 1;
  return a === null;
"
frame size: 1
parameter count: 1
15
bytecode array length: 6
16 17 18 19
bytecodes: [
  /*   42 S> */ B(LdaSmi), I8(1),
                B(Star), R(0),
  /*   45 S> */ B(TestNull),
20
  /*   63 S> */ B(Return),
21 22 23 24 25 26 27 28 29 30 31 32 33
]
constant pool: [
]
handlers: [
]

---
snippet: "
  var a = undefined;
  return undefined === a;
"
frame size: 1
parameter count: 1
34
bytecode array length: 5
35 36 37 38
bytecodes: [
  /*   42 S> */ B(LdaUndefined),
                B(Star), R(0),
  /*   53 S> */ B(TestUndefined),
39
  /*   76 S> */ B(Return),
40 41 42 43 44 45 46 47 48 49 50 51 52
]
constant pool: [
]
handlers: [
]

---
snippet: "
  var a = undefined;
  return undefined !== a;
"
frame size: 1
parameter count: 1
53
bytecode array length: 6
54 55 56 57 58
bytecodes: [
  /*   42 S> */ B(LdaUndefined),
                B(Star), R(0),
  /*   53 S> */ B(TestUndefined),
  /*   70 E> */ B(LogicalNot),
59
  /*   76 S> */ B(Return),
60 61 62 63 64 65 66 67 68 69 70 71 72
]
constant pool: [
]
handlers: [
]

---
snippet: "
  var a = 2;
  return a != null;
"
frame size: 1
parameter count: 1
73
bytecode array length: 7
74 75 76 77 78
bytecodes: [
  /*   42 S> */ B(LdaSmi), I8(2),
                B(Star), R(0),
  /*   45 S> */ B(TestUndetectable),
  /*   54 E> */ B(LogicalNot),
79
  /*   62 S> */ B(Return),
80 81 82 83 84 85 86 87 88 89 90 91 92
]
constant pool: [
]
handlers: [
]

---
snippet: "
  var a = undefined;
  return undefined == a;
"
frame size: 1
parameter count: 1
93
bytecode array length: 5
94 95 96 97
bytecodes: [
  /*   42 S> */ B(LdaUndefined),
                B(Star), R(0),
  /*   53 S> */ B(TestUndetectable),
98
  /*   75 S> */ B(Return),
99 100 101 102 103 104 105 106 107 108 109 110 111
]
constant pool: [
]
handlers: [
]

---
snippet: "
  var a = undefined;
  return undefined === a ? 1 : 2;
"
frame size: 1
parameter count: 1
112
bytecode array length: 12
113 114 115 116 117 118 119
bytecodes: [
  /*   42 S> */ B(LdaUndefined),
                B(Star), R(0),
  /*   53 S> */ B(JumpIfNotUndefined), U8(6),
                B(LdaSmi), I8(1),
                B(Jump), U8(4),
                B(LdaSmi), I8(2),
120
  /*   84 S> */ B(Return),
121 122 123 124 125 126 127 128 129 130 131 132 133
]
constant pool: [
]
handlers: [
]

---
snippet: "
  var a = 0;
  return null == a ? 1 : 2;
"
frame size: 1
parameter count: 1
134
bytecode array length: 13
135 136 137 138
bytecodes: [
  /*   42 S> */ B(LdaZero),
                B(Star), R(0),
  /*   45 S> */ B(TestUndetectable),
139
                B(JumpIfFalse), U8(6),
140 141 142
                B(LdaSmi), I8(1),
                B(Jump), U8(4),
                B(LdaSmi), I8(2),
143
  /*   70 S> */ B(Return),
144 145 146 147 148 149 150 151 152 153 154 155 156
]
constant pool: [
]
handlers: [
]

---
snippet: "
  var a = 0;
  return undefined !== a ? 1 : 2;
"
frame size: 1
parameter count: 1
157
bytecode array length: 12
158 159 160 161 162 163 164
bytecodes: [
  /*   42 S> */ B(LdaZero),
                B(Star), R(0),
  /*   45 S> */ B(JumpIfUndefined), U8(6),
                B(LdaSmi), I8(1),
                B(Jump), U8(4),
                B(LdaSmi), I8(2),
165
  /*   76 S> */ B(Return),
166 167 168 169 170 171 172 173 174 175 176 177 178
]
constant pool: [
]
handlers: [
]

---
snippet: "
  var a = 0;
  return a === null ? 1 : 2;
"
frame size: 1
parameter count: 1
179
bytecode array length: 12
180 181 182 183 184 185 186
bytecodes: [
  /*   42 S> */ B(LdaZero),
                B(Star), R(0),
  /*   45 S> */ B(JumpIfNotNull), U8(6),
                B(LdaSmi), I8(1),
                B(Jump), U8(4),
                B(LdaSmi), I8(2),
187
  /*   71 S> */ B(Return),
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
]
constant pool: [
]
handlers: [
]

---
snippet: "
  var a = 0;
  if (a === null) {
    return 1;
  } else {
    return 2;
  }
"
frame size: 1
parameter count: 1
205
bytecode array length: 11
206 207 208 209 210
bytecodes: [
  /*   42 S> */ B(LdaZero),
                B(Star), R(0),
  /*   45 S> */ B(JumpIfNotNull), U8(5),
  /*   65 S> */ B(LdaSmi), I8(1),
211
  /*   74 S> */ B(Return),
212
  /*   86 S> */ B(LdaSmi), I8(2),
213
  /*   95 S> */ B(Return),
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228
]
constant pool: [
]
handlers: [
]

---
snippet: "
  var a = 0;
  if (a != undefined) {
    return 1;
  }
"
frame size: 1
parameter count: 1
229
bytecode array length: 11
230 231 232 233
bytecodes: [
  /*   42 S> */ B(LdaZero),
                B(Star), R(0),
  /*   45 S> */ B(TestUndetectable),
234
                B(JumpIfTrue), U8(5),
235
  /*   69 S> */ B(LdaSmi), I8(1),
236
  /*   78 S> */ B(Return),
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254
                B(LdaUndefined),
  /*   81 S> */ B(Return),
]
constant pool: [
]
handlers: [
]

---
snippet: "
  var a = undefined;
  var b = 0;
  while (a !== undefined) {
    b++;
  }
"
frame size: 2
parameter count: 1
255
bytecode array length: 21
256 257 258 259 260 261
bytecodes: [
  /*   42 S> */ B(LdaUndefined),
                B(Star), R(0),
  /*   61 S> */ B(LdaZero),
                B(Star), R(1),
  /*   73 S> */ B(Ldar), R(0),
262
                B(JumpIfUndefined), U8(11),
263
  /*   92 S> */ B(Ldar), R(1),
264
                B(Inc), U8(0),
265
                B(Star), R(1),
266
  /*   64 E> */ B(JumpLoop), U8(10), I8(0),
267 268 269 270 271 272 273 274
                B(LdaUndefined),
  /*   99 S> */ B(Return),
]
constant pool: [
]
handlers: [
]