1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/bindings/test/test_throwing_method_noDCE.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,27 @@ 1.4 +<!DOCTYPE html> 1.5 +<meta charset=utf-8> 1.6 +<title>Test that we don't DCE functions that can throw</title> 1.7 +<script src="/resources/testharness.js"></script> 1.8 +<script src="/resources/testharnessreport.js"></script> 1.9 +<div id="log"></div> 1.10 +<script> 1.11 +test(function() { 1.12 + function test(root) { 1.13 + var threw = false; 1.14 + try { 1.15 + root.querySelectorAll(""); 1.16 + } catch(e){ threw = true; }; 1.17 + // Hot loop to make sure the JIT heuristics ion-compile this function even 1.18 + // though it's throwing exceptions (which would normally make us back off 1.19 + // of ion compilation). 1.20 + for (var i=0; i<1500; i++) {} 1.21 + return threw; 1.22 + } 1.23 + 1.24 + var threw = false; 1.25 + var el = document.createElement("div"); 1.26 + for (var i=0; i<200; i++) 1.27 + threw = test(el); 1.28 + assert_true(threw); 1.29 +}, "Shouldn't optimize away throwing functions"); 1.30 +</script>