fieldhoist_slots2.js 755 B

1234567891011121314151617181920212223
  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. function test0(){
  6. var workItem = { increment: 1, isDone: false };
  7. var func0 = function() {
  8. workItem = { increment: 2, isDone: true }
  9. }
  10. while (!workItem.isDone) {
  11. for (var i = 0; i < 3 && !workItem.isDone; i += workItem.increment) {
  12. func0(i);
  13. }
  14. }
  15. WScript.Echo("i = " + i);
  16. };
  17. // generate profile
  18. test0();
  19. // run JITted code
  20. test0();