Helios-Browser.st 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847
  1. Smalltalk current createPackage: 'Helios-Browser'!
  2. HLWidget subclass: #HLBrowser
  3. instanceVariableNames: 'model packagesListWidget classesListWidget protocolsListWidget methodsListWidget sourceWidget'
  4. package: 'Helios-Browser'!
  5. !HLBrowser methodsFor: 'accessing'!
  6. announcer
  7. ^ self model announcer
  8. !
  9. environment
  10. ^ self model environment
  11. !
  12. model
  13. ^ model ifNil: [ model := HLBrowserModel new ]
  14. !
  15. model: aModel
  16. model := aModel
  17. ! !
  18. !HLBrowser methodsFor: 'keybindings'!
  19. registerBindingsOn: aBindingGroup
  20. aBindingGroup
  21. addGroupKey: 66 labelled: 'Browse';
  22. addGroupKey: 71 labelled: 'Go to';
  23. addGroupKey: 84 labelled: 'Toggle'.
  24. HLBrowserCommand withAllSubclasses do: [ :each |
  25. each key ifNotNil: [
  26. (aBindingGroup at: each bindingGroup)
  27. add: (each on: self model) asBinding ] ]
  28. ! !
  29. !HLBrowser methodsFor: 'rendering'!
  30. renderContentOn: html
  31. html with: (HLContainer with: (HLHorizontalSplitter
  32. with: (HLVerticalSplitter
  33. with: (HLVerticalSplitter
  34. with: self packagesListWidget
  35. with: self classesListWidget)
  36. with: (HLVerticalSplitter
  37. with: self protocolsListWidget
  38. with: self methodsListWidget))
  39. with: self sourceWidget))
  40. ! !
  41. !HLBrowser methodsFor: 'widgets'!
  42. classesListWidget
  43. ^ classesListWidget ifNil: [
  44. classesListWidget := HLClassesListWidget on: self model.
  45. classesListWidget next: self protocolsListWidget ]
  46. !
  47. methodsListWidget
  48. ^ methodsListWidget ifNil: [
  49. methodsListWidget := HLMethodsListWidget on: self model ]
  50. !
  51. packagesListWidget
  52. ^ packagesListWidget ifNil: [
  53. packagesListWidget := HLPackagesListWidget on: self model.
  54. packagesListWidget next: self classesListWidget ]
  55. !
  56. protocolsListWidget
  57. ^ protocolsListWidget ifNil: [
  58. protocolsListWidget := HLProtocolsListWidget on: self model.
  59. protocolsListWidget next: self methodsListWidget ]
  60. !
  61. sourceWidget
  62. ^ sourceWidget ifNil: [
  63. sourceWidget := HLBrowserSourceWidget on: self model ]
  64. ! !
  65. HLBrowser class instanceVariableNames: 'nextId'!
  66. !HLBrowser class methodsFor: 'accessing'!
  67. nextId
  68. nextId ifNil: [ nextId := 0 ].
  69. ^ 'browser_', (nextId + 1) asString
  70. !
  71. tabLabel
  72. ^ 'Browser'
  73. !
  74. tabPriority
  75. ^ 0
  76. ! !
  77. !HLBrowser class methodsFor: 'testing'!
  78. canBeOpenAsTab
  79. ^ true
  80. ! !
  81. HLNavigationListWidget subclass: #HLBrowserListWidget
  82. instanceVariableNames: 'model'
  83. package: 'Helios-Browser'!
  84. !HLBrowserListWidget methodsFor: 'accessing'!
  85. model
  86. ^ model
  87. !
  88. model: aBrowserModel
  89. model := aBrowserModel.
  90. self observeModel
  91. ! !
  92. !HLBrowserListWidget methodsFor: 'actions'!
  93. observeModel
  94. ! !
  95. !HLBrowserListWidget class methodsFor: 'instance creation'!
  96. on: aModel
  97. ^ self new
  98. model: aModel;
  99. yourself
  100. ! !
  101. HLBrowserListWidget subclass: #HLClassesListWidget
  102. instanceVariableNames: ''
  103. package: 'Helios-Browser'!
  104. !HLClassesListWidget methodsFor: 'accessing'!
  105. getChildrenOf: aClass
  106. ^ self items select: [ :each | each superclass = aClass ]
  107. !
  108. getRootClassesOf: aCollection
  109. ^ aCollection select: [ :each |
  110. (aCollection includes: each superclass) not ]
  111. !
  112. iconForItem: aClass
  113. ^ aClass theNonMetaClass comment isEmpty
  114. ifFalse: [ 'icon-none' ]
  115. ifTrue: [ 'icon-question-sign' ]
  116. !
  117. showInstance
  118. ^ self model showInstance
  119. ! !
  120. !HLClassesListWidget methodsFor: 'actions'!
  121. focusMethodsListWidget
  122. self model announcer announce: HLMethodsListFocus new
  123. !
  124. focusProtocolsListWidget
  125. self model announcer announce: HLProtocolsListFocus new
  126. !
  127. observeModel
  128. self model announcer
  129. on: HLPackageSelected do: [ :ann | self onPackageSelected: ann item ];
  130. on: HLShowInstanceToggled do: [ :ann | self onShowInstanceToggled ];
  131. on: HLClassSelected do: [ :ann | self onClassSelected: ann item ]
  132. !
  133. selectItem: aClass
  134. self model selectedClass: aClass
  135. !
  136. showInstance: aBoolean
  137. self model showInstance: aBoolean
  138. ! !
  139. !HLClassesListWidget methodsFor: 'reactions'!
  140. onClassSelected: aClass
  141. self selectedItem: aClass.
  142. aClass ifNil: [ ^ self ].
  143. self focus
  144. !
  145. onPackageSelected: aPackage
  146. self selectedItem: nil.
  147. self items: (aPackage
  148. ifNil: [ #() ]
  149. ifNotNil: [ (aPackage classes
  150. collect: [ :each | each theNonMetaClass ]) asSet asArray ]).
  151. self refresh
  152. !
  153. onShowInstanceToggled
  154. self refresh
  155. ! !
  156. !HLClassesListWidget methodsFor: 'rendering'!
  157. renderButtonsOn: html
  158. html div
  159. class: 'btn-group';
  160. at: 'data-toggle' put: 'buttons-radio';
  161. with: [
  162. html button
  163. class: (String streamContents: [ :str |
  164. str nextPutAll: 'btn'.
  165. self showInstance ifTrue: [
  166. str nextPutAll: ' active'] ]);
  167. with: 'Instance';
  168. onClick: [ self showInstance: true ].
  169. html button
  170. class: (String streamContents: [ :str |
  171. str nextPutAll: 'btn'.
  172. self model showInstance ifFalse: [
  173. str nextPutAll: ' active'] ]);
  174. with: 'Class';
  175. onClick: [ self model showInstance: false ] ].
  176. html button
  177. class: 'btn';
  178. at: 'data-toggle' put: 'button';
  179. with: 'Comment'
  180. !
  181. renderItem: aClass level: anInteger on: html
  182. | li |
  183. li := html li.
  184. li
  185. at: 'list-data' put: (self items indexOf: aClass);
  186. class: (self cssClassForItem: aClass);
  187. with: [
  188. html a
  189. with: [
  190. (html tag: 'i') class: (self iconForItem: aClass).
  191. self renderItemLabel: aClass level: anInteger on: html ];
  192. onClick: [
  193. self activateListItem: li asJQuery ] ].
  194. (self getChildrenOf: aClass) do: [ :each |
  195. self renderItem: each level: anInteger + 1 on: html ]
  196. !
  197. renderItem: aClass on: html
  198. super renderItem: aClass on: html.
  199. (self getChildrenOf: aClass) do: [ :each |
  200. self renderItem: each level: 1 on: html ]
  201. !
  202. renderItemLabel: aClass level: anInteger on: html
  203. html span asJQuery html: (String streamContents: [ :str |
  204. anInteger timesRepeat: [
  205. str nextPutAll: '    '].
  206. str nextPutAll: aClass name ])
  207. !
  208. renderItemLabel: aClass on: html
  209. self renderItemLabel: aClass level: 0 on: html
  210. !
  211. renderListOn: html
  212. (self getRootClassesOf: self items)
  213. do: [ :each | self renderItem: each on: html ]
  214. ! !
  215. HLBrowserListWidget subclass: #HLMethodsListWidget
  216. instanceVariableNames: ''
  217. package: 'Helios-Browser'!
  218. !HLMethodsListWidget methodsFor: 'accessing'!
  219. allProtocol
  220. ^ self model allProtocol
  221. !
  222. iconForItem: aCompiledMethod
  223. | override overriden |
  224. override := self isOverride: aCompiledMethod.
  225. overriden := self isOverridden: aCompiledMethod.
  226. ^ override
  227. ifTrue: [ overriden
  228. ifTrue: [ 'icon-resize-vertical' ]
  229. ifFalse: [ 'icon-arrow-up' ] ]
  230. ifFalse: [
  231. overriden
  232. ifTrue: [ 'icon-arrow-down' ]
  233. ifFalse: [ 'icon-none' ] ]
  234. !
  235. methodsInProtocol: aString
  236. ^ aString = self allProtocol
  237. ifTrue: [ self model selectedClass methods ]
  238. ifFalse: [ self model selectedClass methodsInProtocol: aString ]
  239. !
  240. overrideSelectors
  241. ^ self selectorsCache
  242. at: 'override'
  243. ifAbsentPut: [
  244. self model selectedClass allSuperclasses
  245. inject: Set new into: [ :acc :each | acc addAll: each selectors; yourself ] ]
  246. !
  247. overridenSelectors
  248. ^ self selectorsCache
  249. at: 'overriden'
  250. ifAbsentPut: [
  251. self model selectedClass allSubclasses
  252. inject: Set new into: [ :acc :each | acc addAll: each selectors; yourself ] ]
  253. !
  254. selectorsCache
  255. ^ self class selectorsCache
  256. ! !
  257. !HLMethodsListWidget methodsFor: 'actions'!
  258. observeModel
  259. self model announcer on: HLProtocolSelected do: [ :ann |
  260. self onProtocolSelected: ann item ].
  261. self model announcer on: HLShowInstanceToggled do: [ :ann |
  262. self onProtocolSelected: nil ].
  263. self model announcer on: HLMethodSelected do: [ :ann |
  264. self onMethodSelected: ann item ]
  265. !
  266. selectItem: aCompiledMethod
  267. self model selectedMethod: aCompiledMethod
  268. ! !
  269. !HLMethodsListWidget methodsFor: 'cache'!
  270. flushSelectorsCache
  271. selectorsCache := Dictionary new
  272. ! !
  273. !HLMethodsListWidget methodsFor: 'initialization'!
  274. initialize
  275. super initialize.
  276. self flushSelectorsCache
  277. ! !
  278. !HLMethodsListWidget methodsFor: 'reactions'!
  279. onMethodSelected: aMethod
  280. self selectedItem: aMethod.
  281. aMethod ifNil: [ ^ self ].
  282. self focus
  283. !
  284. onProtocolSelected: aString
  285. self selectedItem: nil.
  286. self items: (self model selectedClass
  287. ifNil: [ #() ]
  288. ifNotNil: [ aString
  289. ifNil: [ #() ]
  290. ifNotNil: [ self methodsInProtocol: aString ] ]).
  291. self refresh
  292. ! !
  293. !HLMethodsListWidget methodsFor: 'rendering'!
  294. renderContentOn: html
  295. self model showInstance
  296. ifFalse: [ html div
  297. class: 'class_side';
  298. with: [ super renderContentOn: html ] ]
  299. ifTrue: [ super renderContentOn: html ].
  300. "self flushSelectorsCache"
  301. !
  302. renderItemLabel: aCompiledMethod on: html
  303. html with: aCompiledMethod selector
  304. ! !
  305. !HLMethodsListWidget methodsFor: 'testing'!
  306. isOverridden: aMethod
  307. ^ self selectorsCache isOverridden: aMethod
  308. !
  309. isOverride: aMethod
  310. ^ self selectorsCache isOverride: aMethod
  311. ! !
  312. HLMethodsListWidget class instanceVariableNames: 'selectorsCache'!
  313. !HLMethodsListWidget class methodsFor: 'accessing'!
  314. selectorsCache
  315. ^ HLSelectorsCache current
  316. ! !
  317. HLBrowserListWidget subclass: #HLPackagesListWidget
  318. instanceVariableNames: ''
  319. package: 'Helios-Browser'!
  320. !HLPackagesListWidget methodsFor: 'accessing'!
  321. initializeItems
  322. ^ items := self model packages sort:[:a :b|
  323. a name < b name]
  324. !
  325. items
  326. ^ items ifNil: [self initializeItems]
  327. ! !
  328. !HLPackagesListWidget methodsFor: 'actions'!
  329. focusClassesListWidget
  330. self model announcer announce: HLClassesListFocus new
  331. !
  332. observeModel
  333. self model announcer on: HLPackageSelected do: [ :ann |
  334. self onPackageSelected: ann item ]
  335. !
  336. selectItem: aPackage
  337. self model selectedPackage: aPackage
  338. ! !
  339. !HLPackagesListWidget methodsFor: 'reactions'!
  340. onPackageSelected: aPackage
  341. self selectedItem: aPackage.
  342. self focus
  343. ! !
  344. !HLPackagesListWidget methodsFor: 'rendering'!
  345. renderButtonsOn: html
  346. html span class: 'info'; with: 'Auto commit'.
  347. html div
  348. class: 'btn-group switch';
  349. at: 'data-toggle' put: 'buttons-radio';
  350. with: [
  351. html button
  352. class: (String streamContents: [ :str |
  353. str nextPutAll: 'btn' ]);
  354. with: 'On'.
  355. html button
  356. class: (String streamContents: [ :str |
  357. str nextPutAll: 'btn active' ]);
  358. with: 'Off' ].
  359. html a
  360. class: 'btn';
  361. with: 'Commit'.
  362. ! !
  363. HLBrowserListWidget subclass: #HLProtocolsListWidget
  364. instanceVariableNames: ''
  365. package: 'Helios-Browser'!
  366. !HLProtocolsListWidget methodsFor: 'accessing'!
  367. allProtocol
  368. ^ self model allProtocol
  369. !
  370. selectedItem
  371. ^ super selectedItem" ifNil: [ self allProtocol ]"
  372. ! !
  373. !HLProtocolsListWidget methodsFor: 'actions'!
  374. observeModel
  375. self model announcer on: HLClassSelected do: [ :ann |
  376. self onClassSelected: ann item ].
  377. self model announcer on: HLShowInstanceToggled do: [ :ann |
  378. self onClassSelected: self model selectedClass ].
  379. self model announcer on: HLProtocolSelected do: [ :ann |
  380. self onProtocolSelected: ann item ]
  381. !
  382. selectItem: aString
  383. self model selectedProtocol: aString
  384. ! !
  385. !HLProtocolsListWidget methodsFor: 'reactions'!
  386. onClassSelected: aClass
  387. self selectedItem: nil.
  388. self items: (aClass
  389. ifNil: [ Array with: self allProtocol ]
  390. ifNotNil: [
  391. (Array with: self allProtocol)
  392. addAll: aClass protocols;
  393. yourself ]).
  394. self refresh
  395. !
  396. onProtocolSelected: aString
  397. self selectedItem: aString.
  398. aString ifNil: [ ^ self ].
  399. self focus
  400. ! !
  401. !HLProtocolsListWidget methodsFor: 'rendering'!
  402. renderContentOn: html
  403. self model showInstance
  404. ifFalse: [ html div
  405. class: 'class_side';
  406. with: [ super renderContentOn: html ] ]
  407. ifTrue: [ super renderContentOn: html ]
  408. ! !
  409. Object subclass: #HLBrowserModel
  410. instanceVariableNames: 'announcer environment selectedPackage selectedClass selectedProtocol selectedMethod showInstance showComment'
  411. package: 'Helios-Browser'!
  412. !HLBrowserModel methodsFor: 'accessing'!
  413. allProtocol
  414. ^ '-- All --'
  415. !
  416. announcer
  417. ^ announcer ifNil: [ announcer := Announcer new ]
  418. !
  419. environment
  420. ^ environment ifNil: [ HLManager current environment ]
  421. !
  422. environment: anEnvironment
  423. environment := anEnvironment
  424. !
  425. packages
  426. ^ self environment packages
  427. !
  428. selectedClass
  429. ^ selectedClass
  430. !
  431. selectedClass: aClass
  432. selectedClass = aClass ifTrue: [ ^ self ].
  433. aClass
  434. ifNil: [ selectedClass := nil ]
  435. ifNotNil: [
  436. self showInstance
  437. ifTrue: [ selectedClass := aClass theNonMetaClass ]
  438. ifFalse: [ selectedClass := aClass theMetaClass ] ].
  439. self selectedProtocol: nil.
  440. self announcer announce: (HLClassSelected on: self selectedClass)
  441. !
  442. selectedMethod
  443. ^ selectedMethod
  444. !
  445. selectedMethod: aCompiledMethod
  446. selectedMethod = aCompiledMethod ifTrue: [ ^ self ].
  447. selectedMethod := aCompiledMethod.
  448. self announcer announce: (HLMethodSelected on: aCompiledMethod)
  449. !
  450. selectedPackage
  451. ^ selectedPackage
  452. !
  453. selectedPackage: aPackage
  454. selectedPackage = aPackage ifTrue: [ ^ self ].
  455. selectedPackage := aPackage.
  456. self selectedClass: nil.
  457. self announcer announce: (HLPackageSelected on: aPackage)
  458. !
  459. selectedProtocol
  460. ^ selectedProtocol
  461. !
  462. selectedProtocol: aString
  463. selectedProtocol = aString ifTrue: [ ^ self ].
  464. selectedProtocol := aString.
  465. self selectedMethod: nil.
  466. self announcer announce: (HLProtocolSelected on: aString)
  467. !
  468. showComment
  469. ^ showComment ifNil: [ false ]
  470. !
  471. showComment: aBoolean
  472. showComment := aBoolean.
  473. self announcer announce: HLShowCommentToggled new
  474. !
  475. showInstance
  476. ^ showInstance ifNil: [ true ]
  477. !
  478. showInstance: aBoolean
  479. showInstance := aBoolean.
  480. self selectedClass ifNotNil: [
  481. self selectedClass: (aBoolean
  482. ifTrue: [self selectedClass theNonMetaClass ]
  483. ifFalse: [ self selectedClass theMetaClass ]) ].
  484. self announcer announce: HLShowInstanceToggled new
  485. ! !
  486. !HLBrowserModel class methodsFor: 'actions'!
  487. on: anEnvironment
  488. ^ self new
  489. environment: anEnvironment;
  490. yourself
  491. ! !
  492. HLWidget subclass: #HLBrowserSourceWidget
  493. instanceVariableNames: 'model codeWidget'
  494. package: 'Helios-Browser'!
  495. !HLBrowserSourceWidget methodsFor: 'accessing'!
  496. codeWidget
  497. ^ codeWidget ifNil: [ codeWidget := HLCodeWidget new ]
  498. !
  499. contents
  500. ^ self sourceArea contents
  501. !
  502. contents: aString
  503. self codeWidget contents: aString
  504. !
  505. model
  506. ^ model
  507. !
  508. model: aBrowserModel
  509. model := aBrowserModel.
  510. self observeModel
  511. ! !
  512. !HLBrowserSourceWidget methodsFor: 'actions'!
  513. observeModel
  514. self model announcer on: HLMethodSelected do: [ :ann |
  515. self onMethodSelected: ann item ].
  516. self model announcer on: HLClassSelected do: [ :ann |
  517. self onClassSelected: ann item ].
  518. self model announcer on: HLProtocolSelected do: [ :ann |
  519. self onProtocolSelected: ann item ]
  520. ! !
  521. !HLBrowserSourceWidget methodsFor: 'reactions'!
  522. onClassSelected: aClass
  523. aClass ifNil: [ ^ self contents: '' ].
  524. self contents: aClass definition
  525. !
  526. onMethodSelected: aCompiledMethod
  527. aCompiledMethod ifNil: [ ^ self contents: '' ].
  528. self contents: aCompiledMethod source
  529. !
  530. onProtocolSelected: aString
  531. self model selectedClass ifNil: [ ^ self contents: '' ].
  532. self contents: self model selectedClass definition
  533. ! !
  534. !HLBrowserSourceWidget methodsFor: 'rendering'!
  535. renderContentOn: html
  536. self codeWidget renderOn: html
  537. ! !
  538. !HLBrowserSourceWidget class methodsFor: 'instance creation'!
  539. on: aBrowserModel
  540. ^ self new
  541. model: aBrowserModel;
  542. yourself
  543. ! !
  544. Object subclass: #HLClassCache
  545. instanceVariableNames: 'class parentCache overrideCache overriddenCache'
  546. package: 'Helios-Browser'!
  547. !HLClassCache methodsFor: 'accessing'!
  548. overriddenCache
  549. ^ overriddenCache ifNil: [ overriddenCache := HashedCollection new ]
  550. !
  551. overrideCache
  552. ^ overrideCache ifNil: [ overrideCache := HashedCollection new ]
  553. !
  554. parentCache
  555. ^ parentCache
  556. !
  557. parentCache: aCache
  558. parentCache := aCache
  559. !
  560. theClass
  561. ^ class
  562. !
  563. theClass: aClass
  564. class := aClass
  565. ! !
  566. !HLClassCache methodsFor: 'testing'!
  567. isOverridden: aMethod
  568. ^ self overriddenCache
  569. at: aMethod selector
  570. ifAbsentPut: [ aMethod isOverridden ]
  571. !
  572. isOverride: aMethod
  573. ^ self overrideCache
  574. at: aMethod selector
  575. ifAbsentPut: [ aMethod isOverride ]
  576. ! !
  577. !HLClassCache class methodsFor: 'instance creation'!
  578. on: aClass parentCache: aCache
  579. ^ self new
  580. theClass: aClass;
  581. parentCache: aCache;
  582. yourself
  583. ! !
  584. Object subclass: #HLSelectorsCache
  585. instanceVariableNames: 'classesCache'
  586. package: 'Helios-Browser'!
  587. !HLSelectorsCache methodsFor: 'accessing'!
  588. cacheFor: aClass
  589. aClass ifNil: [ ^ nil ].
  590. ^ self classesCache
  591. at: aClass name
  592. ifAbsentPut: [ self newCacheFor: aClass ]
  593. !
  594. classesCache
  595. ^ classesCache ifNil: [ classesCache := HashedCollection new ]
  596. ! !
  597. !HLSelectorsCache methodsFor: 'factory'!
  598. newCacheFor: aClass
  599. ^ HLClassCache
  600. on: aClass
  601. parentCache: (self cacheFor: aClass superclass)
  602. ! !
  603. !HLSelectorsCache methodsFor: 'testing'!
  604. isOverridden: aMethod
  605. ^ (self cacheFor: aMethod methodClass)
  606. isOverridden: aMethod
  607. !
  608. isOverride: aMethod
  609. ^ (self cacheFor: aMethod methodClass)
  610. isOverride: aMethod
  611. ! !
  612. HLSelectorsCache class instanceVariableNames: 'current'!
  613. !HLSelectorsCache class methodsFor: 'accessing'!
  614. current
  615. ^ current ifNil: [ current := super new ]
  616. !
  617. flush
  618. current := nil
  619. ! !
  620. !HLSelectorsCache class methodsFor: 'instance creation'!
  621. new
  622. self shouldNotImplement
  623. ! !
  624. !CompiledMethod methodsFor: '*Helios-Browser'!
  625. isOverridden
  626. | selector |
  627. selector := self selector.
  628. self methodClass allSubclassesDo: [ :each |
  629. (each includesSelector: selector)
  630. ifTrue: [ ^ true ] ].
  631. ^ false
  632. !
  633. isOverride
  634. | superclass |
  635. superclass := self methodClass superclass.
  636. superclass ifNil: [ ^ false ].
  637. ^ (self methodClass superclass lookupSelector: self selector) isNil
  638. ! !