[Vm-dev] VM Maker: FileAttributesPlugin.oscog-eem.50.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Nov 29 20:23:58 UTC 2019


Eliot Miranda uploaded a new version of FileAttributesPlugin to project VM Maker:
http://source.squeak.org/VMMaker/FileAttributesPlugin.oscog-eem.50.mcz

==================== Summary ====================

Name: FileAttributesPlugin.oscog-eem.50
Author: eem
Time: 6 March 2019, 9:58:12.108207 am
UUID: b0ab4422-fbd0-4f63-bcc6-e505d2c61bb5
Ancestors: FileAttributesPlugin.oscog-akg.49

Simpification and simulaiton of primitiveFileExists & primitivePathMax, using the simpler and more efficient methodreturnXXX: protocol.

=============== Diff against FileAttributesPlugin.oscog-akg.49 ===============

Item was added:
+ ----- Method: FileAttributesPlugin>>faPathMax (in category 'private') -----
+ faPathMax
+ 	"Answer the value of the platform support's definition of FA_PATH_MAX, defined in
+ 	 platforms/{unix.win32,etc}/plugins/FileAttributesPlugin/faSupport.h"
+ 	<inline: #always>
+ 	^#FA_PATH_MAX!

Item was changed:
  ----- Method: FileAttributesPlugin>>primitiveFileExists (in category 'file primitives') -----
  primitiveFileExists
+ 	"Check for existence of a file with a call to access(), or the appropriate platform function."
- 	"Check for existence of a file with a call to access()."
  
- 	| fileNameOop faPath resultOop |
  	<export: true>
+ 	| fileNameOop faPath |
+ 	<var: 'faPath' type: #'fapath'>
- 	<var: 'faPath'type: #'fapath'>
  
  	self cCode: '' inSmalltalk: [faPath := self simulatedFaPath].
+ 	fileNameOop := interpreterProxy stackValue: 0.
- 	fileNameOop := interpreterProxy stackObjectValue: 0.
  	(interpreterProxy isBytes: fileNameOop) ifFalse:
  		[^interpreterProxy primitiveFailFor: PrimErrBadArgument].
  
  	self faSetStPathOop: (self addressOf: faPath) _: fileNameOop.
+ 	interpreterProxy failed ifFalse:
+ 		[^interpreterProxy methodReturnBool: (self faExists: (self addressOf: faPath))]!
- 	interpreterProxy failed ifTrue: [^interpreterProxy primitiveFailureCode].
- 
- 	resultOop := self faExists: (self addressOf: faPath).
- 	^interpreterProxy methodReturnValue: resultOop.
- !

Item was changed:
  ----- Method: FileAttributesPlugin>>primitivePathMax (in category 'file primitives') -----
  primitivePathMax
+ 	"Answer the value of FA_PATH_MAX (PATH_MAX) for the current VM"
- 	"Answer the value of PATH_MAX for the current VM"
  
  	<export: true>
+ 	^interpreterProxy methodReturnInteger: self faPathMax!
- 	^interpreterProxy pop: 1 thenPush: (interpreterProxy integerObjectOf: #FA_PATH_MAX)!

Item was changed:
  ----- Method: FileAttributesPluginSimulator>>faExists: (in category 'simulation') -----
  faExists: faPath
  	"Simulate the the call by actually calling the primitive."
  
+ 	^self primExists: (self faGetStPath: faPath)!
- 	^(self primExists: (self faGetStPath: faPath))
- 		ifTrue: [interpreterProxy trueObject]
- 		ifFalse: [interpreterProxy falseObject].
- !

Item was added:
+ ----- Method: FileAttributesPluginSimulator>>faPathMax (in category 'primitives') -----
+ faPathMax
+ 	"Answer the VMs FA_PATH_MAX value"
+ 
+ 	<primitive: 'primitivePathMax' module: 'FileAttributesPlugin' error: error>
+ 	^self signalError: error for: 'primPathMax'!

Item was removed:
- ----- Method: FileAttributesPluginSimulator>>primPathMax (in category 'primitives') -----
- primPathMax
- 	"Answer the VMs FA_PATH_MAX value"
- 
- 	<primitive: 'primitivePathMax' module: 'FileAttributesPlugin' error: error>
- 	^self signalError: error for: 'primPathMax'!

Item was removed:
- ----- Method: FileAttributesPluginSimulator>>primitivePathMax (in category 'simulation') -----
- primitivePathMax
- 	"Answer the value of FA_PATH_MAX for the current VM.
- 	It doesn't make sense to simulate this, just call the primitive"
- 
- 	^self primPathMax!



More information about the Vm-dev mailing list