diff --git a/implementation-contributed/curation_logs/javascriptcore.json b/implementation-contributed/curation_logs/javascriptcore.json index d1f52af93e472177f11ee6f15467f286b31ecc9c..34f71f55ee01ae1df9863eb440ea29d0ac7ecd27 100644 --- a/implementation-contributed/curation_logs/javascriptcore.json +++ b/implementation-contributed/curation_logs/javascriptcore.json @@ -1,5 +1,5 @@ { - "sourceRevisionAtLastExport": "00228d3ccc", - "targetRevisionAtLastExport": "4314e2cab", + "sourceRevisionAtLastExport": "5895364ed5", + "targetRevisionAtLastExport": "df1fc484e", "curatedFiles": {} } \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/array-profile-should-record-copy-on-write.js b/implementation-contributed/javascriptcore/stress/array-profile-should-record-copy-on-write.js new file mode 100644 index 0000000000000000000000000000000000000000..0de63e92304ff4dc2e57a010a9f88e7f0b38ac40 --- /dev/null +++ b/implementation-contributed/javascriptcore/stress/array-profile-should-record-copy-on-write.js @@ -0,0 +1,39 @@ +function shouldBe(actual, expected) +{ + if (actual !== expected) + throw new Error('bad value: ' + actual); +} +noInline(shouldBe); + +function test1(array) +{ + for (var i = 0; i < 5; ++i) { + array[0] = array[0] + 1; + } + return array; +} +noInline(test1); + +function test2(array) +{ + for (var i = 0; i < 5; ++i) { + array[0] = array[0] + 1; + } + return array; +} +noInline(test2); + +function test3(array) +{ + for (var i = 0; i < 5; ++i) { + array[0] = array[0] + 1; + } + return array; +} +noInline(test3); + +for (var i = 0; i < 1e5; ++i) { + shouldBe(String(test1([0, 1, 2, 3, 4])), `5,1,2,3,4`); + shouldBe(String(test2([0.1, 1.1, 2.1, 3.1, 4.1])), `5.1,1.1,2.1,3.1,4.1`); + shouldBe(String(test3(['C', 'o', 'c', 'o', 'a'])), `C11111,o,c,o,a`); +}