Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2443.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2443 Author: eem Time: 19 September 2018, 10:30:59.900508 am UUID: fe048b98-1f17-4bc2-99ca-13809f5d7c25 Ancestors: VMMaker.oscog-eem.2442 Oops; remember to use isFakeStdinStream, and avoid isKindOf: in a couple of other places. =============== Diff against VMMaker.oscog-eem.2442 =============== Item was changed: ----- Method: FilePluginSimulator>>sqFile:Read:Into:At: (in category 'simulation') ----- sqFile: file Read: count Into: byteArrayIndexArg At: startIndex | byteArrayIndex | byteArrayIndex := byteArrayIndexArg asInteger. "Coerces CArray et al correctly" [[startIndex to: startIndex + count - 1 do: [ :i | file atEnd ifTrue: + [file isFakeStdinStream ifTrue: [file atEnd: false]. - [(file isKindOf: FakeStdinStream) ifTrue: [file atEnd: false]. ^i - startIndex]. interpreterProxy byteAt: byteArrayIndex + i + put: (file next ifNil: [file isFakeStdinStream ifTrue: [^0]] ifNotNil: [:c| c asInteger])]] - put: (file next ifNil: [(file isKindOf: FakeStdinStream) ifTrue: [^0]] ifNotNil: [:c| c asInteger])]] on: Error do: [:ex| + (file isStream and: [file isTranscriptStream]) ifFalse: + [ex pass]. - (file isKindOf: TranscriptStream) ifFalse: [ex pass]. ^0]] ensure: [self recordStateOf: file]. ^count! Item was changed: ----- Method: SmartSyntaxPluginTMethod>>recordDeclarationsIn: (in category 'transforming') ----- recordDeclarationsIn: aCCodeGen "Record C type declarations of the forms <returnTypeC: 'float'> <var: #foo declareC: 'float foo'> <var: #foo type:'float'> <var: #foo as: Class> or the older, obsolete self returnTypeC: 'float'. self var: #foo declareC: 'float foo' self var: #foo type:'float'. self var: #foo as: Class and remove the declarations from the method body." | newStatements | properties pragmas notEmpty ifTrue: [properties pragmas do: [:pragma| pragma keyword = #var:declareC: ifTrue: [self checkedDeclarationAt: pragma arguments first asString put: pragma arguments last in: aCCodeGen]. pragma keyword = #var:type: ifTrue: [| varName varType | varName := pragma arguments first asString. varType := pragma arguments last. varType last = $* ifFalse: [varType := varType, ' ']. self checkedDeclarationAt: varName put: varType, varName in: aCCodeGen]. pragma keyword = #var:as: ifTrue: [| theClass | theClass := Smalltalk at: pragma arguments last name asSymbol ifAbsent: [nil]. + theClass isBehavior ifFalse: - (theClass isKindOf: Behavior) ifFalse: [^self error: 'declarator must be a Behavior']. self checkedDeclarationAt: pragma arguments first value asString put: (theClass ccgDeclareCForVar: pragma arguments first asString) in: aCCodeGen]. pragma keyword = #returnTypeC: ifTrue: [self returnType: pragma arguments last]. pragma keyword = #doNotGenerate: ifTrue: [locals removeKey: pragma arguments last]]. ^self]. newStatements := OrderedCollection new: parseTree statements size. parseTree statements do: [:stmt | | isDeclaration | isDeclaration := false. stmt isSend ifTrue: [stmt selector = #var:declareC: ifTrue: [isDeclaration := true. self declarationAt: stmt args first value asString put: stmt args last value]. stmt selector = #var:type: ifTrue: [ | varName varType | isDeclaration := true. varName := stmt args first value asString. varType := stmt args last value. varType last = $* ifFalse: [varType := varType, ' ']. self declarationAt: varName put: varType, varName. ]. stmt selector = #var:as: ifTrue: [| theClass | isDeclaration := true. theClass := Smalltalk at: stmt args last name asSymbol ifAbsent: [nil]. + theClass isBehavior ifFalse: - (theClass isKindOf: Behavior) ifFalse: [^self error: 'declarator must be a Behavior']. self declarationAt: stmt args first value asString put: (theClass ccgDeclareCForVar: stmt args first value asString)]. stmt selector = #returnTypeC: ifTrue: [isDeclaration := true. returnType := stmt args last value]]. isDeclaration ifFalse: [newStatements add: stmt]]. parseTree setStatements: newStatements asArray! Item was added: + ----- Method: Stream>>isTranscriptStream (in category '*VMMaker-JITSimulation-testing') ----- + isTranscriptStream + ^false! Item was added: + ----- Method: TranscriptStream>>isTranscriptStream (in category '*VMMaker-JITSimulation-testing') ----- + isTranscriptStream + ^true! |
Free forum by Nabble | Edit this page |