Fix many tests that try to force an OSR by checking OptimizationStatus() to instead check OptimizationCount().

BUG=
R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/21221003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15951 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
titzer@chromium.org 2013-07-30 09:28:55 +00:00
parent f328c2c77c
commit 45d4afbde5
5 changed files with 17 additions and 12 deletions

View File

@ -205,7 +205,9 @@ if (support_smi_only_arrays) {
(function literals_after_osr() {
var color = [0];
// Trigger OSR.
while (%GetOptimizationStatus(literals_after_osr, "no sync") == 2) {}
// Trigger OSR, if optimization is not disabled.
if (%GetOptimizationStatus(literals_after_osr) != 4) {
while (%GetOptimizationCount(literals_after_osr) == 0) {}
}
return [color[0]];
})();

View File

@ -25,15 +25,15 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --count-based-interrupts --interrupt-budget=10 --weighted-back-edges
// Flags: --allow-natives-syntax
// Test that OSR works properly when using count-based interrupting/profiling.
function osr_this() {
var a = 1;
// Trigger OSR.
while (%GetOptimizationStatus(osr_this, "no sync") == 2) {}
// Trigger OSR. First check if optimization is disabled.
if (%GetOptimizationStatus(osr_this) == 4) return 1;
while (%GetOptimizationCount(osr_this) == 0) {}
return a;
}
assertEquals(1, osr_this());

View File

@ -52,8 +52,10 @@ function h() {
g();
} else {
// Run for a bit as long as h is unoptimized.
while (%GetOptimizationStatus(h, "no sync") == 2) {
for (var j = 0; j < 100; j++) g();
if (%GetOptimizationStatus(h) != 4) {
while (%GetOptimizationCount(h) == 0) {
for (var j = 0; j < 100; j++) g();
}
}
g();
}

View File

@ -38,8 +38,7 @@ function f() {
}
f();
assertOptimized(f);
assertTrue(%GetOptimizationCount(f) > 0 || %GetOptimizationStatus(f) == 4);
function g() {
for (var i = 0; i < 1; i++) { }
@ -70,4 +69,4 @@ function g() {
}
g();
assertOptimized(g);
assertTrue(%GetOptimizationCount(g) > 0 || %GetOptimizationStatus(g) == 4);

View File

@ -45,8 +45,10 @@
function outer() {
inner(1,2,3);
// Trigger OSR.
while (%GetOptimizationStatus(outer, "no sync") == 2) {}
// Trigger OSR, if optimization is not disabled.
if (%GetOptimizationStatus(outer) != 4) {
while (%GetOptimizationCount(outer) == 0) {}
}
}
outer();