diff -r 9a7fa841f12e -r a6d8b93441b0 compiler/PPCClassBuilder.st --- a/compiler/PPCClassBuilder.st Mon Aug 17 13:39:38 2015 +0100 +++ b/compiler/PPCClassBuilder.st Mon Aug 17 23:11:56 2015 +0100 @@ -10,6 +10,7 @@ category:'PetitCompiler-Core' ! + !PPCClassBuilder class methodsFor:'instance creation'! new @@ -77,7 +78,7 @@ (compiledClass methodDictionary size == 0) ifTrue: [ ^ self ]. "this is hack, but might help the performance..." - (compiledClass methods allSatisfy: [:m | m category beginsWith: 'generated']) ifTrue: [ + (compiledClass methodDictionary values allSatisfy: [:m | m category beginsWith: 'generated']) ifTrue: [ compiledClass removeFromSystem. compiledClass := nil. ^ self @@ -91,19 +92,21 @@ ] ] ] ifFalse: [ -" compiledClass methodsDo: [ :mthd | +" compiledClass methodsDo: [ :mthd | (mthd category beginsWith: 'generated') ifTrue:[ compiledClass removeSelector: mthd selector. ] ] " -" Too slow, but more stable :(" +" Too slow, but more stable :(" (compiledClass allProtocolsUpTo: compiledClass) do: [ :protocol | (protocol beginsWith: 'generated') ifTrue: [ compiledClass removeProtocol: protocol. - ] + ] ] ] + + "Modified: / 17-08-2015 / 13:55:47 / Jan Vrany " ! ! !PPCClassBuilder methodsFor:'compiling'! @@ -133,14 +136,27 @@ instvarString := instvars inject: '' into: [:r :e | r, ' ', e ]. classvarString := constants keys inject: '' into: [:r :e | r, ' ', e ]. - compiledSuperclass - subclass: compiledClassName - instanceVariableNames: instvarString - classVariableNames: classvarString - poolDictionaries: '' - category: 'PetitCompiler-Generated'. + ((Smalltalk respondsTo:#isSmalltalkX) and:[Smalltalk isSmalltalkX]) ifTrue:[ + [ + compiledSuperclass + subclass: compiledClassName + instanceVariableNames: instvarString + classVariableNames: classvarString + poolDictionaries: '' + category: 'PetitCompiler-Generated'. + ] on: ClassBuildWarning do:[:ex | ex proceed ]. + ] ifFalse:[ + compiledSuperclass + subclass: compiledClassName + instanceVariableNames: instvarString + classVariableNames: classvarString + poolDictionaries: '' + category: 'PetitCompiler-Generated'. + ]. compiledClass := Smalltalk at: compiledClassName. + + "Modified: / 17-08-2015 / 14:44:38 / Jan Vrany " ! registerPackages @@ -179,3 +195,10 @@ self registerPackages. ! ! +!PPCClassBuilder class methodsFor:'documentation'! + +version_HG + + ^ '$Changeset: $' +! ! +