4928 Return the method, or nil if instances do not understand aSelector. |
4929 Return the method, or nil if instances do not understand aSelector. |
4929 EXPERIMENTAL: take care of multiple superclasses." |
4930 EXPERIMENTAL: take care of multiple superclasses." |
4930 |
4931 |
4931 |l m cls| |
4932 |l m cls| |
4932 |
4933 |
4933 "JV @ 2010-08-22: Rewritten to respect lookup object." |
4934 Error handle:[:ex | |
4934 (l := self lookupObject) notNil ifTrue:[ |
4935 ] do:[ |
4935 ^ (l |
4936 "JV @ 2010-08-22: Rewritten to respect lookup object." |
4936 lookupMethodForSelector:aSelector |
4937 (l := self lookupObject) notNil ifTrue:[ |
4937 directedTo:self |
4938 ^ (l |
4938 for: nil "Fake receiver" |
4939 lookupMethodForSelector:aSelector |
4939 withArguments: nil "Fake arguments" |
4940 directedTo:self |
4940 from: thisContext methodHome sender |
4941 for: nil "Fake receiver" |
4941 ilc: nil "fake ilc") |
4942 withArguments: nil "Fake arguments" |
|
4943 from: thisContext methodHome sender |
|
4944 ilc: nil "fake ilc") |
|
4945 ]. |
4942 ]. |
4946 ]. |
4943 |
4947 |
4944 cls := self. |
4948 cls := self. |
4945 [ |
4949 [ |
4946 m := cls compiledMethodAt:aSelector. |
4950 m := cls compiledMethodAt:aSelector. |
4947 m notNil ifTrue:[^ m]. |
4951 m notNil ifTrue:[^ m]. |
4948 cls hasMultipleSuperclasses ifTrue:[ |
4952 cls hasMultipleSuperclasses ifTrue:[ |
4949 cls superclasses do:[:aSuperClass | |
4953 cls superclasses do:[:aSuperClass | |
4950 m := aSuperClass lookupMethodFor:aSelector. |
4954 m := aSuperClass lookupMethodFor:aSelector. |
4951 m notNil ifTrue:[^ m]. |
4955 m notNil ifTrue:[^ m]. |
4952 ]. |
4956 ]. |
4953 ^ nil |
4957 ^ nil |
4954 ] ifFalse:[ |
4958 ] ifFalse:[ |
4955 cls := cls superclass |
4959 cls := cls superclass |
4956 ] |
4960 ] |
4957 ] doWhile:[cls notNil]. |
4961 ] doWhile:[cls notNil]. |
4958 ^ nil |
4962 ^ nil |
4959 ! |
4963 ! |
4960 |
4964 |
4961 responseTo:aSelector |
4965 responseTo:aSelector |