equal
deleted
inserted
replaced
17 maxStackDepth relocList methodTempVars numTemp maxNumTemp' |
17 maxStackDepth relocList methodTempVars numTemp maxNumTemp' |
18 classVariableNames:'JumpToAbsJump SequenceNumber STCCompilationDefines |
18 classVariableNames:'JumpToAbsJump SequenceNumber STCCompilationDefines |
19 STCCompilationIncludes STCCompilationOptions STCCompilation |
19 STCCompilationIncludes STCCompilationOptions STCCompilation |
20 ShareCode STCKeepSTIntermediate STCKeepCIntermediate |
20 ShareCode STCKeepSTIntermediate STCKeepCIntermediate |
21 STCModulePath CCCompilationOptions CC STC ListCompiledMethods |
21 STCModulePath CCCompilationOptions CC STC ListCompiledMethods |
22 STCKeepOIntermediate Verbose NewCodeSet' |
22 STCKeepOIntermediate Verbose NewCodeSet NewPrimitives' |
23 poolDictionaries:'' |
23 poolDictionaries:'' |
24 category:'System-Compiler' |
24 category:'System-Compiler' |
25 ! |
25 ! |
26 |
26 |
27 !ByteCodeCompiler class methodsFor:'documentation'! |
27 !ByteCodeCompiler class methodsFor:'documentation'! |
437 |
437 |
438 !ByteCodeCompiler class methodsFor:'initialization'! |
438 !ByteCodeCompiler class methodsFor:'initialization'! |
439 |
439 |
440 initialize |
440 initialize |
441 NewCodeSet := false. |
441 NewCodeSet := false. |
|
442 NewPrimitives := false. |
442 ShareCode := true. |
443 ShareCode := true. |
443 STCKeepCIntermediate := false. |
444 STCKeepCIntermediate := false. |
444 STCKeepOIntermediate := false. |
445 STCKeepOIntermediate := false. |
445 STCKeepSTIntermediate := false. |
446 STCKeepSTIntermediate := false. |
446 STCModulePath := './modules'. |
447 STCModulePath := './modules'. |
463 newCodeSet:aBoolean |
464 newCodeSet:aBoolean |
464 NewCodeSet := aBoolean. |
465 NewCodeSet := aBoolean. |
465 |
466 |
466 " |
467 " |
467 ByteCodeCompiler newCodeSet:true |
468 ByteCodeCompiler newCodeSet:true |
|
469 " |
|
470 ! |
|
471 |
|
472 newPrimitives |
|
473 ^ NewPrimitives |
|
474 |
|
475 ! |
|
476 |
|
477 newPrimitives:aBoolean |
|
478 NewPrimitives := aBoolean. |
|
479 |
|
480 " |
|
481 ByteCodeCompiler newPrimitives:true |
468 " |
482 " |
469 ! ! |
483 ! ! |
470 |
484 |
471 !ByteCodeCompiler class methodsFor:'compiling methods'! |
485 !ByteCodeCompiler class methodsFor:'compiling methods'! |
472 |
486 |
698 " |
712 " |
699 ((compiler hasNonOptionalPrimitiveCode |
713 ((compiler hasNonOptionalPrimitiveCode |
700 or:[(compiler hasPrimitiveCode and:[self canCreateMachineCode]) |
714 or:[(compiler hasPrimitiveCode and:[self canCreateMachineCode]) |
701 or:[STCCompilation == #always and:[sel ~~ #doIt]]]) |
715 or:[STCCompilation == #always and:[sel ~~ #doIt]]]) |
702 and:[(STCCompilation ~~ #never) |
716 and:[(STCCompilation ~~ #never) |
703 and:[NewCodeSet ~~ true]]) ifTrue:[ |
717 and:[NewPrimitives ~~ true]]) ifTrue:[ |
704 newMethod := compiler |
718 newMethod := compiler |
705 compileToMachineCode:aString |
719 compileToMachineCode:aString |
706 forClass:aClass |
720 forClass:aClass |
707 inCategory:cat |
721 inCategory:cat |
708 notifying:requestor |
722 notifying:requestor |
772 |
786 |
773 compiler hasNonOptionalPrimitiveCode ifTrue:[ |
787 compiler hasNonOptionalPrimitiveCode ifTrue:[ |
774 "/ |
788 "/ |
775 "/ generate a trapping method, if primitive code is present |
789 "/ generate a trapping method, if primitive code is present |
776 "/ |
790 "/ |
777 NewCodeSet ~~ true ifTrue:[ |
791 NewPrimitives ~~ true ifTrue:[ |
778 newMethod := compiler trappingStubMethodFor:aString inCategory:cat. |
792 newMethod := compiler trappingStubMethodFor:aString inCategory:cat. |
779 install ifTrue:[ |
793 install ifTrue:[ |
780 aClass addSelector:sel withMethod:newMethod. |
794 aClass addSelector:sel withMethod:newMethod. |
781 ]. |
795 ]. |
782 Transcript show:'*** '. |
796 Transcript show:'*** '. |
824 aClass addSelector:sel withLazyMethod:newMethod. |
838 aClass addSelector:sel withLazyMethod:newMethod. |
825 ^ newMethod |
839 ^ newMethod |
826 ]. |
840 ]. |
827 |
841 |
828 primNr := compiler primitiveNumber. |
842 primNr := compiler primitiveNumber. |
829 ((NewCodeSet == true) or:[primNr isNil]) ifTrue:[ |
843 ((NewPrimitives == true) or:[primNr isNil]) ifTrue:[ |
830 " |
844 " |
831 produce symbolic code first |
845 produce symbolic code first |
832 " |
846 " |
833 symbolicCodeArray := compiler genSymbolicCode. |
847 symbolicCodeArray := compiler genSymbolicCode. |
834 |
848 |
857 |
871 |
858 " |
872 " |
859 finally create the new method-object |
873 finally create the new method-object |
860 " |
874 " |
861 newMethod := compiler createMethod. |
875 newMethod := compiler createMethod. |
862 NewCodeSet == true ifTrue:[ |
876 NewPrimitives == true ifTrue:[ |
863 newMethod byteCode:(compiler code). |
877 newMethod byteCode:(compiler code). |
864 primNr notNil ifTrue:[ |
878 primNr notNil ifTrue:[ |
865 newMethod setPrimitiveNumber:primNr |
879 newMethod setPrimitiveNumber:primNr |
866 ] |
880 ] |
867 ] ifFalse:[ |
881 ] ifFalse:[ |
3673 ! ! |
3687 ! ! |
3674 |
3688 |
3675 !ByteCodeCompiler class methodsFor:'documentation'! |
3689 !ByteCodeCompiler class methodsFor:'documentation'! |
3676 |
3690 |
3677 version |
3691 version |
3678 ^ '$Header: /cvs/stx/stx/libcomp/ByteCodeCompiler.st,v 1.166 2000-06-20 18:20:24 cg Exp $' |
3692 ^ '$Header: /cvs/stx/stx/libcomp/ByteCodeCompiler.st,v 1.167 2000-06-24 15:42:54 cg Exp $' |
3679 ! ! |
3693 ! ! |
3680 ByteCodeCompiler initialize! |
3694 ByteCodeCompiler initialize! |