813 lastSelectedClasses := selected copy. |
829 lastSelectedClasses := selected copy. |
814 ] |
830 ] |
815 ! |
831 ! |
816 |
832 |
817 update:something with:aParameter from:changedObject |
833 update:something with:aParameter from:changedObject |
818 |cls sel mthd newMethod oldMethod idx classListValue| |
834 |cls sel mthd newMethod oldMethod idx classListValue change| |
819 |
835 |
820 self inSlaveMode ifTrue:[ |
836 self inSlaveMode ifTrue:[ |
821 something == #methodInClass ifTrue:[ ^ self ]. |
837 something == #methodInClass ifTrue:[ ^ self ]. |
822 something == #addChange: ifTrue:[ self invalidateList. ^ self ]. |
838 something == #addChange: ifTrue:[ listValid ifTrue:[self invalidateList]. ^ self ]. |
823 something == #methodCoverageInfo ifTrue:[ self invalidateList. ^ self ]. |
839 something == #methodCoverageInfo ifTrue:[ self invalidateList. ^ self ]. |
824 ]. |
840 ]. |
825 "/ self window sensor isNil ifTrue:[ |
841 "/ self window sensor isNil ifTrue:[ |
826 "/ "/ not visible ... |
842 "/ "/ not visible ... |
827 "/ self invalidateList. |
843 "/ self invalidateList. |
844 listValid == true ifTrue:[ |
860 listValid == true ifTrue:[ |
845 self enqueueDelayedUpdateList |
861 self enqueueDelayedUpdateList |
846 ]. |
862 ]. |
847 ^ self. |
863 ^ self. |
848 ]. |
864 ]. |
|
865 |
|
866 something == #addChange: ifTrue:[ |
|
867 listValid ifTrue:[ |
|
868 change := aParameter. |
|
869 change isMethodCategoryChange ifTrue:[ |
|
870 cls := change changeClass. |
|
871 (self classIsInList:cls) ifTrue:[ |
|
872 self updateListsFor:aParameter. |
|
873 "/ self enqueueDelayedUpdateList |
|
874 ]. |
|
875 ]. |
|
876 ]. |
|
877 ^ self |
|
878 ]. |
|
879 |
849 something == #methodCoverageInfo ifTrue:[ |
880 something == #methodCoverageInfo ifTrue:[ |
850 listValid == true ifTrue:[ |
881 listValid == true ifTrue:[ |
851 mthd := aParameter. |
882 mthd := aParameter. |
852 cls := mthd mclass. |
883 cls := mthd mclass. |
853 cls notNil ifTrue:[ |
884 cls notNil ifTrue:[ |
854 classListValue size > 0 ifTrue:[ |
885 (self classIsInList:cls) ifTrue:[ |
855 ((classListValue includesIdentical:cls theNonMetaclass) |
886 self enqueueDelayedUpdateList |
856 or:[(classListValue includesIdentical:cls theMetaclass)]) ifTrue:[ |
|
857 self enqueueDelayedUpdateList |
|
858 ] |
|
859 ] |
887 ] |
860 ]. |
888 ]. |
861 ]. |
889 ]. |
862 ^ self |
890 ^ self |
863 ]. |
891 ]. |
864 something == #lastTestRunResult ifTrue:[ |
892 something == #lastTestRunResult ifTrue:[ |
865 cls := aParameter at:1. |
893 cls := aParameter at:1. |
866 sel := aParameter at:2. |
894 sel := aParameter at:2. |
867 "/ JV: Note: change is triggered only if outcome changes |
895 "/ JV: Note: change is triggered only if outcome changes |
868 cls notNil ifTrue:[ |
896 cls notNil ifTrue:[ |
869 classListValue size > 0 ifTrue:[ |
897 (self classIsInList:cls) ifTrue:[ |
870 ((classListValue includesIdentical:cls theNonMetaclass) |
898 self enqueueDelayedUpdateList |
871 or:[(classListValue includesIdentical:cls theMetaclass)]) ifTrue:[ |
|
872 self enqueueDelayedUpdateList |
|
873 ] |
|
874 ] |
899 ] |
875 ]. |
900 ]. |
876 ^ self |
901 ^ self |
877 ]. |
902 ]. |
878 |
903 |
879 something == #methodInClassRemoved ifTrue:[ |
904 something == #methodInClassRemoved ifTrue:[ |
880 self inSlaveMode ifFalse:[ |
905 self inSlaveMode ifFalse:[ |
881 cls := aParameter at:1. |
906 cls := aParameter at:1. |
882 cls notNil ifTrue:[ |
907 cls notNil ifTrue:[ |
883 classListValue size > 0 ifTrue:[ |
908 (self classIsInList:cls) ifTrue:[ |
884 ((classListValue includesIdentical:cls theNonMetaclass) |
909 self enqueueDelayedUpdateList |
885 or:[(classListValue includesIdentical:cls theMetaclass)]) ifTrue:[ |
|
886 self enqueueDelayedUpdateList |
|
887 ] |
|
888 ] |
910 ] |
889 ]. |
911 ]. |
890 ]. |
912 ]. |
891 ^ self |
913 ^ self |
892 ]. |
914 ]. |
893 |
915 |
894 something == #methodInClass ifTrue:[ |
916 something == #methodInClass ifTrue:[ |
895 cls := aParameter at:1. |
917 cls := aParameter at:1. |
896 cls notNil ifTrue:[ |
918 cls notNil ifTrue:[ |
897 classListValue size > 0 ifTrue:[ |
919 (self classIsInList:cls) ifTrue:[ |
898 ((classListValue includesIdentical:cls theNonMetaclass) |
920 newMethod := cls compiledMethodAt:(aParameter at:2). |
899 or:[(classListValue includesIdentical:cls theMetaclass)]) ifTrue:[ |
921 oldMethod := aParameter at:3. |
900 newMethod := cls compiledMethodAt:(aParameter at:2). |
922 ((oldMethod isNil |
901 oldMethod := aParameter at:3. |
923 and:[newMethod package ~= cls package]) |
902 ((oldMethod isNil |
924 or:[oldMethod notNil |
903 and:[newMethod package ~= cls package]) |
925 and:[newMethod package ~= oldMethod package]]) |
904 or:[oldMethod notNil |
926 ifTrue:[ |
905 and:[newMethod package ~= oldMethod package]]) |
927 "/ must update the list (for the package-info) |
906 ifTrue:[ |
928 self enqueueDelayedUpdateList |
907 "/ must update the list (for the package-info) |
|
908 self enqueueDelayedUpdateList |
|
909 ] |
|
910 ] |
929 ] |
911 ] |
930 ] |
912 ]. |
931 ]. |
913 ^ self |
932 ^ self |
914 ]. |
933 ]. |
1851 "Modified: / 31-10-2001 / 11:35:39 / cg" |
1870 "Modified: / 31-10-2001 / 11:35:39 / cg" |
1852 "Modified: / 24-09-2013 / 23:30:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1871 "Modified: / 24-09-2013 / 23:30:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1853 ! |
1872 ! |
1854 |
1873 |
1855 updateListsFor:aClass |
1874 updateListsFor:aClass |
|
1875 "selective update of a single entry (avoid full rescan)" |
|
1876 |
1856 |classes found foundInSelection| |
1877 |classes found foundInSelection| |
1857 |
1878 |
1858 found := foundInSelection := false. |
1879 found := foundInSelection := false. |
1859 |
1880 |
1860 "/ update for a changed class in the classList |
1881 "/ update for a changed class in the classList |
1861 (classes := classList value) size > 0 ifTrue:[ |
1882 (classes := classList value) size > 0 ifTrue:[ |
1862 (self updateClassesIn:classes) ifTrue:[ |
1883 (self updateClassesIn:classes) ifTrue:[ |
1863 found := true |
1884 found := true |
1864 ]. |
1885 ]. |
1865 (classes includes:nil) ifTrue:[ |
1886 (classes includes:nil) ifTrue:[ |
1866 "/ self halt:'should not happen'. |
1887 "/ self halt:'should not happen'. |
1867 classList value:(classes := classes select:[:each | each notNil]). |
1888 classList value:(classes := classes select:[:each | each notNil]). |
1868 ]. |
1889 ]. |
1869 ]. |
1890 ]. |
1870 "/ possibly in the generator |
1891 "/ possibly in the generator |
1871 ((classes := inGeneratorHolder value) isOrderedCollection |
1892 ((classes := inGeneratorHolder value) isOrderedCollection |
1872 and:[classes size > 0]) ifTrue:[ |
1893 and:[classes size > 0]) ifTrue:[ |
1873 (self updateClassesIn:classes) ifTrue:[ |
1894 (self updateClassesIn:classes) ifTrue:[ |
1874 found := true |
1895 found := true |
1875 ]. |
1896 ]. |
1876 (classes includes:nil) ifTrue:[ |
1897 (classes includes:nil) ifTrue:[ |
1877 "/ self halt:'should not happen'. |
1898 "/ self halt:'should not happen'. |
1878 inGeneratorHolder value:(classes select:[:each | each notNil]). |
1899 inGeneratorHolder value:(classes select:[:each | each notNil]). |
1879 ] |
1900 ] |
1880 ]. |
1901 ]. |
1881 "/ and in the selection |
1902 "/ and in the selection |
1882 (classes := self selectedClasses value) size > 0 ifTrue:[ |
1903 (classes := self selectedClasses value) size > 0 ifTrue:[ |
1883 (self updateClassesIn:classes) ifTrue:[ |
1904 (self updateClassesIn:classes) ifTrue:[ |
1884 found := true. |
1905 found := true. |
1885 foundInSelection := true. |
1906 foundInSelection := true. |
1886 ]. |
1907 ]. |
1887 (classes includes:nil) ifTrue:[ |
1908 (classes includes:nil) ifTrue:[ |
1888 "/ self halt:'should not happen'. |
1909 "/ self halt:'should not happen'. |
1889 self selectedClasses value:(classes select:[:each | each notNil]). |
1910 self selectedClasses value:(classes select:[:each | each notNil]). |
1890 ] |
1911 ] |
1891 ]. |
1912 ]. |
1892 "/ and in the last selection |
1913 "/ and in the last selection |
1893 (classes := lastSelectedClasses) size > 0 ifTrue:[ |
1914 (classes := lastSelectedClasses) size > 0 ifTrue:[ |
1894 (self updateClassesIn:classes) ifTrue:[ |
1915 (self updateClassesIn:classes) ifTrue:[ |
1895 found := true |
1916 found := true |
1896 ]. |
1917 ]. |
1897 (classes includes:nil) ifTrue:[ |
1918 (classes includes:nil) ifTrue:[ |
1898 "/ self halt:'should not happen'. |
1919 "/ self halt:'should not happen'. |
1899 lastSelectedClasses := (classes select:[:each | each notNil]). |
1920 lastSelectedClasses := (classes select:[:each | each notNil]). |
1900 ] |
1921 ] |
1901 ]. |
1922 ]. |
1902 |
1923 |
1903 found ifFalse:[ |
1924 found ifFalse:[ |