872 |
872 |
873 flags := classRef flags. |
873 flags := classRef flags. |
874 ^ flags bitTest:Behavior flagSymbol |
874 ^ flags bitTest:Behavior flagSymbol |
875 ! |
875 ! |
876 |
876 |
877 isJavaMethod |
877 isJavaMethod |
878 |nm| |
878 |nm| |
879 |
879 |
880 nm := classRef name. |
880 nm := classRef name. |
881 ^ (nm = 'JavaMethod' |
881 ^ (nm = 'JavaMethod' |
882 or:[ nm = 'JavaMethodWithException' |
882 or:[ nm = 'JavaMethodWithException' |
883 or:[ nm = 'JavaMethodWithHandler' |
883 or:[ nm = 'JavaMethodWithHandler' |
884 or:[ nm = 'JavaNativeMethod' ]]]) |
884 or:[ nm = 'JavaNativeMethod' ]]]) |
885 ! |
885 ! |
886 |
886 |
887 isLazyMethod |
887 isLazyMethod |
888 ^ classRef name = 'LazyMethod' |
888 ^ classRef name = 'LazyMethod' |
889 ! |
889 ! |
890 |
890 |
891 isMeta |
891 isMeta |
892 ^ false |
892 ^ false |
893 ! |
893 ! |
894 |
894 |
895 isMethod |
895 isMethod |
896 |cls| |
896 |cls| |
897 |
897 |
898 cls := classRef. |
898 cls := classRef. |
899 [cls notNil] whileTrue:[ |
899 [cls notNil] whileTrue:[ |
900 cls name = 'Method' ifTrue:[^ true]. |
900 cls name = 'Method' ifTrue:[^ true]. |
1212 ]. |
1212 ]. |
1213 self halt. |
1213 self halt. |
1214 ! |
1214 ! |
1215 |
1215 |
1216 sourceStream |
1216 sourceStream |
1217 |sourcePosition source aStream fileName junk who |
1217 |sourcePosition source aStream fileName junk who |
1218 myClass mgr className sep dir mod package| |
1218 myClass mgr className sep dir mod package| |
1219 |
1219 |
1220 self isMethod ifTrue:[ |
1220 self isMethod ifTrue:[ |
1221 sourcePosition := self at:(Method instVarOffsetOf:'sourcePosition'). |
1221 sourcePosition := self at:(Method instVarOffsetOf:'sourcePosition'). |
1222 source := self at:(Method instVarOffsetOf:'source'). |
1222 source := self at:(Method instVarOffsetOf:'source'). |
1281 aStream notNil ifTrue:[ |
1281 aStream notNil ifTrue:[ |
1282 ^ aStream |
1282 ^ aStream |
1283 ]. |
1283 ]. |
1284 |
1284 |
1285 "/ |
1285 "/ |
1286 "/ nope - look in standard places |
1286 "/ nope - look in standard places |
1287 "/ (if there is a source-code manager - otherwise, we already did that) |
1287 "/ (if there is a source-code manager - otherwise, we already did that) |
1288 "/ |
1288 "/ |
1289 mgr notNil ifTrue:[ |
1289 mgr notNil ifTrue:[ |
1290 aStream := self localSourceStream. |
1290 aStream := self localSourceStream. |
1291 aStream notNil ifTrue:[ |
1291 aStream notNil ifTrue:[ |
3775 classFilename := self classFilename. |
3775 classFilename := self classFilename. |
3776 package := self package. |
3776 package := self package. |
3777 name := self name. |
3777 name := self name. |
3778 |
3778 |
3779 "/ |
3779 "/ |
3780 "/ if there is no SourceCodeManager, |
3780 "/ if there is no SourceCodeManager, |
3781 "/ or TryLocalSourceFirst is true, |
3781 "/ or TryLocalSourceFirst is true, |
3782 "/ look in standard places first |
3782 "/ look in standard places first |
3783 "/ |
3783 "/ |
3784 ((mgr := self sourceCodeManager) isNil |
3784 ((mgr := self sourceCodeManager) isNil |
3785 or:[Class tryLocalSourceFirst == true]) ifTrue:[ |
3785 or:[Class tryLocalSourceFirst == true]) ifTrue:[ |
3786 aStream := self localSourceStreamFor:source. |
3786 aStream := self localSourceStreamFor:source. |
3787 ]. |
3787 ]. |
3788 |
3788 |
3789 aStream isNil ifTrue:[ |
3789 aStream isNil ifTrue:[ |
3790 "/ mhmh - still no source file. |
3790 "/ mhmh - still no source file. |
3791 "/ If there is a SourceCodeManager, ask it to aquire the |
3791 "/ If there is a SourceCodeManager, ask it to acquire the |
3792 "/ the source for my class, and return an open stream on it. |
3792 "/ the source for my class, and return an open stream on it. |
3793 "/ if that one does not know about the source, look in |
3793 "/ if that one does not know about the source, look in |
3794 "/ standard places |
3794 "/ standard places |
3795 |
3795 |
3796 mgr notNil ifTrue:[ |
3796 mgr notNil ifTrue:[ |
3797 self classFilename ~= source ifTrue:[ |
3797 self classFilename ~= source ifTrue:[ |
3810 aStream := mgr getSourceStreamFor:self. |
3810 aStream := mgr getSourceStreamFor:self. |
3811 ] |
3811 ] |
3812 ]. |
3812 ]. |
3813 aStream notNil ifTrue:[ |
3813 aStream notNil ifTrue:[ |
3814 (self validateSourceStream:aStream) ifFalse:[ |
3814 (self validateSourceStream:aStream) ifFalse:[ |
3815 ('Class [info]: repositories source for `' |
3815 ('Class [info]: repositories source for `' |
3816 , (self isMeta ifTrue:[self soleInstance name] |
3816 , (self isMeta ifTrue:[self soleInstance name] |
3817 ifFalse:[name]) |
3817 ifFalse:[name]) |
3818 , ''' is invalid.') infoPrintCR. |
3818 , ''' is invalid.') infoPrintCR. |
3819 aStream close. |
3819 aStream close. |
3820 aStream := nil |
3820 aStream := nil |
3824 ]. |
3824 ]. |
3825 ] |
3825 ] |
3826 ]. |
3826 ]. |
3827 |
3827 |
3828 aStream isNil ifTrue:[ |
3828 aStream isNil ifTrue:[ |
3829 "/ |
3829 "/ |
3830 "/ hard case - there is no source file for this class |
3830 "/ hard case - there is no source file for this class |
3831 "/ (in the source-dir-path). |
3831 "/ (in the source-dir-path). |
3832 "/ |
3832 "/ |
3833 |
3833 |
3834 "/ |
3834 "/ |
3835 "/ look if my binary is from a dynamically loaded module, |
3835 "/ look if my binary is from a dynamically loaded module, |
3836 "/ and, if so, look in the modules directory for the |
3836 "/ and, if so, look in the modules directory for the |
3837 "/ source file. |
3837 "/ source file. |
3838 "/ |
3838 "/ |
3839 ObjectFileLoader notNil ifTrue:[ |
3839 ObjectFileLoader notNil ifTrue:[ |
3840 ObjectFileLoader loadedObjectHandlesDo:[:h | |
3840 ObjectFileLoader loadedObjectHandlesDo:[:h | |
3841 |f classes| |
3841 |f classes| |
3842 |
3842 |
3843 aStream isNil ifTrue:[ |
3843 aStream isNil ifTrue:[ |