-
Notifications
You must be signed in to change notification settings - Fork 64
/
VMMachineCodeMethod.class.st
53 lines (45 loc) · 1.25 KB
/
VMMachineCodeMethod.class.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Class {
#name : #VMMachineCodeMethod,
#superclass : #Object,
#instVars : [
'virtualMachine',
'cogMethodSurrogate'
],
#pools : [
'VMStackFrameOffsets'
],
#category : #'VMMakerTests-Visualisation'
}
{ #category : #'instance creation' }
VMMachineCodeMethod class >> newOnInterpreter: aVirtualMachine cogMethodSurrogate: aCogMethodSurrogate [
^ self new
virtualMachine: aVirtualMachine;
cogMethodSurrogate: aCogMethodSurrogate;
yourself
]
{ #category : #accessing }
VMMachineCodeMethod >> cogMethodSurrogate [
^ cogMethodSurrogate
]
{ #category : #accessing }
VMMachineCodeMethod >> cogMethodSurrogate: anObject [
cogMethodSurrogate := anObject
]
{ #category : #accessing }
VMMachineCodeMethod >> disassemble [
| methodEntry instructions |
methodEntry := cogMethodSurrogate asInteger + virtualMachine cogit entryOffset.
instructions := virtualMachine cogit processor machineSimulator
disassembleFrom: methodEntry
to: cogMethodSurrogate asInteger + cogMethodSurrogate asInteger.
^ '
' join: (instructions collect: [:i | i assemblyCodeString])
]
{ #category : #accessing }
VMMachineCodeMethod >> virtualMachine [
^ virtualMachine
]
{ #category : #accessing }
VMMachineCodeMethod >> virtualMachine: anObject [
virtualMachine := anObject
]