-"Here are some doits to get Slang to generate a single method to the transcript"[Transcript show: [| sel vmm s cg | sel := #scavenge:. vmm := (VMMaker forPlatform: 'Cross') interpreterClass: StackInterpreter; options: #(ObjectMemory Spur64BitCoMemoryManager). cg := [vmm buildCodeGeneratorForInterpreter] on: Notification do: [:ex| ex tag == #getVMMaker ifTrue: [ex resume: vmm] ifFalse: [ex pass]]. "to break at inlining decisions or type inferrence uncomment the following. If src & dest are different selectors, breaks on inlining. If src & dest are the same selector, breaks on type inference in sel." "cg breakSrcInlineSelector: sel; breakDestInlineSelector: sel; breakOnInline: false". cg vmClass preGenerationHook: cg. cg inferTypesForImplicitlyTypedVariablesAndMethods. cg retainMethods: { sel }. cg prepareMethods. ((sel beginsWith: 'bytecode') or: [sel endsWith: 'Bytecode']) ifTrue: [cg doBasicInlining: true] ifFalse: [cg doInlining: true]. s := ReadWriteStream on: String new. (cg methodNamed: sel) halt; emitCCodeOn: s generator: cg. s contents] value].[Transcript show: [| sel vmm s cg | sel := #primitiveVoidVMStateForMethod. vmm := (VMMaker forPlatform: 'Cross') interpreterClass: CoInterpreter"MT"; options: {#Cogit. Cogit chooseCogitClass name}. cg := [vmm buildCodeGeneratorForInterpreter] on: Notification do: [:ex| ex tag == #getVMMaker ifTrue: [ex resume: vmm] ifFalse: [ex pass]]. cg vmClass preGenerationHook: cg. cg inferTypesForImplicitlyTypedVariablesAndMethods. cg retainMethods: { sel }. cg prepareMethods. ((sel beginsWith: 'bytecode') or: [sel endsWith: 'Bytecode']) ifTrue: [cg doBasicInlining: true] ifFalse: [cg doInlining: true]. s := ReadWriteStream on: String new. (cg methodNamed: sel) halt; emitCCodeOn: s generator: cg. s contents] value].[Transcript show: [| sel s vmm cg | sel := #compileEntry. vmm := VMMaker forPlatform: 'Cross'. cg := [vmm interpreterClass: CoInterpreter; options: {#Cogit. Cogit chooseCogitClass name}; buildCodeGeneratorForCogit] on: Notification do: [:ex| ex tag == #getVMMaker ifTrue: [ex resume: vmm] ifFalse: [ex pass]]. cg vmClass preGenerationHook: cg. cg inferTypesForImplicitlyTypedVariablesAndMethods. cg retainMethods: { #compactCogCompiledCode. sel }. cg prepareMethods. cg doInlining: cg vmClass doInlining. s := ReadWriteStream on: String new. (cg methodNamed: sel) halt; emitCCodeOn: s generator: cg. s contents] value].[Transcript show: [| tm s vmm cg | vmm := VMMaker forPlatform: 'Cross'. cg := [vmm interpreterClass: StackInterpreter; buildCodeGeneratorForInterpreter] on: Notification do: [:ex| ex tag == #getVMMaker ifTrue: [ex resume: vmm] ifFalse: [ex pass]]. cg vmClass preGenerationHook: cg. tm := (StackInterpreter compile: 'foo self cppIf: ''ARBITRARY'' ifTrue: [self cCode: ''arbi''] ifFalse: [self cCode: ''trary'']. self cppIf: (self cCode: ''ARBITRARY'') ifTrue: [self cCode: ''arbi''] ifFalse: [self cCode: ''trary'']' classified: nil notifying: nil trailer: CompiledMethodTrailer empty ifFail: []) node asTranslationMethodOfClass: cg translationMethodClass. cg addMethod: tm. cg inferTypesForImplicitlyTypedVariablesAndMethods. cg retainMethods: { #foo }. cg prepareMethods. cg doInlining: true. s := ReadWriteStream on: String new. (cg methodNamed: #foo) halt; emitCCodeOn: s generator: cg. s contents] value].[Transcript show: [| plugin sel s vmm cg | plugin := ThreadedARMFFIPlugin. sel := #primitiveCallout. vmm := VMMaker forPlatform: 'Cross'. cg := [plugin buildCodeGenerator] on: Notification do: [:ex| ex tag == #getVMMaker ifTrue: [ex resume: vmm] ifFalse: [ex pass]]. cg breakSrcInlineSelector: #cdigitMontgomery:len:times:len:modulo:len:mInvModB:into:; breakDestInlineSelector: sel; breakOnInline: "false"true. cg inferTypesForImplicitlyTypedVariablesAndMethods. cg retainMethods: { sel }. cg prepareMethods. cg doInlining: true. s := ReadWriteStream on: String new. (cg anyMethodNamed: sel) removeUnusedTempsAndNilIfRequiredIn: cg; halt; emitCCodeOn: s generator: cg. s contents] value].[Transcript show: [| plugin s cg | plugin := FileCopyPlugin"UnixOSProcessPlugin". cg := plugin buildCodeGenerator. cg inferTypesForImplicitlyTypedVariablesAndMethods. plugin pruneUnusedInterpreterPluginMethodsIn: cg. s := ReadWriteStream on: String new. cg emitCCodeOn: s doInlining: true doAssertions: false. s contents] value].[| cg |cg := BitBltSimulation buildCodeGeneratorUpTo: BitBltSimulation.cg inferTypesForImplicitlyTypedVariablesAndMethods].
0 commit comments