Array.st
changeset 2052 9fdab6cbecfa
parent 1903 30c98b3377c5
child 2145 d243ffafeae3
equal deleted inserted replaced
2051:08fd6a693ee3 2052:9fdab6cbecfa
   608     |home|
   608     |home|
   609 %{
   609 %{
   610     REGISTER OBJFUNC codeVal;
   610     REGISTER OBJFUNC codeVal;
   611     REGISTER int index;
   611     REGISTER int index;
   612     REGISTER OBJ rHome;
   612     REGISTER OBJ rHome;
       
   613     OBJ slf;
   613     int nIndex, nInsts;
   614     int nIndex, nInsts;
   614     static struct inlineCache val = _ILC1;
   615     static struct inlineCache val = _ILC1;
   615     int indexLow, indexHigh;
   616     int indexLow, indexHigh;
   616 
   617 
   617     if (__bothSmallInteger(start, stop)) {
   618     if (__bothSmallInteger(start, stop)) {
   618 	indexLow = __intVal(start);
   619 	indexLow = __intVal(start);
   619 	if (indexLow > 0) {
   620 	if (indexLow > 0) {
   620 	    indexHigh = __intVal(stop);
   621 	    indexHigh = __intVal(stop);
   621 	    if (__qClass(self) != @global(Array)) {
   622 	    slf = self;
   622 		nInsts = __intVal(__ClassInstPtr(__qClass(self))->c_ninstvars);
   623 	    nIndex = __BYTES2OBJS__(__qSize(slf) - OHDR_SIZE);
       
   624 	    if (__qClass(slf) != @global(Array)) {
       
   625 		nInsts = __intVal(__ClassInstPtr(__qClass(slf))->c_ninstvars);
   623 		indexLow += nInsts;
   626 		indexLow += nInsts;
   624 		indexHigh += nInsts;
   627 		indexHigh += nInsts;
   625 	    }
   628 	    }
   626 	    nIndex = __BYTES2OBJS__(__qSize(self) - OHDR_SIZE);
       
   627 	    if (indexHigh <= nIndex) {
   629 	    if (indexHigh <= nIndex) {
   628 		indexLow--;
   630 		indexLow--;
   629 		indexHigh--;
   631 		indexHigh--;
   630 		if (__isBlockLike(aBlock)
   632 		if (__isBlockLike(aBlock)
   631 		 && ((codeVal = __BlockInstPtr(aBlock)->b_code) != (OBJFUNC)nil)
   633 		 && ((codeVal = __BlockInstPtr(aBlock)->b_code) != (OBJFUNC)nil)
  1766 ! !
  1768 ! !
  1767 
  1769 
  1768 !Array class methodsFor:'documentation'!
  1770 !Array class methodsFor:'documentation'!
  1769 
  1771 
  1770 version
  1772 version
  1771     ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.75 1996-11-06 12:17:47 cg Exp $'
  1773     ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.76 1997-01-04 13:19:32 cg Exp $'
  1772 ! !
  1774 ! !