VM Maker: VMMaker.oscog-eem.2359.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.2359.mcz

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

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

Name: VMMaker.oscog-eem.2359
Author: eem
Time: 15 March 2018, 4:58:47.365471 pm
UUID: b3273e3e-dd9d-4819-a928-7034e1cf412c
Ancestors: VMMaker.oscog-eem.2358

Oops!  Fixed one I missed.

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

Item was changed:
  ----- Method: MiscPrimitivePlugin>>primitiveTranslateStringWithTable (in category 'primitives') -----
  primitiveTranslateStringWithTable
  "ByteString (class) translate: aString from: start to: stop table: table"
  <export: true>
  | aString start stop table |
  <var: #table type: #'unsigned char *'>
  <var: #aString type: #'unsigned char *'>
  ((interpreterProxy isBytes: (interpreterProxy stackValue: 0))
  and: [(interpreterProxy isIntegerObject: (interpreterProxy stackValue: 1))
  and: [(interpreterProxy isIntegerObject: (interpreterProxy stackValue: 2))
  and: [interpreterProxy isBytes: (interpreterProxy stackValue: 3)]]]) ifFalse:
  [^interpreterProxy primitiveFailFor: PrimErrBadArgument].
  (interpreterProxy isOopImmutable: (interpreterProxy stackValue: 3)) ifTrue:
  [^interpreterProxy primitiveFailFor: PrimErrNoModification].
  aString := interpreterProxy firstIndexableField: (interpreterProxy stackValue: 3).
  start := interpreterProxy integerValueOf: (interpreterProxy stackValue: 2).
  stop := interpreterProxy integerValueOf: (interpreterProxy stackValue: 1).
  table := interpreterProxy firstIndexableField: (interpreterProxy stackValue: 0).
  (start >= 1 and: [stop <= (interpreterProxy sizeOfSTArrayFromCPrimitive: aString)]) ifFalse:
  [^interpreterProxy primitiveFailFor: PrimErrBadIndex].
+ (interpreterProxy sizeOfSTArrayFromCPrimitive: table) < 256 ifTrue:
+ [^interpreterProxy primitiveFailFor: PrimErrBadArgument].
  start - 1 to: stop - 1 do: [ :i | aString at: i put: (table at: (aString at: i))].
  interpreterProxy pop: interpreterProxy methodArgumentCount!