Index: test/mjsunit/lithium/MulI.js |
diff --git a/test/mjsunit/regress/regress-frame-details-null-receiver.js b/test/mjsunit/lithium/MulI.js |
similarity index 67% |
copy from test/mjsunit/regress/regress-frame-details-null-receiver.js |
copy to test/mjsunit/lithium/MulI.js |
index d15ed4d00ae774ad01406855fc42cb8c1dfbcc07..68588bd512849ab442d9c3e18fcb8246512801e1 100644 |
--- a/test/mjsunit/regress/regress-frame-details-null-receiver.js |
+++ b/test/mjsunit/lithium/MulI.js |
@@ -25,28 +25,46 @@ |
// (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: --expose-debug-as debug --allow-natives-syntax |
- |
-Debug = debug.Debug; |
-var listened = false; |
- |
-function listener(event, exec_state, event_data, data) { |
- if (event == Debug.DebugEvent.Exception) { |
- for (var i = 0; i < exec_state.frameCount(); i++) { |
- print(exec_state.frame(i).receiver()); |
- print(exec_state.frame(i).func().name()); |
- } |
- } |
- listened = true; |
+// Flags: --allow-natives-syntax --no-use-osr |
+ |
+function foo_smi(a, b) { |
+ var result = a * b; |
+ result += a * 35; |
+ result += a * -1; |
+ result += a * 1; |
+ result += a * 0; |
+ return result * a; |
+} |
+ |
+function foo_int(a, b) { |
+ var result = a * b; |
+ result += a * 35; |
+ result += a * -1; |
+ result += a * 1; |
+ result += a * 0; |
+ return result * a; |
} |
-Debug.setListener(listener); |
-Debug.setBreakOnException(); |
+foo_smi(10, 5); |
+var r1 = foo_smi(10, 5); |
+%OptimizeFunctionOnNextCall(foo_smi); |
+var r2 = foo_smi(10, 5); |
-assertThrows(function() { delete null['foo']; }); |
+assertEquals(r1, r2); |
-Debug.clearBreakOnException(); |
-Debug.setListener(null); |
+foo_int(10, 21474800); |
+var r3 = foo_int(10, 21474800); |
+%OptimizeFunctionOnNextCall(foo_int); |
+var r4 = foo_int(10, 21474800); |
-assertTrue(listened); |
+assertEquals(r3, r4); |
+ |
+// Check overflow with -1 constant. |
+function foo2(value) { |
+ return value * -1; |
+} |
+foo2(-2147483600); |
+foo2(-2147483600); |
+%OptimizeFunctionOnNextCall(foo2); |
+assertEquals(2147483648, foo2(-2147483648)); |