Bug 519768 - NJ: fix lirasm test failures, r=nnethercote.
authorGraydon Hoare <graydon@mozilla.com>
Wed, 30 Sep 2009 11:20:50 -0700
changeset 33568 5247cfd604db55d8624059bef11e648a12c26fbd
parent 33567 d04601f54db59260351f7e30bfca17c4eb5574f5
child 33570 67be479f8a95b6a13a92ae6a8d74aee679ff966a
push idunknown
push userunknown
push dateunknown
reviewersnnethercote
bugs519768
milestone1.9.3a1pre
Bug 519768 - NJ: fix lirasm test failures, r=nnethercote.
js/src/lirasm/lirasm.cpp
--- a/js/src/lirasm/lirasm.cpp
+++ b/js/src/lirasm/lirasm.cpp
@@ -455,17 +455,19 @@ dump_srecords(ostream &out, Fragment *fr
 
 
 uint32_t
 FragmentAssembler::sProfId = 0;
 
 FragmentAssembler::FragmentAssembler(Lirasm &parent, const string &fragmentName)
     : mParent(parent), mFragName(fragmentName)
 {
-    mFragment = new Fragment(NULL verbose_only(, sProfId++));
+    mFragment = new Fragment(NULL verbose_only(, (mParent.mLogc.lcbits &
+                                                  nanojit::LC_FragProfile) ?
+                                                  sProfId++ : 0));
     mFragment->lirbuf = mParent.mLirbuf;
     mFragment->root = mFragment;
     mParent.mFragments[mFragName].fragptr = mFragment;
 
     mBufWriter = new LirBufWriter(mParent.mLirbuf);
     mCseFilter = new CseFilter(mBufWriter, mParent.mAlloc);
     mExprFilter = new ExprFilter(mCseFilter);
     mVerboseWriter = NULL;
@@ -478,16 +480,18 @@ FragmentAssembler::FragmentAssembler(Lir
                                            mParent.mLirbuf->names,
                                            &mParent.mLogc);
         mLir = mVerboseWriter;
     }
 #endif
 
     mReturnTypeBits = 0;
     mLir->ins0(LIR_start);
+    for (int i = 0; i < nanojit::NumSavedRegs; ++i)
+        mLir->insParam(i, 1);
 
     mLineno = 0;
 }
 
 FragmentAssembler::~FragmentAssembler()
 {
     delete mVerboseWriter;
     delete mExprFilter;
@@ -727,18 +731,18 @@ FragmentAssembler::endFragment()
         mReturnTypeBits != RT_GUARD) {
         cerr << "warning: multiple return types in fragment '"
              << mFragName << "'" << endl;
     }
 
     mFragment->lastIns =
         mLir->insGuard(LIR_x, NULL, createGuardRecord(createSideExit()));
 
-    ::compile(&mParent.mAssm, mFragment, mParent.mAlloc
-              verbose_only(, mParent.mLabelMap));
+    ::compile(&mParent.mAssm, mFragment
+              verbose_only(, mParent.mAlloc, mParent.mLabelMap));
 
     if (mParent.mAssm.error() != nanojit::None) {
         cerr << "error during assembly: ";
         switch (mParent.mAssm.error()) {
           case nanojit::StackFull: cerr << "StackFull"; break;
           case nanojit::UnknownBranch: cerr << "UnknownBranch"; break;
           case nanojit::None: cerr << "None"; break;
         }