2
0

test120.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. var GiantPrintArray = [];
  6. var reuseObjects = false;
  7. var PolymorphicFuncObjArr = [];
  8. var PolyFuncArr = [];
  9. function GetPolymorphicFunction() {
  10. if(PolyFuncArr.length > 1) {
  11. var myFunc = PolyFuncArr.shift();
  12. PolyFuncArr.push(myFunc);
  13. return myFunc;
  14. }
  15. else {
  16. return PolyFuncArr[0];
  17. }
  18. }
  19. function GetObjectwithPolymorphicFunction() {
  20. if(reuseObjects) {
  21. if(PolymorphicFuncObjArr.length > 1) {
  22. var myFunc = PolymorphicFuncObjArr.shift();
  23. PolymorphicFuncObjArr.push(myFunc);
  24. return myFunc
  25. }
  26. else {
  27. return PolymorphicFuncObjArr[0];
  28. }
  29. }
  30. else {
  31. var obj = {};
  32. obj.polyfunc = GetPolymorphicFunction();
  33. PolymorphicFuncObjArr.push(obj)
  34. return obj
  35. }
  36. };
  37. function InitPolymorphicFunctionArray() {
  38. for(var i = 0; i < arguments.length; i++) {
  39. PolyFuncArr.push(arguments[i])
  40. }
  41. }
  42. ;
  43. function test0() {
  44. //letconst3.ecs
  45. function v79580() {
  46. var v79581 = -2147483646;
  47. {
  48. const v79581 = 1;
  49. GiantPrintArray.push(v79581);
  50. }
  51. GiantPrintArray.push(v79581);
  52. }
  53. v79580();
  54. };
  55. // generate profile
  56. test0();
  57. // Run Simple JIT
  58. test0();
  59. test0();
  60. test0();
  61. test0();
  62. test0();
  63. // run JITted code
  64. runningJITtedCode = true;
  65. test0();
  66. WScript.Echo("pass");