NamespaceAwareLookup.st
branchjv
changeset 21242 19fabe339f8b
parent 21086 dae6aabc5a14
parent 21100 6cd737df7462
child 23107 40173e082cbc
equal deleted inserted replaced
21092:6dc23c67620f 21242:19fabe339f8b
    87 
    87 
    88 lookupMethodForSelector: selector directedTo: initialSearchClass for: receiver withArguments: argArrayOrNil from: sendingContext ilc: ilc
    88 lookupMethodForSelector: selector directedTo: initialSearchClass for: receiver withArguments: argArrayOrNil from: sendingContext ilc: ilc
    89 
    89 
    90     "JV @ 2010-07-24
    90     "JV @ 2010-07-24
    91      Following C code is just a performance optimization.
    91      Following C code is just a performance optimization.
    92      It is not neccessary, however it speeds things in most
    92      It is not necessary, however it speeds things in most
    93      cases. Such optimization significantly speeds up the IDE
    93      cases. Such optimization significantly speeds up the IDE
    94      since class browser involves dozens of super-polymorphic
    94      since class browser involves dozens of super-polymorphic
    95      sends (> 1000 receiver classes per send-site).
    95      sends (> 1000 receiver classes per send-site).
    96 	"
    96         "
    97 
    97 
    98 %{
    98 %{
    99     OBJ sendingMthd = nil;
    99     OBJ sendingMthd = nil;
   100     OBJ ctx = sendingContext;
   100     OBJ ctx = sendingContext;
   101     while ( ctx && 
   101     while ( ctx && 
   108 	 (((INT)(__ContextInstPtr(ctx)->c_flags) & __MASKSMALLINT(__METHOD_VALID))) ) {
   108 	 (((INT)(__ContextInstPtr(ctx)->c_flags) & __MASKSMALLINT(__METHOD_VALID))) ) {
   109         sendingMthd = __ContextInstPtr(sendingContext)->c_method;	 
   109         sendingMthd = __ContextInstPtr(sendingContext)->c_method;	 
   110     }
   110     }
   111 	          
   111 	          
   112     if (__Class(sendingMthd) == Method &&
   112     if (__Class(sendingMthd) == Method &&
   113 	    __MethodInstPtr(sendingMthd)->m_annotation == nil) {
   113             __MethodInstPtr(sendingMthd)->m_annotation == nil) {
   114 	    OBJ m = __lookup(initialSearchClass, selector);
   114             OBJ m = __lookup(initialSearchClass, selector);
   115 	    if (m != nil) RETURN ( m );
   115             if (m != nil) RETURN ( m );
   116     }
   116     }
   117 %}.
   117 %}.
   118 
   118 
   119     ^Instance lookupMethodForSelector: selector directedTo: initialSearchClass
   119     ^Instance lookupMethodForSelector: selector directedTo: initialSearchClass
   120 			  for: receiver withArguments: argArrayOrNil
   120                           for: receiver withArguments: argArrayOrNil
   121 			  from: sendingContext
   121                           from: sendingContext
   122 			  ilc: ilc
   122 			  ilc: ilc
   123 
       
   124 ! !
   123 ! !
   125 
   124 
   126 !NamespaceAwareLookup methodsFor:'lookup'!
   125 !NamespaceAwareLookup methodsFor:'lookup'!
   127 
   126 
   128 lookupMethodForSelector: selector directedTo: initialSearchClass for: receiver withArguments: argArrayOrNil from: sendingContext ilc: ilcCache
   127 lookupMethodForSelector: selector directedTo: initialSearchClass for: receiver withArguments: argArrayOrNil from: sendingContext ilc: ilcCache
   131 
   130 
   132     | sendingNs sendingMthd queue seen namespaces methods imports numMethods|
   131     | sendingNs sendingMthd queue seen namespaces methods imports numMethods|
   133 
   132 
   134     "JV @ 2010-07-24
   133     "JV @ 2010-07-24
   135      Following C code is just a performance optimization.
   134      Following C code is just a performance optimization.
   136      It is not neccessary, however it speeds things in most
   135      It is not necessary, however it speeds things in most
   137      cases. Such optimization significantly speeds up the IDE
   136      cases. Such optimization significantly speeds up the IDE
   138      since class browser involves dozens of super-polymorphic
   137      since class browser involves dozens of super-polymorphic
   139      sends (> 1000 receiver classes per send-site).
   138      sends (> 1000 receiver classes per send-site).
   140     "
   139     "
   141     
   140     
   421 ! !
   420 ! !
   422 
   421 
   423 !NamespaceAwareLookup class methodsFor:'documentation'!
   422 !NamespaceAwareLookup class methodsFor:'documentation'!
   424 
   423 
   425 version_CVS
   424 version_CVS
   426     ^ '$Header: /cvs/stx/stx/libbasic/NamespaceAwareLookup.st,v 1.4 2015-05-18 00:05:38 cg Exp $'
   425     ^ '$Header$'
   427 !
   426 !
   428 
   427 
   429 version_HG
   428 version_HG
   430 
   429 
   431     ^ '$Changeset: <not expanded> $'
   430     ^ '$Changeset: <not expanded> $'
   432 !
   431 !
   433 
   432 
   434 version_SVN
   433 version_SVN
   435     ^ '$Id: NamespaceAwareLookup.st,v 1.4 2015-05-18 00:05:38 cg Exp $'
   434     ^ '$Id$'
   436 ! !
   435 ! !
   437 
   436 
   438 
   437 
   439 NamespaceAwareLookup initialize!
   438 NamespaceAwareLookup initialize!