[Vm-dev] VM Maker: VMMaker.oscog-eem.1822.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Apr 19 17:26:23 UTC 2016
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1822.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.1822
Author: eem
Time: 19 April 2016, 10:24:04.070999 am
UUID: f18408b3-d8bb-4ac7-9d7d-b37ace026619
Ancestors: VMMaker.oscog-cb.1821
Slang, go the extra quarter-mile and define an optional primitive as the fast primitive fail code (null pointer) so that unselected optional primitives are in the prmitiveTable as fast primitive fails.
=============== Diff against VMMaker.oscog-cb.1821 ===============
Item was added:
+ ----- Method: CCodeGenerator>>maybeEmitPrimitiveFailureDefineFor:on: (in category 'C translation support') -----
+ maybeEmitPrimitiveFailureDefineFor: selector on: aStream
+ (vmClass notNil
+ and: [(vmClass inheritsFrom: InterpreterPrimitives)
+ and: [(vmClass primitiveTable includes: selector)]]) ifTrue:
+ [aStream nextPutAll: '#else\# define ' withCRs; nextPutAll: selector; nextPutAll: ' (void (*)(void))0\' withCRs]!
Item was changed:
----- Method: TMethod>>emitCFunctionPrototype:generator:isPrototype: (in category 'C code generation') -----
emitCFunctionPrototype: aStream generator: aCodeGen isPrototype: isPrototype "<Boolean>"
"Emit a C function header for this method onto the given stream.
Answer if the method has any compileTimeOptionPragmas"
| compileTimeOptionPragmas returnTypeIsFunctionPointer |
(compileTimeOptionPragmas := self compileTimeOptionPragmas) notEmpty ifTrue:
[self outputConditionalDefineFor: compileTimeOptionPragmas on: aStream].
returnTypeIsFunctionPointer := returnType last = $)
and: [returnType includesSubString: (aCodeGen cFunctionNameFor: selector)].
export
ifTrue:
[aStream nextPutAll: 'EXPORT('; nextPutAll: returnType; nextPut: $)]
ifFalse:
[self isStatic
ifTrue: [aStream nextPutAll: 'static ']
ifFalse:
[isPrototype ifTrue:
[aStream nextPutAll: 'extern ']].
(isPrototype or: [inline ~~ #always]) ifFalse: [aStream nextPutAll: 'inline '].
aStream nextPutAll: returnType].
(functionAttributes isNil or: [returnTypeIsFunctionPointer]) ifFalse:
[aStream space; nextPutAll: functionAttributes].
isPrototype ifTrue: [aStream space] ifFalse: [aStream cr].
returnTypeIsFunctionPointer ifFalse:
[aStream
nextPutAll: (aCodeGen cFunctionNameFor: selector);
nextPut: $(.
args isEmpty
ifTrue: [aStream nextPutAll: #void]
ifFalse:
[args
do: [:arg| aStream nextPutAll: (self declarationAt: arg)]
separatedBy: [aStream nextPutAll: ', ']].
aStream nextPut: $)].
isPrototype ifTrue:
[aStream nextPut: $;; cr.
+ compileTimeOptionPragmas isEmpty ifFalse:
+ [aCodeGen maybeEmitPrimitiveFailureDefineFor: selector on: aStream.
+ self terminateConditionalDefineFor: compileTimeOptionPragmas on: aStream]].
- self terminateConditionalDefineFor: compileTimeOptionPragmas on: aStream].
^compileTimeOptionPragmas notEmpty!
More information about the Vm-dev
mailing list