| 1 |
// |jit-test| --ion-limit-script-size=off |
| 2 |
|
| 3 |
setJitCompilerOption("baseline.warmup.trigger", 9); |
| 4 |
setJitCompilerOption("ion.warmup.trigger", 20); |
| 5 |
var i; |
| 6 |
|
| 7 |
var warp = true; |
| 8 |
|
| 9 |
// Prevent GC from cancelling/discarding Ion compilations. |
| 10 |
gczeal(0); |
| 11 |
|
| 12 |
var max = 200; |
| 13 |
|
| 14 |
// Check that we are able to remove the operation inside recover test functions (denoted by "rop..."), |
| 15 |
// when we inline the first version of uceFault, and ensure that the bailout is correct |
| 16 |
// when uceFault is replaced (which cause an invalidation bailout) |
| 17 |
|
| 18 |
var uceFault = function (i) { |
| 19 |
if (i > 98) |
| 20 |
uceFault = function (i) { return true; }; |
| 21 |
return false; |
| 22 |
} |
| 23 |
|
| 24 |
var uceFault_bitnot_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_bitnot_number')); |
| 25 |
function rbitnot_number(i) { |
| 26 |
var x = ~i; |
| 27 |
if (uceFault_bitnot_number(i) || uceFault_bitnot_number(i)) |
| 28 |
assertEq(x, -100 /* = ~99 */); |
| 29 |
assertRecoveredOnBailout(x, true); |
| 30 |
return i; |
| 31 |
} |
| 32 |
|
| 33 |
var uceFault_bitnot_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_bitnot_object')); |
| 34 |
function rbitnot_object(i) { |
| 35 |
var t = i; |
| 36 |
var o = { valueOf: function () { return t; } }; |
| 37 |
var x = ~o; /* computed with t == i, not 1000 */ |
| 38 |
t = 1000; |
| 39 |
if (uceFault_bitnot_object(i) || uceFault_bitnot_object(i)) |
| 40 |
assertEq(x, -100 /* = ~99 */); |
| 41 |
assertRecoveredOnBailout(x, false); |
| 42 |
return i; |
| 43 |
} |
| 44 |
|
| 45 |
var uceFault_bitand_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_bitand_number')); |
| 46 |
function rbitand_number(i) { |
| 47 |
var x = 1 & i; |
| 48 |
if (uceFault_bitand_number(i) || uceFault_bitand_number(i)) |
| 49 |
assertEq(x, 1 /* = 1 & 99 */); |
| 50 |
assertRecoveredOnBailout(x, true); |
| 51 |
return i; |
| 52 |
} |
| 53 |
|
| 54 |
var uceFault_bitand_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_bitand_object')); |
| 55 |
function rbitand_object(i) { |
| 56 |
var t = i; |
| 57 |
var o = { valueOf: function () { return t; } }; |
| 58 |
var x = o & i; /* computed with t == i, not 1000 */ |
| 59 |
t = 1000; |
| 60 |
if (uceFault_bitand_object(i) || uceFault_bitand_object(i)) |
| 61 |
assertEq(x, 99); |
| 62 |
assertRecoveredOnBailout(x, false); |
| 63 |
return i; |
| 64 |
} |
| 65 |
|
| 66 |
var uceFault_bitor_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_bitor_number')); |
| 67 |
function rbitor_number(i) { |
| 68 |
var x = i | -100; /* -100 == ~99 */ |
| 69 |
if (uceFault_bitor_number(i) || uceFault_bitor_number(i)) |
| 70 |
assertEq(x, -1) /* ~99 | 99 = -1 */ |
| 71 |
assertRecoveredOnBailout(x, true); |
| 72 |
return i; |
| 73 |
} |
| 74 |
|
| 75 |
var uceFault_bitor_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_bitor_object')); |
| 76 |
function rbitor_object(i) { |
| 77 |
var t = i; |
| 78 |
var o = { valueOf: function() { return t; } }; |
| 79 |
var x = o | -100; |
| 80 |
t = 1000; |
| 81 |
if (uceFault_bitor_object(i) || uceFault_bitor_object(i)) |
| 82 |
assertEq(x, -1); |
| 83 |
assertRecoveredOnBailout(x, false); |
| 84 |
return i; |
| 85 |
} |
| 86 |
|
| 87 |
var uceFault_bitxor_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_bitxor_number')); |
| 88 |
function rbitxor_number(i) { |
| 89 |
var x = 1 ^ i; |
| 90 |
if (uceFault_bitxor_number(i) || uceFault_bitxor_number(i)) |
| 91 |
assertEq(x, 98 /* = 1 XOR 99 */); |
| 92 |
assertRecoveredOnBailout(x, true); |
| 93 |
return i; |
| 94 |
} |
| 95 |
|
| 96 |
var uceFault_bitxor_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_bitxor_object')); |
| 97 |
function rbitxor_object(i) { |
| 98 |
var t = i; |
| 99 |
var o = { valueOf: function () { return t; } }; |
| 100 |
var x = 1 ^ o; /* computed with t == i, not 1000 */ |
| 101 |
t = 1000; |
| 102 |
if (uceFault_bitxor_object(i) || uceFault_bitxor_object(i)) |
| 103 |
assertEq(x, 98 /* = 1 XOR 99 */); |
| 104 |
assertRecoveredOnBailout(x, false); |
| 105 |
return i; |
| 106 |
} |
| 107 |
|
| 108 |
var uceFault_lsh_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_lsh_number')); |
| 109 |
function rlsh_number(i) { |
| 110 |
var x = i << 1; |
| 111 |
if (uceFault_lsh_number(i) || uceFault_lsh_number(i)) |
| 112 |
assertEq(x, 198); /* 99 << 1 == 198 */ |
| 113 |
assertRecoveredOnBailout(x, true); |
| 114 |
return i; |
| 115 |
} |
| 116 |
|
| 117 |
var uceFault_lsh_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_lsh_object')); |
| 118 |
function rlsh_object(i) { |
| 119 |
var t = i; |
| 120 |
var o = { valueOf: function() { return t; } }; |
| 121 |
var x = o << 1; |
| 122 |
t = 1000; |
| 123 |
if (uceFault_lsh_object(i) || uceFault_lsh_object(i)) |
| 124 |
assertEq(x, 198); |
| 125 |
assertRecoveredOnBailout(x, false); |
| 126 |
return i; |
| 127 |
} |
| 128 |
|
| 129 |
var uceFault_rsh_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_rsh_number')); |
| 130 |
function rrsh_number(i) { |
| 131 |
var x = i >> 1; |
| 132 |
if (uceFault_rsh_number(i) || uceFault_rsh_number(i)) |
| 133 |
assertEq(x, 49 /* = 99 >> 1 */); |
| 134 |
assertRecoveredOnBailout(x, true); |
| 135 |
return i; |
| 136 |
} |
| 137 |
|
| 138 |
var uceFault_rsh_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_rsh_object')); |
| 139 |
function rrsh_object(i) { |
| 140 |
var t = i; |
| 141 |
var o = { valueOf: function () { return t; } }; |
| 142 |
var x = o >> 1; /* computed with t == i, not 1000 */ |
| 143 |
t = 1000; |
| 144 |
if (uceFault_rsh_object(i) || uceFault_rsh_object(i)) |
| 145 |
assertEq(x, 49 /* = 99 >> 1 */); |
| 146 |
assertRecoveredOnBailout(x, false); |
| 147 |
return i; |
| 148 |
} |
| 149 |
|
| 150 |
var uceFault_ursh_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_ursh_number')); |
| 151 |
function rursh_number(i) { |
| 152 |
var x = i >>> 1; |
| 153 |
if (uceFault_ursh_number(i) || uceFault_ursh_number(i)) |
| 154 |
assertEq(x, 49 /* = 99 >>> 1 */); |
| 155 |
assertRecoveredOnBailout(x, true); |
| 156 |
return i; |
| 157 |
} |
| 158 |
|
| 159 |
var uceFault_ursh_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_ursh_object')); |
| 160 |
function rursh_object(i) { |
| 161 |
var t = i; |
| 162 |
var o = { valueOf: function () { return t; } }; |
| 163 |
var x = o >>> 1; /* computed with t == i, not 1000 */ |
| 164 |
t = 1000; |
| 165 |
if (uceFault_ursh_object(i) || uceFault_ursh_object(i)) |
| 166 |
assertEq(x, 49 /* = 99 >>> 1 */); |
| 167 |
assertRecoveredOnBailout(x, false); |
| 168 |
return i; |
| 169 |
} |
| 170 |
|
| 171 |
var uceFault_signextend8_1 = eval(`(${uceFault})`.replace('uceFault', 'uceFault_signextend8_1')); |
| 172 |
function rsignextend8_1(i) { |
| 173 |
var x = (i << 24) >> 24; |
| 174 |
if (uceFault_signextend8_1(i) || uceFault_signextend8_1(i)) |
| 175 |
assertEq(x, 99 /* = (99 << 24) >> 24 */); |
| 176 |
assertRecoveredOnBailout(x, true); |
| 177 |
return i; |
| 178 |
} |
| 179 |
|
| 180 |
var uceFault_signextend8_2 = eval(`(${uceFault})`.replace('uceFault', 'uceFault_signextend8_2')); |
| 181 |
function rsignextend8_2(i) { |
| 182 |
var x = ((-1 * i) << 24) >> 24; |
| 183 |
if (uceFault_signextend8_2(i) || uceFault_signextend8_2(i)) |
| 184 |
assertEq(x, -99 /* = (-99 << 24) >> 24 */); |
| 185 |
assertRecoveredOnBailout(x, true); |
| 186 |
return i; |
| 187 |
} |
| 188 |
|
| 189 |
var uceFault_signextend16_1 = eval(`(${uceFault})`.replace('uceFault', 'uceFault_signextend16_1')); |
| 190 |
function rsignextend16_1(i) { |
| 191 |
var x = (i << 16) >> 16; |
| 192 |
if (uceFault_signextend16_1(i) || uceFault_signextend16_1(i)) |
| 193 |
assertEq(x, 99 /* = (99 << 16) >> 16 */); |
| 194 |
assertRecoveredOnBailout(x, true); |
| 195 |
return i; |
| 196 |
} |
| 197 |
|
| 198 |
var uceFault_signextend16_2 = eval(`(${uceFault})`.replace('uceFault', 'uceFault_signextend16_2')); |
| 199 |
function rsignextend16_2(i) { |
| 200 |
var x = ((-1 * i) << 16) >> 16; |
| 201 |
if (uceFault_signextend16_2(i) || uceFault_signextend16_2(i)) |
| 202 |
assertEq(x, -99 /* = (-99 << 16) >> 16 */); |
| 203 |
assertRecoveredOnBailout(x, true); |
| 204 |
return i; |
| 205 |
} |
| 206 |
|
| 207 |
var uceFault_add_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_add_number')); |
| 208 |
function radd_number(i) { |
| 209 |
var x = 1 + i; |
| 210 |
if (uceFault_add_number(i) || uceFault_add_number(i)) |
| 211 |
assertEq(x, 100 /* = 1 + 99 */); |
| 212 |
assertRecoveredOnBailout(x, true); |
| 213 |
return i; |
| 214 |
} |
| 215 |
|
| 216 |
var uceFault_add_float = eval(`(${uceFault})`.replace('uceFault', 'uceFault_add_float')); |
| 217 |
function radd_float(i) { |
| 218 |
var t = Math.fround(1/3); |
| 219 |
var fi = Math.fround(i); |
| 220 |
var x = Math.fround(Math.fround(Math.fround(Math.fround(t + fi) + t) + fi) + t); |
| 221 |
if (uceFault_add_float(i) || uceFault_add_float(i)) |
| 222 |
assertEq(x, 199); /* != 199.00000002980232 (when computed with double additions) */ |
| 223 |
assertRecoveredOnBailout(x, true); |
| 224 |
return i; |
| 225 |
} |
| 226 |
|
| 227 |
var uceFault_add_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_add_object')); |
| 228 |
function radd_object(i) { |
| 229 |
var t = i; |
| 230 |
var o = { valueOf: function () { return t; } }; |
| 231 |
var x = o + i; /* computed with t == i, not 1000 */ |
| 232 |
t = 1000; |
| 233 |
if (uceFault_add_object(i) || uceFault_add_object(i)) |
| 234 |
assertEq(x, 198); |
| 235 |
assertRecoveredOnBailout(x, false); |
| 236 |
return i; |
| 237 |
} |
| 238 |
|
| 239 |
var uceFault_sub_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_sub_number')); |
| 240 |
function rsub_number(i) { |
| 241 |
var x = 1 - i; |
| 242 |
if (uceFault_sub_number(i) || uceFault_sub_number(i)) |
| 243 |
assertEq(x, -98 /* = 1 - 99 */); |
| 244 |
assertRecoveredOnBailout(x, true); |
| 245 |
return i; |
| 246 |
} |
| 247 |
|
| 248 |
var uceFault_sub_float = eval(`(${uceFault})`.replace('uceFault', 'uceFault_sub_float')); |
| 249 |
function rsub_float(i) { |
| 250 |
var t = Math.fround(1/3); |
| 251 |
var fi = Math.fround(i); |
| 252 |
var x = Math.fround(Math.fround(Math.fround(Math.fround(t - fi) - t) - fi) - t); |
| 253 |
if (uceFault_sub_float(i) || uceFault_sub_float(i)) |
| 254 |
assertEq(x, -198.3333282470703); /* != -198.33333334326744 (when computed with double subtractions) */ |
| 255 |
assertRecoveredOnBailout(x, true); |
| 256 |
return i; |
| 257 |
} |
| 258 |
|
| 259 |
var uceFault_sub_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_sub_object')); |
| 260 |
function rsub_object(i) { |
| 261 |
var t = i; |
| 262 |
var o = { valueOf: function () { return t; } }; |
| 263 |
var x = o - i; /* computed with t == i, not 1000 */ |
| 264 |
t = 1000; |
| 265 |
if (uceFault_sub_object(i) || uceFault_sub_object(i)) |
| 266 |
assertEq(x, 0); |
| 267 |
assertRecoveredOnBailout(x, false); |
| 268 |
return i; |
| 269 |
} |
| 270 |
|
| 271 |
var uceFault_mul_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_mul_number')); |
| 272 |
function rmul_number(i) { |
| 273 |
var x = 2 * i; |
| 274 |
if (uceFault_mul_number(i) || uceFault_mul_number(i)) |
| 275 |
assertEq(x, 198 /* = 2 * 99 */); |
| 276 |
assertRecoveredOnBailout(x, true); |
| 277 |
return i; |
| 278 |
} |
| 279 |
|
| 280 |
var uceFault_mul_overflow = eval(`(${uceFault})`.replace('uceFault', 'uceFault_mul_overflow')); |
| 281 |
function rmul_overflow(i) { |
| 282 |
var x = Math.pow(2, i * 16 / 99) | 0; |
| 283 |
x = x * x; |
| 284 |
if (uceFault_mul_overflow(i) || uceFault_mul_overflow(i)) |
| 285 |
assertEq(x, Math.pow(2, 32)); |
| 286 |
assertRecoveredOnBailout(x, true); |
| 287 |
return i; |
| 288 |
} |
| 289 |
|
| 290 |
var uceFault_mul_float = eval(`(${uceFault})`.replace('uceFault', 'uceFault_mul_float')); |
| 291 |
function rmul_float(i) { |
| 292 |
var t = Math.fround(1/3); |
| 293 |
var fi = Math.fround(i); |
| 294 |
var x = Math.fround(Math.fround(Math.fround(Math.fround(t * fi) * t) * fi) * t); |
| 295 |
if (uceFault_mul_float(i) || uceFault_mul_float(i)) |
| 296 |
assertEq(x, 363); /* != 363.0000324547301 (when computed with double multiplications) */ |
| 297 |
assertRecoveredOnBailout(x, true); |
| 298 |
return i; |
| 299 |
} |
| 300 |
|
| 301 |
var uceFault_mul_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_mul_object')); |
| 302 |
function rmul_object(i) { |
| 303 |
var t = i; |
| 304 |
var o = { valueOf: function () { return t; } }; |
| 305 |
var x = o * i; /* computed with t == i, not 1000 */ |
| 306 |
t = 1000; |
| 307 |
if (uceFault_mul_object(i) || uceFault_mul_object(i)) |
| 308 |
assertEq(x, 9801); |
| 309 |
assertRecoveredOnBailout(x, false); |
| 310 |
return i; |
| 311 |
} |
| 312 |
|
| 313 |
var uceFault_imul_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_imul_number')); |
| 314 |
function rimul_number(i) { |
| 315 |
var x = Math.imul(2, i); |
| 316 |
if (uceFault_imul_number(i) || uceFault_imul_number(i)) |
| 317 |
assertEq(x, 198 /* = 2 * 99 */); |
| 318 |
assertRecoveredOnBailout(x, true); |
| 319 |
return i; |
| 320 |
} |
| 321 |
|
| 322 |
var uceFault_imul_overflow = eval(`(${uceFault})`.replace('uceFault', 'uceFault_imul_overflow')); |
| 323 |
function rimul_overflow(i) { |
| 324 |
var x = Math.pow(2, i * 16 / 99) | 0; |
| 325 |
x = Math.imul(x, x); |
| 326 |
if (uceFault_imul_overflow(i) || uceFault_imul_overflow(i)) |
| 327 |
assertEq(x, 0); |
| 328 |
assertRecoveredOnBailout(x, true); |
| 329 |
return i; |
| 330 |
} |
| 331 |
|
| 332 |
var uceFault_imul_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_imul_object')); |
| 333 |
function rimul_object(i) { |
| 334 |
var t = i; |
| 335 |
var o = { valueOf: function () { return t; } }; |
| 336 |
var x = Math.imul(o, i); /* computed with t == i, not 1000 */ |
| 337 |
t = 1000; |
| 338 |
if (uceFault_imul_object(i) || uceFault_imul_object(i)) |
| 339 |
assertEq(x, 9801); |
| 340 |
assertRecoveredOnBailout(x, false); |
| 341 |
return i; |
| 342 |
} |
| 343 |
|
| 344 |
var uceFault_div_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_div_number')); |
| 345 |
function rdiv_number(i) { |
| 346 |
i = i | 0; |
| 347 |
if (i < 1) { return i; } |
| 348 |
var x = 1 / i; |
| 349 |
if (uceFault_div_number(i) || uceFault_div_number(i)) |
| 350 |
assertEq(x, 0.010101010101010102 /* = 1 / 99 */); |
| 351 |
assertRecoveredOnBailout(x, true); |
| 352 |
return i; |
| 353 |
} |
| 354 |
|
| 355 |
var uceFault_div_double = eval(`(${uceFault})`.replace('uceFault', 'uceFault_div_double')); |
| 356 |
function rdiv_double(i) { |
| 357 |
var x = 1 / i; |
| 358 |
if (uceFault_div_double(i) || uceFault_div_double(i)) |
| 359 |
assertEq(x, 0.010101010101010102 /* = 1 / 99 */); |
| 360 |
assertRecoveredOnBailout(x, true); |
| 361 |
return i; |
| 362 |
} |
| 363 |
|
| 364 |
var uceFault_div_float = eval(`(${uceFault})`.replace('uceFault', 'uceFault_div_float')); |
| 365 |
function rdiv_float(i) { |
| 366 |
var t = Math.fround(1/3); |
| 367 |
var fi = Math.fround(i); |
| 368 |
var x = Math.fround(Math.fround(Math.fround(Math.fround(t / fi) / t) / fi) / t); |
| 369 |
if (uceFault_div_float(i) || uceFault_div_float(i)) |
| 370 |
assertEq(x, 0.0003060912131331861); /* != 0.0003060912060598955 (when computed with double divisions) */ |
| 371 |
assertRecoveredOnBailout(x, true); |
| 372 |
return i; |
| 373 |
} |
| 374 |
|
| 375 |
var uceFault_div_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_div_object')); |
| 376 |
function rdiv_object(i) { |
| 377 |
var t = i; |
| 378 |
var o = { valueOf: function () { return t; } }; |
| 379 |
var x = o / i; /* computed with t == i, not 1000 */ |
| 380 |
t = 1000; |
| 381 |
if (uceFault_div_object(i) || uceFault_div_object(i)) |
| 382 |
assertEq(x, 1); |
| 383 |
assertRecoveredOnBailout(x, false); |
| 384 |
return i; |
| 385 |
} |
| 386 |
|
| 387 |
var uceFault_mod_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_mod_number')); |
| 388 |
function rmod_number(i) { |
| 389 |
var x = i % 98; |
| 390 |
if (uceFault_mod_number(i) || uceFault_mod_number(i)) |
| 391 |
assertEq(x, 1); /* 99 % 98 = 1 */ |
| 392 |
assertRecoveredOnBailout(x, true); |
| 393 |
return i; |
| 394 |
} |
| 395 |
|
| 396 |
var uceFault_mod_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_mod_object')); |
| 397 |
function rmod_object(i) { |
| 398 |
var t = i; |
| 399 |
var o = { valueOf: function() { return t; } }; |
| 400 |
var x = o % 98; /* computed with t == i, not 1000 */ |
| 401 |
t = 1000; |
| 402 |
if(uceFault_mod_object(i) || uceFault_mod_object(i)) |
| 403 |
assertEq(x, 1); /* 99 % 98 = 1 */ |
| 404 |
assertRecoveredOnBailout(x, false); |
| 405 |
return i; |
| 406 |
} |
| 407 |
|
| 408 |
var uceFault_not_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_not_number')); |
| 409 |
function rnot_number(i) { |
| 410 |
var x = !i; |
| 411 |
if (uceFault_not_number(i) || uceFault_not_number(i)) |
| 412 |
assertEq(x, false /* = !99 */); |
| 413 |
assertRecoveredOnBailout(x, true); |
| 414 |
return i; |
| 415 |
} |
| 416 |
|
| 417 |
var uceFault_not_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_not_object')); |
| 418 |
function rnot_object(i) { |
| 419 |
var o = createIsHTMLDDA(); |
| 420 |
var x = !o; |
| 421 |
if(uceFault_not_object(i) || uceFault_not_object(i)) |
| 422 |
assertEq(x, true /* = !undefined = !document.all = !createIsHTMLDDA() */); |
| 423 |
assertRecoveredOnBailout(x, true); |
| 424 |
return i; |
| 425 |
} |
| 426 |
|
| 427 |
let uceFault_not_bigint_intptr = eval(`(${uceFault})`.replace('uceFault', 'uceFault_not_bigint_intptr')); |
| 428 |
function rnot_bigint_intptr(i) { |
| 429 |
var y = BigInt(i) + 1n; |
| 430 |
var x = !y; |
| 431 |
if (uceFault_not_bigint_intptr(i) || uceFault_not_bigint_intptr(i)) |
| 432 |
assertEq(x, false /* = !100n */); |
| 433 |
assertRecoveredOnBailout(x, true); |
| 434 |
return y; |
| 435 |
} |
| 436 |
|
| 437 |
let uceFault_not_bigint_int64 = eval(`(${uceFault})`.replace('uceFault', 'uceFault_not_bigint_int64')); |
| 438 |
function rnot_bigint_int64(i) { |
| 439 |
var ta = new BigInt64Array(1); |
| 440 |
var y = ta[0]; |
| 441 |
var x = !y; |
| 442 |
if (uceFault_not_bigint_int64(i) || uceFault_not_bigint_int64(i)) |
| 443 |
assertEq(x, true /* = !0n */); |
| 444 |
assertRecoveredOnBailout(x, true); |
| 445 |
return y; |
| 446 |
} |
| 447 |
|
| 448 |
var uceFault_compare_number_eq = eval(`(${uceFault})`.replace('uceFault', 'uceFault_compare_number_eq')); |
| 449 |
function rcompare_number_eq(i) { |
| 450 |
var x = i == 99; |
| 451 |
if (uceFault_compare_number_eq(i) || uceFault_compare_number_eq(i)) |
| 452 |
assertEq(x, true); |
| 453 |
assertRecoveredOnBailout(x, true); |
| 454 |
return i; |
| 455 |
} |
| 456 |
|
| 457 |
var uceFault_compare_number_stricteq = eval(`(${uceFault})`.replace('uceFault', 'uceFault_compare_number_stricteq')); |
| 458 |
function rcompare_number_stricteq(i) { |
| 459 |
var x = i === 99; |
| 460 |
if (uceFault_compare_number_stricteq(i) || uceFault_compare_number_stricteq(i)) |
| 461 |
assertEq(x, true); |
| 462 |
assertRecoveredOnBailout(x, true); |
| 463 |
return i; |
| 464 |
} |
| 465 |
|
| 466 |
var uceFault_compare_number_ne = eval(`(${uceFault})`.replace('uceFault', 'uceFault_compare_number_ne')); |
| 467 |
function rcompare_number_ne(i) { |
| 468 |
var x = i != 99; |
| 469 |
if (uceFault_compare_number_ne(i) || uceFault_compare_number_ne(i)) |
| 470 |
assertEq(x, false); |
| 471 |
assertRecoveredOnBailout(x, true); |
| 472 |
return i; |
| 473 |
} |
| 474 |
|
| 475 |
var uceFault_compare_number_strictne = eval(`(${uceFault})`.replace('uceFault', 'uceFault_compare_number_strictne')); |
| 476 |
function rcompare_number_strictne(i) { |
| 477 |
var x = i !== 99; |
| 478 |
if (uceFault_compare_number_strictne(i) || uceFault_compare_number_strictne(i)) |
| 479 |
assertEq(x, false); |
| 480 |
assertRecoveredOnBailout(x, true); |
| 481 |
return i; |
| 482 |
} |
| 483 |
|
| 484 |
var uceFault_compare_number_lt = eval(`(${uceFault})`.replace('uceFault', 'uceFault_compare_number_lt')); |
| 485 |
function rcompare_number_lt(i) { |
| 486 |
var x = i < 99; |
| 487 |
if (uceFault_compare_number_lt(i) || uceFault_compare_number_lt(i)) |
| 488 |
assertEq(x, false); |
| 489 |
assertRecoveredOnBailout(x, true); |
| 490 |
return i; |
| 491 |
} |
| 492 |
|
| 493 |
var uceFault_compare_number_le = eval(`(${uceFault})`.replace('uceFault', 'uceFault_compare_number_le')); |
| 494 |
function rcompare_number_le(i) { |
| 495 |
var x = i <= 99; |
| 496 |
if (uceFault_compare_number_le(i) || uceFault_compare_number_le(i)) |
| 497 |
assertEq(x, true); |
| 498 |
assertRecoveredOnBailout(x, true); |
| 499 |
return i; |
| 500 |
} |
| 501 |
|
| 502 |
var uceFault_compare_number_gt = eval(`(${uceFault})`.replace('uceFault', 'uceFault_compare_number_gt')); |
| 503 |
function rcompare_number_gt(i) { |
| 504 |
var x = i > 99; |
| 505 |
if (uceFault_compare_number_gt(i) || uceFault_compare_number_gt(i)) |
| 506 |
assertEq(x, false); |
| 507 |
assertRecoveredOnBailout(x, true); |
| 508 |
return i; |
| 509 |
} |
| 510 |
|
| 511 |
var uceFault_compare_number_ge = eval(`(${uceFault})`.replace('uceFault', 'uceFault_compare_number_ge')); |
| 512 |
function rcompare_number_ge(i) { |
| 513 |
var x = i >= 99; |
| 514 |
if (uceFault_compare_number_ge(i) || uceFault_compare_number_ge(i)) |
| 515 |
assertEq(x, true); |
| 516 |
assertRecoveredOnBailout(x, true); |
| 517 |
return i; |
| 518 |
} |
| 519 |
|
| 520 |
var uceFault_compare_string_eq = eval(`(${uceFault})`.replace('uceFault', 'uceFault_compare_string_eq')); |
| 521 |
function rcompare_string_eq(i) { |
| 522 |
var x = String(i) == "99"; |
| 523 |
if (uceFault_compare_string_eq(i) || uceFault_compare_string_eq(i)) |
| 524 |
assertEq(x, true); |
| 525 |
assertRecoveredOnBailout(x, true); |
| 526 |
return i; |
| 527 |
} |
| 528 |
|
| 529 |
var uceFault_compare_string_stricteq = eval(`(${uceFault})`.replace('uceFault', 'uceFault_compare_string_stricteq')); |
| 530 |
function rcompare_string_stricteq(i) { |
| 531 |
var x = String(i) === "99"; |
| 532 |
if (uceFault_compare_string_stricteq(i) || uceFault_compare_string_stricteq(i)) |
| 533 |
assertEq(x, true); |
| 534 |
assertRecoveredOnBailout(x, true); |
| 535 |
return i; |
| 536 |
} |
| 537 |
|
| 538 |
var uceFault_compare_string_ne = eval(`(${uceFault})`.replace('uceFault', 'uceFault_compare_string_ne')); |
| 539 |
function rcompare_string_ne(i) { |
| 540 |
var x = String(i) != "99"; |
| 541 |
if (uceFault_compare_string_ne(i) || uceFault_compare_string_ne(i)) |
| 542 |
assertEq(x, false); |
| 543 |
assertRecoveredOnBailout(x, true); |
| 544 |
return i; |
| 545 |
} |
| 546 |
|
| 547 |
var uceFault_compare_string_strictne = eval(`(${uceFault})`.replace('uceFault', 'uceFault_compare_string_strictne')); |
| 548 |
function rcompare_string_strictne(i) { |
| 549 |
var x = String(i) !== "99"; |
| 550 |
if (uceFault_compare_string_strictne(i) || uceFault_compare_string_strictne(i)) |
| 551 |
assertEq(x, false); |
| 552 |
assertRecoveredOnBailout(x, true); |
| 553 |
return i; |
| 554 |
} |
| 555 |
|
| 556 |
var uceFault_compare_string_lt = eval(`(${uceFault})`.replace('uceFault', 'uceFault_compare_string_lt')); |
| 557 |
function rcompare_string_lt(i) { |
| 558 |
var x = String(i) < "99"; |
| 559 |
if (uceFault_compare_string_lt(i) || uceFault_compare_string_lt(i)) |
| 560 |
assertEq(x, false); |
| 561 |
assertRecoveredOnBailout(x, true); |
| 562 |
return i; |
| 563 |
} |
| 564 |
|
| 565 |
var uceFault_compare_string_le = eval(`(${uceFault})`.replace('uceFault', 'uceFault_compare_string_le')); |
| 566 |
function rcompare_string_le(i) { |
| 567 |
var x = String(i) <= "99"; |
| 568 |
if (uceFault_compare_string_le(i) || uceFault_compare_string_le(i)) |
| 569 |
assertEq(x, true); |
| 570 |
assertRecoveredOnBailout(x, true); |
| 571 |
return i; |
| 572 |
} |
| 573 |
|
| 574 |
var uceFault_compare_string_gt = eval(`(${uceFault})`.replace('uceFault', 'uceFault_compare_string_gt')); |
| 575 |
function rcompare_string_gt(i) { |
| 576 |
var x = String(i) > "99"; |
| 577 |
if (uceFault_compare_string_gt(i) || uceFault_compare_string_gt(i)) |
| 578 |
assertEq(x, false); |
| 579 |
assertRecoveredOnBailout(x, true); |
| 580 |
return i; |
| 581 |
} |
| 582 |
|
| 583 |
var uceFault_compare_string_ge = eval(`(${uceFault})`.replace('uceFault', 'uceFault_compare_string_ge')); |
| 584 |
function rcompare_string_ge(i) { |
| 585 |
var x = String(i) >= "99"; |
| 586 |
if (uceFault_compare_string_ge(i) || uceFault_compare_string_ge(i)) |
| 587 |
assertEq(x, true); |
| 588 |
assertRecoveredOnBailout(x, true); |
| 589 |
return i; |
| 590 |
} |
| 591 |
|
| 592 |
var uceFault_compare_bigint_eq = eval(`(${uceFault})`.replace('uceFault', 'uceFault_compare_bigint_eq')); |
| 593 |
function rcompare_bigint_eq(i, bi) { |
| 594 |
var x = bi == 99n; |
| 595 |
if (uceFault_compare_bigint_eq(i) || uceFault_compare_bigint_eq(i)) |
| 596 |
assertEq(x, true); |
| 597 |
assertRecoveredOnBailout(x, true); |
| 598 |
return i; |
| 599 |
} |
| 600 |
|
| 601 |
var uceFault_compare_bigint_stricteq = eval(`(${uceFault})`.replace('uceFault', 'uceFault_compare_bigint_stricteq')); |
| 602 |
function rcompare_bigint_stricteq(i, bi) { |
| 603 |
var x = bi === 99n; |
| 604 |
if (uceFault_compare_bigint_stricteq(i) || uceFault_compare_bigint_stricteq(i)) |
| 605 |
assertEq(x, true); |
| 606 |
assertRecoveredOnBailout(x, true); |
| 607 |
return i; |
| 608 |
} |
| 609 |
|
| 610 |
var uceFault_compare_bigint_ne = eval(`(${uceFault})`.replace('uceFault', 'uceFault_compare_bigint_ne')); |
| 611 |
function rcompare_bigint_ne(i, bi) { |
| 612 |
var x = bi != 99n; |
| 613 |
if (uceFault_compare_bigint_ne(i) || uceFault_compare_bigint_ne(i)) |
| 614 |
assertEq(x, false); |
| 615 |
assertRecoveredOnBailout(x, true); |
| 616 |
return i; |
| 617 |
} |
| 618 |
|
| 619 |
var uceFault_compare_bigint_strictne = eval(`(${uceFault})`.replace('uceFault', 'uceFault_compare_bigint_strictne')); |
| 620 |
function rcompare_bigint_strictne(i, bi) { |
| 621 |
var x = bi !== 99n; |
| 622 |
if (uceFault_compare_bigint_strictne(i) || uceFault_compare_bigint_strictne(i)) |
| 623 |
assertEq(x, false); |
| 624 |
assertRecoveredOnBailout(x, true); |
| 625 |
return i; |
| 626 |
} |
| 627 |
|
| 628 |
var uceFault_compare_bigint_lt = eval(`(${uceFault})`.replace('uceFault', 'uceFault_compare_bigint_lt')); |
| 629 |
function rcompare_bigint_lt(i, bi) { |
| 630 |
var x = bi < 99n; |
| 631 |
if (uceFault_compare_bigint_lt(i) || uceFault_compare_bigint_lt(i)) |
| 632 |
assertEq(x, false); |
| 633 |
assertRecoveredOnBailout(x, true); |
| 634 |
return i; |
| 635 |
} |
| 636 |
|
| 637 |
var uceFault_compare_bigint_le = eval(`(${uceFault})`.replace('uceFault', 'uceFault_compare_bigint_le')); |
| 638 |
function rcompare_bigint_le(i, bi) { |
| 639 |
var x = bi <= 99n; |
| 640 |
if (uceFault_compare_bigint_le(i) || uceFault_compare_bigint_le(i)) |
| 641 |
assertEq(x, true); |
| 642 |
assertRecoveredOnBailout(x, true); |
| 643 |
return i; |
| 644 |
} |
| 645 |
|
| 646 |
var uceFault_compare_bigint_gt = eval(`(${uceFault})`.replace('uceFault', 'uceFault_compare_bigint_gt')); |
| 647 |
function rcompare_bigint_gt(i, bi) { |
| 648 |
var x = bi > 99n; |
| 649 |
if (uceFault_compare_bigint_gt(i) || uceFault_compare_bigint_gt(i)) |
| 650 |
assertEq(x, false); |
| 651 |
assertRecoveredOnBailout(x, true); |
| 652 |
return i; |
| 653 |
} |
| 654 |
|
| 655 |
var uceFault_compare_bigint_ge = eval(`(${uceFault})`.replace('uceFault', 'uceFault_compare_bigint_ge')); |
| 656 |
function rcompare_bigint_ge(i, bi) { |
| 657 |
var x = bi >= 99n; |
| 658 |
if (uceFault_compare_bigint_ge(i) || uceFault_compare_bigint_ge(i)) |
| 659 |
assertEq(x, true); |
| 660 |
assertRecoveredOnBailout(x, true); |
| 661 |
return i; |
| 662 |
} |
| 663 |
|
| 664 |
var uceFault_concat_string = eval(`(${uceFault})`.replace('uceFault', 'uceFault_concat_string')); |
| 665 |
function rconcat_string(i) { |
| 666 |
var x = "s" + i.toString(); |
| 667 |
if (uceFault_concat_string(i) || uceFault_concat_string(i)) |
| 668 |
assertEq(x, "s99"); |
| 669 |
assertRecoveredOnBailout(x, true); |
| 670 |
return i; |
| 671 |
} |
| 672 |
|
| 673 |
var uceFault_concat_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_concat_number')); |
| 674 |
function rconcat_number(i) { |
| 675 |
var x = "s" + i; |
| 676 |
if (uceFault_concat_number(i) || uceFault_concat_number(i)) |
| 677 |
assertEq(x, "s99"); |
| 678 |
assertRecoveredOnBailout(x, true); |
| 679 |
return i; |
| 680 |
} |
| 681 |
|
| 682 |
var uceFault_string_length = eval(`(${uceFault})`.replace('uceFault', 'uceFault_string_length')); |
| 683 |
function rstring_length(i) { |
| 684 |
var x = i.toString().length; |
| 685 |
if (uceFault_string_length(i) || uceFault_string_length(i)) |
| 686 |
assertEq(x, 2); |
| 687 |
assertRecoveredOnBailout(x, true); |
| 688 |
return i; |
| 689 |
} |
| 690 |
|
| 691 |
var uceFault_arguments_length_1 = eval(`(${uceFault})`.replace('uceFault', 'uceFault_arguments_length_1')); |
| 692 |
function rarguments_length_1(i) { |
| 693 |
var x = arguments.length; |
| 694 |
if (uceFault_arguments_length_1(i) || uceFault_arguments_length_1(i)) |
| 695 |
assertEq(x, 1); |
| 696 |
assertRecoveredOnBailout(x, true); |
| 697 |
return i; |
| 698 |
} |
| 699 |
|
| 700 |
var uceFault_arguments_length_3 = eval(`(${uceFault})`.replace('uceFault', 'uceFault_arguments_length_3')); |
| 701 |
function rarguments_length_3(i) { |
| 702 |
var x = arguments.length; |
| 703 |
if (uceFault_arguments_length_3(i) || uceFault_arguments_length_3(i)) |
| 704 |
assertEq(x, 3); |
| 705 |
assertRecoveredOnBailout(x, true); |
| 706 |
return i; |
| 707 |
} |
| 708 |
|
| 709 |
function ret_argumentsLength() { return arguments.length; } |
| 710 |
|
| 711 |
var uceFault_inline_arguments_length_1 = eval(`(${uceFault})`.replace('uceFault', 'uceFault_inline_arguments_length_1')); |
| 712 |
function rinline_arguments_length_1(i) { |
| 713 |
var x = ret_argumentsLength.apply(this, arguments); |
| 714 |
if (uceFault_inline_arguments_length_1(i) || uceFault_inline_arguments_length_1(i)) |
| 715 |
assertEq(x, 1); |
| 716 |
// We cannot garantee that the function would be inlined |
| 717 |
// assertRecoveredOnBailout(x, true); |
| 718 |
return i; |
| 719 |
} |
| 720 |
|
| 721 |
var uceFault_inline_arguments_length_3 = eval(`(${uceFault})`.replace('uceFault', 'uceFault_inline_arguments_length_3')); |
| 722 |
function rinline_arguments_length_3(i) { |
| 723 |
var x = ret_argumentsLength.apply(this, arguments); |
| 724 |
if (uceFault_inline_arguments_length_3(i) || uceFault_inline_arguments_length_3(i)) |
| 725 |
assertEq(x, 3); |
| 726 |
// We cannot garantee that the function would be inlined |
| 727 |
// assertRecoveredOnBailout(x, true); |
| 728 |
return i; |
| 729 |
} |
| 730 |
|
| 731 |
var uceFault_floor_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_floor_number')); |
| 732 |
function rfloor_number(i) { |
| 733 |
var x = Math.floor(i + 0.1111); |
| 734 |
if (uceFault_floor_number(i) || uceFault_floor_number(i)) |
| 735 |
assertEq(x, i); |
| 736 |
assertRecoveredOnBailout(x, true); |
| 737 |
return i; |
| 738 |
} |
| 739 |
|
| 740 |
var uceFault_floor_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_floor_object')); |
| 741 |
function rfloor_object(i) { |
| 742 |
var t = i + 0.1111; |
| 743 |
var o = { valueOf: function () { return t; } }; |
| 744 |
var x = Math.floor(o); |
| 745 |
t = 1000.1111; |
| 746 |
if (uceFault_floor_object(i) || uceFault_floor_object(i)) |
| 747 |
assertEq(x, i); |
| 748 |
assertRecoveredOnBailout(x, false); |
| 749 |
return i; |
| 750 |
} |
| 751 |
|
| 752 |
let uceFault_floor_double = eval(`(${uceFault})`.replace('uceFault', 'uceFault_floor_double')); |
| 753 |
function rfloor_double(i) { |
| 754 |
const x = Math.floor(i + (-1 >>> 0)); |
| 755 |
if (uceFault_floor_double(i) || uceFault_floor_double(i)) |
| 756 |
assertEq(x, 99 + (-1 >>> 0)); /* = i + 2 ^ 32 - 1 */ |
| 757 |
assertRecoveredOnBailout(x, true); |
| 758 |
return i; |
| 759 |
} |
| 760 |
|
| 761 |
var uceFault_ceil_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_ceil_number')); |
| 762 |
function rceil_number(i) { |
| 763 |
var x = Math.ceil(-i - 0.12010799100); |
| 764 |
if (uceFault_ceil_number(i) || uceFault_ceil_number(i)) |
| 765 |
assertEq(x, -i); |
| 766 |
assertRecoveredOnBailout(x, true); |
| 767 |
return i; |
| 768 |
} |
| 769 |
|
| 770 |
let uceFault_ceil_double = eval(`(${uceFault})`.replace('uceFault', 'uceFault_ceil_double')); |
| 771 |
function rceil_double(i) { |
| 772 |
const x = Math.ceil(i + (-1 >>> 0)); |
| 773 |
if (uceFault_ceil_double(i) || uceFault_ceil_double(i)) |
| 774 |
assertEq(x, 99 + (-1 >>> 0)); /* = i + 2 ^ 32 - 1 */ |
| 775 |
assertRecoveredOnBailout(x, true); |
| 776 |
return i; |
| 777 |
} |
| 778 |
|
| 779 |
var uceFault_round_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_round')); |
| 780 |
function rround_number(i) { |
| 781 |
var x = Math.round(i + 1.4); |
| 782 |
if (uceFault_round_number(i) || uceFault_round_number(i)) |
| 783 |
assertEq(x, 100); /* = i + 1*/ |
| 784 |
assertRecoveredOnBailout(x, true); |
| 785 |
return i; |
| 786 |
} |
| 787 |
|
| 788 |
var uceFault_round_double = eval(`(${uceFault})`.replace('uceFault', 'uceFault_round_double')); |
| 789 |
function rround_double(i) { |
| 790 |
var x = Math.round(i + (-1 >>> 0)); |
| 791 |
if (uceFault_round_double(i) || uceFault_round_double(i)) |
| 792 |
assertEq(x, 99 + (-1 >>> 0)); /* = i + 2 ^ 32 - 1 */ |
| 793 |
assertRecoveredOnBailout(x, true); |
| 794 |
return i; |
| 795 |
} |
| 796 |
|
| 797 |
var uceFault_trunc_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_trunc_number')); |
| 798 |
function rtrunc_number(i) { |
| 799 |
var x = Math.trunc(-i - 0.12010799100); |
| 800 |
if (uceFault_trunc_number(i) || uceFault_trunc_number(i)) |
| 801 |
assertEq(x, -i); |
| 802 |
assertRecoveredOnBailout(x, true); |
| 803 |
return i; |
| 804 |
} |
| 805 |
|
| 806 |
let uceFault_trunc_double = eval(`(${uceFault})`.replace('uceFault', 'uceFault_trunc_double')); |
| 807 |
function rtrunc_double(i) { |
| 808 |
const x = Math.trunc(i + (-1 >>> 0)); |
| 809 |
if (uceFault_trunc_double(i) || uceFault_trunc_double(i)) |
| 810 |
assertEq(x, 99 + (-1 >>> 0)); /* = i + 2 ^ 32 - 1 */ |
| 811 |
assertRecoveredOnBailout(x, true); |
| 812 |
return i; |
| 813 |
} |
| 814 |
|
| 815 |
var uceFault_Char_Code_At = eval(`(${uceFault})`.replace('uceFault', 'uceFault_Char_Code_At')); |
| 816 |
function rcharCodeAt(i) { |
| 817 |
var s = "aaaaa"; |
| 818 |
var x = s.charCodeAt(i % 4); |
| 819 |
if (uceFault_Char_Code_At(i) || uceFault_Char_Code_At(i)) |
| 820 |
assertEq(x, 97 ); |
| 821 |
assertRecoveredOnBailout(x, true); |
| 822 |
return i; |
| 823 |
} |
| 824 |
|
| 825 |
var uceFault_from_char_code = eval(`(${uceFault})`.replace('uceFault', 'uceFault_from_char_code')); |
| 826 |
function rfrom_char_code(i) { |
| 827 |
var x = String.fromCharCode(i); |
| 828 |
if (uceFault_from_char_code(i) || uceFault_from_char_code(i)) |
| 829 |
assertEq(x, "c"); |
| 830 |
assertRecoveredOnBailout(x, true); |
| 831 |
return i; |
| 832 |
} |
| 833 |
|
| 834 |
var uceFault_from_char_code_non_ascii = eval(`(${uceFault})`.replace('uceFault', 'uceFault_from_char_code_non_ascii')); |
| 835 |
function rfrom_char_code_non_ascii(i) { |
| 836 |
var x = String.fromCharCode(i * 100); |
| 837 |
if (uceFault_from_char_code_non_ascii(i) || uceFault_from_char_code_non_ascii(i)) |
| 838 |
assertEq(x, "\u26AC"); |
| 839 |
assertRecoveredOnBailout(x, true); |
| 840 |
return i; |
| 841 |
} |
| 842 |
|
| 843 |
var uceFault_pow_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_pow_number')); |
| 844 |
function rpow_number(i) { |
| 845 |
var x = Math.pow(i, 3.14159); |
| 846 |
if (uceFault_pow_number(i) || uceFault_pow_number(i)) |
| 847 |
assertEq(x, Math.pow(99, 3.14159)); |
| 848 |
assertRecoveredOnBailout(x, true); |
| 849 |
return i; |
| 850 |
} |
| 851 |
|
| 852 |
var uceFault_pow_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_pow_object')); |
| 853 |
function rpow_object(i) { |
| 854 |
var t = i; |
| 855 |
var o = { valueOf: function () { return t; } }; |
| 856 |
var x = Math.pow(o, 3.14159); /* computed with t == i, not 1.5 */ |
| 857 |
t = 1.5; |
| 858 |
if (uceFault_pow_object(i) || uceFault_pow_object(i)) |
| 859 |
assertEq(x, Math.pow(99, 3.14159)); |
| 860 |
assertRecoveredOnBailout(x, false); |
| 861 |
return i; |
| 862 |
} |
| 863 |
|
| 864 |
var uceFault_powhalf_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_powhalf_number')); |
| 865 |
function rpowhalf_number(i) { |
| 866 |
var x = Math.pow(i, 0.5); |
| 867 |
if (uceFault_powhalf_number(i) || uceFault_powhalf_number(i)) |
| 868 |
assertEq(x, Math.pow(99, 0.5)); |
| 869 |
assertRecoveredOnBailout(x, true); |
| 870 |
return i; |
| 871 |
} |
| 872 |
|
| 873 |
var uceFault_powhalf_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_powhalf_object')); |
| 874 |
function rpowhalf_object(i) { |
| 875 |
var t = i; |
| 876 |
var o = { valueOf: function () { return t; } }; |
| 877 |
var x = Math.pow(o, 0.5); /* computed with t == i, not 1.5 */ |
| 878 |
t = 1.5; |
| 879 |
if (uceFault_powhalf_object(i) || uceFault_powhalf_object(i)) |
| 880 |
assertEq(x, Math.pow(99, 0.5)); |
| 881 |
assertRecoveredOnBailout(x, false); |
| 882 |
return i; |
| 883 |
} |
| 884 |
|
| 885 |
var uceFault_min_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_min_number')); |
| 886 |
function rmin_number(i) { |
| 887 |
var x = Math.min(i, i-1, i-2.1); |
| 888 |
if (uceFault_min_number(i) || uceFault_min_number(i)) |
| 889 |
assertEq(x, i-2.1); |
| 890 |
assertRecoveredOnBailout(x, true); |
| 891 |
return i; |
| 892 |
} |
| 893 |
|
| 894 |
var uceFault_min_float = eval(`(${uceFault})`.replace('uceFault', 'uceFault_min_float')); |
| 895 |
function rmin_float(i) { |
| 896 |
var x = Math.fround(Math.min(Math.fround(i), Math.fround(13.37))); |
| 897 |
if (uceFault_min_number(i) || uceFault_min_number(i)) |
| 898 |
assertEq(x, Math.fround(13.37)); |
| 899 |
assertRecoveredOnBailout(x, true); |
| 900 |
return i; |
| 901 |
} |
| 902 |
|
| 903 |
var uceFault_min_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_min_object')); |
| 904 |
function rmin_object(i) { |
| 905 |
var t = i; |
| 906 |
var o = { valueOf: function () { return t; } }; |
| 907 |
var x = Math.min(o, o-1, o-2.1) |
| 908 |
t = 1000; |
| 909 |
if (uceFault_min_object(i) || uceFault_min_object(i)) |
| 910 |
assertEq(x, i-2.1); |
| 911 |
assertRecoveredOnBailout(x, false); |
| 912 |
return i; |
| 913 |
} |
| 914 |
|
| 915 |
var uceFault_max_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_max_number')); |
| 916 |
function rmax_number(i) { |
| 917 |
var x = Math.max(i, i-1, i-2.1); |
| 918 |
if (uceFault_max_number(i) || uceFault_max_number(i)) |
| 919 |
assertEq(x, i); |
| 920 |
assertRecoveredOnBailout(x, true); |
| 921 |
return i; |
| 922 |
} |
| 923 |
|
| 924 |
var uceFault_max_float = eval(`(${uceFault})`.replace('uceFault', 'uceFault_max_float')); |
| 925 |
function rmax_float(i) { |
| 926 |
var x = Math.fround(Math.max(Math.fround(-i), Math.fround(13.37))); |
| 927 |
if (uceFault_max_number(i) || uceFault_max_number(i)) |
| 928 |
assertEq(x, Math.fround(13.37)); |
| 929 |
assertRecoveredOnBailout(x, true); |
| 930 |
return i; |
| 931 |
} |
| 932 |
|
| 933 |
var uceFault_max_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_max_object')); |
| 934 |
function rmax_object(i) { |
| 935 |
var t = i; |
| 936 |
var o = { valueOf: function () { return t; } }; |
| 937 |
var x = Math.max(o, o-1, o-2.1) |
| 938 |
t = 1000; |
| 939 |
if (uceFault_max_object(i) || uceFault_max_object(i)) |
| 940 |
assertEq(x, i); |
| 941 |
assertRecoveredOnBailout(x, false); |
| 942 |
return i; |
| 943 |
} |
| 944 |
|
| 945 |
var uceFault_abs = eval(`(${uceFault})`.replace('uceFault', 'uceFault_abs')); |
| 946 |
function rabs_number(i) { |
| 947 |
var x = Math.abs(i-42); |
| 948 |
if (uceFault_abs(i) || uceFault_abs(i)) |
| 949 |
assertEq(x, 57); |
| 950 |
assertRecoveredOnBailout(x, true); |
| 951 |
return i; |
| 952 |
} |
| 953 |
|
| 954 |
var uceFault_abs_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_abs_object')); |
| 955 |
function rabs_object(i) { |
| 956 |
var t = -i; |
| 957 |
var o = { valueOf: function() { return t; } }; |
| 958 |
var x = Math.abs(o); /* computed with t == i, not 1000 */ |
| 959 |
t = 1000; |
| 960 |
if(uceFault_abs_object(i) || uceFault_abs_object(i)) |
| 961 |
assertEq(x, 99); |
| 962 |
assertRecoveredOnBailout(x, false); |
| 963 |
return i; |
| 964 |
} |
| 965 |
|
| 966 |
var uceFault_sqrt_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_sqrt_number')); |
| 967 |
function rsqrt_number(i) { |
| 968 |
var x = Math.sqrt(i); |
| 969 |
if (uceFault_sqrt_number(i) || uceFault_sqrt_number(i)) |
| 970 |
assertEq(x, Math.sqrt(99)); |
| 971 |
assertRecoveredOnBailout(x, true); |
| 972 |
return i; |
| 973 |
} |
| 974 |
|
| 975 |
var uceFault_sqrt_float = eval(`(${uceFault})`.replace('uceFault', 'uceFault_sqrt_float')); |
| 976 |
function rsqrt_float(i) { |
| 977 |
var x = Math.fround(Math.sqrt(Math.fround(i))); |
| 978 |
if (uceFault_sqrt_float(i) || uceFault_sqrt_float(i)) |
| 979 |
assertEq(x, Math.fround(Math.sqrt(Math.fround(99)))); /* != 9.9498743710662 (when computed with double sqrt) */ |
| 980 |
assertRecoveredOnBailout(x, true); |
| 981 |
return i; |
| 982 |
} |
| 983 |
|
| 984 |
var uceFault_sqrt_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_sqrt_object')); |
| 985 |
function rsqrt_object(i) { |
| 986 |
var t = i; |
| 987 |
var o = { valueOf: function () { return t; } }; |
| 988 |
var x = Math.sqrt(o); /* computed with t == i, not 1.5 */ |
| 989 |
t = 1.5; |
| 990 |
if (uceFault_sqrt_object(i) || uceFault_sqrt_object(i)) |
| 991 |
assertEq(x, Math.sqrt(99)); |
| 992 |
assertRecoveredOnBailout(x, false); |
| 993 |
return i; |
| 994 |
} |
| 995 |
|
| 996 |
var uceFault_atan2_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_atan2_number')); |
| 997 |
function ratan2_number(i) { |
| 998 |
var x = Math.atan2(i, i+1); |
| 999 |
if (uceFault_atan2_number(i) || uceFault_atan2_number(i)) |
| 1000 |
assertEq(x, Math.atan2(99, 100)); |
| 1001 |
assertRecoveredOnBailout(x, true); |
| 1002 |
return i; |
| 1003 |
} |
| 1004 |
|
| 1005 |
var uceFault_atan2_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_atan2_object')); |
| 1006 |
function ratan2_object(i) { |
| 1007 |
var t = i; |
| 1008 |
var o = { valueOf: function () { return t; } }; |
| 1009 |
var x = Math.atan2(o, o+1); |
| 1010 |
t = 1000; |
| 1011 |
if (uceFault_atan2_object(i) || uceFault_atan2_object(i)) |
| 1012 |
assertEq(x, Math.atan2(i, i+1)); |
| 1013 |
assertRecoveredOnBailout(x, false); |
| 1014 |
return i; |
| 1015 |
} |
| 1016 |
|
| 1017 |
var uceFault_str_split = eval(`(${uceFault})`.replace('uceFault', 'uceFault_str_split')) |
| 1018 |
function rstr_split(i) { |
| 1019 |
var x = "str01234567899876543210rts".split("" + i); |
| 1020 |
if (uceFault_str_split(i) || uceFault_str_split(i)) |
| 1021 |
assertEq(x[0], "str012345678"); |
| 1022 |
assertRecoveredOnBailout(x, true); |
| 1023 |
return i; |
| 1024 |
} |
| 1025 |
|
| 1026 |
var uceFault_regexp_exec = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_exec')) |
| 1027 |
function rregexp_exec(i) { |
| 1028 |
var re = new RegExp("(str)\\d+" + i + "\\d+rts"); |
| 1029 |
var res = re.exec("str01234567899876543210rts"); |
| 1030 |
if (uceFault_regexp_exec(i) || uceFault_regexp_exec(i)) |
| 1031 |
assertEq(res[1], "str"); |
| 1032 |
assertRecoveredOnBailout(res, false); |
| 1033 |
return i; |
| 1034 |
} |
| 1035 |
var uceFault_regexp_y_exec = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_y_exec')) |
| 1036 |
function rregexp_y_exec(i) { |
| 1037 |
var re = new RegExp("(str)\\d+" + (i % 10), "y"); |
| 1038 |
var res = re.exec("str00123456789"); |
| 1039 |
if (uceFault_regexp_y_exec(i) || uceFault_regexp_y_exec(i)) |
| 1040 |
assertEq(res[1], "str"); |
| 1041 |
assertRecoveredOnBailout(res, false); |
| 1042 |
assertEq(re.lastIndex == 0, false); |
| 1043 |
return i; |
| 1044 |
} |
| 1045 |
|
| 1046 |
var uceFault_regexp_y_literal_exec = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_y_literal_exec')) |
| 1047 |
function rregexp_y_literal_exec(i) { |
| 1048 |
var re = /(str)\d*0/y; |
| 1049 |
var res = re.exec("str00123456789"); |
| 1050 |
if (uceFault_regexp_y_literal_exec(i) || uceFault_regexp_y_literal_exec(i)) |
| 1051 |
assertEq(res[1], "str"); |
| 1052 |
assertRecoveredOnBailout(res, false); |
| 1053 |
assertEq(re.lastIndex == 0, false); |
| 1054 |
return i; |
| 1055 |
} |
| 1056 |
|
| 1057 |
var uceFault_regexp_g_exec = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_g_exec')) |
| 1058 |
function rregexp_g_exec(i) { |
| 1059 |
var re = new RegExp("(str)\\d+" + (i % 10), "g"); |
| 1060 |
var res = re.exec("str00123456789str00123456789"); |
| 1061 |
if (uceFault_regexp_g_exec(i) || uceFault_regexp_g_exec(i)) |
| 1062 |
assertEq(res[1], "str"); |
| 1063 |
assertRecoveredOnBailout(res, false); |
| 1064 |
assertEq(re.lastIndex == 0, false); |
| 1065 |
return i; |
| 1066 |
} |
| 1067 |
|
| 1068 |
var uceFault_regexp_g_literal_exec = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_g_literal_exec')) |
| 1069 |
function rregexp_g_literal_exec(i) { |
| 1070 |
var re = /(str)\d*0/g; |
| 1071 |
var res = re.exec("str00123456789str00123456789"); |
| 1072 |
if (uceFault_regexp_g_literal_exec(i) || uceFault_regexp_g_literal_exec(i)) |
| 1073 |
assertEq(res[1], "str"); |
| 1074 |
assertRecoveredOnBailout(res, false); |
| 1075 |
assertEq(re.lastIndex == 0, false); |
| 1076 |
return i; |
| 1077 |
} |
| 1078 |
|
| 1079 |
var uceFault_regexp_i_exec = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_i_exec')) |
| 1080 |
function rregexp_i_exec(i) { |
| 1081 |
var re = new RegExp("(str)\\d+" + (i % 10), "i"); |
| 1082 |
var res = re.exec("STR00123456789"); |
| 1083 |
if (uceFault_regexp_i_exec(i) || uceFault_regexp_i_exec(i)) |
| 1084 |
assertEq(res[1], "STR"); |
| 1085 |
assertRecoveredOnBailout(res, false); |
| 1086 |
assertEq(re.lastIndex == 0, true); |
| 1087 |
return i; |
| 1088 |
} |
| 1089 |
|
| 1090 |
var uceFault_regexp_i_literal_exec = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_i_literal_exec')) |
| 1091 |
function rregexp_i_literal_exec(i) { |
| 1092 |
var re = /(str)\d*0/i; |
| 1093 |
var res = re.exec("STR00123456789"); |
| 1094 |
if (uceFault_regexp_i_literal_exec(i) || uceFault_regexp_i_literal_exec(i)) |
| 1095 |
assertEq(res[1], "STR"); |
| 1096 |
assertRecoveredOnBailout(res, false); |
| 1097 |
assertEq(re.lastIndex == 0, true); |
| 1098 |
return i; |
| 1099 |
} |
| 1100 |
|
| 1101 |
|
| 1102 |
var uceFault_regexp_m_exec = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_m_exec')) |
| 1103 |
function rregexp_m_exec(i) { |
| 1104 |
var re = new RegExp("^(str)\\d+" + (i % 10), "m"); |
| 1105 |
var res = re.exec("abc\nstr00123456789"); |
| 1106 |
if (uceFault_regexp_m_exec(i) || uceFault_regexp_m_exec(i)) |
| 1107 |
assertEq(res[1], "str"); |
| 1108 |
assertRecoveredOnBailout(res, false); |
| 1109 |
assertEq(re.lastIndex == 0, true); |
| 1110 |
return i; |
| 1111 |
} |
| 1112 |
|
| 1113 |
var uceFault_regexp_m_literal_exec = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_m_literal_exec')) |
| 1114 |
function rregexp_m_literal_exec(i) { |
| 1115 |
var re = /^(str)\d*0/m; |
| 1116 |
var res = re.exec("abc\nstr00123456789"); |
| 1117 |
if (uceFault_regexp_m_literal_exec(i) || uceFault_regexp_m_literal_exec(i)) |
| 1118 |
assertEq(res[1], "str"); |
| 1119 |
assertRecoveredOnBailout(res, false); |
| 1120 |
assertEq(re.lastIndex == 0, true); |
| 1121 |
return i; |
| 1122 |
} |
| 1123 |
|
| 1124 |
var uceFault_regexp_test = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_test')) |
| 1125 |
function rregexp_test(i) { |
| 1126 |
var re = new RegExp("str\\d+" + i + "\\d+rts"); |
| 1127 |
var res = re.test("str01234567899876543210rts"); |
| 1128 |
if (uceFault_regexp_test(i) || uceFault_regexp_test(i)) |
| 1129 |
assertEq(res, true); |
| 1130 |
assertRecoveredOnBailout(res, false); |
| 1131 |
return i; |
| 1132 |
} |
| 1133 |
|
| 1134 |
var uceFault_regexp_y_test = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_y_test')) |
| 1135 |
function rregexp_y_test(i) { |
| 1136 |
var re = new RegExp("str\\d+" + (i % 10), "y"); |
| 1137 |
var res = re.test("str00123456789"); |
| 1138 |
if (uceFault_regexp_y_test(i) || uceFault_regexp_y_test(i)) |
| 1139 |
assertEq(res, true); |
| 1140 |
assertRecoveredOnBailout(res, false); |
| 1141 |
assertEq(re.lastIndex == 0, false); |
| 1142 |
return i; |
| 1143 |
} |
| 1144 |
|
| 1145 |
var uceFault_regexp_y_literal_test = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_y_literal_test')) |
| 1146 |
function rregexp_y_literal_test(i) { |
| 1147 |
var re = /str\d*0/y; |
| 1148 |
var res = re.test("str00123456789"); |
| 1149 |
if (uceFault_regexp_y_literal_test(i) || uceFault_regexp_y_literal_test(i)) |
| 1150 |
assertEq(res, true); |
| 1151 |
assertRecoveredOnBailout(res, false); |
| 1152 |
assertEq(re.lastIndex == 0, false); |
| 1153 |
return i; |
| 1154 |
} |
| 1155 |
|
| 1156 |
var uceFault_regexp_g_test = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_g_test')) |
| 1157 |
function rregexp_g_test(i) { |
| 1158 |
var re = new RegExp("str\\d+" + (i % 10), "g"); |
| 1159 |
var res = re.test("str00123456789str00123456789"); |
| 1160 |
if (uceFault_regexp_g_test(i) || uceFault_regexp_g_test(i)) |
| 1161 |
assertEq(res, true); |
| 1162 |
assertRecoveredOnBailout(res, false); |
| 1163 |
assertEq(re.lastIndex == 0, false); |
| 1164 |
return i; |
| 1165 |
} |
| 1166 |
|
| 1167 |
var uceFault_regexp_g_literal_test = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_g_literal_test')) |
| 1168 |
function rregexp_g_literal_test(i) { |
| 1169 |
var re = /str\d*0/g; |
| 1170 |
var res = re.test("str00123456789str00123456789"); |
| 1171 |
if (uceFault_regexp_g_literal_test(i) || uceFault_regexp_g_literal_test(i)) |
| 1172 |
assertEq(res, true); |
| 1173 |
assertRecoveredOnBailout(res, false); |
| 1174 |
assertEq(re.lastIndex == 0, false); |
| 1175 |
return i; |
| 1176 |
} |
| 1177 |
|
| 1178 |
var uceFault_regexp_i_test = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_i_test')) |
| 1179 |
function rregexp_i_test(i) { |
| 1180 |
var re = new RegExp("str\\d+" + (i % 10), "i"); |
| 1181 |
var res = re.test("STR00123456789"); |
| 1182 |
if (uceFault_regexp_i_test(i) || uceFault_regexp_i_test(i)) |
| 1183 |
assertEq(res, true); |
| 1184 |
assertRecoveredOnBailout(res, false); |
| 1185 |
assertEq(re.lastIndex == 0, true); |
| 1186 |
return i; |
| 1187 |
} |
| 1188 |
|
| 1189 |
var uceFault_regexp_i_literal_test = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_i_literal_test')) |
| 1190 |
function rregexp_i_literal_test(i) { |
| 1191 |
var re = /str\d*0/i; |
| 1192 |
var res = re.test("STR00123456789"); |
| 1193 |
if (uceFault_regexp_i_literal_test(i) || uceFault_regexp_i_literal_test(i)) |
| 1194 |
assertEq(res, true); |
| 1195 |
assertRecoveredOnBailout(res, false); |
| 1196 |
assertEq(re.lastIndex == 0, true); |
| 1197 |
return i; |
| 1198 |
} |
| 1199 |
|
| 1200 |
var uceFault_regexp_m_test = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_m_test')) |
| 1201 |
function rregexp_m_test(i) { |
| 1202 |
var re = new RegExp("^str\\d+" + (i % 10), "m"); |
| 1203 |
var res = re.test("abc\nstr00123456789"); |
| 1204 |
if (uceFault_regexp_m_test(i) || uceFault_regexp_m_test(i)) |
| 1205 |
assertEq(res, true); |
| 1206 |
assertRecoveredOnBailout(res, false); |
| 1207 |
assertEq(re.lastIndex == 0, true); |
| 1208 |
return i; |
| 1209 |
} |
| 1210 |
|
| 1211 |
var uceFault_regexp_m_literal_test = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_m_literal_test')) |
| 1212 |
function rregexp_m_literal_test(i) { |
| 1213 |
var re = /^str\d*0/m; |
| 1214 |
var res = re.test("abc\nstr00123456789"); |
| 1215 |
if (uceFault_regexp_m_literal_test(i) || uceFault_regexp_m_literal_test(i)) |
| 1216 |
assertEq(res, true); |
| 1217 |
assertRecoveredOnBailout(res, false); |
| 1218 |
assertEq(re.lastIndex == 0, true); |
| 1219 |
return i; |
| 1220 |
} |
| 1221 |
|
| 1222 |
var uceFault_regexp_replace = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_replace')) |
| 1223 |
function rregexp_replace(i) { |
| 1224 |
var re = new RegExp("str\\d+" + (i % 10)); |
| 1225 |
var res = "str00123456789".replace(re, "abc"); |
| 1226 |
if (uceFault_regexp_replace(i) || uceFault_regexp_replace(i)) |
| 1227 |
assertEq(res, "abc"); |
| 1228 |
assertRecoveredOnBailout(res, false); |
| 1229 |
return i; |
| 1230 |
} |
| 1231 |
|
| 1232 |
var uceFault_regexp_y_replace = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_y_replace')) |
| 1233 |
function rregexp_y_replace(i) { |
| 1234 |
var re = new RegExp("str\\d+" + (i % 10), "y"); |
| 1235 |
re.test("str00123456789"); |
| 1236 |
assertEq(re.lastIndex == 0, false); |
| 1237 |
|
| 1238 |
var res = "str00123456789".replace(re, "abc"); |
| 1239 |
|
| 1240 |
assertEq(re.lastIndex, 0); |
| 1241 |
|
| 1242 |
assertEq(res, "str00123456789"); |
| 1243 |
|
| 1244 |
res = "str00123456789".replace(re, "abc"); |
| 1245 |
assertEq(re.lastIndex == 0, false); |
| 1246 |
|
| 1247 |
if (uceFault_regexp_y_replace(i) || uceFault_regexp_y_replace(i)) |
| 1248 |
assertEq(res, "abc"); |
| 1249 |
assertRecoveredOnBailout(res, false); |
| 1250 |
return i; |
| 1251 |
} |
| 1252 |
|
| 1253 |
var uceFault_regexp_y_literal_replace = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_y_literal_replace')) |
| 1254 |
function rregexp_y_literal_replace(i) { |
| 1255 |
var re = /str\d+9/y; |
| 1256 |
re.test("str00123456789"); |
| 1257 |
assertEq(re.lastIndex == 0, false); |
| 1258 |
|
| 1259 |
var res = "str00123456789".replace(re, "abc"); |
| 1260 |
|
| 1261 |
assertEq(re.lastIndex, 0); |
| 1262 |
|
| 1263 |
assertEq(res, "str00123456789"); |
| 1264 |
|
| 1265 |
res = "str00123456789".replace(re, "abc"); |
| 1266 |
assertEq(re.lastIndex == 0, false); |
| 1267 |
|
| 1268 |
if (uceFault_regexp_y_literal_replace(i) || uceFault_regexp_y_literal_replace(i)) |
| 1269 |
assertEq(res, "abc"); |
| 1270 |
assertRecoveredOnBailout(res, false); |
| 1271 |
return i; |
| 1272 |
} |
| 1273 |
|
| 1274 |
var uceFault_regexp_g_replace = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_g_replace')) |
| 1275 |
function rregexp_g_replace(i) { |
| 1276 |
var re = new RegExp("str\\d+" + (i % 10), "g"); |
| 1277 |
re.test("str00123456789"); |
| 1278 |
assertEq(re.lastIndex == 0, false); |
| 1279 |
|
| 1280 |
var res = "str00123456789".replace(re, "abc"); |
| 1281 |
|
| 1282 |
// replace will always zero the lastIndex field, even if it was not zero before. |
| 1283 |
assertEq(re.lastIndex == 0, true); |
| 1284 |
|
| 1285 |
if (uceFault_regexp_g_replace(i) || uceFault_regexp_g_replace(i)) |
| 1286 |
assertEq(res, "abc"); |
| 1287 |
assertRecoveredOnBailout(res, false); |
| 1288 |
return i; |
| 1289 |
} |
| 1290 |
|
| 1291 |
var uceFault_regexp_g_literal_replace = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_g_literal_replace')) |
| 1292 |
function rregexp_g_literal_replace(i) { |
| 1293 |
var re = /str\d+9/g; |
| 1294 |
re.test("str00123456789"); |
| 1295 |
assertEq(re.lastIndex == 0, false); |
| 1296 |
|
| 1297 |
var res = "str00123456789".replace(re, "abc"); |
| 1298 |
|
| 1299 |
// replace will zero the lastIndex field. |
| 1300 |
assertEq(re.lastIndex == 0, true); |
| 1301 |
|
| 1302 |
if (uceFault_regexp_g_literal_replace(i) || uceFault_regexp_g_literal_replace(i)) |
| 1303 |
assertEq(res, "abc"); |
| 1304 |
assertRecoveredOnBailout(res, false); |
| 1305 |
return i; |
| 1306 |
} |
| 1307 |
|
| 1308 |
var uceFault_regexp_i_replace = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_i_replace')) |
| 1309 |
function rregexp_i_replace(i) { |
| 1310 |
var re = new RegExp("str\\d+" + (i % 10), "i"); |
| 1311 |
re.test("STR00123456789"); |
| 1312 |
assertEq(re.lastIndex == 0, true); |
| 1313 |
|
| 1314 |
var res = "STR00123456789".replace(re, "abc"); |
| 1315 |
|
| 1316 |
assertEq(re.lastIndex == 0, true); |
| 1317 |
|
| 1318 |
if (uceFault_regexp_i_replace(i) || uceFault_regexp_i_replace(i)) |
| 1319 |
assertEq(res, "abc"); |
| 1320 |
assertRecoveredOnBailout(res, false); |
| 1321 |
return i; |
| 1322 |
} |
| 1323 |
|
| 1324 |
var uceFault_regexp_i_literal_replace = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_i_literal_replace')) |
| 1325 |
function rregexp_i_literal_replace(i) { |
| 1326 |
var re = /str\d+9/i; |
| 1327 |
re.test("STR00123456789"); |
| 1328 |
assertEq(re.lastIndex == 0, true); |
| 1329 |
|
| 1330 |
var res = "str00123456789".replace(re, "abc"); |
| 1331 |
|
| 1332 |
assertEq(re.lastIndex == 0, true); |
| 1333 |
|
| 1334 |
if (uceFault_regexp_i_literal_replace(i) || uceFault_regexp_i_literal_replace(i)) |
| 1335 |
assertEq(res, "abc"); |
| 1336 |
assertRecoveredOnBailout(res, false); |
| 1337 |
return i; |
| 1338 |
} |
| 1339 |
|
| 1340 |
var uceFault_regexp_m_replace = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_m_replace')) |
| 1341 |
function rregexp_m_replace(i) { |
| 1342 |
var re = new RegExp("^str\\d+" + (i % 10), "m"); |
| 1343 |
re.test("abc\nstr00123456789"); |
| 1344 |
assertEq(re.lastIndex == 0, true); |
| 1345 |
|
| 1346 |
var res = "abc\nstr00123456789".replace(re, "abc"); |
| 1347 |
|
| 1348 |
assertEq(re.lastIndex == 0, true); |
| 1349 |
|
| 1350 |
if (uceFault_regexp_m_replace(i) || uceFault_regexp_m_replace(i)) |
| 1351 |
assertEq(res, "abc\nabc"); |
| 1352 |
assertRecoveredOnBailout(res, false); |
| 1353 |
return i; |
| 1354 |
} |
| 1355 |
|
| 1356 |
var uceFault_regexp_m_literal_replace = eval(`(${uceFault})`.replace('uceFault', 'uceFault_regexp_m_literal_replace')) |
| 1357 |
function rregexp_m_literal_replace(i) { |
| 1358 |
var re = /^str\d+9/m; |
| 1359 |
re.test("abc\nstr00123456789"); |
| 1360 |
assertEq(re.lastIndex == 0, true); |
| 1361 |
|
| 1362 |
var res = "abc\nstr00123456789".replace(re, "abc"); |
| 1363 |
|
| 1364 |
assertEq(re.lastIndex == 0, true); |
| 1365 |
|
| 1366 |
if (uceFault_regexp_m_literal_replace(i) || uceFault_regexp_m_literal_replace(i)) |
| 1367 |
assertEq(res, "abc\nabc"); |
| 1368 |
assertRecoveredOnBailout(res, false); |
| 1369 |
return i; |
| 1370 |
} |
| 1371 |
|
| 1372 |
var uceFault_string_replace = eval(`(${uceFault})`.replace('uceFault', 'uceFault_string_replace')) |
| 1373 |
function rstring_replace(i) { |
| 1374 |
var re = /str\d+9/; |
| 1375 |
|
| 1376 |
assertEq(re.lastIndex == 0, true); |
| 1377 |
var res = "str00123456789".replace(re, "abc"); |
| 1378 |
if (uceFault_string_replace(i) || uceFault_string_replace(i)) |
| 1379 |
assertEq(res, "abc"); |
| 1380 |
assertRecoveredOnBailout(res, false); |
| 1381 |
assertEq(re.lastIndex == 0, true); |
| 1382 |
return i; |
| 1383 |
} |
| 1384 |
|
| 1385 |
var uceFault_string_replace_y = eval(`(${uceFault})`.replace('uceFault', 'uceFault_string_replace_y')) |
| 1386 |
function rstring_replace_y(i) { |
| 1387 |
var re = /str\d+9/y; |
| 1388 |
|
| 1389 |
assertEq(re.lastIndex == 0, true); |
| 1390 |
var res = "str00123456789".replace(re, "abc"); |
| 1391 |
if (uceFault_string_replace_y(i) || uceFault_string_replace_y(i)) |
| 1392 |
assertEq(res, "abc"); |
| 1393 |
assertRecoveredOnBailout(res, false); |
| 1394 |
assertEq(re.lastIndex == 0, false); |
| 1395 |
return i; |
| 1396 |
} |
| 1397 |
|
| 1398 |
var uceFault_string_replace_g = eval(`(${uceFault})`.replace('uceFault', 'uceFault_string_replace_g')) |
| 1399 |
function rstring_replace_g(i) { |
| 1400 |
var re = /str\d+9/g; |
| 1401 |
|
| 1402 |
assertEq(re.lastIndex == 0, true); |
| 1403 |
var res = "str00123456789str00123456789".replace(re, "abc"); |
| 1404 |
if (uceFault_string_replace_g(i) || uceFault_string_replace_g(i)) |
| 1405 |
assertEq(res, "abcabc"); |
| 1406 |
assertRecoveredOnBailout(res, false); |
| 1407 |
assertEq(re.lastIndex == 0, true); |
| 1408 |
return i; |
| 1409 |
} |
| 1410 |
|
| 1411 |
var uceFault_string_slice = eval(`(${uceFault})`.replace('uceFault', 'uceFault_string_slice')) |
| 1412 |
function rstring_slice(i) { |
| 1413 |
var res = "str00123456789".slice(0, 3); |
| 1414 |
if (uceFault_string_slice(i) || uceFault_string_slice(i)) |
| 1415 |
assertEq(res, "str"); |
| 1416 |
assertRecoveredOnBailout(res, false); |
| 1417 |
return i; |
| 1418 |
} |
| 1419 |
|
| 1420 |
var uceFault_string_substring = eval(`(${uceFault})`.replace('uceFault', 'uceFault_string_substring')) |
| 1421 |
function rstring_substring(i) { |
| 1422 |
var res = "str00123456789".substring(0, 3); |
| 1423 |
if (uceFault_string_substring(i) || uceFault_string_substring(i)) |
| 1424 |
assertEq(res, "str"); |
| 1425 |
assertRecoveredOnBailout(res, false); |
| 1426 |
return i; |
| 1427 |
} |
| 1428 |
|
| 1429 |
var uceFault_typeof = eval(`(${uceFault})`.replace('uceFault', 'uceFault_typeof')) |
| 1430 |
function rtypeof(i) { |
| 1431 |
var inputs = [ {}, [], 1, true, undefined, function(){}, null, Symbol() ]; |
| 1432 |
var types = [ "object", "object", "number", "boolean", "undefined", "function", "object", "symbol"]; |
| 1433 |
|
| 1434 |
var x = typeof (inputs[i % inputs.length]); |
| 1435 |
var y = types[i % types.length]; |
| 1436 |
|
| 1437 |
if (uceFault_typeof(i) || uceFault_typeof(i)) |
| 1438 |
assertEq(x, y); |
| 1439 |
assertRecoveredOnBailout(x, true); |
| 1440 |
return i; |
| 1441 |
} |
| 1442 |
|
| 1443 |
var uceFault_todouble_value = eval(`(${uceFault})`.replace('uceFault', 'uceFault_todouble_value')) |
| 1444 |
function rtodouble_value(i) { |
| 1445 |
var a = 1; |
| 1446 |
if (i == 1000) a = "1"; |
| 1447 |
|
| 1448 |
var x = a < 8.1; |
| 1449 |
|
| 1450 |
if (uceFault_todouble_value(i) || uceFault_todouble_value(i)) |
| 1451 |
assertEq(x, true); |
| 1452 |
assertRecoveredOnBailout(x, true); |
| 1453 |
return i; |
| 1454 |
} |
| 1455 |
|
| 1456 |
var uceFault_todouble_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_todouble_number')); |
| 1457 |
function rtodouble_number(i) { |
| 1458 |
var x = Math.fround(Math.fround(i) + Math.fround(i)) + 1; |
| 1459 |
if (uceFault_todouble_number(i) || uceFault_todouble_number(i)) |
| 1460 |
assertEq(2 * i + 1, x); |
| 1461 |
assertRecoveredOnBailout(x, true); |
| 1462 |
return i; |
| 1463 |
} |
| 1464 |
|
| 1465 |
var uceFault_tofloat32_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_tofloat32_number')); |
| 1466 |
function rtofloat32_number(i) { |
| 1467 |
var x = Math.fround(i + 0.1111111111); |
| 1468 |
if (uceFault_tofloat32_number(i) || uceFault_tofloat32_number(i)) |
| 1469 |
assertEq(x, Math.fround(99.1111111111)); |
| 1470 |
assertRecoveredOnBailout(x, true); |
| 1471 |
return i; |
| 1472 |
} |
| 1473 |
|
| 1474 |
var uceFault_tofloat32_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_tofloat32_object')); |
| 1475 |
function rtofloat32_object(i) { |
| 1476 |
var t = i + 0.1111111111; |
| 1477 |
var o = { valueOf: function () { return t; } }; |
| 1478 |
var x = Math.fround(o); |
| 1479 |
t = 1000.1111111111; |
| 1480 |
if (uceFault_tofloat32_object(i) || uceFault_tofloat32_object(i)) |
| 1481 |
assertEq(x, Math.fround(99.1111111111)); |
| 1482 |
assertRecoveredOnBailout(x, false); |
| 1483 |
return i; |
| 1484 |
} |
| 1485 |
|
| 1486 |
var uceFault_tofloat16_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_tofloat16_number')); |
| 1487 |
function rtofloat16_number(i) { |
| 1488 |
var x = Math.f16round(i + 0.22); |
| 1489 |
if (uceFault_tofloat16_number(i) || uceFault_tofloat16_number(i)) |
| 1490 |
assertEq(x, Math.f16round(99.22)); |
| 1491 |
assertRecoveredOnBailout(x, true); |
| 1492 |
return i; |
| 1493 |
} |
| 1494 |
|
| 1495 |
var uceFault_tofloat16_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_tofloat16_object')); |
| 1496 |
function rtofloat16_object(i) { |
| 1497 |
var t = i + 0.22; |
| 1498 |
var o = { valueOf: function () { return t; } }; |
| 1499 |
var x = Math.f16round(o); |
| 1500 |
t = 1000.22; |
| 1501 |
if (uceFault_tofloat16_object(i) || uceFault_tofloat16_object(i)) |
| 1502 |
assertEq(x, Math.f16round(99.22)); |
| 1503 |
assertRecoveredOnBailout(x, false); |
| 1504 |
return i; |
| 1505 |
} |
| 1506 |
|
| 1507 |
var uceFault_trunc_to_int32_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_trunc_to_int32_number')); |
| 1508 |
function rtrunc_to_int32_number(i) { |
| 1509 |
var x = (i + 0.12) | 0; |
| 1510 |
if (uceFault_trunc_to_int32_number(i) || uceFault_trunc_to_int32_number(i)) |
| 1511 |
assertEq(x, (i + 0.12) | 0); |
| 1512 |
assertRecoveredOnBailout(x, true); |
| 1513 |
return i; |
| 1514 |
} |
| 1515 |
|
| 1516 |
var uceFault_trunc_to_int32_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_trunc_to_int32_object')); |
| 1517 |
function rtrunc_to_int32_object(i) { |
| 1518 |
var t1 = i + 0.12; |
| 1519 |
var o1 = { valueOf: function() { return t1; } }; |
| 1520 |
var x = o1 | 0; |
| 1521 |
t1 = 777.12; |
| 1522 |
if (uceFault_trunc_to_int32_object(i) || uceFault_trunc_to_int32_object(i)) |
| 1523 |
assertEq(x, (i + 0.12) | 0); |
| 1524 |
assertRecoveredOnBailout(x, false); |
| 1525 |
} |
| 1526 |
|
| 1527 |
var uceFault_trunc_to_int32_string = eval(`(${uceFault})`.replace('uceFault', 'uceFault_trunc_to_int32_string')); |
| 1528 |
function rtrunc_to_int32_string(i) { |
| 1529 |
var x = (i + "0") | 0; |
| 1530 |
if (uceFault_trunc_to_int32_string(i) || uceFault_trunc_to_int32_string(i)) |
| 1531 |
assertEq(x, (i + "0") | 0); |
| 1532 |
assertRecoveredOnBailout(x, true); |
| 1533 |
return i; |
| 1534 |
} |
| 1535 |
|
| 1536 |
var uceFault_hypot_number_2args = eval(`(${uceFault})`.replace('uceFault', 'uceFault_hypot_number_2args')); |
| 1537 |
function rhypot_number_2args(i) { |
| 1538 |
var x = Math.hypot(i, i + 1); |
| 1539 |
if (uceFault_hypot_number_2args(i) || uceFault_hypot_number_2args(i)) |
| 1540 |
assertEq(x, Math.sqrt(i * i + (i + 1) * (i + 1))); |
| 1541 |
assertRecoveredOnBailout(x, true); |
| 1542 |
return i; |
| 1543 |
} |
| 1544 |
|
| 1545 |
var uceFault_hypot_number_3args = eval(`(${uceFault})`.replace('uceFault', 'uceFault_hypot_number_3args')); |
| 1546 |
function rhypot_number_3args(i) { |
| 1547 |
var x = Math.hypot(i, i + 1, i + 2); |
| 1548 |
if (uceFault_hypot_number_3args(i) || uceFault_hypot_number_3args(i)) |
| 1549 |
assertEq(x, Math.sqrt(i * i + (i + 1) * (i + 1) + (i + 2) * (i + 2))); |
| 1550 |
assertRecoveredOnBailout(x, true); |
| 1551 |
return i; |
| 1552 |
} |
| 1553 |
|
| 1554 |
var uceFault_hypot_number_4args = eval(`(${uceFault})`.replace('uceFault', 'uceFault_hypot_number_4args')); |
| 1555 |
function rhypot_number_4args(i) { |
| 1556 |
var x = Math.hypot(i, i + 1, i + 2, i + 3); |
| 1557 |
if (uceFault_hypot_number_4args(i) || uceFault_hypot_number_4args(i)) |
| 1558 |
assertEq(x, Math.sqrt(i * i + (i + 1) * (i + 1) + (i + 2) * (i + 2) + (i + 3) * (i + 3))); |
| 1559 |
assertRecoveredOnBailout(x, true); |
| 1560 |
return i; |
| 1561 |
} |
| 1562 |
|
| 1563 |
var uceFault_hypot_object_2args = eval(`(${uceFault})`.replace('uceFault', 'uceFault_hypot_object_2args')); |
| 1564 |
function rhypot_object_2args(i) { |
| 1565 |
var t0 = i; |
| 1566 |
var t1 = i + 1; |
| 1567 |
var o0 = { valueOf: function () { return t0; } }; |
| 1568 |
var o1 = { valueOf: function () { return t1; } }; |
| 1569 |
var x = Math.hypot(o0, o1); |
| 1570 |
t0 = 1000; |
| 1571 |
t1 = 2000; |
| 1572 |
if (uceFault_hypot_object_2args(i) || uceFault_hypot_object_2args(i) ) |
| 1573 |
assertEq(x, Math.sqrt(i * i + (i + 1) * (i + 1))); |
| 1574 |
assertRecoveredOnBailout(x, false); |
| 1575 |
return i; |
| 1576 |
} |
| 1577 |
|
| 1578 |
var uceFault_hypot_object_3args = eval(`(${uceFault})`.replace('uceFault', 'uceFault_hypot_object_3args')); |
| 1579 |
function rhypot_object_3args(i) { |
| 1580 |
var t0 = i; |
| 1581 |
var t1 = i + 1; |
| 1582 |
var t2 = i + 2; |
| 1583 |
var o0 = { valueOf: function () { return t0; } }; |
| 1584 |
var o1 = { valueOf: function () { return t1; } }; |
| 1585 |
var o2 = { valueOf: function () { return t2; } }; |
| 1586 |
var x = Math.hypot(o0, o1, o2); |
| 1587 |
t0 = 1000; |
| 1588 |
t1 = 2000; |
| 1589 |
t2 = 3000; |
| 1590 |
if (uceFault_hypot_object_3args(i) || uceFault_hypot_object_3args(i) ) |
| 1591 |
assertEq(x, Math.sqrt(i * i + (i + 1) * (i + 1) + (i + 2) * (i + 2))); |
| 1592 |
assertRecoveredOnBailout(x, false); |
| 1593 |
return i; |
| 1594 |
} |
| 1595 |
|
| 1596 |
var uceFault_hypot_object_4args = eval(`(${uceFault})`.replace('uceFault', 'uceFault_hypot_object_4args')); |
| 1597 |
function rhypot_object_4args(i) { |
| 1598 |
var t0 = i; |
| 1599 |
var t1 = i + 1; |
| 1600 |
var t2 = i + 2; |
| 1601 |
var t3 = i + 3; |
| 1602 |
var o0 = { valueOf: function () { return t0; } }; |
| 1603 |
var o1 = { valueOf: function () { return t1; } }; |
| 1604 |
var o2 = { valueOf: function () { return t2; } }; |
| 1605 |
var o3 = { valueOf: function () { return t3; } }; |
| 1606 |
var x = Math.hypot(o0, o1, o2, o3); |
| 1607 |
t0 = 1000; |
| 1608 |
t1 = 2000; |
| 1609 |
t2 = 3000; |
| 1610 |
t3 = 4000; |
| 1611 |
if (uceFault_hypot_object_4args(i) || uceFault_hypot_object_4args(i) ) |
| 1612 |
assertEq(x, Math.sqrt(i * i + (i + 1) * (i + 1) + (i + 2) * (i + 2) + (i + 3) * (i + 3))); |
| 1613 |
assertRecoveredOnBailout(x, false); |
| 1614 |
return i; |
| 1615 |
} |
| 1616 |
|
| 1617 |
var uceFault_random = eval(`(${uceFault})`.replace('uceFault', 'uceFault_random')); |
| 1618 |
function rrandom(i) { |
| 1619 |
// setRNGState() exists only in debug builds |
| 1620 |
if (getBuildConfiguration("debug")) setRNGState(2, 1+i); |
| 1621 |
|
| 1622 |
var x = Math.random(); |
| 1623 |
if (uceFault_random(i) || uceFault_random(i)) { |
| 1624 |
// TODO(Warp): Conditional operator ?: prevents recovering operands. |
| 1625 |
// assertEq(x, getBuildConfiguration("debug") ? setRNGState(2, 1+i) || Math.random() : x); |
| 1626 |
if (getBuildConfiguration("debug")) { |
| 1627 |
assertEq(x, setRNGState(2, 1+i) || Math.random()); |
| 1628 |
} else { |
| 1629 |
assertEq(x, x); |
| 1630 |
} |
| 1631 |
} |
| 1632 |
assertRecoveredOnBailout(x, true); |
| 1633 |
return i; |
| 1634 |
} |
| 1635 |
|
| 1636 |
var uceFault_sin_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_sin_number')); |
| 1637 |
function rsin_number(i) { |
| 1638 |
var x = Math.sin(i); |
| 1639 |
if (uceFault_sin_number(i) || uceFault_sin_number(i)) |
| 1640 |
assertEq(x, Math.sin(i)); |
| 1641 |
assertRecoveredOnBailout(x, true); |
| 1642 |
return i; |
| 1643 |
} |
| 1644 |
|
| 1645 |
var uceFault_sin_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_sin_object')); |
| 1646 |
function rsin_object(i) { |
| 1647 |
var t = i; |
| 1648 |
var o = { valueOf: function() { return t; } }; |
| 1649 |
var x = Math.sin(o); |
| 1650 |
t = 777; |
| 1651 |
if (uceFault_sin_object(i) || uceFault_sin_object(i)) |
| 1652 |
assertEq(x, Math.sin(i)); |
| 1653 |
assertRecoveredOnBailout(x, false); |
| 1654 |
return i; |
| 1655 |
} |
| 1656 |
|
| 1657 |
var uceFault_log_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_log_number')); |
| 1658 |
function rlog_number(i) { |
| 1659 |
var x = Math.log(i); |
| 1660 |
if (uceFault_log_number(i) || uceFault_log_number(i)) |
| 1661 |
assertEq(x, Math.log(99) /* log(99) */); |
| 1662 |
assertRecoveredOnBailout(x, true); |
| 1663 |
return i; |
| 1664 |
} |
| 1665 |
|
| 1666 |
var uceFault_log_object = eval(`(${uceFault})`.replace('uceFault', 'uceFault_log_object')); |
| 1667 |
function rlog_object(i) { |
| 1668 |
var t = i; |
| 1669 |
var o = { valueOf: function() { return t; } }; |
| 1670 |
var x = Math.log(o); /* Evaluated with t == i, not t == 1000 */ |
| 1671 |
t = 1000; |
| 1672 |
if (uceFault_log_object(i) || uceFault_log_object(i)) |
| 1673 |
assertEq(x, Math.log(99) /* log(99) */); |
| 1674 |
assertRecoveredOnBailout(x, false); |
| 1675 |
return i; |
| 1676 |
} |
| 1677 |
|
| 1678 |
var uceFault_cos_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_cos_number')); |
| 1679 |
function rcos_number(i) { |
| 1680 |
var x = Math.cos(i); |
| 1681 |
if (uceFault_cos_number(i) || uceFault_cos_number(i)) |
| 1682 |
assertEq(x, Math.cos(99)); |
| 1683 |
assertRecoveredOnBailout(x, true); |
| 1684 |
return i; |
| 1685 |
} |
| 1686 |
|
| 1687 |
var uceFault_tan_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_tan_number')); |
| 1688 |
function rtan_number(i) { |
| 1689 |
var x = Math.tan(i); |
| 1690 |
if (uceFault_tan_number(i) || uceFault_tan_number(i)) |
| 1691 |
assertEq(x, Math.tan(99)); |
| 1692 |
assertRecoveredOnBailout(x, true); |
| 1693 |
return i; |
| 1694 |
} |
| 1695 |
|
| 1696 |
var uceFault_exp_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_exp_number')); |
| 1697 |
function rexp_number(i) { |
| 1698 |
var x = Math.exp(i); |
| 1699 |
if (uceFault_exp_number(i) || uceFault_exp_number(i)) |
| 1700 |
assertEq(x, Math.exp(99)); |
| 1701 |
assertRecoveredOnBailout(x, true); |
| 1702 |
return i; |
| 1703 |
} |
| 1704 |
|
| 1705 |
var uceFault_acos_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_acos_number')); |
| 1706 |
function racos_number(i) { |
| 1707 |
var x = Math.acos(1 / i); |
| 1708 |
if (uceFault_acos_number(i) || uceFault_acos_number(i)) |
| 1709 |
assertEq(x, Math.acos(1 / 99)); |
| 1710 |
assertRecoveredOnBailout(x, true); |
| 1711 |
return i; |
| 1712 |
} |
| 1713 |
|
| 1714 |
var uceFault_asin_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_asin_number')); |
| 1715 |
function rasin_number(i) { |
| 1716 |
var x = Math.asin(1 / i); |
| 1717 |
if (uceFault_asin_number(i) || uceFault_asin_number(i)) |
| 1718 |
assertEq(x, Math.asin(1 / 99)); |
| 1719 |
assertRecoveredOnBailout(x, true); |
| 1720 |
return i; |
| 1721 |
} |
| 1722 |
|
| 1723 |
var uceFault_atan_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_atan_number')); |
| 1724 |
function ratan_number(i) { |
| 1725 |
var x = Math.atan(i); |
| 1726 |
if (uceFault_atan_number(i) || uceFault_atan_number(i)) |
| 1727 |
assertEq(x, Math.atan(99)); |
| 1728 |
assertRecoveredOnBailout(x, true); |
| 1729 |
return i; |
| 1730 |
} |
| 1731 |
|
| 1732 |
var uceFault_log10_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_log10_number')); |
| 1733 |
function rlog10_number(i) { |
| 1734 |
var x = Math.log10(i); |
| 1735 |
if (uceFault_log10_number(i) || uceFault_log10_number(i)) |
| 1736 |
assertEq(x, Math.log10(99)); |
| 1737 |
assertRecoveredOnBailout(x, true); |
| 1738 |
return i; |
| 1739 |
} |
| 1740 |
|
| 1741 |
var uceFault_log2_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_log2_number')); |
| 1742 |
function rlog2_number(i) { |
| 1743 |
var x = Math.log2(i); |
| 1744 |
if (uceFault_log2_number(i) || uceFault_log2_number(i)) |
| 1745 |
assertEq(x, Math.log2(99)); |
| 1746 |
assertRecoveredOnBailout(x, true); |
| 1747 |
return i; |
| 1748 |
} |
| 1749 |
|
| 1750 |
var uceFault_log1p_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_log1p_number')); |
| 1751 |
function rlog1p_number(i) { |
| 1752 |
var x = Math.log1p(i); |
| 1753 |
if (uceFault_log1p_number(i) || uceFault_log1p_number(i)) |
| 1754 |
assertEq(x, Math.log1p(99)); |
| 1755 |
assertRecoveredOnBailout(x, true); |
| 1756 |
return i; |
| 1757 |
} |
| 1758 |
|
| 1759 |
var uceFault_expm1_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_expm1_number')); |
| 1760 |
function rexpm1_number(i) { |
| 1761 |
var x = Math.expm1(i); |
| 1762 |
if (uceFault_expm1_number(i) || uceFault_expm1_number(i)) |
| 1763 |
assertEq(x, Math.expm1(99)); |
| 1764 |
assertRecoveredOnBailout(x, true); |
| 1765 |
return i; |
| 1766 |
} |
| 1767 |
|
| 1768 |
var uceFault_cosh_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_cosh_number')); |
| 1769 |
function rcosh_number(i) { |
| 1770 |
var x = Math.cosh(i); |
| 1771 |
if (uceFault_cosh_number(i) || uceFault_cosh_number(i)) |
| 1772 |
assertEq(x, Math.cosh(99)); |
| 1773 |
assertRecoveredOnBailout(x, true); |
| 1774 |
return i; |
| 1775 |
} |
| 1776 |
|
| 1777 |
var uceFault_sinh_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_sinh_number')); |
| 1778 |
function rsinh_number(i) { |
| 1779 |
var x = Math.sinh(i); |
| 1780 |
if (uceFault_sinh_number(i) || uceFault_sinh_number(i)) |
| 1781 |
assertEq(x, Math.sinh(99)); |
| 1782 |
assertRecoveredOnBailout(x, true); |
| 1783 |
return i; |
| 1784 |
} |
| 1785 |
|
| 1786 |
var uceFault_tanh_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_tanh_number')); |
| 1787 |
function rtanh_number(i) { |
| 1788 |
var x = Math.tanh(1 / i); |
| 1789 |
if (uceFault_tanh_number(i) || uceFault_tanh_number(i)) |
| 1790 |
assertEq(x, Math.tanh(1 / 99)); |
| 1791 |
assertRecoveredOnBailout(x, true); |
| 1792 |
return i; |
| 1793 |
} |
| 1794 |
|
| 1795 |
var uceFault_acosh_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_acosh_number')); |
| 1796 |
function racosh_number(i) { |
| 1797 |
var x = Math.acosh(i); |
| 1798 |
if (uceFault_acosh_number(i) || uceFault_acosh_number(i)) |
| 1799 |
assertEq(x, Math.acosh(99)); |
| 1800 |
assertRecoveredOnBailout(x, true); |
| 1801 |
return i; |
| 1802 |
} |
| 1803 |
|
| 1804 |
var uceFault_asinh_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_asinh_number')); |
| 1805 |
function rasinh_number(i) { |
| 1806 |
var x = Math.asinh(i); |
| 1807 |
if (uceFault_asinh_number(i) || uceFault_asinh_number(i)) |
| 1808 |
assertEq(x, Math.asinh(99)); |
| 1809 |
assertRecoveredOnBailout(x, true); |
| 1810 |
return i; |
| 1811 |
} |
| 1812 |
|
| 1813 |
var uceFault_atanh_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_atanh_number')); |
| 1814 |
function ratanh_number(i) { |
| 1815 |
var x = Math.atanh(1 / i); |
| 1816 |
if (uceFault_atanh_number(i) || uceFault_atanh_number(i)) |
| 1817 |
assertEq(x, Math.atanh(1 / 99)); |
| 1818 |
assertRecoveredOnBailout(x, true); |
| 1819 |
return i; |
| 1820 |
} |
| 1821 |
|
| 1822 |
var uceFault_cbrt_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_cbrt_number')); |
| 1823 |
function rcbrt_number(i) { |
| 1824 |
var x = Math.cbrt(i); |
| 1825 |
if (uceFault_cbrt_number(i) || uceFault_cbrt_number(i)) |
| 1826 |
assertEq(x, Math.cbrt(99)); |
| 1827 |
assertRecoveredOnBailout(x, true); |
| 1828 |
return i; |
| 1829 |
} |
| 1830 |
|
| 1831 |
var uceFault_sign_number = eval(`(${uceFault})`.replace('uceFault', 'uceFault_sign_number')); |
| 1832 |
function rsign_number(i) { |
| 1833 |
var x = Math.sign(-i - 0.12010799100); |
| 1834 |
if (uceFault_sign_number(i) || uceFault_sign_number(i)) |
| 1835 |
assertEq(x, Math.sign(-10)); |
| 1836 |
assertRecoveredOnBailout(x, true); |
| 1837 |
return i; |
| 1838 |
} |
| 1839 |
|
| 1840 |
let uceFault_sign_double = eval(`(${uceFault})`.replace('uceFault', 'uceFault_sign_double')); |
| 1841 |
function rsign_double(i) { |
| 1842 |
const x = Math.sign(i + (-1 >>> 0)); |
| 1843 |
if (uceFault_sign_double(i) || uceFault_sign_double(i)) |
| 1844 |
assertEq(x, Math.sign(10)); |
| 1845 |
assertRecoveredOnBailout(x, true); |
| 1846 |
return i; |
| 1847 |
} |
| 1848 |
|
| 1849 |
let uceFault_add_bigint = eval(`(${uceFault})`.replace('uceFault', 'uceFault_add_bigint')); |
| 1850 |
function rbigintadd(i) { |
| 1851 |
var x = 1n + i; |
| 1852 |
if (uceFault_add_bigint(i) || uceFault_add_bigint(i)) |
| 1853 |
assertEq(x, 100n /* = 1 + 99 */); |
| 1854 |
assertRecoveredOnBailout(x, true); |
| 1855 |
return i; |
| 1856 |
} |
| 1857 |
|
| 1858 |
let uceFault_sub_bigint = eval(`(${uceFault})`.replace('uceFault', 'uceFault_sub_bigint')); |
| 1859 |
function rbigintsub(i) { |
| 1860 |
var x = 1n - i; |
| 1861 |
if (uceFault_sub_bigint(i) || uceFault_sub_bigint(i)) |
| 1862 |
assertEq(x, -98n /* = 1 - 99 */); |
| 1863 |
assertRecoveredOnBailout(x, true); |
| 1864 |
return i; |
| 1865 |
} |
| 1866 |
|
| 1867 |
let uceFault_mul_bigint = eval(`(${uceFault})`.replace('uceFault', 'uceFault_mul_bigint')); |
| 1868 |
function rbigintmul(i) { |
| 1869 |
var x = 2n * i; |
| 1870 |
if (uceFault_mul_bigint(i) || uceFault_mul_bigint(i)) |
| 1871 |
assertEq(x, 198n /* = 2 * 99 */); |
| 1872 |
assertRecoveredOnBailout(x, true); |
| 1873 |
return i; |
| 1874 |
} |
| 1875 |
|
| 1876 |
let uceFault_div_bigint = eval(`(${uceFault})`.replace('uceFault', 'uceFault_div_bigint')); |
| 1877 |
function rbigintdiv(i) { |
| 1878 |
var x = i / 3n; |
| 1879 |
if (uceFault_div_bigint(i) || uceFault_div_bigint(i)) |
| 1880 |
assertEq(x, 33n /* = 99 / 3 */); |
| 1881 |
assertRecoveredOnBailout(x, true); |
| 1882 |
return i; |
| 1883 |
} |
| 1884 |
|
| 1885 |
let uceFault_mod_bigint = eval(`(${uceFault})`.replace('uceFault', 'uceFault_mod_bigint')); |
| 1886 |
function rbigintmod(i) { |
| 1887 |
var x = i % 2n; |
| 1888 |
if (uceFault_mod_bigint(i) || uceFault_mod_bigint(i)) |
| 1889 |
assertEq(x, 1n /* = 99 % 2 */); |
| 1890 |
assertRecoveredOnBailout(x, true); |
| 1891 |
return i; |
| 1892 |
} |
| 1893 |
|
| 1894 |
let uceFault_pow_bigint = eval(`(${uceFault})`.replace('uceFault', 'uceFault_pow_bigint')); |
| 1895 |
function rbigintpow(i) { |
| 1896 |
var x = i ** 5n; |
| 1897 |
if (uceFault_pow_bigint(i) || uceFault_pow_bigint(i)) |
| 1898 |
assertEq(x, 9509900499n /* = 99 ** 5 */); |
| 1899 |
assertRecoveredOnBailout(x, true); |
| 1900 |
return i; |
| 1901 |
} |
| 1902 |
|
| 1903 |
let uceFault_inc_bigint = eval(`(${uceFault})`.replace('uceFault', 'uceFault_inc_bigint')); |
| 1904 |
function rbigintinc(i) { |
| 1905 |
var x = i; |
| 1906 |
x++; |
| 1907 |
if (uceFault_inc_bigint(i) || uceFault_inc_bigint(i)) |
| 1908 |
assertEq(x, 100n /* = 99 + 1 */); |
| 1909 |
assertRecoveredOnBailout(x, true); |
| 1910 |
return i; |
| 1911 |
} |
| 1912 |
|
| 1913 |
let uceFault_dec_bigint = eval(`(${uceFault})`.replace('uceFault', 'uceFault_dec_bigint')); |
| 1914 |
function rbigintdec(i) { |
| 1915 |
var x = i; |
| 1916 |
x--; |
| 1917 |
if (uceFault_dec_bigint(i) || uceFault_dec_bigint(i)) |
| 1918 |
assertEq(x, 98n /* = 99 - 1 */); |
| 1919 |
assertRecoveredOnBailout(x, true); |
| 1920 |
return i; |
| 1921 |
} |
| 1922 |
|
| 1923 |
let uceFault_neg_bigint = eval(`(${uceFault})`.replace('uceFault', 'uceFault_neg_bigint')); |
| 1924 |
function rbigintneg(i) { |
| 1925 |
var x = -i; |
| 1926 |
if (uceFault_neg_bigint(i) || uceFault_neg_bigint(i)) |
| 1927 |
assertEq(x, -99n); |
| 1928 |
assertRecoveredOnBailout(x, true); |
| 1929 |
return i; |
| 1930 |
} |
| 1931 |
|
| 1932 |
let uceFault_bitand_bigint = eval(`(${uceFault})`.replace('uceFault', 'uceFault_bitand_bigint')); |
| 1933 |
function rbigintbitand(i) { |
| 1934 |
var x = 1n & i; |
| 1935 |
if (uceFault_bitand_bigint(i) || uceFault_bitand_bigint(i)) |
| 1936 |
assertEq(x, 1n /* = 1 & 99 */); |
| 1937 |
assertRecoveredOnBailout(x, true); |
| 1938 |
return i; |
| 1939 |
} |
| 1940 |
|
| 1941 |
let uceFault_bitor_bigint = eval(`(${uceFault})`.replace('uceFault', 'uceFault_bitor_bigint')); |
| 1942 |
function rbigintbitor(i) { |
| 1943 |
var x = i | -100n; /* -100 == ~99 */ |
| 1944 |
if (uceFault_bitor_bigint(i) || uceFault_bitor_bigint(i)) |
| 1945 |
assertEq(x, -1n) /* ~99 | 99 = -1 */ |
| 1946 |
assertRecoveredOnBailout(x, true); |
| 1947 |
return i; |
| 1948 |
} |
| 1949 |
|
| 1950 |
let uceFault_bitxor_bigint = eval(`(${uceFault})`.replace('uceFault', 'uceFault_bitxor_bigint')); |
| 1951 |
function rbigintbitxor(i) { |
| 1952 |
var x = 1n ^ i; |
| 1953 |
if (uceFault_bitxor_bigint(i) || uceFault_bitxor_bigint(i)) |
| 1954 |
assertEq(x, 98n /* = 1 XOR 99 */); |
| 1955 |
assertRecoveredOnBailout(x, true); |
| 1956 |
return i; |
| 1957 |
} |
| 1958 |
|
| 1959 |
let uceFault_bitnot_bigint = eval(`(${uceFault})`.replace('uceFault', 'uceFault_bitnot_bigint')); |
| 1960 |
function rbigintbitnot(i) { |
| 1961 |
var x = ~i; |
| 1962 |
if (uceFault_bitnot_bigint(i) || uceFault_bitnot_bigint(i)) |
| 1963 |
assertEq(x, -100n /* = ~99 */); |
| 1964 |
assertRecoveredOnBailout(x, true); |
| 1965 |
return i; |
| 1966 |
} |
| 1967 |
|
| 1968 |
let uceFault_lsh_bigint = eval(`(${uceFault})`.replace('uceFault', 'uceFault_lsh_bigint')); |
| 1969 |
function rbigintlsh(i) { |
| 1970 |
var x = i << 1n; |
| 1971 |
if (uceFault_lsh_bigint(i) || uceFault_lsh_bigint(i)) |
| 1972 |
assertEq(x, 198n); /* 99 << 1 == 198 */ |
| 1973 |
assertRecoveredOnBailout(x, true); |
| 1974 |
return i; |
| 1975 |
} |
| 1976 |
|
| 1977 |
let uceFault_rsh_bigint = eval(`(${uceFault})`.replace('uceFault', 'uceFault_rsh_bigint')); |
| 1978 |
function rbigintrsh(i) { |
| 1979 |
var x = i >> 1n; |
| 1980 |
if (uceFault_rsh_bigint(i) || uceFault_rsh_bigint(i)) |
| 1981 |
assertEq(x, 49n /* = 99 >> 1 */); |
| 1982 |
assertRecoveredOnBailout(x, true); |
| 1983 |
return i; |
| 1984 |
} |
| 1985 |
|
| 1986 |
let uceFault_bigintasint = eval(`(${uceFault})`.replace('uceFault', 'uceFault_bigintasint')); |
| 1987 |
function rbigintasint(i) { |
| 1988 |
var x = BigInt.asIntN(6, i); |
| 1989 |
if (uceFault_bigintasint(i) || uceFault_bigintasint(i)) |
| 1990 |
assertEq(x, -29n); |
| 1991 |
assertRecoveredOnBailout(x, true); |
| 1992 |
return i; |
| 1993 |
} |
| 1994 |
|
| 1995 |
let uceFault_bigintasuint = eval(`(${uceFault})`.replace('uceFault', 'uceFault_bigintasuint')); |
| 1996 |
function rbigintasuint(i) { |
| 1997 |
var x = BigInt.asUintN(6, i); |
| 1998 |
if (uceFault_bigintasuint(i) || uceFault_bigintasuint(i)) |
| 1999 |
assertEq(x, 35n); |
| 2000 |
assertRecoveredOnBailout(x, true); |
| 2001 |
return i; |
| 2002 |
} |
| 2003 |
|
| 2004 |
let uceFault_int32tobigint = eval(`(${uceFault})`.replace('uceFault', 'uceFault_int32tobigint')); |
| 2005 |
function rint32tobigint(i) { |
| 2006 |
var x = BigInt(i); |
| 2007 |
if (uceFault_int32tobigint(i) || uceFault_int32tobigint(i)) |
| 2008 |
assertEq(x, 99n); |
| 2009 |
assertRecoveredOnBailout(x, true); |
| 2010 |
return i; |
| 2011 |
} |
| 2012 |
|
| 2013 |
let uceFault_nantozero_nan = eval(`(${uceFault})`.replace('uceFault', 'uceFault_nantozero_nan')); |
| 2014 |
function rnantozero_nan(i) { |
| 2015 |
// Note: |x| must be Double-typed. |
| 2016 |
var x = NaN ** (i + 0.5); |
| 2017 |
var y = x ? x : +0; |
| 2018 |
if (uceFault_nantozero_nan(i) || uceFault_nantozero_nan(i)) |
| 2019 |
assertEq(y, +0); |
| 2020 |
assertRecoveredOnBailout(y, true); |
| 2021 |
return i; |
| 2022 |
} |
| 2023 |
|
| 2024 |
let uceFault_nantozero_poszero = eval(`(${uceFault})`.replace('uceFault', 'uceFault_nantozero_poszero')); |
| 2025 |
function rnantozero_poszero(i) { |
| 2026 |
// Note: |x| must be Double-typed. |
| 2027 |
var x = (i + 0.5) * +0; |
| 2028 |
var y = x ? x : +0; |
| 2029 |
if (uceFault_nantozero_poszero(i) || uceFault_nantozero_poszero(i)) |
| 2030 |
assertEq(y, +0); |
| 2031 |
assertRecoveredOnBailout(y, true); |
| 2032 |
return i; |
| 2033 |
} |
| 2034 |
|
| 2035 |
let uceFault_nantozero_negzero = eval(`(${uceFault})`.replace('uceFault', 'uceFault_nantozero_negzero')); |
| 2036 |
function rnantozero_negzero(i) { |
| 2037 |
// Note: |x| must be Double-typed. |
| 2038 |
var x = (i + 0.5) * -0; |
| 2039 |
var y = x ? x : +0; |
| 2040 |
if (uceFault_nantozero_negzero(i) || uceFault_nantozero_negzero(i)) |
| 2041 |
assertEq(y, +0); |
| 2042 |
assertRecoveredOnBailout(y, true); |
| 2043 |
return i; |
| 2044 |
} |
| 2045 |
|
| 2046 |
let uceFault_ratomicsislockfree_true = eval(`(${uceFault})`.replace('uceFault', 'uceFault_ratomicsislockfree_true')); |
| 2047 |
function ratomicsislockfree_true(i) { |
| 2048 |
var x = [1, 2, 4, 8][i & 3]; |
| 2049 |
var y = Atomics.isLockFree(x); |
| 2050 |
if (uceFault_ratomicsislockfree_true(i) || uceFault_ratomicsislockfree_true(i)) |
| 2051 |
assertEq(y, true); |
| 2052 |
assertRecoveredOnBailout(y, true); |
| 2053 |
return i; |
| 2054 |
} |
| 2055 |
|
| 2056 |
let uceFault_ratomicsislockfree_false = eval(`(${uceFault})`.replace('uceFault', 'uceFault_ratomicsislockfree_false')); |
| 2057 |
function ratomicsislockfree_false(i) { |
| 2058 |
var x = [-1, 0, 3, 1000][i & 3]; |
| 2059 |
var y = Atomics.isLockFree(x); |
| 2060 |
if (uceFault_ratomicsislockfree_false(i) || uceFault_ratomicsislockfree_false(i)) |
| 2061 |
assertEq(y, false); |
| 2062 |
assertRecoveredOnBailout(y, true); |
| 2063 |
return i; |
| 2064 |
} |
| 2065 |
|
| 2066 |
for (j = 100 - max; j < 100; j++) { |
| 2067 |
with({}){} // Do not Ion-compile this loop. |
| 2068 |
let i = j < 2 ? (Math.abs(j) % 50) + 2 : j; |
| 2069 |
rbitnot_number(i); |
| 2070 |
rbitnot_object(i); |
| 2071 |
rbitand_number(i); |
| 2072 |
rbitand_object(i); |
| 2073 |
rbitor_number(i); |
| 2074 |
rbitor_object(i); |
| 2075 |
rbitxor_number(i); |
| 2076 |
rbitxor_object(i); |
| 2077 |
rlsh_number(i); |
| 2078 |
rlsh_object(i); |
| 2079 |
rrsh_number(i); |
| 2080 |
rrsh_object(i); |
| 2081 |
rursh_number(i); |
| 2082 |
rursh_object(i); |
| 2083 |
rsignextend8_1(i); |
| 2084 |
rsignextend8_2(i); |
| 2085 |
rsignextend16_1(i); |
| 2086 |
rsignextend16_2(i); |
| 2087 |
radd_number(i); |
| 2088 |
radd_float(i); |
| 2089 |
radd_object(i); |
| 2090 |
rsub_number(i); |
| 2091 |
rsub_float(i); |
| 2092 |
rsub_object(i); |
| 2093 |
rmul_number(i); |
| 2094 |
rmul_overflow(i); |
| 2095 |
rmul_float(i); |
| 2096 |
rmul_object(i); |
| 2097 |
rimul_number(i); |
| 2098 |
rimul_overflow(i); |
| 2099 |
rimul_object(i); |
| 2100 |
rdiv_number(i); |
| 2101 |
rdiv_double(i); |
| 2102 |
rdiv_float(i); |
| 2103 |
rdiv_object(i); |
| 2104 |
rmod_number(i); |
| 2105 |
rmod_object(i); |
| 2106 |
rnot_number(i); |
| 2107 |
rnot_object(i); |
| 2108 |
rnot_bigint_intptr(i); |
| 2109 |
rnot_bigint_int64(i); |
| 2110 |
rcompare_number_eq(i); |
| 2111 |
rcompare_number_stricteq(i); |
| 2112 |
rcompare_number_ne(i); |
| 2113 |
rcompare_number_stricteq(i); |
| 2114 |
rcompare_number_lt(i); |
| 2115 |
rcompare_number_le(i); |
| 2116 |
rcompare_number_gt(i); |
| 2117 |
rcompare_number_ge(i); |
| 2118 |
rcompare_string_eq(i); |
| 2119 |
rcompare_string_stricteq(i); |
| 2120 |
rcompare_string_ne(i); |
| 2121 |
rcompare_string_stricteq(i); |
| 2122 |
rcompare_string_lt(i); |
| 2123 |
rcompare_string_le(i); |
| 2124 |
rcompare_string_gt(i); |
| 2125 |
rcompare_string_ge(i); |
| 2126 |
rcompare_bigint_eq(i, BigInt(i)); |
| 2127 |
rcompare_bigint_stricteq(i, BigInt(i)); |
| 2128 |
rcompare_bigint_ne(i, BigInt(i)); |
| 2129 |
rcompare_bigint_stricteq(i, BigInt(i)); |
| 2130 |
rcompare_bigint_lt(i, BigInt(i)); |
| 2131 |
rcompare_bigint_le(i, BigInt(i)); |
| 2132 |
rcompare_bigint_gt(i, BigInt(i)); |
| 2133 |
rcompare_bigint_ge(i, BigInt(i)); |
| 2134 |
rconcat_string(i); |
| 2135 |
rconcat_number(i); |
| 2136 |
rstring_length(i); |
| 2137 |
rarguments_length_1(i); |
| 2138 |
rarguments_length_3(i, 0, 1); |
| 2139 |
rinline_arguments_length_1(i); |
| 2140 |
rinline_arguments_length_3(i, 0, 1); |
| 2141 |
rfloor_number(i); |
| 2142 |
rfloor_double(i); |
| 2143 |
rfloor_object(i); |
| 2144 |
rceil_number(i); |
| 2145 |
rceil_double(i); |
| 2146 |
rround_number(i); |
| 2147 |
rround_double(i); |
| 2148 |
rtrunc_number(i); |
| 2149 |
rtrunc_double(i); |
| 2150 |
rcharCodeAt(i); |
| 2151 |
rfrom_char_code(i); |
| 2152 |
rfrom_char_code_non_ascii(i); |
| 2153 |
rpow_number(i); |
| 2154 |
rpow_object(i); |
| 2155 |
rpowhalf_number(i); |
| 2156 |
rpowhalf_object(i); |
| 2157 |
rmin_number(i); |
| 2158 |
rmin_float(i); |
| 2159 |
rmin_object(i); |
| 2160 |
rmax_number(i); |
| 2161 |
rmax_float(i); |
| 2162 |
rmax_object(i); |
| 2163 |
rabs_number(i); |
| 2164 |
rabs_object(i); |
| 2165 |
rsqrt_number(i); |
| 2166 |
rsqrt_float(i); |
| 2167 |
rsqrt_object(i); |
| 2168 |
ratan2_number(i); |
| 2169 |
ratan2_object(i); |
| 2170 |
if (!warp) { |
| 2171 |
// TODO(Warp): Warp doesn't currently support a compiler constraints like |
| 2172 |
// system to elide checks for modified built-ins. Additionally this test |
| 2173 |
// requires to inline the self-hosted function and to elide all type |
| 2174 |
// checks before the StringSplitString intrinsic is called. |
| 2175 |
rstr_split(i); |
| 2176 |
} |
| 2177 |
rregexp_exec(i); |
| 2178 |
rregexp_y_exec(i); |
| 2179 |
rregexp_y_literal_exec(i); |
| 2180 |
rregexp_g_exec(i); |
| 2181 |
rregexp_g_literal_exec(i); |
| 2182 |
rregexp_i_exec(i); |
| 2183 |
rregexp_i_literal_exec(i); |
| 2184 |
rregexp_m_exec(i); |
| 2185 |
rregexp_m_literal_exec(i); |
| 2186 |
rregexp_test(i); |
| 2187 |
rregexp_y_test(i); |
| 2188 |
rregexp_y_literal_test(i); |
| 2189 |
rregexp_g_test(i); |
| 2190 |
rregexp_g_literal_test(i); |
| 2191 |
rregexp_i_test(i); |
| 2192 |
rregexp_i_literal_test(i); |
| 2193 |
rregexp_m_test(i); |
| 2194 |
rregexp_m_literal_test(i); |
| 2195 |
rregexp_replace(i); |
| 2196 |
rregexp_y_replace(i); |
| 2197 |
rregexp_y_literal_replace(i); |
| 2198 |
rregexp_g_replace(i); |
| 2199 |
rregexp_g_literal_replace(i); |
| 2200 |
rregexp_i_replace(i); |
| 2201 |
rregexp_i_literal_replace(i); |
| 2202 |
rregexp_m_replace(i); |
| 2203 |
rregexp_m_literal_replace(i); |
| 2204 |
rstring_replace(i); |
| 2205 |
rstring_replace_y(i); |
| 2206 |
rstring_replace_g(i); |
| 2207 |
rstring_slice(i); |
| 2208 |
rstring_substring(i); |
| 2209 |
rtypeof(i); |
| 2210 |
rtodouble_value(i); |
| 2211 |
rtodouble_number(i); |
| 2212 |
rtofloat32_number(i); |
| 2213 |
rtofloat32_object(i); |
| 2214 |
rtofloat16_number(i); |
| 2215 |
rtofloat16_object(i); |
| 2216 |
rtrunc_to_int32_number(i); |
| 2217 |
rtrunc_to_int32_object(i); |
| 2218 |
if (!warp) { |
| 2219 |
// TODO(Warp): Bitwise operations on strings not optimised in Warp. |
| 2220 |
rtrunc_to_int32_string(i); |
| 2221 |
} |
| 2222 |
rhypot_number_2args(i); |
| 2223 |
rhypot_number_3args(i); |
| 2224 |
rhypot_number_4args(i); |
| 2225 |
rhypot_object_2args(i); |
| 2226 |
rhypot_object_3args(i); |
| 2227 |
rhypot_object_4args(i); |
| 2228 |
rrandom(i); |
| 2229 |
rsin_number(i); |
| 2230 |
rsin_object(i); |
| 2231 |
rlog_number(i); |
| 2232 |
rlog_object(i); |
| 2233 |
rcos_number(i); |
| 2234 |
rexp_number(i); |
| 2235 |
rtan_number(i); |
| 2236 |
racos_number(i); |
| 2237 |
rasin_number(i); |
| 2238 |
ratan_number(i); |
| 2239 |
rlog10_number(i); |
| 2240 |
rlog2_number(i); |
| 2241 |
rlog1p_number(i); |
| 2242 |
rexpm1_number(i); |
| 2243 |
rcosh_number(i); |
| 2244 |
rsinh_number(i); |
| 2245 |
rtanh_number(i); |
| 2246 |
racosh_number(i); |
| 2247 |
rasinh_number(i); |
| 2248 |
ratanh_number(i); |
| 2249 |
rcbrt_number(i); |
| 2250 |
rsign_number(i); |
| 2251 |
rsign_double(i); |
| 2252 |
rbigintadd(BigInt(i)); |
| 2253 |
rbigintsub(BigInt(i)); |
| 2254 |
rbigintmul(BigInt(i)); |
| 2255 |
rbigintdiv(BigInt(i)); |
| 2256 |
rbigintmod(BigInt(i)); |
| 2257 |
rbigintpow(BigInt(i)); |
| 2258 |
rbigintinc(BigInt(i)); |
| 2259 |
rbigintdec(BigInt(i)); |
| 2260 |
rbigintneg(BigInt(i)); |
| 2261 |
rbigintbitand(BigInt(i)); |
| 2262 |
rbigintbitor(BigInt(i)); |
| 2263 |
rbigintbitxor(BigInt(i)); |
| 2264 |
rbigintbitnot(BigInt(i)); |
| 2265 |
rbigintlsh(BigInt(i)); |
| 2266 |
rbigintrsh(BigInt(i)); |
| 2267 |
rbigintasint(BigInt(i)); |
| 2268 |
rbigintasuint(BigInt(i)); |
| 2269 |
rint32tobigint(i); |
| 2270 |
rnantozero_nan(i); |
| 2271 |
rnantozero_poszero(i); |
| 2272 |
rnantozero_negzero(i); |
| 2273 |
ratomicsislockfree_true(i); |
| 2274 |
ratomicsislockfree_false(i); |
| 2275 |
} |
| 2276 |
|
| 2277 |
// Test that we can refer multiple time to the same recover instruction, as well |
| 2278 |
// as chaining recover instructions. |
| 2279 |
|
| 2280 |
function alignedAlloc($size, $alignment) { |
| 2281 |
var $1 = $size + 4 | 0; |
| 2282 |
var $2 = $alignment - 1 | 0; |
| 2283 |
var $3 = $1 + $2 | 0; |
| 2284 |
var $4 = malloc($3); |
| 2285 |
} |
| 2286 |
|
| 2287 |
function malloc($bytes) { |
| 2288 |
var $189 = undefined; |
| 2289 |
var $198 = $189 + 8 | 0; |
| 2290 |
} |
| 2291 |
|
| 2292 |
for (i = 0; i < 50; i++) |
| 2293 |
alignedAlloc(608, 16); |