[Vm-dev] VM Maker: VMMaker.oscog-eem.1946.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Sep 6 17:28:25 UTC 2016
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1946.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.1946
Author: eem
Time: 6 September 2016, 7:25:45.714008 pm
UUID: 5d49f2e2-77f3-4f4d-877b-b3fecceda04e
Ancestors: VMMaker.oscog-eem.1945
Fix Slang bug that misgenerated the macros for the full block entry offsets.
Add some facade machinery for the new full block check asserts.
=============== Diff against VMMaker.oscog-eem.1945 ===============
Item was changed:
----- Method: CCodeGenerator>>addMethodFor:selector: (in category 'utilities') -----
addMethodFor: aClass selector: selector
"Add the given method to the code base and answer its translation
or nil if it shouldn't be translated."
| method tmethod |
method := aClass compiledMethodAt: selector.
(method pragmaAt: #doNotGenerate) ifNotNil:
["only remove a previous method if this one overrides it, i.e. this is a subclass method.
If the existing method is in a different hierarchy this method must be merely a redeirect."
(methods at: selector ifAbsent: []) ifNotNil:
[:tm|
(aClass includesBehavior: tm definingClass) ifTrue:
[self removeMethodForSelector: selector]].
^nil].
method isSubclassResponsibility ifTrue:
[^nil].
(self shouldIncludeMethodFor: aClass selector: selector) ifFalse:
[^nil].
tmethod := self compileToTMethodSelector: selector in: aClass.
"Even thoug we exclude initialize methods, we must consider their
global variable usage, otherwise globals may be incorrectly localized."
selector == #initialize ifTrue:
[self checkForGlobalUsage: (tmethod allReferencedVariablesUsing: self) in: tmethod.
^nil].
self addMethod: tmethod.
"If the method has a macro then add the macro. But keep the method
for analysis purposes (e.g. its variable accesses)."
(method pragmaAt: #cmacro:) ifNotNil:
[:pragma|
self addMacro: (pragma argumentAt: 1) for: selector.
(inlineList includes: selector) ifTrue:
[inlineList := inlineList copyWithout: selector]].
(method pragmaAt: #cmacro) ifNotNil:
[:pragma| | literal | "Method should be just foo ^const"
self assert: (method numArgs = 0 and: [method numLiterals = 3 or: [method isQuick]]).
literal := method isQuick
ifTrue: [method decompile block statements last expr key]
ifFalse: [method literalAt: 1].
+ self addMacro: '() ', (method isReturnField
+ ifTrue: [literal]
+ ifFalse: [self cLiteralFor: literal value name: method selector]) for: selector.
- self addMacro: '() ', (self cLiteralFor: literal value name: method selector) for: selector.
(inlineList includes: selector) ifTrue:
[inlineList := inlineList copyWithout: selector]].
^tmethod!
Item was changed:
----- Method: Cogit class>>mustBeGlobal: (in category 'translation') -----
mustBeGlobal: var
"Answer if a variable must be global and exported. Used for inst vars that are accessed from VM
support code. include cePositive32BitIntegerTrampoline as a hack to prevent it being inlined (it is
only used outside of Cogit by the object representation). Include CFramePointer CStackPointer as
a hack to get them declared at all."
^#( 'ceBaseFrameReturnTrampoline' #ceCaptureCStackPointers 'ceCheckForInterruptTrampoline'
ceEnterCogCodePopReceiverReg realCEEnterCogCodePopReceiverReg
ceCallCogCodePopReceiverReg realCECallCogCodePopReceiverReg
ceCallCogCodePopReceiverAndClassRegs realCECallCogCodePopReceiverAndClassRegs
'ceReturnToInterpreterTrampoline' 'ceCannotResumeTrampoline'
ceTryLockVMOwner ceUnlockVMOwner
+ 'cmEntryOffset' 'cmNoCheckEntryOffset' 'cmDynSuperEntryOffset' 'cmSelfSendEntryOffset'
+ 'missOffset' 'cbEntryOffset' 'cbNoSwitchEntryOffset' 'blockNoContextSwitchOffset' breakPC
- 'cmEntryOffset' 'cmNoCheckEntryOffset' 'cmDynSuperEntryOffset' 'cmSelfSendEntryOffset' 'missOffset'
- 'blockNoContextSwitchOffset' breakPC
CFramePointer CStackPointer 'cFramePointerInUse' ceGetFP ceGetSP
traceFlags 'traceStores' debugPrimCallStackOffset)
includes: var!
Item was changed:
----- Method: Cogit>>entryOffset (in category 'accessing') -----
entryOffset
<api>
+ <cmacro>
- <cmacro: '() cmEntryOffset'>
^cmEntryOffset!
Item was changed:
----- Method: Cogit>>noCheckEntryOffset (in category 'accessing') -----
noCheckEntryOffset
<api>
+ <cmacro>
- <cmacro: '() cmNoCheckEntryOffset'>
^cmNoCheckEntryOffset!
Item was added:
+ ----- Method: CurrentImageCoInterpreterFacade>>isOopCompiledMethod: (in category 'accessing') -----
+ isOopCompiledMethod: anOop
+ ^(objectMap keyAtValue: anOop) isCompiledMethod!
Item was added:
+ ----- Method: CurrentImageCoInterpreterFacade>>ultimateLiteralOf: (in category 'accessing') -----
+ ultimateLiteralOf: methodObj
+ | meth |
+ meth := (objectMap keyAtValue: methodObj).
+ ^self oopForObject: (meth literalAt: meth numLiterals)!
More information about the Vm-dev
mailing list