summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/cacheir/bug1837157.js
blob: c468a1a259d6bc83fbe74fa089ff2eb817386e1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// |jit-test| --fast-warmup; --no-threads
with ({}) {}

function foo(a) {
  a.prop = 0;
}

class A {
  set prop(x) { }
}

function newShape() {
  class B extends A {}
  return new B();
}

function triggerIonCompile() {
  with ({}) {}
  for (var i = 0; i < 50; i++) {
    foo(initialShapes[i % initialShapes.length])
  }
}

var initialShapes = [];
for (var i = 0; i < 8; i++) {
  initialShapes.push(newShape());
}

triggerIonCompile();

for (var i = 0; i < 10; i++) {
  foo(0);
}
foo(newShape());

triggerIonCompile();