nativeArrayPushInlining.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. function test0()
  7. {
  8. GiantPrintArray.push(3.2);
  9. GiantPrintArray.push(true);
  10. }
  11. test0();
  12. //Profiled as NativeFloatArray
  13. test0();
  14. for(var i =0;i<GiantPrintArray.length;i++){
  15. WScript.Echo(GiantPrintArray[i]);
  16. };
  17. function test1()
  18. {
  19. var ary;
  20. GiantPrintArray.push(2);
  21. GiantPrintArray.push(ary);
  22. }
  23. test1();
  24. //Profiled as NativeIntArray
  25. test1();
  26. for(var i =0;i<GiantPrintArray.length;i++){
  27. WScript.Echo(GiantPrintArray[i]);
  28. };
  29. function test2(a)
  30. {
  31. GiantPrintArray.push(a);
  32. }
  33. var GiantPrintArray = [1.1];
  34. test2(1);
  35. //Profiled as NativeFloatArray
  36. var ary;
  37. test2(ary);
  38. for(var i =0;i<GiantPrintArray.length;i++){
  39. WScript.Echo(GiantPrintArray[i]);
  40. };
  41. function test3()
  42. {
  43. GiantPrintArray = [{}];
  44. GiantPrintArray.push(7);
  45. }
  46. test3();
  47. //Profiled as Var Array
  48. test3();
  49. for(var i =0;i<GiantPrintArray.length;i++){
  50. WScript.Echo(GiantPrintArray[i]);
  51. };