-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Tests cases for Generator Jit
- Loading branch information
Showing
15 changed files
with
465 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/es6/async-jit-bugs.js → test/es6GeneratorJit/async-jit-bugs.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/es6/generator-jit-bugs.js → test/es6GeneratorJit/generator-jit-bugs.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Beginning basicAsync | ||
basicAsync Loop 0 a = 80 | ||
basicAsync Loop 0 arguments[0] = 80 | ||
basicAsync Loop 0 a = 160 | ||
basicAsync Loop 0 arguments[0] = 160 | ||
Loop 3 completed | ||
Loop 4 k = 160 | ||
Loop 4 k = 80 | ||
Loop 4 k = 0 | ||
Loop 4 completed | ||
Beginning basicAsync | ||
basicAsync Loop 0 a = 80 | ||
basicAsync Loop 0 arguments[0] = 80 | ||
basicAsync Loop 0 a = 160 | ||
basicAsync Loop 0 arguments[0] = 160 | ||
Loop 3 completed | ||
Loop 4 k = 160 | ||
Loop 4 k = 80 | ||
Loop 4 k = 0 | ||
Loop 4 completed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
Beginning basicAsync | ||
---BeginBackEnd: function: printif--- | ||
---EndBackEnd--- | ||
---BeginBackEnd: function: printif--- | ||
---EndBackEnd--- | ||
---BeginBackEnd: function: basicAsync, loop:1--- | ||
---EndBackEnd--- | ||
basicAsync Loop 0 a = 80 | ||
basicAsync Loop 0 arguments[0] = 80 | ||
---BeginBackEnd: function: basicAsync, loop:0--- | ||
---EndBackEnd--- | ||
basicAsync Loop 0 a = 160 | ||
basicAsync Loop 0 arguments[0] = 160 | ||
Loop 3 completed | ||
---BeginBackEnd: function: value--- | ||
---EndBackEnd--- | ||
---BeginBackEnd: function: value--- | ||
---EndBackEnd--- | ||
---BeginBackEnd: function: value--- | ||
---EndBackEnd--- | ||
Loop 4 k = 160 | ||
---BeginBackEnd: function: basicAsync, loop:4--- | ||
---EndBackEnd--- | ||
Loop 4 k = 80 | ||
Loop 4 k = 0 | ||
Loop 4 completed | ||
Beginning basicAsync | ||
basicAsync Loop 0 a = 80 | ||
basicAsync Loop 0 arguments[0] = 80 | ||
basicAsync Loop 0 a = 160 | ||
basicAsync Loop 0 arguments[0] = 160 | ||
Loop 3 completed | ||
---BeginBackEnd: function: Array.prototype.values--- | ||
---EndBackEnd--- | ||
---BeginBackEnd: function: Anonymous function--- | ||
---EndBackEnd--- | ||
---BeginBackEnd: function: Anonymous function--- | ||
---EndBackEnd--- | ||
Loop 4 k = 160 | ||
Loop 4 k = 80 | ||
Loop 4 k = 0 | ||
Loop 4 completed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
//------------------------------------------------------------------------------------------------------- | ||
// Copyright (C) Microsoft. All rights reserved. | ||
// Copyright (c) ChakraCore Project Contributors. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. | ||
//------------------------------------------------------------------------------------------------------- | ||
|
||
let bar = []; | ||
let j = 0; | ||
|
||
function printif (text, x, mod) { | ||
if (x % mod == 0) { | ||
print (text + x); | ||
} | ||
} | ||
|
||
async function basicAsync(a, b) { | ||
print("Beginning basicAsync") | ||
await b; | ||
var foo = [0.1, 0.2, 0.3, 0.4, 0]; | ||
while (a < 200) { // Loop 0 - should be jitted | ||
foo[a] = Math.random(); | ||
printif(arguments.callee.name + " Loop 0 a = ", a, 80); | ||
printif(arguments.callee.name + " Loop 0 arguments[0] = ", arguments[0], 80); | ||
for (let k in foo) { bar[k] = a - k;} // Loop 1 - shuld be jitted | ||
++a; | ||
} | ||
while (true){ // Loop 2 - should not be jitted | ||
for (j = 0; j < 100; ++j) { // Loop 3 - should not be jitted | ||
await j; | ||
foo[j] = j; | ||
} | ||
print("Loop 3 completed"); | ||
for (let k of bar) { // Loop 4 - should be jitted | ||
printif("Loop 4 k = ", k, 80); | ||
foo[0] = foo[1] + 1; | ||
} | ||
print("Loop 4 completed"); | ||
return j; | ||
} | ||
} | ||
|
||
basicAsync(4, 3).then(x => basicAsync(3, 2)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Beginning test of basicGenerator | ||
basicGenerator Loop 0 a = 40 | ||
basicGenerator Loop 0 arguments[0] = 40 | ||
basicGenerator Loop 0 a = 80 | ||
basicGenerator Loop 0 arguments[0] = 80 | ||
Loop 3 completed | ||
Loop 4 k = 80 | ||
Loop 4 k = 40 | ||
Loop 4 k = 0 | ||
Loop 4 completed | ||
yielded value = 80 | ||
yielded value = 40 | ||
yielded value = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
Beginning test of basicGenerator | ||
---BeginBackEnd: function: printif--- | ||
---EndBackEnd--- | ||
---BeginBackEnd: function: printif--- | ||
---EndBackEnd--- | ||
---BeginBackEnd: function: basicGenerator, loop:1--- | ||
---EndBackEnd--- | ||
basicGenerator Loop 0 a = 40 | ||
basicGenerator Loop 0 arguments[0] = 40 | ||
---BeginBackEnd: function: basicGenerator, loop:0--- | ||
---EndBackEnd--- | ||
basicGenerator Loop 0 a = 80 | ||
basicGenerator Loop 0 arguments[0] = 80 | ||
Loop 3 completed | ||
---BeginBackEnd: function: value--- | ||
---EndBackEnd--- | ||
---BeginBackEnd: function: value--- | ||
---EndBackEnd--- | ||
---BeginBackEnd: function: value--- | ||
---EndBackEnd--- | ||
Loop 4 k = 80 | ||
---BeginBackEnd: function: basicGenerator, loop:4--- | ||
---EndBackEnd--- | ||
Loop 4 k = 40 | ||
Loop 4 k = 0 | ||
Loop 4 completed | ||
---BeginBackEnd: function: Array.prototype.values--- | ||
---EndBackEnd--- | ||
---BeginBackEnd: function: Anonymous function--- | ||
---EndBackEnd--- | ||
---BeginBackEnd: function: Anonymous function--- | ||
---EndBackEnd--- | ||
yielded value = 80 | ||
yielded value = 40 | ||
yielded value = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
//------------------------------------------------------------------------------------------------------- | ||
// Copyright (C) Microsoft. All rights reserved. | ||
// Copyright (c) ChakraCore Project Contributors. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. | ||
//------------------------------------------------------------------------------------------------------- | ||
|
||
let bar = []; | ||
let j = 0; | ||
|
||
function printif (text, x, mod) { | ||
if (x % mod == 0) { | ||
print (text + x); | ||
} | ||
} | ||
|
||
function* basicGenerator(a, b) { | ||
print("Beginning test of " + arguments.callee.name); | ||
yield "yield 2nd param b =" + b; | ||
var foo = [0.1, 0.2, 0.3, 0.4, 0]; | ||
while (a < 100) { // Loop 0 - should be jitted | ||
foo[a] = Math.random(); | ||
printif(arguments.callee.name + " Loop 0 a = ", a, 40); | ||
printif(arguments.callee.name + " Loop 0 arguments[0] = ", arguments[0], 40); | ||
for (let k in foo) { bar[k] = a - k;} // Loop 1 - shuld be jitted | ||
++a; | ||
} | ||
while (true){ // Loop 2 - should not be jitted | ||
for (j = 0; j < 100; ++j) { // Loop 3 - should not be jitted | ||
if (j % 40 == 1) | ||
yield j; | ||
|
||
foo[j] = j; | ||
} | ||
print("Loop 3 completed"); | ||
for (let k of bar) { // Loop 4 - should be jitted | ||
printif("Loop 4 k = ", k, 40); | ||
foo[0] = foo[1] + 1; | ||
} | ||
print("Loop 4 completed"); | ||
yield* bar; // Loop 5 - should not be jitted | ||
return j; | ||
} | ||
} | ||
|
||
const gen = basicGenerator(5, 1); | ||
for (let x = gen.next(); !x.done; x = gen.next() ) { | ||
printif("yielded value = ", x.value, 40); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Loop 0 a = 40 | ||
Loop 0 a = 80 | ||
Loop 0 a = 120 | ||
Loop 0 a = 160 | ||
Loop 3 completed | ||
Loop 4 k = 160 | ||
Loop 4 k = 120 | ||
Loop 4 k = 80 | ||
Loop 4 k = 40 | ||
Loop 4 k = 0 | ||
Loop 4 completed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
---BeginBackEnd: function: printif--- | ||
---EndBackEnd--- | ||
---BeginBackEnd: function: printif--- | ||
---EndBackEnd--- | ||
---BeginBackEnd: function: Module code, loop:1--- | ||
---EndBackEnd--- | ||
Loop 0 a = 40 | ||
Loop 0 a = 80 | ||
Loop 0 a = 120 | ||
---BeginBackEnd: function: Module code, loop:0--- | ||
---EndBackEnd--- | ||
Loop 0 a = 160 | ||
Loop 3 completed | ||
---BeginBackEnd: function: value--- | ||
---EndBackEnd--- | ||
---BeginBackEnd: function: value--- | ||
---EndBackEnd--- | ||
---BeginBackEnd: function: value--- | ||
---EndBackEnd--- | ||
Loop 4 k = 160 | ||
---BeginBackEnd: function: Module code, loop:4--- | ||
---EndBackEnd--- | ||
Loop 4 k = 120 | ||
Loop 4 k = 80 | ||
Loop 4 k = 40 | ||
Loop 4 k = 0 | ||
Loop 4 completed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
//------------------------------------------------------------------------------------------------------- | ||
// Copyright (C) Microsoft. All rights reserved. | ||
// Copyright (c) ChakraCore Project Contributors. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. | ||
//------------------------------------------------------------------------------------------------------- | ||
|
||
let bar = []; | ||
let j = 0, a = 3, b = 2; | ||
|
||
function printif (text, x, mod) { | ||
if (x % mod == 0) { | ||
print (text + x); | ||
} | ||
} | ||
|
||
|
||
await b; | ||
var foo = [0.1, 0.2, 0.3, 0.4, 0]; | ||
while (a < 200) { // Loop 0 - should be jitted | ||
foo[a] = Math.random(); | ||
printif("Loop 0 a = ", a, 40); | ||
for (let k in foo) { bar[k] = a - k;} // Loop 1 - shuld be jitted | ||
++a; | ||
} | ||
while (true){ // Loop 2 - should not be jitted | ||
for (j = 0; j < 100; ++j) { // Loop 3 - should not be jitted | ||
await j; | ||
|
||
foo[j] = j; | ||
} | ||
print("Loop 3 completed"); | ||
for (let k of bar) { // Loop 4 - should be jitted | ||
printif("Loop 4 k = ", k, 40); | ||
foo[0] = foo[1] + 1; | ||
} | ||
print("Loop 4 completed"); | ||
await j; | ||
break; | ||
} | ||
|
||
|
Oops, something went wrong.