VM Maker: VMMaker.oscog-eem.2229.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

VM Maker: VMMaker.oscog-eem.2229.mcz

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

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

Name: VMMaker.oscog-eem.2229
Author: eem
Time: 30 May 2017, 1:15:51.741503 pm
UUID: 4dff0ffc-4ffb-4987-a246-5f1294e55467
Ancestors: VMMaker.oscog-eem.2227

Fix a compilation warning in the FFI plugin.  Add class comments for the X64 callout state holders (they got written in a discarded refactoring).

=============== Diff against VMMaker.oscog-eem.2227 ===============

Item was changed:
  ThreadedFFICalloutStateForX64 subclass: #ThreadedFFICalloutStateForX64SysV
  instanceVariableNames: ''
  classVariableNames: ''
  poolDictionaries: ''
  category: 'VMMaker-Plugins-FFI'!
+
+ !ThreadedFFICalloutStateForX64SysV commentStamp: 'eem 5/30/2017 10:22' prior: 0!
+ A ThreadedFFICalloutStateForX64SysV is a holder for the callout state maintained while marshalling an FFI call on an X64 (x86-64) system using the System V ABI.!

Item was changed:
  ThreadedFFICalloutStateForX64 subclass: #ThreadedFFICalloutStateForX64Win64
  instanceVariableNames: 'floatRegisterSignature'
  classVariableNames: ''
  poolDictionaries: ''
  category: 'VMMaker-Plugins-FFI'!
+
+ !ThreadedFFICalloutStateForX64Win64 commentStamp: 'eem 5/30/2017 10:22' prior: 0!
+ A ThreadedFFICalloutStateForX64Win64 is a holder for the callout state maintained while marshalling an FFI call on an X64 (x86-64) system using the _WIN64 ABI.!

Item was changed:
  ----- Method: ThreadedFFIPlugin>>ffiAddressOf:startingAt:size: (in category 'primitive support') -----
  ffiAddressOf: rcvr startingAt: byteOffset size: byteSize
  "Answer a long of the address of the byteSize slot (byte, short, int, whatever) at byteOffset in rcvr.
  Nominally intended for use with ExternalAddress objects, this code will work (for obscure historical
  reasons) with plain Byte or Word Arrays as well. "
  | rcvrClass rcvrSize addr |
  (interpreterProxy isBytes: rcvr) ifFalse:[^interpreterProxy primitiveFail].
  byteOffset > 0 ifFalse:[^interpreterProxy primitiveFail].
  rcvrClass := interpreterProxy fetchClassOf: rcvr.
  rcvrSize := interpreterProxy byteSizeOf: rcvr.
  rcvrClass = interpreterProxy classExternalAddress
  ifTrue:
  [rcvrSize = BytesPerWord ifFalse:[^interpreterProxy primitiveFail].
  addr := interpreterProxy fetchPointer: 0 ofObject: rcvr. "Hack!!!!"
  "don't you dare to read from object memory (unless is pinned)!!"
  (addr = 0 "or: [(interpreterProxy isInMemory: addr) or: [(interpreterProxy isPinned: rcvr) not]]") ifTrue:
  [^interpreterProxy primitiveFail]]
  ifFalse:
  [byteOffset+byteSize-1 <= rcvrSize ifFalse:
  [^interpreterProxy primitiveFail].
  addr := self cCoerce: (interpreterProxy firstIndexableField: rcvr) to: #'sqIntptr_t'].
  addr := addr + byteOffset - 1.
+ ^addr asVoidPointer!
- ^addr!