compiler/PPCClassBuilder.st
changeset 516 3b81c9e53352
parent 505 19d830b74322
parent 515 b5316ef15274
child 518 a6d8b93441b0
--- a/compiler/PPCClassBuilder.st	Fri Jul 31 14:07:31 2015 +0100
+++ b/compiler/PPCClassBuilder.st	Mon Aug 17 12:56:02 2015 +0100
@@ -74,6 +74,16 @@
 !
 
 cleanGeneratedMethods
+    (compiledClass methodDictionary size == 0) ifTrue: [ ^ self ].
+
+    "this is hack, but might help the performance..."
+    (compiledClass methods allSatisfy: [:m | m category beginsWith: 'generated']) ifTrue: [
+        compiledClass removeFromSystem.
+        compiledClass := nil.
+        ^ self
+    ].
+
+
     ((Smalltalk respondsTo:#isSmalltalkX) and:[ Smalltalk isSmalltalkX ]) ifTrue:[
         compiledClass methodsDo: [ :mthd |
             (mthd category beginsWith: 'generated') ifTrue:[
@@ -81,10 +91,17 @@
             ]
         ]
     ] ifFalse: [ 
+"		compiledClass methodsDo: [ :mthd |
+            (mthd category beginsWith: 'generated') ifTrue:[
+                compiledClass removeSelector: mthd selector.
+            ]
+        ]
+"
+"		Too slow, but more stable :("
         (compiledClass allProtocolsUpTo: compiledClass) do: [ :protocol |
             (protocol beginsWith: 'generated') ifTrue: [ 
                 compiledClass removeProtocol: protocol.
-            ]
+            ]		
         ]
     ]
 ! !