baseline-hints-1.js (1050B)
1 // |jit-test| --blinterp-warmup-threshold=1; --baseline-warmup-threshold=1 2 // Simple test to make sure an eager baseline hint is set after entering baseline. 3 4 if (typeof getJitCompilerOptions == "function" && 5 typeof inJit == "function" && 6 typeof hasBaselineHint == "function") { 7 8 var jco = getJitCompilerOptions(); 9 if (jco["baseline.enable"] && jco["blinterp.enable"] && 10 jco["blinterp.warmup.trigger"] == 1 && 11 jco["baseline.warmup.trigger"] == 1) { 12 13 function testFunction() { 14 return inJit(); 15 } 16 17 assertEq(hasBaselineHint(testFunction), false); 18 in_jit = testFunction(); 19 assertEq(in_jit, false); 20 21 // Should be in blinterp, but no hint should be set yet. 22 assertEq(hasBaselineHint(testFunction), false); 23 in_jit = testFunction(); // Trigger baseline compilation. 24 assertEq(in_jit, true); 25 26 // testFunction should have been baseline compiled and a hint should also be set now. 27 assertEq(hasBaselineHint(testFunction), true); 28 in_jit = testFunction(); 29 assertEq(in_jit, true); 30 } 31 }