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

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

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

Name: VMMaker.oscog-eem.613
Author: eem
Time: 10 February 2014, 3:07:28.778 pm
UUID: a84d1f38-0c74-4f61-8e2a-f3c77262a9fb
Ancestors: VMMaker.oscog-eem.612

Make primitiveClone cope with variable args, cloning its last
argument.  This for the Newspeak VMMirror.

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

Item was changed:
  ----- Method: CoInterpreterPrimitives>>primitiveClone (in category 'object access primitives') -----
  primitiveClone
  "Return a shallow copy of the receiver.
  Special-case non-single contexts (because of context-to-stack mapping).
  Can't fail for contexts cuz of image context instantiation code (sigh).
  Special case CompiledMerhods since the copy mustn't refer to CogMethod
  if receiver has been cogged."
 
  | rcvr newCopy objHeader |
  rcvr := self stackTop.
  (objectMemory isImmediate: rcvr)
  ifTrue: [newCopy := rcvr]
  ifFalse:
  [objHeader := objectMemory baseHeader: rcvr.
  (objectMemory isContextHeader: objHeader)
  ifTrue: [newCopy := self cloneContext: rcvr]
  ifFalse: [newCopy := objectMemory clone: rcvr].
  newCopy = 0 ifTrue:
  [^self primitiveFailFor: PrimErrNoMemory].
  (objectMemory isCompiledMethodHeader: objHeader) ifTrue:
  ["use stackTop since GC may have moved rcvr"
  self rawHeaderOf: newCopy put: (self headerOf: self stackTop)]].
+ self pop: argumentCount + 1 thenPush: newCopy!
- self pop: 1 thenPush: newCopy!

Item was changed:
  ----- Method: Interpreter>>primitiveClone (in category 'object access primitives') -----
  primitiveClone
  "Return a shallow copy of the receiver."
 
  | newCopy |
+ newCopy := self clone: self stackTop.
+ newCopy = 0 ifTrue: "not enough memory most likely"
+ [^self primitiveFail].
+ self pop: argumentCount + 1 thenPush: newCopy!
- newCopy := self clone: (self stackTop).
- newCopy = 0
- ifTrue:["not enough memory most likely" ^self primitiveFail].
- self pop: 1 thenPush: newCopy.!

Item was changed:
  ----- Method: InterpreterPrimitives>>primitiveClone (in category 'object access primitives') -----
  primitiveClone
  "Return a shallow copy of the receiver."
 
  | rcvr newCopy |
  rcvr := self stackTop.
  (objectMemory isImmediate: rcvr)
  ifTrue:
  [newCopy := rcvr]
  ifFalse:
  [newCopy := objectMemory clone: rcvr.
  newCopy = 0 ifTrue: "not enough memory most likely"
  [^self primitiveFail]].
+ self pop: argumentCount + 1 thenPush: newCopy!
- self pop: 1 thenPush: newCopy!

Item was changed:
  ----- Method: NewspeakInterpreter>>primitiveClone (in category 'object access primitives') -----
  primitiveClone
  "Return a shallow copy of the receiver."
 
  | newCopy |
+ newCopy := self clone: self stackTop.
+ newCopy = 0 ifTrue: "not enough memory most likely"
+ [^self primitiveFail].
+ self pop: argumentCount + 1 thenPush: newCopy!
- newCopy := self clone: (self stackTop).
- newCopy = 0
- ifTrue:["not enough memory most likely" ^self primitiveFail].
- self pop: 1 thenPush: newCopy.!

Item was changed:
  ----- Method: StackInterpreterPrimitives>>primitiveClone (in category 'object access primitives') -----
  primitiveClone
  "Return a shallow copy of the receiver.
  Special-case non-single contexts (because of context-to-stack mapping).
  Can't fail for contexts cuz of image context instantiation code (sigh)."
 
  | rcvr newCopy |
  rcvr := self stackTop.
  (objectMemory isImmediate: rcvr)
  ifTrue:
  [newCopy := rcvr]
  ifFalse:
  [(objectMemory isContextNonImm: rcvr)
  ifTrue:
  [newCopy := self cloneContext: rcvr]
  ifFalse:
  [newCopy := objectMemory clone: rcvr].
  newCopy = 0 ifTrue:
  [^self primitiveFailFor: PrimErrNoMemory]].
+ self pop: argumentCount + 1 thenPush: newCopy!
- self pop: 1 thenPush: newCopy!