Bug 580187 - Pass vp to ComputeThisFromVp (r=dvander)
authorLuke Wagner <lw@mozilla.com>
Tue, 20 Jul 2010 19:32:04 -0700
changeset 48517 faf55b60e857e7672e41f043c7a7a5bfebcdda88
parent 48516 8463de3a71e1cfc2057ec498f6ce0eef1d292184
child 48518 73922e37b73313237a6e1235ec2bf64d4c309601
push id14748
push userrsayre@mozilla.com
push dateSun, 01 Aug 2010 00:33:23 +0000
treeherdermozilla-central@f0df797bb2a9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs580187
milestone2.0b2pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 580187 - Pass vp to ComputeThisFromVp (r=dvander)
js/src/jstracer.cpp
js/src/trace-test/tests/basic/testSlowNativeWithNullThis.js
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -11387,17 +11387,17 @@ TraceRecorder::callNative(uintN argc, JS
         /*
          * For fast natives, 'null' or primitives are fine as as 'this' value.
          * For slow natives we have to ensure the object is substituted for the
          * appropriate global object or boxed object value. JSOP_NEW allocates its
          * own object so it's guaranteed to have a valid 'this' value.
          */
         if (!(fun->flags & JSFUN_FAST_NATIVE)) {
             if (vp[1].isNull()) {
-                JSObject* thisObj = ComputeThisFromVp(cx, vp + 2);
+                JSObject* thisObj = ComputeThisFromVp(cx, vp);
                 if (!thisObj)
                     RETURN_ERROR("error in js_ComputeGlobalThis");
                 this_ins = INS_CONSTOBJ(thisObj);
             } else if (!vp[1].isObject()) {
                 RETURN_STOP("slow native(primitive, args)");
             } else {
                 if (vp[1].toObject().hasClass(&js_WithClass))
                     RETURN_STOP("can't trace slow native invocation on With object");
new file mode 100644
--- /dev/null
+++ b/js/src/trace-test/tests/basic/testSlowNativeWithNullThis.js
@@ -0,0 +1,6 @@
+x = 0
+for (a = 0; a < 3; a++) {
+    (function () {
+        return Float64Array
+    })()(x, 1)
+}