Bug 1132888 part 4 - Test that we do not disable assertRecoveredOnBailout assertion. r=h4writer

--HG--
rename : js/src/jit-test/tests/self-test/assertRecoveredOnBailout.js => js/src/jit-test/tests/self-test/assertRecoveredOnBailout-0.js
This commit is contained in:
Nicolas B. Pierron 2016-11-08 14:06:39 +00:00
Родитель 8e71e75524
Коммит 0b8d145f14
5 изменённых файлов: 62 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,32 @@
// |jit-test| crash
var opts = getJitCompilerOptions();
if (!opts['ion.enable'] || !opts['baseline.enable'] ||
opts["ion.forceinlineCaches"] || opts["ion.check-range-analysis"])
{
crash("Cannot test assertRecoveredOnBailout");
}
function g() {
return inIon();
}
// Wait until IonMonkey compilation finished.
while(!(res = g()));
// Check that we entered Ion succesfully.
if (res !== true)
crash("Cannot enter IonMonkey");
// Test that assertRecoveredOnBailout fails as expected.
function f () {
var o = {};
assertRecoveredOnBailout(o, false);
return inIon();
}
// Wait until IonMonkey compilation finished.
while(!(res = f()));
// Ensure that we entered Ion.
assertEq(res, true);

Просмотреть файл

@ -6224,6 +6224,15 @@ JS_SetGlobalJitCompilerOption(JSContext* cx, JSJitCompilerOption opt, uint32_t v
JitSpew(js::jit::JitSpew_IonScripts, "IonBuilder: Disable non-IC optimizations.");
}
break;
case JSJITCOMPILER_ION_CHECK_RANGE_ANALYSIS:
if (value == 0) {
jit::JitOptions.checkRangeAnalysis = false;
JitSpew(js::jit::JitSpew_IonScripts, "IonBuilder: Enable range analysis checks.");
} else {
jit::JitOptions.checkRangeAnalysis = true;
JitSpew(js::jit::JitSpew_IonScripts, "IonBuilder: Disable range analysis checks.");
}
break;
case JSJITCOMPILER_ION_ENABLE:
if (value == 1) {
JS::ContextOptionsRef(cx).setIon(true);
@ -6295,6 +6304,9 @@ JS_GetGlobalJitCompilerOption(JSContext* cx, JSJitCompilerOption opt, uint32_t*
case JSJITCOMPILER_ION_FORCE_IC:
*valueOut = jit::JitOptions.forceInlineCaches;
break;
case JSJITCOMPILER_ION_CHECK_RANGE_ANALYSIS:
*valueOut = jit::JitOptions.checkRangeAnalysis;
break;
case JSJITCOMPILER_ION_ENABLE:
*valueOut = JS::ContextOptionsRef(cx).ion();
break;

Просмотреть файл

@ -5736,6 +5736,7 @@ JS_SetOffthreadIonCompilationEnabled(JSContext* cx, bool enabled);
Register(ION_FORCE_IC, "ion.forceinlineCaches") \
Register(ION_ENABLE, "ion.enable") \
Register(ION_INTERRUPT_WITHOUT_SIGNAL, "ion.interrupt-without-signals") \
Register(ION_CHECK_RANGE_ANALYSIS, "ion.check-range-analysis") \
Register(BASELINE_ENABLE, "baseline.enable") \
Register(OFFTHREAD_COMPILATION_ENABLE, "offthread-compilation.enable") \
Register(JUMP_THRESHOLD, "jump-threshold") \

Просмотреть файл

@ -120,6 +120,7 @@ class JitTest:
self.test_join = [] # List of other configurations to test with all existing variants.
self.expect_error = '' # Errors to expect and consider passing
self.expect_status = 0 # Exit status to expect from shell
self.expect_crash = False # Exit status or error output.
self.is_module = False
self.test_reflect_stringify = None # Reflect.stringify implementation to test
@ -141,6 +142,7 @@ class JitTest:
t.test_join = self.test_join
t.expect_error = self.expect_error
t.expect_status = self.expect_status
t.expect_crash = self.expect_crash
t.test_reflect_stringify = self.test_reflect_stringify
t.enable = True
t.is_module = self.is_module
@ -231,6 +233,8 @@ class JitTest:
test.test_join.append([name[len('test-join='):]])
elif name == 'module':
test.is_module = True
elif name == 'crash':
test.expect_crash = True
elif name.startswith('--'):
# // |jit-test| --ion-gvn=off; --no-sse4
test.jitflags.append(name)
@ -370,6 +374,19 @@ def check_output(out, err, rc, timed_out, test, options):
if 'Assertion failed:' in line:
return False
if test.expect_crash:
if sys.platform == 'win32' and rc == 3 - 2 ** 31:
return True
if sys.platform != 'win32' and rc == -11:
return True
# When building with ASan enabled, ASan will convert the -11 returned
# value to 1. As a work-around we look for the error output which
# includes the crash reason.
if rc == 1 and ("Hit MOZ_CRASH" in err or "Assertion failure:" in err):
return True
if rc != test.expect_status:
# Tests which expect a timeout check for exit code 6.
# Sometimes 0 is returned on Windows for unknown reasons.