[Vm-dev] VM Maker: VMMaker.gdb-bgs.2748.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Jun 1 23:04:41 UTC 2020
Boris G. Shingarov uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.gdb-bgs.2748.mcz
==================== Summary ====================
Name: VMMaker.gdb-bgs.2748
Author: bgs
Time: 1 June 2020, 7:04:31.839686 pm
UUID: ee592c75-7d1e-4ff9-9f6c-3c27e621f21e
Ancestors: VMMaker.gdb-bgs.2747
Add TargetAwareARM. Corresponds to GDB-bgs.4
=============== Diff against VMMaker.gdb-bgs.2747 ===============
Item was changed:
----- Method: CogAbstractInstruction>>getDefaultCogCodeSize (in category 'accessing') -----
getDefaultCogCodeSize
"Answer the default number of bytes to allocate for native code at startup.
The actual value can be set via vmParameterAt: and/or a preference in the ini file.
Subclasses may this default override to arrange that the code zone has about
the same number of methods as the x86 back-end at a similar point in execution."
<inline: true>
+ ^1024 * 2048!
- ^1024 * 1024!
Item was changed:
----- Method: CogOutOfLineLiteralsARMCompiler>>getDefaultCogCodeSize (in category 'accessing') -----
getDefaultCogCodeSize
"Return the default number of bytes to allocate for native code at startup.
The actual value can be set via vmParameterAt: and/or a preference in the ini file."
<inline: true>
+ ^1024 * 2048!
- ^1024 * 1280!
Item was changed:
----- Method: CogVMSimulator>>moveMethodCacheToMemoryAt: (in category 'initialization') -----
moveMethodCacheToMemoryAt: address
| oldMethodCache |
oldMethodCache := methodCache.
"In the VM the methodCache is written as a normal array with 1-relative addressing.
In C this works by allocating an extra element in the methodCache array (see
class-side declareCVarsIn:). In simulation simply position the start of the methodCache
one word lower, achieving the same effect. -1 because CArrayAccessor is 0-relative
and adds 1 on accesses itself."
methodCache := CMethodCacheAccessor new
objectMemory: objectMemory
at: address
array: oldMethodCache
functionPointerIndex: MethodCachePrimFunction
entrySize: MethodCacheEntrySize.
self assert: address - objectMemory wordSize = self methodCacheAddress.
+ 1 to: MethodCacheSize do:
- " 1 to: MethodCacheSize do:
[:i|
+ self assert: (methodCache at: i) = 0].
- self assert: (methodCache at: i) = 0]. "
methodCache at: 1 put: 16rC4EC4.
self assert: (objectMemory longAt: address) = 16rC4EC4.
1 to: MethodCacheSize do:
[:i|
methodCache at: i put: (oldMethodCache at: i)]!
Item was changed:
----- Method: CogVMSimulator>>movePrimTraceLogToMemoryAt: (in category 'initialization') -----
movePrimTraceLogToMemoryAt: address
| oldTraceLog |
oldTraceLog := primTraceLog.
primTraceLog := CArrayOfLongsAccessor new
objectMemory: objectMemory at: address.
self assert: address = self primTraceLogAddress.
+ 0 to: PrimTraceLogSize - 1 do:
- " 0 to: PrimTraceLogSize - 1 do:
[:i|
+ self assert: (primTraceLog at: i) = 0].
- self assert: (primTraceLog at: i) = 0]."
primTraceLog at: 0 put: 16rC4EC4.
self assert: (objectMemory longAt: address) = 16rC4EC4.
0 to: PrimTraceLogSize - 1 do:
[:i|
primTraceLog at: i put: (oldTraceLog at: i)]!
Item was changed:
----- Method: Cogit class>>initializeMiscConstants (in category 'class initialization') -----
initializeMiscConstants
super initializeMiscConstants.
Debug := InitializationOptions at: #Debug ifAbsent: [false].
(InitializationOptions includesKey: #EagerInstructionDecoration)
ifTrue:
[EagerInstructionDecoration := InitializationOptions at: #EagerInstructionDecoration]
ifFalse:
[EagerInstructionDecoration ifNil:
[EagerInstructionDecoration := false]]. "speeds up single stepping but could lose fidelity"
ProcessorClass := (InitializationOptions at: #ISA ifAbsentPut: [self objectMemoryClass defaultISA]) caseOf: {
[#X64] -> [BochsX64Alien].
[#IA32] -> ["BochsIA32Alien" TargetAwareX86 ].
+ [#ARMv5] -> ["GdbARMAlien" TargetAwareARM ].
- [#ARMv5] -> [GdbARMAlien].
[#ARMv8] -> [GdbARMv8Alien].
[#MIPSEL] -> [MIPSELSimulator] }.
CogCompilerClass := self activeCompilerClass.
CogAbstractInstruction initializeAbstractRegisters.
self objectMemoryClass objectRepresentationClass initializeMiscConstants.
"Our criterion for which methods to JIT is literal count. The default value is 60 literals or less."
MaxLiteralCountForCompile := InitializationOptions at: #MaxLiteralCountForCompile ifAbsent: [60].
"we special-case 0, 1 & 2 argument sends, N is numArgs >= 3"
NumSendTrampolines := 4.
"Currently not even the ceImplicitReceiverTrampoline contains object references."
NumObjRefsInRuntime := 0.
"6 is a fine number for the max number of PCI entries. 8 is too large."
MaxCPICCases := 6.
"One variable defines whether in a block and whether in a vanilla or full block."
InVanillaBlock := 1.
InFullBlock := 2.
NSCSelectorIndex := (NSSendCache instVarNames indexOf: #selector) - 1.
NSCNumArgsIndex := (NSSendCache instVarNames indexOf: #numArgs) - 1.
NSCClassTagIndex := (NSSendCache instVarNames indexOf: #classTag) - 1.
NSCEnclosingObjectIndex := (NSSendCache instVarNames indexOf: #enclosingObject) - 1.
NSCTargetIndex := (NSSendCache instVarNames indexOf: #target) - 1.
NumOopsPerNSC := NSSendCache instVarNames size.
"Max size to alloca when compiling.
Mac OS X 10.6.8 segfaults approaching 8Mb.
Linux 2.6.9 segfaults above 11Mb.
WIndows XP segfaults approaching 2Mb."
MaxStackAllocSize := 1024 * 1024 * 3 / 2 !
Item was changed:
----- Method: Cogit>>handleABICallOrJumpSimulationTrap:evaluable: (in category 'simulation only') -----
handleABICallOrJumpSimulationTrap: aProcessorSimulationTrap evaluable: evaluable
<doNotGenerate>
+ self assert: aProcessorSimulationTrap type = #controlTransfer.
- self assert: aProcessorSimulationTrap type = #call.
processor
+ simulateBuildFrameIn: coInterpreter memory for: evaluable.
- simulateLeafCallOf: aProcessorSimulationTrap address
- nextpc: aProcessorSimulationTrap nextpc
- memory: coInterpreter memory.
self recordInstruction: {'(simulated call of '. aProcessorSimulationTrap address. '/'. evaluable selector. ')'}.
clickConfirm ifTrue:
[(self confirm: 'skip run-time call?') ifFalse:
[clickConfirm := false. self halt]].
evaluable valueWithArguments: (processor
postCallArgumentsNumArgs: evaluable numArgs
in: coInterpreter memory).
self recordInstruction: {'(simulated return to '. processor retpcIn: coInterpreter memory. ')'}.
processor
smashABICallerSavedRegistersWithValuesFrom: 16r80000000 by: objectMemory wordSize;
+ simulateReturnIn: coInterpreter memory!
- simulateLeafReturnIn: coInterpreter memory!
More information about the Vm-dev
mailing list