Changeset 169
- Timestamp:
- 05/20/07 17:35:04 (2 years ago)
- Files:
-
- trunk/mdcl.zip (modified) (previous)
- trunk/minid/baselib.d (modified) (1 diff)
- trunk/minid/compiler.d (modified) (1 diff)
- trunk/minid/opcodes.d (modified) (1 diff)
- trunk/minid/types.d (modified) (16 diffs)
- trunk/test.opt (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/minid/baselib.d
r167 r169 430 430 int mdtypeof(MDState s, uint numParams) 431 431 { 432 s.push( typeStrings[s.getParam(0u).type]);432 s.push(s.getParam(0u).typeString()); 433 433 return 1; 434 434 } trunk/minid/compiler.d
r167 r169 3149 3149 ret.mNumParams = mNumParams; 3150 3150 ret.mNumUpvals = mUpvals.length; 3151 ret.mStackSize = mStackSize ;3151 ret.mStackSize = mStackSize + 1; 3152 3152 ret.mCode = mCode; 3153 3153 ret.mLineInfo = mLineInfo; trunk/minid/opcodes.d
r167 r169 171 171 PopCatch..........I: n/a, n/a 172 172 PopFinally........I: n/a, n/a 173 Precall...........R: dest, src, lookup (0 = no, 1 = yes)173 Precall...........R: dest, src, lookup (0 = no, 1 = yes) 174 174 PushCatch.........J: exception reg, branch offset 175 175 PushFinally.......J: n/a, branch offset trunk/minid/types.d
r167 r169 2871 2871 writefln(); 2872 2872 writefln("-----Stack Dump-----"); 2873 for(int i = 0; i < m CurrentAR.savedTop; i++)2873 for(int i = 0; i < mStack.length; i++) 2874 2874 writefln("[%2d:%3d]: %s", i, i - cast(int)mCurrentAR.base, mStack[i].toString()); 2875 2875 … … 3717 3717 mCurrentAR.numReturns = numReturns; 3718 3718 mCurrentAR.env = closure.environment(); 3719 3719 3720 3720 mStackIndex = base + funcDef.mStackSize; 3721 3721 … … 3793 3793 } 3794 3794 3795 mStackIndex = destSlot;3796 3797 3795 if(mARIndex == 0) 3798 3796 mState = State.Dead; 3799 3797 3800 if(!isMultRet) 3798 if(isMultRet) 3799 mStackIndex = destSlot; 3800 else 3801 3801 mStackIndex = mCurrentAR.savedTop; 3802 3802 … … 4869 4869 } 4870 4870 4871 protected MDValue lookupMethod(MDValue* RS, MDString methodName)4871 protected final MDValue lookupMethod(MDValue* RS, MDString methodName) 4872 4872 { 4873 4873 MDValue* v; … … 4924 4924 } 4925 4925 4926 protected MDValue operatorCat(MDValue[] vals)4926 protected final MDValue operatorCat(MDValue[] vals) 4927 4927 { 4928 4928 debug(TIMINGS) scope _profiler_ = new Profiler("Cat"); … … 4964 4964 } 4965 4965 4966 protected void operatorCatAssign(MDValue* dest, MDValue[] vals)4966 protected final void operatorCatAssign(MDValue* dest, MDValue[] vals) 4967 4967 { 4968 4968 debug(TIMINGS) scope _profiler_ = new Profiler("CatEq"); … … 5095 5095 Instruction i = *mCurrentAR.pc; 5096 5096 mCurrentAR.pc++; 5097 5098 MM operation = void;5099 5097 5100 5098 switch(i.opcode) … … 5553 5551 if(numParams == -1) 5554 5552 numParams = getBasedStackIndex() - funcReg - 1; 5553 else 5554 mStackIndex = funcReg + numParams + 1; 5555 5555 5556 5556 if(callPrologue(funcReg, numResults, numParams) == true) … … 5558 5558 depth++; 5559 5559 constTable = mCurrentAR.func.script.func.mConstants; 5560 } 5561 else 5562 { 5563 if(numResults >= 0) 5564 mStackIndex = mCurrentAR.savedTop; 5560 5565 } 5561 5566 } … … 5570 5575 if(numParams == -1) 5571 5576 numParams = getBasedStackIndex() - funcReg - 1; 5572 5577 else 5578 mStackIndex = funcReg + numParams + 1; 5579 5573 5580 funcReg = basedIndexToAbs(funcReg); 5574 5581 … … 5615 5622 if(numParams == -1) 5616 5623 numParams = getBasedStackIndex() - funcReg - 1; 5624 else 5625 mStackIndex = funcReg + numParams + 1; 5617 5626 5618 5627 if(callPrologue(funcReg, numResults, numParams) == true) … … 5621 5630 constTable = mCurrentAR.func.script.func.mConstants; 5622 5631 } 5632 else 5633 { 5634 if(numResults >= 0) 5635 mStackIndex = mCurrentAR.savedTop; 5636 } 5623 5637 } 5624 5638 else … … 5633 5647 if(numParams == -1) 5634 5648 numParams = getBasedStackIndex() - funcReg - 1; 5649 else 5650 mStackIndex = funcReg + numParams + 1; 5635 5651 5636 5652 funcReg = basedIndexToAbs(funcReg); … … 5665 5681 5666 5682 int numResults = i.imm - 1; 5683 5684 if(numResults >= 0) 5685 mStackIndex = i.rd + numResults; 5667 5686 5668 5687 close(0); … … 5672 5691 if(depth == 0) 5673 5692 return; 5674 5693 5675 5694 constTable = mCurrentAR.func.script.func.mConstants; 5676 5695 break; … … 5681 5700 int numNeeded = i.imm - 1; 5682 5701 int numVarargs = mCurrentAR.base - mCurrentAR.vargBase; 5702 uint dest = basedIndexToAbs(i.rd); 5683 5703 5684 5704 if(numNeeded == -1) 5705 { 5685 5706 numNeeded = numVarargs; 5686 5687 needStackSlots(numNeeded); 5707 mStackIndex = dest + numVarargs; 5708 checkStack(mStackIndex); 5709 } 5688 5710 5689 5711 uint src = mCurrentAR.vargBase; 5690 uint dest = basedIndexToAbs(i.rd);5691 5712 5692 5713 for(uint index = 0; index < numNeeded; index++) 5693 5714 { 5694 5715 if(index < numVarargs) 5695 copyAbsStack(dest + index, src);5716 copyAbsStack(dest, src); 5696 5717 else 5697 getAbsStack(dest + index).setNull();5698 5718 getAbsStack(dest).setNull(); 5719 5699 5720 src++; 5721 dest++; 5700 5722 } 5701 5702 mStackIndex = dest + numNeeded;5723 5724 debug(STACKINDEX) writefln("Op.Vararg set stack index to ", mStackIndex); 5703 5725 break; 5704 5726
