[Vm-dev] VM Maker: VMMaker.oscog-eem.2524.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Mar 6 15:16:29 UTC 2019
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2524.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.2524
Author: eem
Time: 6 March 2019, 7:16:15.760905 am
UUID: 0ebcb871-1196-4c0f-bbcb-45e8280e3737
Ancestors: VMMaker.oscog-eem.2523
Plugins:
ThreadedFFIPlugin: Make sure the ARM identifyingPredefinedMacros do not confuse 32 & 64 bits (& change the 32-bit CogARMCompiler to match).
FilePluginSimulator:
Avoid using MultiByteFileStream, cutting back to the minimal StandardFileStream. Obey writeFlag properly on opening a file (some platforms, e.g. Pharo6 use primitiveFileOpen/fileOpenName:size:write:secure: to check for existence (!!).
Have the simulator halt before deleting a file (to avoid the simulator doing damage).
=============== Diff against VMMaker.oscog-eem.2523 ===============
Item was changed:
----- Method: CogARMCompiler class>>identifyingPredefinedMacros (in category 'translation') -----
identifyingPredefinedMacros
+ ^#('__ARM_ARCH_5__' '__ARM_ARCH_6__' '__ARM_ARCH_7__' '__arm__' '__arm32__' 'ARM32' '_M_ARM')!
- ^#('__ARM_ARCH__' '__arm__' '__arm32__' 'ARM32' '_M_ARM')!
Item was changed:
----- Method: FilePluginSimulator>>fileOpenName:size:write:secure: (in category 'file primitives') -----
fileOpenName: nameIndex size: nameSize write: writeFlag secure: secureFlag
"Open the named file, possibly checking security. Answer the file oop."
| path f index |
openFiles size >= maxOpenFiles ifTrue:
[^interpreterProxy primitiveFailFor: PrimErrLimitExceeded].
path := (interpreterProxy asByteArray: nameIndex size: nameSize) utf8Decoded.
+ (writeFlag
+ or: [StandardFileStream isAFileNamed: path]) ifFalse:
+ [^interpreterProxy primitiveFail].
+ f := StandardFileStream new open: path forWrite: writeFlag.
- f := writeFlag
- ifTrue: [FileStream fileNamed: path]
- ifFalse:
- [(StandardFileStream isAFileNamed: path) ifTrue:
- [FileStream readOnlyFileNamed: path]].
f ifNil: [^interpreterProxy primitiveFail].
f binary.
+ self assert: f isReadOnly = writeFlag not.
index := (3 to: openFiles size + 1) detect: [:n| (openFiles includesKey: n) not].
openFiles at: index put: f.
^interpreterProxy integerObjectOf: index!
Item was changed:
----- Method: FilePluginSimulator>>fileOpenNewName:size:secure: (in category 'file primitives') -----
fileOpenNewName: nameIndex size: nameSize secure: secureFlag
"Open the new named file, possibly checking security. Answer the file oop."
| path f index |
openFiles size >= maxOpenFiles ifTrue:
[^interpreterProxy primitiveFailFor: PrimErrLimitExceeded].
path := (interpreterProxy interpreter asByteArray: nameIndex size: nameSize) utf8Decoded.
"the #defaultAction for FileExistsException creates a dialog,
so it is caught and resignaled as a generic Error"
+ [f := StandardFileStream newFileNamed: path]
- [f := FileStream newFileNamed: nameIndex]
on: FileExistsException
do: [:error | ^ interpreterProxy primitiveFailFor: PrimErrInappropriate].
f ifNil: [^interpreterProxy primitiveFail].
+ self deny: f isReadOnly.
f binary.
index := (3 to: openFiles size + 1) detect: [:n| (openFiles includesKey: n) not].
openFiles at: index put: f.
^interpreterProxy integerObjectOf: index!
Item was added:
+ ----- Method: FilePluginSimulator>>primitiveFileGetPosition (in category 'file primitives') -----
+ primitiveFileGetPosition
+ super primitiveFileGetPosition.
+ interpreterProxy failed ifTrue:
+ [self halt]!
Item was changed:
----- Method: FilePluginSimulator>>sqFileDeleteName:Size: (in category 'simulation') -----
sqFileDeleteName: nameIndex Size: nameSize
| path |
-
path := (interpreterProxy asString: nameIndex size: nameSize) asByteArray utf8Decoded.
(StandardFileStream isAFileNamed: path) ifFalse:
[^interpreterProxy primitiveFail].
+ self halt: 'Deleting ', (path contractTo: 64).
[FileDirectory deleteFilePath: path]
on: Error
do: [:ex| interpreterProxy primitiveFail]!
Item was changed:
----- Method: ThreadedARM32FFIPlugin class>>identifyingPredefinedMacros (in category 'translation') -----
identifyingPredefinedMacros
+ ^#('__ARM_ARCH_5__' '__ARM_ARCH_6__' '__ARM_ARCH_7__' '__arm32__' 'ARM32')!
- ^#('__ARM_ARCH__' '__arm__' '__arm32__' 'ARM32')!
Item was removed:
- ----- Method: ThreadedX64FFIPlugin class>>identifyingPredefinedMacros (in category 'translation') -----
- identifyingPredefinedMacros
- "Answer the predefined macros that identify the platforms a subclass handles, if any.
- If the subclass isn't yet ready for production (a work in progress) simply answer nil.
- Override to filter-out this abstract class."
- ^nil!
More information about the Vm-dev
mailing list