NamespaceAwareLookup.st
author HG Automerge
Mon, 26 Dec 2016 10:13:07 +0000
branchjv
changeset 21247 9ee1206fc247
parent 21242 19fabe339f8b
child 23107 40173e082cbc
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
     1
"
13478
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
     2
 COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
     3
	      All Rights Reserved
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
     4
13478
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
     5
Permission is hereby granted, free of charge, to any person
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
     6
obtaining a copy of this software and associated documentation
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
     7
files (the 'Software'), to deal in the Software without
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
     8
restriction, including without limitation the rights to use,
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
     9
copy, modify, merge, publish, distribute, sublicense, and/or sell
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    10
copies of the Software, and to permit persons to whom the
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    11
Software is furnished to do so, subject to the following
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    12
conditions:
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    13
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    14
The above copyright notice and this permission notice shall be
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    15
included in all copies or substantial portions of the Software.
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    16
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    17
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    18
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    19
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    20
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    21
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    22
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    23
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    24
OTHER DEALINGS IN THE SOFTWARE.
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    25
"
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    26
"{ Package: 'stx:libbasic' }"
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    27
21100
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
    28
"{ NameSpace: Smalltalk }"
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
    29
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    30
Lookup subclass:#NamespaceAwareLookup
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    31
	instanceVariableNames:''
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    32
	classVariableNames:'Instance'
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    33
	poolDictionaries:''
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    34
	category:'Kernel-Extensions'
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    35
!
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    36
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    37
!NamespaceAwareLookup class methodsFor:'documentation'!
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    38
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    39
copyright
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    40
"
13478
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    41
 COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
    42
	      All Rights Reserved
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    43
13478
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    44
Permission is hereby granted, free of charge, to any person
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    45
obtaining a copy of this software and associated documentation
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    46
files (the 'Software'), to deal in the Software without
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    47
restriction, including without limitation the rights to use,
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    48
copy, modify, merge, publish, distribute, sublicense, and/or sell
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    49
copies of the Software, and to permit persons to whom the
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    50
Software is furnished to do so, subject to the following
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    51
conditions:
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    52
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    53
The above copyright notice and this permission notice shall be
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    54
included in all copies or substantial portions of the Software.
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    55
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    56
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    57
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    58
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    59
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    60
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    61
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    62
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
    63
OTHER DEALINGS IN THE SOFTWARE.
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    64
"
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    65
! !
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    66
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    67
!NamespaceAwareLookup class methodsFor:'initialization'!
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    68
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    69
initialize
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    70
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    71
    Instance := self basicNew
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    72
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    73
    "Created: / 10-07-2010 / 21:12:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    74
! !
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    75
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    76
!NamespaceAwareLookup class methodsFor:'accessing'!
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    77
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    78
instance
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    79
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    80
    ^Instance
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    81
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    82
    "Created: / 20-05-2010 / 11:18:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    83
    "Modified: / 10-07-2010 / 21:12:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    84
! !
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    85
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    86
!NamespaceAwareLookup class methodsFor:'lookup'!
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    87
20133
fefb47dc71f6 Issue #73: Updated NamespaceAeareLookup to use new lookup callback signature
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20132
diff changeset
    88
lookupMethodForSelector: selector directedTo: initialSearchClass for: receiver withArguments: argArrayOrNil from: sendingContext ilc: ilc
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    89
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    90
    "JV @ 2010-07-24
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    91
     Following C code is just a performance optimization.
21100
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
    92
     It is not necessary, however it speeds things in most
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    93
     cases. Such optimization significantly speeds up the IDE
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    94
     since class browser involves dozens of super-polymorphic
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
    95
     sends (> 1000 receiver classes per send-site).
21100
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
    96
        "
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
    97
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
    98
%{
21086
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
    99
    OBJ sendingMthd = nil;
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   100
    OBJ ctx = sendingContext;
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   101
    while ( ctx && 
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   102
          (__isLazy(ctx) 
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   103
                ? __isLazyBCon(ctx) 
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   104
                : __qIsBlockContextLike(ctx))) {
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   105
        ctx = __ContextInstPtr(ctx)->c_home;
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   106
    }
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   107
    if ( (ctx != nil) &&
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   108
	 (((INT)(__ContextInstPtr(ctx)->c_flags) & __MASKSMALLINT(__METHOD_VALID))) ) {
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   109
        sendingMthd = __ContextInstPtr(sendingContext)->c_method;	 
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   110
    }
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   111
	          
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   112
    if (__Class(sendingMthd) == Method &&
21100
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   113
            __MethodInstPtr(sendingMthd)->m_annotation == nil) {
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   114
            OBJ m = __lookup(initialSearchClass, selector);
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   115
            if (m != nil) RETURN ( m );
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   116
    }
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   117
%}.
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   118
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   119
    ^Instance lookupMethodForSelector: selector directedTo: initialSearchClass
21100
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   120
                          for: receiver withArguments: argArrayOrNil
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   121
                          from: sendingContext
20133
fefb47dc71f6 Issue #73: Updated NamespaceAeareLookup to use new lookup callback signature
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20132
diff changeset
   122
			  ilc: ilc
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   123
! !
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   124
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   125
!NamespaceAwareLookup methodsFor:'lookup'!
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   126
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   127
lookupMethodForSelector: selector directedTo: initialSearchClass for: receiver withArguments: argArrayOrNil from: sendingContext ilc: ilcCache
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   128
    "Invoked by the VM to ask me for a method to fire.
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   129
     For details, see comment inLookup>>lookupMethodForSelector:directedTo:for:withArguments:from:"
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   130
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   131
    | sendingNs sendingMthd queue seen namespaces methods imports numMethods|
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   132
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   133
    "JV @ 2010-07-24
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   134
     Following C code is just a performance optimization.
21100
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   135
     It is not necessary, however it speeds things in most
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   136
     cases. Such optimization significantly speeds up the IDE
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   137
     since class browser involves dozens of super-polymorphic
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   138
     sends (> 1000 receiver classes per send-site).
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   139
    "
21086
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   140
    
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   141
%{    
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   142
    OBJ ctx = sendingContext;
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   143
    sendingMthd = nil;
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   144
    while ( ctx && 
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   145
          (__isLazy(ctx) 
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   146
                ? __isLazyBCon(ctx) 
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   147
                : __qIsBlockContextLike(ctx))) {
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   148
        ctx = __ContextInstPtr(ctx)->c_home;
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   149
    }
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   150
    if ( (ctx != nil) &&
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   151
	 (((INT)(__ContextInstPtr(ctx)->c_flags) & __MASKSMALLINT(__METHOD_VALID))) ) {
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   152
        sendingMthd = __ContextInstPtr(ctx)->c_method;	 
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   153
    }
dae6aabc5a14 Block-in-context: fixed NamespaceAwareLookup to handle Block in context's method slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 20133
diff changeset
   154
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   155
    if (__Class(sendingMthd) == Method &&
21100
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   156
            __MethodInstPtr(sendingMthd)->m_annotation == nil) {
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   157
            OBJ m = __lookup(initialSearchClass, selector);
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   158
            if (m != nil) {
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   159
                if (ilcCache != nil) __ilcBind(ilcCache, initialSearchClass, m, selector);
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   160
                RETURN ( m );
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   161
            }
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   162
    }
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   163
%}.
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   164
    "If you remove C code above, uncomment the line below."
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   165
    "sendingMthd := sendingContext method."
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   166
    sendingNs := sendingMthd isNil
21100
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   167
            ifTrue:[nil]
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   168
            ifFalse:[sendingMthd nameSpace].
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   169
21100
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   170
        "Second chance to speed up things (in case sending method
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   171
         has resource or so)"
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   172
%{
16080
e12fe7f621a8 class: NamespaceAwareLookup
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13478
diff changeset
   173
    if (sendingNs == nil) {
21100
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   174
        OBJ m = __lookup(initialSearchClass, selector);
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   175
        if (m != nil) {
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   176
            if (ilcCache != nil) __ilcBind(ilcCache, initialSearchClass, m, selector);
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   177
            RETURN ( m );
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   178
        }
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   179
    }
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   180
%}.
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   181
    "
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   182
    Stderr
21100
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   183
            show: 'sel='; show: selector; show: ' ns='; show: sendingNs printString;
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   184
            show: ' method=', sendingMthd printString; cr.
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   185
        "
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   186
    sendingNs notNil ifTrue: [
21100
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   187
        seen := Set new.
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   188
        namespaces := Array with: sendingNs.
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   189
21100
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   190
        [namespaces notEmpty] whileTrue:[
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   191
            methods := self
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   192
                        lookupMethodsForSelector: selector
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   193
                        directedTo: initialSearchClass
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   194
                        inNamespaces: namespaces.
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   195
            numMethods := methods size.
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   196
            numMethods == 1 ifTrue:[
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   197
                ^ methods anyOne
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   198
            ].
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   199
            numMethods > 1 ifTrue:[
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   200
                ^self ambiguousMessageSend: selector withArgs: argArrayOrNil
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   201
            ].
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   202
            "No method found"
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   203
            seen addAll: namespaces.
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   204
            imports := Set new.
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   205
            namespaces do:[:namespace|
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   206
                namespace notNil ifTrue:[
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   207
                    namespace imports do:[:import|
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   208
                        (seen includes: import) ifFalse: [
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   209
                            imports add: import
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   210
                        ]
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   211
                    ]
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   212
                ]
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   213
            ].
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   214
            namespaces := imports
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   215
        ].
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   216
    ].
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   217
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   218
    methods := self lookupMethodsForSelector: selector
21100
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   219
                        directedTo: initialSearchClass.
16080
e12fe7f621a8 class: NamespaceAwareLookup
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13478
diff changeset
   220
    methods size == 1 ifTrue:[
21100
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   221
        | m |
16080
e12fe7f621a8 class: NamespaceAwareLookup
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13478
diff changeset
   222
21100
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   223
        m := methods anyOne.
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   224
        ilcCache notNil ifTrue:[ ilcCache bindTo: m forClass: initialSearchClass ].
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   225
        ^ m
16080
e12fe7f621a8 class: NamespaceAwareLookup
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13478
diff changeset
   226
    ].
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   227
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   228
    ^nil
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   229
16080
e12fe7f621a8 class: NamespaceAwareLookup
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13478
diff changeset
   230
    "Created: / 19-02-2014 / 21:49:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
20132
f7206036949e Issue #73: Send #selectorWithoutNameSpace instead of #selector
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18366
diff changeset
   231
    "Modified: / 21-06-2016 / 07:32:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   232
! !
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   233
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   234
!NamespaceAwareLookup methodsFor:'lookup - helpers'!
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   235
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   236
lookupMethodsForSelector: selector directedTo: initialSearchClass
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   237
    "Searches initialSearchClass for a methods with in any namespace"
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   238
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   239
    ^self
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   240
	lookupMethodsForSelector: selector
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   241
	directedTo: initialSearchClass
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   242
	suchThat:[:sel :mthd|true].
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   243
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   244
    "Created: / 19-07-2010 / 15:37:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   245
!
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   246
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   247
lookupMethodsForSelector: selector directedTo: initialSearchClass inNamespaces: namespaces
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   248
    "Searches initialSearchClass for a methods with given selector in given namespaces."
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   249
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   250
    ^self
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   251
	lookupMethodsForSelector: selector
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   252
	directedTo: initialSearchClass
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   253
	suchThat:[:sel :mthd|namespaces includes: mthd nameSpace].
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   254
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   255
    "Created: / 19-07-2010 / 15:13:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   256
!
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   257
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   258
lookupMethodsForSelector: selector directedTo: initialSearchClass suchThat: block
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   259
    "Searches initialSearchClass for a method with given selector in given nameSpace.
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   260
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   261
     if no method in given namespace is found, returns nil"
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   262
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   263
    | searchClass methods seen |
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   264
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   265
    searchClass := initialSearchClass.
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   266
    methods := Set new.
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   267
    seen := OrderedCollection new.
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   268
    [ searchClass notNil ] whileTrue:[
20132
f7206036949e Issue #73: Send #selectorWithoutNameSpace instead of #selector
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18366
diff changeset
   269
        searchClass selectorsAndMethodsDo:[:sel :mthd|
f7206036949e Issue #73: Send #selectorWithoutNameSpace instead of #selector
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18366
diff changeset
   270
            (sel selectorWithoutNameSpace = selector
f7206036949e Issue #73: Send #selectorWithoutNameSpace instead of #selector
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18366
diff changeset
   271
              and:[ (seen includes: mthd nameSpace) not
f7206036949e Issue #73: Send #selectorWithoutNameSpace instead of #selector
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18366
diff changeset
   272
              and:[ block value: sel value: mthd]]
f7206036949e Issue #73: Send #selectorWithoutNameSpace instead of #selector
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18366
diff changeset
   273
            ) ifTrue:[
f7206036949e Issue #73: Send #selectorWithoutNameSpace instead of #selector
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18366
diff changeset
   274
                methods add: mthd.
f7206036949e Issue #73: Send #selectorWithoutNameSpace instead of #selector
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18366
diff changeset
   275
                seen add: mthd nameSpace
f7206036949e Issue #73: Send #selectorWithoutNameSpace instead of #selector
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18366
diff changeset
   276
            ]
f7206036949e Issue #73: Send #selectorWithoutNameSpace instead of #selector
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18366
diff changeset
   277
        ].
f7206036949e Issue #73: Send #selectorWithoutNameSpace instead of #selector
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18366
diff changeset
   278
        searchClass := searchClass superclass
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   279
    ].
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   280
    ^methods
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   281
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   282
    "Created: / 19-07-2010 / 15:34:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
20132
f7206036949e Issue #73: Send #selectorWithoutNameSpace instead of #selector
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18366
diff changeset
   283
    "Modified: / 21-06-2016 / 00:25:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   284
! !
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   285
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   286
!NamespaceAwareLookup methodsFor:'trampolines'!
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   287
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   288
ambiguousMessageSend
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   289
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   290
    ^self ambiguousMessage:
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   291
	(Message
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   292
	    selector: #__placeholder__
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   293
	    arguments: #()
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   294
	)
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   295
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   296
    "Created: / 19-08-2010 / 22:05:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   297
!
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   298
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   299
ambiguousMessageSend: selector withArgs: argArrayOrNil
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   300
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   301
    | trampoline |
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   302
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   303
    trampoline := self class methodDictionary at:
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   304
		     (#(" 0"ambiguousMessageSend
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   305
			" 1"ambiguousMessageSendWith:
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   306
			" 2"ambiguousMessageSendWith:with:
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   307
			" 3"ambiguousMessageSendWith:with:with:
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   308
			" 4"ambiguousMessageSendWith:with:with:with:
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   309
			" 5"ambiguousMessageSendWith:with:with:with:with:
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   310
			" 6"ambiguousMessageSendWith:with:with:with:with:with:
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   311
			" 7"ambiguousMessageSendWith:with:with:with:with:with:with:
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   312
			" 8"ambiguousMessageSendWith:with:with:with:with:with:with:with:
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   313
			)
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   314
			at: argArrayOrNil size + 1).
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   315
    trampoline := trampoline asByteCodeMethod.
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   316
    1 to: trampoline numLiterals do: [:litNr|
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   317
	(trampoline literalAt: litNr) == #__placeholder__ ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   318
	    (trampoline literalAt: litNr put: selector)
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   319
	]
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   320
    ].
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   321
    ^trampoline
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   322
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   323
    "Created: / 19-08-2010 / 22:09:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   324
!
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   325
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   326
ambiguousMessageSendWith: a1
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   327
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   328
    ^self ambiguousMessage:
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   329
	(Message
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   330
	    selector: #__placeholder__
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   331
	    arguments: (Array with: a1)
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   332
	)
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   333
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   334
    "Created: / 19-08-2010 / 22:06:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   335
!
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   336
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   337
ambiguousMessageSendWith: a1 with: a2
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   338
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   339
    ^self ambiguousMessage:
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   340
	(Message
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   341
	    selector: #__placeholder__
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   342
	    arguments: (Array with: a1 with: a2)
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   343
	)
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   344
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   345
    "Created: / 19-08-2010 / 22:06:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   346
!
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   347
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   348
ambiguousMessageSendWith: a1 with: a2 with: a3
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   349
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   350
    ^self ambiguousMessage:
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   351
	(Message
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   352
	    selector: #__placeholder__
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   353
	    arguments: (Array with: a1 with: a2 with: a3)
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   354
	)
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   355
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   356
    "Created: / 19-08-2010 / 22:06:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   357
!
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   358
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   359
ambiguousMessageSendWith: a1 with: a2 with: a3 with: a4
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   360
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   361
    ^self ambiguousMessage:
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   362
	(Message
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   363
	    selector: #__placeholder__
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   364
	    arguments: (Array with: a1 with: a2 with: a3 with: a4)
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   365
	)
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   366
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   367
    "Created: / 19-08-2010 / 22:06:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   368
!
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   369
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   370
ambiguousMessageSendWith: a1 with: a2 with: a3 with: a4
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   371
		    with: a5
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   372
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   373
    ^self ambiguousMessage:
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   374
	(Message
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   375
	    selector: #__placeholder__
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   376
	    arguments: (Array with: a1 with: a2 with: a3 with: a4
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   377
			      with: a5)
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   378
	)
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   379
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   380
    "Created: / 19-08-2010 / 22:07:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   381
!
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   382
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   383
ambiguousMessageSendWith: a1 with: a2 with: a3 with: a4
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   384
		    with: a5 with: a6
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   385
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   386
    ^self ambiguousMessage:
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   387
	(Message
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   388
	    selector: #__placeholder__
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   389
	    arguments: (Array with: a1 with: a2 with: a3 with: a4
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   390
			      with: a5 with: a6)
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   391
	)
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   392
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   393
    "Created: / 19-08-2010 / 22:07:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   394
!
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   395
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   396
ambiguousMessageSendWith: a1 with: a2 with: a3 with: a4
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   397
		    with: a5 with: a6 with: a7
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   398
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   399
    ^self ambiguousMessage:
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   400
	(Message
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   401
	    selector: #__placeholder__
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   402
	    arguments: (Array with: a1 with: a2 with: a3 with: a4
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   403
			      with: a5 with: a6 with: a7)
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   404
	)
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   405
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   406
    "Created: / 19-08-2010 / 22:07:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   407
!
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   408
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   409
ambiguousMessageSendWith: a1 with: a2 with: a3 with: a4
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   410
		    with: a5 with: a6 with: a7 with: a8
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   411
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   412
    ^self ambiguousMessage:
18359
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   413
	(Message
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   414
	    selector: #__placeholder__
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   415
	    arguments: (Array with: a1 with: a2 with: a3 with: a4
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   416
			      with: a5 with: a6 with: a7 with: a8)
Claus Gittinger <cg@exept.de>
parents: 16080
diff changeset
   417
	)
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   418
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   419
    "Created: / 19-08-2010 / 22:08:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   420
! !
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   421
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   422
!NamespaceAwareLookup class methodsFor:'documentation'!
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   423
13478
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
   424
version_CVS
21100
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   425
    ^ '$Header$'
13478
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
   426
!
0212bdc3f19c changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 13403
diff changeset
   427
20132
f7206036949e Issue #73: Send #selectorWithoutNameSpace instead of #selector
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18366
diff changeset
   428
version_HG
f7206036949e Issue #73: Send #selectorWithoutNameSpace instead of #selector
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18366
diff changeset
   429
f7206036949e Issue #73: Send #selectorWithoutNameSpace instead of #selector
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18366
diff changeset
   430
    ^ '$Changeset: <not expanded> $'
f7206036949e Issue #73: Send #selectorWithoutNameSpace instead of #selector
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18366
diff changeset
   431
!
f7206036949e Issue #73: Send #selectorWithoutNameSpace instead of #selector
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18366
diff changeset
   432
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   433
version_SVN
21100
6cd737df7462 #OTHER by mawalch
mawalch
parents: 18359
diff changeset
   434
    ^ '$Id$'
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   435
! !
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   436
16080
e12fe7f621a8 class: NamespaceAwareLookup
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13478
diff changeset
   437
13403
9cdd42752750 added AmbiguousMessage, Annotation, NamespaceAwareLookup
vrany
parents:
diff changeset
   438
NamespaceAwareLookup initialize!