[INFER] Remove cruft for handling overflowing INCNAME/etc. ops, bug 642164.
authorBrian Hackett <bhackett1024@gmail.com>
Wed, 16 Mar 2011 22:25:32 -0700
changeset 74795 84090709049e7593413f21a62e1d559d150e3a1f
parent 74794 61b3cd5aaee114210206fcf55ca50f87ad3b895b
child 74796 54ba422e342996337749c2277a3ea8eee426ee95
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
bugs642164
milestone2.0b13pre
[INFER] Remove cruft for handling overflowing INCNAME/etc. ops, bug 642164.
js/src/jit-test/tests/basic/bug642164.js
js/src/methodjit/StubCalls.cpp
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/basic/bug642164.js
@@ -0,0 +1,14 @@
+function raisesException(exception) {
+  return function (code) {
+      eval(code);
+  };
+};
+function obj() {
+  var o = { assertEq: true, y: 1 };
+  Object.defineProperty(o, 'x', { writable: false });
+  return o;
+}
+function in_strict_with(expr) {
+  return "with(obj()) { (function () { 'use strict'; " + expr + " })(); }";
+}
+try { assertEq(raisesException(TypeError)(in_strict_with('x++;')), true); } catch (e) {}
--- a/js/src/methodjit/StubCalls.cpp
+++ b/js/src/methodjit/StubCalls.cpp
@@ -1059,42 +1059,27 @@ MonitorArithmeticOverflow(VMFrame &f, co
     switch (JSOp(*f.regs.pc)) {
       case JSOP_INCPROP:
       case JSOP_DECPROP:
       case JSOP_PROPINC:
       case JSOP_PROPDEC:
         ov = f.regs.sp[-4];
         break;
 
-      case JSOP_INCNAME:
-      case JSOP_DECNAME:
-      case JSOP_NAMEINC:
-      case JSOP_NAMEDEC:
-        ov = f.regs.sp[-3];
-        break;
-
       default:
         return true;
     }
 
     JSObject *obj = ValueToObject(cx, &ov);
     if (!obj)
         return true;
     JSAtom *atom;
     GET_ATOM_FROM_BYTECODE(f.script(), f.regs.pc, 0, atom);
-    cx->addTypePropertyId(obj->getType(), ATOM_TO_JSID(atom), TYPE_DOUBLE);
-
-    /*
-     * Also do an uncached setProperty, if this is a Call object which
-     * addTypeProperty does not work for.
-     */
-    Value nv = v;
-    obj->setProperty(cx, ATOM_TO_JSID(atom), &nv, f.script()->strictModeCode);
-
-    return true;
+
+    return cx->addTypePropertyId(obj->getType(), ATOM_TO_JSID(atom), TYPE_DOUBLE);
 }
 
 void JS_FASTCALL
 stubs::Add(VMFrame &f)
 {
     JSContext *cx = f.cx;
     JSFrameRegs &regs = f.regs;
     Value rval = regs.sp[-1];