Bug 592199 - call js_PutArguments from trace always (r=dmandelin, a=blocking)
authorLuke Wagner <lw@mozilla.com>
Wed, 01 Sep 2010 09:53:29 -0700
changeset 51829 c38ea6cd0ea2e06291ea739698f9b9ed3d14dda0
parent 51828 51d17027ff45d6b9179601a3f06a6cc75830c855
child 51830 19f441a1c2623e936984e03264523779c4ce5beb
push id15443
push userlwagner@mozilla.com
push dateWed, 01 Sep 2010 16:55:18 +0000
treeherdermozilla-central@c38ea6cd0ea2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdmandelin, blocking
bugs592199
milestone2.0b6pre
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 592199 - call js_PutArguments from trace always (r=dmandelin, a=blocking)
js/src/jstracer.cpp
js/src/trace-test/tests/testPutOnEmptyArgsObject.js
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -10305,22 +10305,19 @@ TraceRecorder::clearCurrentFrameSlotsFro
  * argument values into the object as properties in case it is used after
  * this frame returns.
  */
 JS_REQUIRES_STACK void
 TraceRecorder::putActivationObjects()
 {
     JSStackFrame *fp = cx->fp();
 
-    bool have_args = fp->hasArgsObj() &&
-        !fp->getArgsObj()->isStrictArguments() &&
-        fp->numActualArgs() > 0;
-    bool have_call = fp->hasFunction() &&
-        JSFUN_HEAVYWEIGHT_TEST(fp->getFunction()->flags) &&
-        fp->getFunction()->countArgsAndVars();
+    bool have_args = fp->hasArgsObj() && !fp->getArgsObj()->isStrictArguments();
+    bool have_call = fp->hasCallObj();
+    JS_ASSERT(have_call == (fp->hasFunction() && fp->getFunction()->isHeavyweight()));
 
     if (!have_args && !have_call)
         return;
 
     int nargs = have_args ? argSlots(fp) : fp->numFormalArgs();
 
     LIns* args_ins;
     if (nargs) {
new file mode 100644
--- /dev/null
+++ b/js/src/trace-test/tests/testPutOnEmptyArgsObject.js
@@ -0,0 +1,16 @@
+var g;
+
+function h() {
+    return arguments.length;
+}
+
+function f() {
+    var args = arguments;
+    g = function() { return h.apply(this, args); }
+}
+
+for (var i = 0; i < 10; ++i) {
+    f();
+}
+
+assertEq(g(), 0);