SnapShotImageMemory.st
author mawalch
Wed, 27 Jan 2016 17:01:30 +0100
changeset 3250 48b1dfb0b16f
parent 3091 4ec02687f35f
child 3324 dee0c393db4e
permissions -rw-r--r--
#DOCUMENTATION class: SnapShotImageMemory
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1423
5bb61f51152d checkin from browser
ps
parents: 1422
diff changeset
     1
"{ Package: 'stx:libtool2' }"
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
3250
48b1dfb0b16f #DOCUMENTATION
mawalch
parents: 3091
diff changeset
     3
"{ NameSpace: Smalltalk }"
48b1dfb0b16f #DOCUMENTATION
mawalch
parents: 3091
diff changeset
     4
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
Object subclass:#SnapShotImageMemory
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
     6
	instanceVariableNames:'image stream msb ptrSize intSize intTag spaceInfos symbolEntries
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
     7
		globalEntries addrToObjectMapping fetchINT hdrSize'
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
	classVariableNames:''
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
	poolDictionaries:''
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
	category:'System-Support'
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    13
Object subclass:#ImageHeader
1864
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
    14
	instanceVariableNames:'memory address classRef bits byteSize'
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    15
	classVariableNames:''
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    16
	poolDictionaries:''
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    17
	privateIn:SnapShotImageMemory
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    18
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    19
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    20
SnapShotImageMemory::ImageHeader variableSubclass:#ImageObject
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
    21
	instanceVariableNames:'cachedContents'
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
	classVariableNames:''
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
	poolDictionaries:''
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
	privateIn:SnapShotImageMemory
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
1448
42ec8770d09f comment added
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
    27
SnapShotImageMemory::ImageHeader variableByteSubclass:#ImageByteObject
42ec8770d09f comment added
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
    28
	instanceVariableNames:''
42ec8770d09f comment added
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
    29
	classVariableNames:''
42ec8770d09f comment added
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
    30
	poolDictionaries:''
42ec8770d09f comment added
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
    31
	privateIn:SnapShotImageMemory
42ec8770d09f comment added
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
    32
!
42ec8770d09f comment added
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
    33
1482
13fe76a0986b more caching (faster now)
Claus Gittinger <cg@exept.de>
parents: 1469
diff changeset
    34
SnapShotImageMemory::ImageObject variableSubclass:#ImageMethodObject
1552
298232956ca8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1551
diff changeset
    35
	instanceVariableNames:'cachedPackage cachedMClass cachedSelector'
1482
13fe76a0986b more caching (faster now)
Claus Gittinger <cg@exept.de>
parents: 1469
diff changeset
    36
	classVariableNames:''
13fe76a0986b more caching (faster now)
Claus Gittinger <cg@exept.de>
parents: 1469
diff changeset
    37
	poolDictionaries:''
13fe76a0986b more caching (faster now)
Claus Gittinger <cg@exept.de>
parents: 1469
diff changeset
    38
	privateIn:SnapShotImageMemory
13fe76a0986b more caching (faster now)
Claus Gittinger <cg@exept.de>
parents: 1469
diff changeset
    39
!
13fe76a0986b more caching (faster now)
Claus Gittinger <cg@exept.de>
parents: 1469
diff changeset
    40
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
SnapShotImageMemory::ImageObject variableSubclass:#ImageClassObject
1482
13fe76a0986b more caching (faster now)
Claus Gittinger <cg@exept.de>
parents: 1469
diff changeset
    42
	instanceVariableNames:'cachedCategory cachedFlags cachedName'
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
	classVariableNames:''
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
	poolDictionaries:''
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
	privateIn:SnapShotImageMemory
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
    48
Object subclass:#SpaceInfo
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
    49
	instanceVariableNames:'start end size flags imageBase'
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
    50
	classVariableNames:''
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
    51
	poolDictionaries:''
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
    52
	privateIn:SnapShotImageMemory
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
    53
!
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
    54
1448
42ec8770d09f comment added
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
    55
!SnapShotImageMemory class methodsFor:'documentation'!
42ec8770d09f comment added
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
    56
42ec8770d09f comment added
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
    57
documentation
42ec8770d09f comment added
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
    58
"
42ec8770d09f comment added
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
    59
    I represent the memory as contained in a snapshot image.
42ec8770d09f comment added
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
    60
42ec8770d09f comment added
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
    61
    I am not used directly; instead, via the SystemBrowsers entry:
42ec8770d09f comment added
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
    62
        SystemBrowser openOnSnapShotImage:'/export/home/cg/work/stx/projects/smalltalk/st.img'
1864
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
    63
        SystemBrowser openOnSnapShotImage:'crash.img'
1448
42ec8770d09f comment added
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
    64
42ec8770d09f comment added
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
    65
    [author:]
42ec8770d09f comment added
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
    66
        Claus Gittinger
42ec8770d09f comment added
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
    67
42ec8770d09f comment added
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
    68
"
42ec8770d09f comment added
Claus Gittinger <cg@exept.de>
parents: 1440
diff changeset
    69
! !
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
!SnapShotImageMemory class methodsFor:'instance creation'!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
for:aFilename
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
    ^ self new for:aFilename
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
! !
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
!SnapShotImageMemory class methodsFor:'private'!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
isNilOOP:anOOP
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
    ^ anOOP == 0
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
isPointerOOP:anOOP
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
    ^ (anOOP bitTest:1) not
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
isSmallIntegerOOP:anOOP
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
    ^ anOOP bitTest:1
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
! !
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
!SnapShotImageMemory methodsFor:'accessing'!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
globalEntries
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
    "return the value of the instance variable 'globalEntries' (automatically generated)"
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
    96
    ^ globalEntries
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
    97
!
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
globalEntries:something
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
    "set the value of the instance variable 'globalEntries' (automatically generated)"
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   102
    globalEntries := something.
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   103
!
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   104
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   105
image
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   106
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   107
    ^ image
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   108
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   109
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   110
image:something
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   111
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   112
    image := something.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   113
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   114
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   115
ptrSize
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   116
    "return the value of the instance variable 'ptrSize' (automatically generated)"
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   117
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   118
    ^ ptrSize
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   119
!
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   120
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   121
ptrSize:something
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   122
    "set the value of the instance variable 'ptrSize' (automatically generated)"
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   123
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   124
    ptrSize := something.
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   125
! !
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
!SnapShotImageMemory methodsFor:'object access'!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   129
fetchByteAt:addr
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   130
    |byte imgAddr|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   131
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   132
    imgAddr := self imageAddressOf:addr.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   133
    stream position:imgAddr.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   134
    byte := stream next.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   135
    ^ byte
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   136
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   137
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
fetchClassObjectAt:baseAddr
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   139
    |addr classPtr size bits o classRef nInsts|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   140
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   141
    (baseAddr bitAnd:ptrSize-1) ~~ 0 ifTrue:[self halt].
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
1864
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   143
    o := addrToObjectMapping at:(baseAddr bitShift:-2) ifAbsent:nil.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
    o notNil ifTrue:[^ o].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
    addr := baseAddr.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
    classPtr := self fetchPointerAt:addr.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
    addr := addr + ptrSize.
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   149
    size := self fetchUnboxedInteger4At:addr.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   150
    addr := addr + 4.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   151
    bits := self fetchUnboxedInteger4At:addr.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   152
    addr := addr + 4.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   153
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   154
    nInsts := (size - hdrSize) // intSize.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   155
    o := ImageClassObject new:nInsts.
1864
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   156
    o memory:self.
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   157
    o address:baseAddr.
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   158
    addrToObjectMapping at:(baseAddr bitShift:-2) put:o.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   159
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   160
    (self class isPointerOOP:classPtr) ifFalse:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   161
        self halt
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   162
    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   163
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   164
    "/ size > 8000 ifTrue:[self halt].
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   165
    o byteSize:size.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
    o bits:bits.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   168
    1 to:nInsts do:[:idx |
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   169
        o at:idx put:(fetchINT value).
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   170
"/        o at:idx put:(self fetchObjectAt:(self fetchUnboxedIntegerAt:addr)).
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   171
        addr := addr + ptrSize.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
    ].
1864
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   173
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   174
    classRef := self fetchClassObjectAt:classPtr.
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   175
    o classRef:classRef.
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   176
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
    ^ o
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
fetchObjectAt:baseAddr
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   181
    |addr classPtr classRef size bits o nBytes nInsts flags indexTypeFlags imgAddr|
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   182
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   183
    baseAddr == 0 ifTrue:[^ nil].
1864
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   184
    (baseAddr bitAnd:1) == 1 ifTrue:[
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   185
        "/ sign extent integer
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   186
        ptrSize == 8 ifTrue:[
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   187
            (baseAddr bitTest:16r8000000000000000) ifTrue:[
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   188
                ^ (baseAddr - 16r10000000000000000) bitShift:-1
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   189
            ].
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   190
            ^ baseAddr bitShift:-1
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   191
        ] ifFalse:[
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   192
            (baseAddr bitTest:16r80000000) ifTrue:[
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   193
                ^ (baseAddr - 16r100000000) bitShift32:-1
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   194
            ].
1864
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   195
            ^ baseAddr bitShift32:-1
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   196
        ].
1864
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   197
    ].
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   198
    (baseAddr bitAnd:ptrSize-1) ~~ 0 ifTrue:[self halt].
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
1864
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   200
    o := addrToObjectMapping at:(baseAddr bitShift:-2) ifAbsent:nil.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
    o notNil ifTrue:[^ o].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
    addr := baseAddr.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
    classPtr := self fetchPointerAt:addr.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
    addr := addr + ptrSize.
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   206
    size := self fetchUnboxedInteger4At:addr.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   207
    addr := addr + 4.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   208
    bits := self fetchUnboxedInteger4At:addr.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   209
    addr := addr + 4.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
    (self class isPointerOOP:classPtr) ifFalse:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
        self halt
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
    ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
    classRef := self fetchClassObjectAt:classPtr.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   216
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   217
    imgAddr := self imageAddressOf:addr.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   218
    stream position:imgAddr.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   219
1482
13fe76a0986b more caching (faster now)
Claus Gittinger <cg@exept.de>
parents: 1469
diff changeset
   220
    flags := classRef flags.
13fe76a0986b more caching (faster now)
Claus Gittinger <cg@exept.de>
parents: 1469
diff changeset
   221
    indexTypeFlags := flags bitAnd:Behavior maskIndexType.
13fe76a0986b more caching (faster now)
Claus Gittinger <cg@exept.de>
parents: 1469
diff changeset
   222
    (indexTypeFlags = Behavior flagBytes) ifTrue:[ 
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   223
        nBytes := (size - hdrSize).
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   224
        o := ImageByteObject new:nBytes.
1864
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   225
        o memory:self.
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   226
        o address:baseAddr.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   227
        o classRef:classRef.
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   228
        "/ size > 8000 ifTrue:[self halt].
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   229
        o byteSize:size.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   230
        o bits:bits.
1864
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   231
        addrToObjectMapping at:(baseAddr bitShift:-2) put:o.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   233
        1 to:nBytes do:[:idx |
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   234
            o at:idx put:(stream next).
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   235
            addr := addr + 1.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   236
        ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   237
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   238
"/Transcript show:'#'.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   239
"/Transcript show:((ByteArray new:nBytes-1) replaceFrom:1 to:nBytes-1 with:o startingAt:1) asString.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   240
"/Transcript cr.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   242
    ] ifFalse:[
1482
13fe76a0986b more caching (faster now)
Claus Gittinger <cg@exept.de>
parents: 1469
diff changeset
   243
        (indexTypeFlags = Behavior flagNotIndexed) ifFalse:[ 
13fe76a0986b more caching (faster now)
Claus Gittinger <cg@exept.de>
parents: 1469
diff changeset
   244
            (indexTypeFlags ~= Behavior flagPointers) ifTrue:[
13fe76a0986b more caching (faster now)
Claus Gittinger <cg@exept.de>
parents: 1469
diff changeset
   245
                (indexTypeFlags ~= Behavior flagWeakPointers) ifTrue:[
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   246
                    self halt 
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   247
                ]
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   248
            ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   249
        ].
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   251
        nInsts := (size - hdrSize) // intSize.
1482
13fe76a0986b more caching (faster now)
Claus Gittinger <cg@exept.de>
parents: 1469
diff changeset
   252
        (flags bitTest:Behavior flagBehavior)
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   253
        "/ classRef isImageBehavior 
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   254
        ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   255
            o := ImageClassObject new:nInsts.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   256
        ] ifFalse:[
1482
13fe76a0986b more caching (faster now)
Claus Gittinger <cg@exept.de>
parents: 1469
diff changeset
   257
            (flags bitTest:Behavior flagMethod) ifTrue:[
13fe76a0986b more caching (faster now)
Claus Gittinger <cg@exept.de>
parents: 1469
diff changeset
   258
                o := ImageMethodObject new:nInsts.
13fe76a0986b more caching (faster now)
Claus Gittinger <cg@exept.de>
parents: 1469
diff changeset
   259
            ] ifFalse:[
13fe76a0986b more caching (faster now)
Claus Gittinger <cg@exept.de>
parents: 1469
diff changeset
   260
                o := ImageObject new:nInsts.
13fe76a0986b more caching (faster now)
Claus Gittinger <cg@exept.de>
parents: 1469
diff changeset
   261
            ]
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   262
        ].
1864
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   263
        o memory:self.
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   264
        o address:baseAddr.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   265
        o classRef:classRef.
3089
994863569542 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 3088
diff changeset
   266
        "/ size > 8000 ifTrue:[self halt].
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   267
        o byteSize:size.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   268
        o bits:bits.
1864
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   269
        addrToObjectMapping at:(baseAddr bitShift:-2) put:o.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   271
        1 to:nInsts do:[:idx |
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   272
            o at:idx put:(fetchINT value).
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   273
"/            o at:idx put:(self fetchObjectAt:(self fetchUnboxedIntegerAt:addr)).
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   274
            addr := addr + ptrSize.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   275
        ]
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   276
    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   277
    ^ o
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   278
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   280
fetchPointerAt:addr
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   281
    ^ self fetchUnboxedIntegerAt:addr
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   284
fetchUnboxedInteger4At:addr
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   285
    |ptr imgAddr|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   286
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   287
    (addr bitAnd:(4-1)) ~~ 0 ifTrue:[self halt].
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   288
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   289
    imgAddr := self imageAddressOf:addr.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   290
    stream position:imgAddr.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   291
    ptr := stream nextUnsignedLongMSB:msb.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   292
    ^ ptr
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   293
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   294
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   295
fetchUnboxedIntegerAt:addr
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   296
    |ptr imgAddr|
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   297
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   298
    (addr bitAnd:(ptrSize-1)) ~~ 0 ifTrue:[self halt].
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   299
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   300
    imgAddr := self imageAddressOf:addr.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   301
    stream position:imgAddr.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   302
    ptr := fetchINT value.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   303
    ^ ptr
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   304
!
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   305
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   306
imageAddressOf:addr
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   307
    spaceInfos do:[:eachSpace |
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   308
        |byte imgAddr|
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
        addr >= eachSpace start ifTrue:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   311
            addr <= eachSpace end ifTrue:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
                imgAddr := eachSpace imageBase + (addr - eachSpace start).
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   313
                ^ imgAddr
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
            ]
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
        ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   316
    ].
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   317
    self halt:'image address error'.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   318
! !
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   319
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
!SnapShotImageMemory methodsFor:'private'!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
allClassesDo:aBlock
1551
6d0cb201dc8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
   323
    globalEntries do:[:eachGlobal |
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   324
        |val|
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   325
1551
6d0cb201dc8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
   326
        val := eachGlobal value.
6d0cb201dc8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
   327
        (val notNil     
6d0cb201dc8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
   328
        and:[(val isKindOf:ImageHeader)
6d0cb201dc8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
   329
        and:[val isImageBehavior]]) ifTrue:[
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   330
            aBlock value:val
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   331
        ].
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   332
    ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   333
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   334
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   335
fetchByteArrayFor:aByteArrayRef
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   336
    |nBytes|
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   337
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   338
    (aByteArrayRef isImageBytes) ifFalse:[self halt].
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   339
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   340
    nBytes := aByteArrayRef byteSize - hdrSize.
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   341
    ^ ((ByteArray new:nBytes) replaceFrom:1 to:nBytes-1 with:aByteArrayRef startingAt:1).
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   342
!
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   343
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   344
fetchStringFor:aStringRef
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   345
    |nBytes|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   346
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   347
    (aStringRef isImageBytes) ifFalse:[self halt].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   348
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   349
    nBytes := aStringRef byteSize - hdrSize.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   350
    ^ ((ByteArray new:nBytes-1) 
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   351
            replaceFrom:1 to:nBytes-1 with:aStringRef startingAt:1) asString.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   352
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   353
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   354
for:aFilename
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   355
    stream := aFilename asFilename readStream binary.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   356
    addrToObjectMapping := IdentityDictionary new.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   357
1864
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   358
    addrToObjectMapping at:((ObjectMemory addressOf:false) bitShift:-2) put:false.
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   359
    addrToObjectMapping at:((ObjectMemory addressOf:true) bitShift:-2)  put:true.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   360
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   361
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   362
printStringOfClass:aClassRef
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   363
    |nameSlot|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   364
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   365
    (aClassRef isImageBehavior) ifFalse:[self halt].
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   366
    ((aClassRef byteSize - hdrSize) // intSize) < Class instSize ifTrue:[self halt.].
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   367
1791
2bc8227a8b18 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1724
diff changeset
   368
    nameSlot := aClassRef nameSlot.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   369
    nameSlot isInteger ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   370
        nameSlot := self fetchObjectAt:nameSlot
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   371
    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   372
    nameSlot isImageSymbol ifFalse:[self halt].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   373
    ^ 'Class: ' , (self printStringOfSymbol:nameSlot)
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   374
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   375
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   376
printStringOfObject:anObjectRef
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   377
    |s nBytes|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   378
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   379
    anObjectRef isNil ifTrue:[^ 'nil'].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   380
    (anObjectRef isInteger) ifTrue:[^ anObjectRef printString].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   381
    (anObjectRef == true ) ifTrue:[^ anObjectRef printString].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   382
    (anObjectRef == false) ifTrue:[^ anObjectRef printString].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   383
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   384
    (anObjectRef isImageSymbol) ifTrue:[^ self printStringOfSymbol:anObjectRef].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   385
    (anObjectRef isImageBehavior) ifTrue:[^ self printStringOfClass:anObjectRef].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   386
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   387
    ^ 'obj(' , anObjectRef printString , ')'
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   388
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   389
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   390
printStringOfString:aStringRef
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   391
    |nBytes|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   392
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   393
    (aStringRef isString) ifFalse:[self halt].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   394
    ^ self fetchStringFor:aStringRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   395
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   396
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   397
printStringOfSymbol:aSymbolRef
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   398
    (aSymbolRef isImageSymbol) ifFalse:[self halt].
1420
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   399
    ^ self fetchStringFor:aSymbolRef.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   400
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   401
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   402
readGlobalEntries
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   403
        |refPointer theSymbolPtr theSymbolRef theValuePtr theValueRef pos|
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   404
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   405
        globalEntries := OrderedCollection new.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   406
        [
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   407
            refPointer := fetchINT value.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   408
            theSymbolPtr := fetchINT value.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   409
            theValuePtr := fetchINT value.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   410
            theSymbolPtr ~~ 0
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   411
        ] whileTrue:[
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   412
            globalEntries add:(theSymbolPtr -> theValuePtr).
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   413
        ].
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   414
        globalEntries := globalEntries asArray.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   415
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   416
"/ globalEntries inspect.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   417
        pos := stream position.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   418
        globalEntries do:[:item |
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   419
            theSymbolPtr := item key.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   420
            theValuePtr := item value.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   421
            theSymbolRef := self fetchObjectAt:theSymbolPtr.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   422
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   423
"/            Transcript show:(self printStringOfSymbol:theSymbolRef).
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   424
"/            Transcript show:'->'.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   425
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   426
            theValueRef := self fetchObjectAt:theValuePtr.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   427
"/            Transcript show:(self printStringOfObject:theValueRef).
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   428
"/            Transcript cr.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   429
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   430
            item key:theSymbolRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   431
            item value:theValueRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   432
        ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   433
        stream position:pos.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   434
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   435
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   436
readHeader
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   437
        "
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   438
         (self for:'st.img') readHeader
1864
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   439
         (self for:'crash.img') readHeader
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   440
        "
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   441
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   442
        |order magic version timeStamp snapID last_util_addr hiText_addr flags 
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   443
         lowData hiData charSlots charTableSlots fixMemStart fixMemEnd 
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   444
         symMemStart symMemEnd vmDataAddr sharedMethodCode sharedBlockCode 
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   445
         nContexts contextSpace nRegistered symbolsSeqNr nSpaces 
1864
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   446
         classNameSize spaceSize numCharSlots|
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   447
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   448
        stream next:256.        "/ skip execCmd
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   449
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   450
        msb := false.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   451
        order := stream nextUnsignedLongMSB:msb.        
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   452
        order = 16r076543210 ifTrue:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   453
        ] ifFalse:[
1423
5bb61f51152d checkin from browser
ps
parents: 1422
diff changeset
   454
            order = 16r10325476 ifTrue:[
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   455
                msb := true.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   456
            ] ifFalse:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   457
                self error:'unhandled byteorder'
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   458
            ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   459
        ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   460
        magic := (stream next:8) asString.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   461
        magic ~= 'ST/X-IMG' ifTrue:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   462
            self error:'not an st/x image'
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   463
        ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   464
        version := stream nextUnsignedLongMSB:msb.        
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   465
        timeStamp := stream nextUnsignedLongMSB:msb.        
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   466
        ptrSize := stream nextByte.        
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   467
        ptrSize ~~ 4 ifTrue:[
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   468
            ptrSize ~~ 8 ifTrue:[
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   469
                self error:'unhandled ptr format'
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   470
            ].
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   471
        ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   472
        stream next:7.    "/ filler    
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   473
        intSize := stream nextUnsignedLongMSB:msb.        
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   474
        intSize == 9 "encoded as SmallInteger; i.e. with tag" ifTrue:[
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   475
            intSize := 4.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   476
            intTag := 1.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   477
        ] ifFalse:[
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   478
            intSize == 17 "encoded as SmallInteger; i.e. with tag" ifTrue:[
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   479
                intSize := 8.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   480
                intTag := 1.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   481
            ] ifFalse:[
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   482
                self error:'unhandled int format'
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   483
            ].
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   484
        ].
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   485
        hdrSize := ptrSize + 4 + 4.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   486
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   487
        intSize == 4 ifTrue:[
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   488
            fetchINT := [stream nextUnsignedLongMSB:msb] 
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   489
        ] ifFalse:[
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   490
            fetchINT := [stream nextUnsignedHyperMSB:msb]
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   491
        ].
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   492
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   493
        snapID := stream nextUnsignedLongMSB:msb.        
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   494
        intSize == 8 ifTrue:[
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   495
            "/ sigh - align for 8byte
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   496
            stream next:4
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   497
        ].
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   498
        last_util_addr := fetchINT value.        
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   499
        hiText_addr := fetchINT value.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   500
        flags := fetchINT value.        
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   501
        "infoPrinting :=" stream next.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   502
        "debugPrinting :=" stream next.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   503
        stream next:6.    "/ filler    
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   504
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   505
        lowData := fetchINT value.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   506
        hiData := fetchINT value.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   507
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   508
        charSlots := fetchINT value.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   509
        charTableSlots := fetchINT value.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   510
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   511
        version >= 8 ifTrue:[
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   512
            fixMemStart := fetchINT value.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   513
            fixMemEnd := fetchINT value.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   514
            symMemStart := fetchINT value.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   515
            symMemEnd := fetchINT value.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   516
            vmDataAddr := fetchINT value.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   517
        ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   518
        stream next:(128 * intSize).    "/ skip sharedMethodCode ptrs
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   519
        stream next:(128 * intSize).    "/ skip sharedBlockCode ptrs
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   520
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   521
        nContexts := fetchINT value.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   522
        contextSpace := fetchINT value.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   523
        nRegistered := fetchINT value.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   524
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   525
        version >= 8 ifTrue:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   526
            version >= 9 ifTrue:[
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   527
                symbolsSeqNr := fetchINT value.
1864
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   528
                version >= 10 ifTrue:[
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   529
                    numCharSlots := fetchINT value.
1864
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   530
                    stream next:(intSize * 30).
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   531
                ] ifFalse:[
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   532
                    stream next:(intSize * 31).
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   533
                ].
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   534
            ] ifFalse:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   535
                stream next:(intSize * 32).
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   536
            ]
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   537
        ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   538
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   539
        nSpaces := fetchINT value.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   540
        spaceInfos := (1 to:nSpaces) collect:[:idx | SpaceInfo new].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   541
        
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   542
        1 to:nSpaces do:[:i |
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   543
            (spaceInfos at:i) flags:(fetchINT value).
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   544
        ].
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   545
        nSpaces+1 to:32 do:[:i | fetchINT value].
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   546
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   547
        1 to:nSpaces do:[:i |
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   548
            (spaceInfos at:i) start:(fetchINT value).
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   549
        ].
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   550
        nSpaces+1 to:32 do:[:i | fetchINT value].
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   551
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   552
        1 to:nSpaces do:[:i |
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   553
            (spaceInfos at:i) size:(fetchINT value).
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   554
        ].
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   555
        nSpaces+1 to:32 do:[:i | fetchINT value].
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   556
        version >= 8 ifTrue:[
1864
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   557
            stream reset.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   558
            stream skip:4096.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   559
        ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   560
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   561
        1 to:nSpaces do:[:i |
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   562
            (spaceInfos at:i) end:((spaceInfos at:i) start + (spaceInfos at:i) size - 1).
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   563
        ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   564
        1 to:nSpaces do:[:i |
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   565
            (spaceInfos at:i) imageBase:(stream position).
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   566
            spaceSize := (spaceInfos at:i) size.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   567
            stream skip:spaceSize.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   568
        ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   569
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   570
        "/ registration
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   571
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   572
        self readRegistrationEntries.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   573
        Transcript showCR:'reading symbols...'.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   574
        self readSymbolEntries.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   575
        self readUGlobalEntries.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   576
        Transcript showCR:'reading globals...'.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   577
        self readGlobalEntries.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   578
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   579
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   580
"/struct basicImageHeader {
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   581
"/        char            h_execCmd[256];
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   582
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   583
"/        int             h_orderWord;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   584
"/        char            h_magic[8];
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   585
"/        int             h_version;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   586
"/        int             h_timeStamp;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   587
"/        char            h_ptrSize;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   588
"/        char            h_filler1[7];
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   589
"/        int             h_intSize;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   590
"/        int             h_snapID;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   591
"/        INT             h_last_util_addr;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   592
"/        INT             h_hiText_addr;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   593
"/        INT             h_flags;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   594
"/        char            h_infoPrinting;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   595
"/        char            h_debugPrinting;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   596
"/        char            h_filler2[6];
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   597
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   598
"/        /*
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   599
"/         * these are to verify compatibility of the image with
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   600
"/         * myself ...
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   601
"/         * this is now obsolete.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   602
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   603
"/        INT             h_lowData, h_hiData;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   604
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   605
"/        /*
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   606
"/         * base address of character- and characterTable slots
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   607
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   608
"/        INT             h_charSlots;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   609
"/        INT             h_charTableSlots;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   610
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   611
"/#if HEADER_VERSION >= 8
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   612
"/        /*
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   613
"/         * the fixBase (VMDATA address)
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   614
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   615
"/        INT             h_fixMemStart;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   616
"/        INT             h_fixMemEnd;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   617
"/        INT             h_symMemStart;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   618
"/        INT             h_symMemEnd;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   619
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   620
"/        INT             h_vmDataAddr;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   621
"/#endif
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   622
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   623
"/        INT             h_sharedMethodCode[128];
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   624
"/        INT             h_sharedBlockCode[128];
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   625
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   626
"/        /*      
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   627
"/         * space needed to restore contexts
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   628
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   629
"/        INT             h_nContexts;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   630
"/        INT             h_contextSpace;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   631
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   632
"/        /*
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   633
"/         * number of class registration info records
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   634
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   635
"/        INT             h_nRegistered;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   636
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   637
"/#if HEADER_VERSION >= 8
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   638
"/        /*
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   639
"/         * reserved slots, for future versions
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   640
"/         * (can add additional info, without affecting position of following stuff)
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   641
"/         * If you add slots, you MUST DECREMENT the fillcount.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   642
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   643
"/# if HEADER_VERSION >= 9
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   644
"/        INT             h_symbolsSeqNr;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   645
"/        INT             h_reserved[31];
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   646
"/# else
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   647
"/        INT             h_reserved[32];
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   648
"/# endif
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   649
"/#endif
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   650
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   651
"/        /*
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   652
"/         * number of spaces, base and size of each
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   653
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   654
"/        INT             h_nSpaces;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   655
"/        INT             h_spaceFlags[MAXSPACES];
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   656
"/        INT             h_spaceBase[MAXSPACES];
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   657
"/        INT             h_spaceSize[MAXSPACES];
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   658
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   659
"/        /*
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   660
"/         * here come nSpaces object spaces
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   661
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   662
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   663
"/        /*
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   664
"/         * here comes registration info
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   665
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   666
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   667
"/        /*
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   668
"/         * here come nSymbols symbolEntries
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   669
"/         * followed by a zero/zero entry
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   670
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   671
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   672
"/        /*
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   673
"/         * here come nGlobal globalEntries
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   674
"/         * followed by a zero/zero entry
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   675
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   676
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   677
"/        /*
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   678
"/         * here come nUnnamedGlobal globalEntries
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   679
"/         * followed by a zero/zero entry
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   680
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   681
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   682
"/        /*
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   683
"/         * here come stack contexts
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   684
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   685
"/};      
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   686
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   687
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   688
readRegistrationEntries
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   689
        |classNameSize|
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   690
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   691
        [
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   692
            classNameSize := stream nextUnsignedLongMSB:msb.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   693
            classNameSize ~~ 0
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   694
        ] whileTrue:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   695
            |className flags moduleTimestamp signature nMethods nBlocks oldLitRefs nLitRefs
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   696
             oldConstTable nConsts|
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   697
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   698
            className := (stream next:classNameSize) asString.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   699
            stream next. "/ 0-byte
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   700
            flags := fetchINT value.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   701
            moduleTimestamp := fetchINT value.   
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   702
            signature := fetchINT value.   
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   703
            nMethods := stream nextUnsignedLongMSB:msb.   
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   704
            nMethods timesRepeat:[ fetchINT value ].
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   705
            nBlocks := stream nextUnsignedLongMSB:msb.   
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   706
            nBlocks timesRepeat:[ fetchINT value ].
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   707
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   708
            oldLitRefs := fetchINT value.  
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   709
            nLitRefs := stream nextUnsignedLongMSB:msb.
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   710
            nLitRefs timesRepeat:[ fetchINT value ].
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   711
            fetchINT value. "/ 0-litRef
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   712
            oldConstTable := fetchINT value.  
1550
6ca23298d888 care for -1 in nConsts
Claus Gittinger <cg@exept.de>
parents: 1486
diff changeset
   713
            nConsts := stream nextLongMSB:msb.
6ca23298d888 care for -1 in nConsts
Claus Gittinger <cg@exept.de>
parents: 1486
diff changeset
   714
            nConsts > 0 ifTrue:[
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   715
                nConsts timesRepeat:[ fetchINT value ].
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   716
            ].
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   717
"/            Transcript show:className; 
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   718
"/                    show:' nconsts:'; show:nConsts; 
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   719
"/                    show:' nlits:'; show:nLitRefs;
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   720
"/                    show:' nMethods:'; show:nMethods;
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   721
"/                    show:' nBlocks:'; showCR:nBlocks.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   722
        ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   723
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   724
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   725
readSymbolEntries
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   726
        |refPointer theSymbolPtr theSymbolRef pos|
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   727
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   728
        symbolEntries := OrderedCollection new.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   729
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   730
        [
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   731
            refPointer := fetchINT value.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   732
            theSymbolPtr := fetchINT value.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   733
            theSymbolPtr ~~ 0
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   734
        ] whileTrue:[
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   735
            symbolEntries add:theSymbolPtr.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   736
        ].
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   737
        symbolEntries := symbolEntries asArray.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   738
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   739
        pos := stream position.
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   740
        1 to:symbolEntries size do:[:i |
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   741
            |theSymbolPtr|
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   742
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   743
            "/ an inlined collect, to avoid allocating big array twice.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   744
            theSymbolPtr := symbolEntries at:i.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   745
            theSymbolRef := self fetchObjectAt:theSymbolPtr.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   746
            theSymbolRef isImageSymbol ifFalse:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   747
                self halt
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   748
            ].
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   749
            symbolEntries at:i put:theSymbolRef.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   750
        ].        
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   751
        stream position:pos
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   752
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   753
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   754
readUGlobalEntries
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   755
        |refPointer theValue|
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   756
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   757
        [
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   758
            refPointer := fetchINT value.
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   759
            theValue := fetchINT value.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   760
            refPointer ~~ 0
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   761
        ] whileTrue
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   762
! !
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   763
3088
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   764
!SnapShotImageMemory methodsFor:'queries'!
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   765
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   766
metaClassByteSize
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   767
    ^ Metaclass instSize * ptrSize + hdrSize
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   768
!
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   769
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   770
privateMetaClassByteSize
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   771
    ^ PrivateMetaclass instSize * ptrSize + hdrSize
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   772
! !
5a5e9b9b5138 class: SnapShotImageMemory
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   773
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   774
!SnapShotImageMemory::ImageHeader methodsFor:'accessing'!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   775
1864
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   776
address:something
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   777
    address := something.
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   778
!
41ebace0f00a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   779
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   780
bits
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   781
    "return the value of the instance variable 'bits' (automatically generated)"
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   782
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   783
    ^ bits
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   784
!
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   785
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   786
bits:something
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   787
    "set the value of the instance variable 'bits' (automatically generated)"
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   788
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   789
    bits := something.
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   790
!
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   791
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   792
byteSize
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   793
    "return the value of the instance variable 'size' (automatically generated)"
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   794
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   795
    ^ byteSize
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   796
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   797
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   798
byteSize:something
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   799
    "set the value of the instance variable 'size' (automatically generated)"
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   800
1791
2bc8227a8b18 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1724
diff changeset
   801
"/ something > 8000 ifTrue:[self halt].
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   802
    byteSize := something.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   803
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   804
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   805
classRef
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   806
    "return the value of the instance variable 'classRef' (automatically generated)"
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   807
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   808
    ^ classRef
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   809
!
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   810
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   811
classRef:something
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   812
    "set the value of the instance variable 'classRef' (automatically generated)"
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   813
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   814
    classRef := something.
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   815
!
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   816
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   817
memory
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   818
    "return the value of the instance variable 'memory' (automatically generated)"
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   819
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   820
    ^ memory
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   821
!
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   822
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   823
memory:something
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   824
    "set the value of the instance variable 'memory' (automatically generated)"
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   825
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   826
    memory := something.
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   827
! !
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   828
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   829
!SnapShotImageMemory::ImageHeader methodsFor:'queries'!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   830
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   831
category
1791
2bc8227a8b18 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1724
diff changeset
   832
    |categoryPtr categoryRef category categorySlotOffset|
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   833
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   834
    self isMethodOrLazyMethod ifTrue:[
1791
2bc8227a8b18 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1724
diff changeset
   835
        categorySlotOffset := Method instVarOffsetOf:'category'.
2bc8227a8b18 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1724
diff changeset
   836
        "/ categorySlotOffset := 6.
2bc8227a8b18 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1724
diff changeset
   837
        categoryPtr := self at:categorySlotOffset.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   838
        categoryRef := memory fetchObjectAt:categoryPtr.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   839
        category := memory fetchStringFor:categoryRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   840
        ^ category
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   841
    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   842
self halt.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   843
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   844
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   845
isBehavior
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   846
    ^ self isImageBehavior
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   847
!
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   848
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   849
isImageBehavior
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   850
    |flags|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   851
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   852
    flags := classRef flags.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   853
    ^ flags bitTest:Behavior flagBehavior  
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   854
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   855
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   856
isImageBytes
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   857
    |flags|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   858
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   859
    flags := classRef flags bitAnd:Behavior maskIndexType.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   860
    ^ flags = Behavior flagBytes 
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   861
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   862
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   863
isImageMethod
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   864
    |flags|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   865
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   866
    flags := classRef flags.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   867
    ^ flags bitTest:Behavior flagMethod 
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   868
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   869
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   870
isImageSymbol
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   871
    |flags|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   872
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   873
    flags := classRef flags.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   874
    ^ flags bitTest:Behavior flagSymbol 
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   875
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   876
1420
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   877
isJavaMethod    
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   878
    |nm|
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   879
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   880
    nm := classRef name.
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   881
    ^ (nm = 'JavaMethod'
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   882
      or:[ nm = 'JavaMethodWithException' 
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   883
      or:[ nm = 'JavaMethodWithHandler' 
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   884
      or:[ nm = 'JavaNativeMethod' ]]])
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   885
!
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   886
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   887
isLazyMethod                               
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   888
    ^ classRef name = 'LazyMethod'
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   889
!
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   890
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   891
isMeta
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   892
    ^ false
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   893
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   894
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   895
isMethod                               
1420
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   896
    |cls|
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   897
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   898
    cls := classRef.
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   899
    [cls notNil] whileTrue:[
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   900
        cls name = 'Method' ifTrue:[^ true].
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   901
        cls := cls superclass
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   902
    ].
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   903
    ^ false.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   904
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   905
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   906
isMethodDictionary
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   907
    ^ classRef name = 'MethodDictionary'
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   908
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   909
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   910
isMethodOrLazyMethod                 
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   911
    classRef name = 'LazyMethod' ifTrue:[^ true].
1420
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   912
    ^ self isMethod
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   913
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   914
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   915
isString                               
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   916
    ^ classRef name = 'String'
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   917
! !
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   918
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   919
!SnapShotImageMemory::ImageObject methodsFor:'method protocol'!
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   920
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   921
byteCode
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   922
    |byteCodeSlotOffset byteCodePtr byteCodeRef byteCode|
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   923
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   924
    self isMethod ifTrue:[
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   925
        byteCodeSlotOffset := Method instVarOffsetOf:'byteCode'.
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   926
    ].
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   927
    byteCodeSlotOffset notNil ifTrue:[
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   928
        byteCodePtr := self at:byteCodeSlotOffset.
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   929
        byteCodeRef := memory fetchObjectAt:byteCodePtr.
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   930
        byteCodeRef isNil ifTrue:[^ nil].
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   931
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   932
        byteCode := memory fetchByteArrayFor:byteCodeRef.
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   933
        ^ byteCode
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   934
    ].
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   935
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   936
    self halt.
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   937
!
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   938
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   939
comment
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   940
    |src comment comments parser|
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   941
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   942
    self isMethod ifTrue:[
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   943
        src := self source.
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   944
        src isNil ifTrue:[^ nil].
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   945
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   946
        parser := Parser for:src in:nil.
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   947
        parser ignoreErrors; ignoreWarnings; saveComments:true.
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   948
        parser parseMethodSpec.
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   949
        comments := parser comments.
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   950
        comments size ~~ 0 ifTrue:[
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   951
            comment := comments first string.
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   952
            (comment withoutSpaces endsWith:'}') ifTrue:[
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   953
                "if first comment is a pragma, take next comment"
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   954
                comment := comments at:2 ifAbsent:nil.
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   955
                comment notNil ifTrue:[
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   956
                    comment := comment string.
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   957
                ].
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   958
            ].
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   959
        ].
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   960
        ^ comment.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   961
    ].
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   962
    self isLazyMethod ifTrue:[
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   963
        ^ ''
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   964
    ].
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   965
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   966
    self halt.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   967
!
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   968
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   969
containingClass
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   970
    self isMethodOrLazyMethod ifTrue:[
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   971
        ^ self mclass
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   972
    ].
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   973
    self halt.
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   974
!
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   975
1469
b726d8a4b801 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1448
diff changeset
   976
flags
b726d8a4b801 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1448
diff changeset
   977
    |flagsSlotOffset flagsPtr flags|
b726d8a4b801 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1448
diff changeset
   978
b726d8a4b801 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1448
diff changeset
   979
    self isMethod ifTrue:[
b726d8a4b801 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1448
diff changeset
   980
        flagsSlotOffset := Method instVarOffsetOf:'flags'.
b726d8a4b801 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1448
diff changeset
   981
    ].
b726d8a4b801 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1448
diff changeset
   982
    flagsSlotOffset notNil ifTrue:[
b726d8a4b801 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1448
diff changeset
   983
        flagsPtr := self at:flagsSlotOffset.
b726d8a4b801 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1448
diff changeset
   984
        flags := memory fetchObjectAt:flagsPtr.
b726d8a4b801 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1448
diff changeset
   985
        ^ flags
b726d8a4b801 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1448
diff changeset
   986
    ].
b726d8a4b801 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1448
diff changeset
   987
b726d8a4b801 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1448
diff changeset
   988
    self halt.
b726d8a4b801 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1448
diff changeset
   989
!
b726d8a4b801 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1448
diff changeset
   990
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   991
hasCode
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   992
    ^ false
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   993
!
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   994
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   995
isBreakpointed
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   996
    ^ false
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
   997
!
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   998
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   999
isCounting
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1000
    ^ false
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1001
!
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1002
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1003
isCountingMemoryUsage
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1004
    ^ false
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1005
!
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1006
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1007
isDynamic
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1008
    ^ false
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1009
!
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1010
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1011
isExecutable
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1012
    self isMethod ifTrue:[
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1013
        ^ false
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1014
    ].
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1015
    self halt.
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1016
!
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1017
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1018
isIgnored
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1019
    ^ false
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1020
!
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1021
1482
13fe76a0986b more caching (faster now)
Claus Gittinger <cg@exept.de>
parents: 1469
diff changeset
  1022
isObsolete
13fe76a0986b more caching (faster now)
Claus Gittinger <cg@exept.de>
parents: 1469
diff changeset
  1023
    ^ false
13fe76a0986b more caching (faster now)
Claus Gittinger <cg@exept.de>
parents: 1469
diff changeset
  1024
!
13fe76a0986b more caching (faster now)
Claus Gittinger <cg@exept.de>
parents: 1469
diff changeset
  1025
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1026
isPrivate
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1027
    ^ false
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1028
!
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1029
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1030
isProtected
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1031
    ^ false
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1032
!
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1033
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1034
isPublic
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1035
    ^ true
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1036
!
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1037
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1038
isTimed
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1039
    ^ false
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1040
!
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1041
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1042
isTraced
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1043
    ^ false
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1044
!
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1045
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1046
isWrapped
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1047
    ^ false
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1048
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1049
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1050
mclass
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1051
    |mclassSlotOffset mclassPtr mclass|
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1052
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1053
    self isMethod ifTrue:[
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1054
        mclassSlotOffset := Method instVarOffsetOf:'mclass'.
1420
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1055
    ] ifFalse:[
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1056
        self isJavaMethod ifTrue:[
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1057
            mclassSlotOffset := JavaMethod instVarOffsetOf:'javaClass'.
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1058
        ]
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1059
    ].
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1060
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1061
    mclassSlotOffset notNil ifTrue:[
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1062
        mclassPtr := self at:mclassSlotOffset.
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1063
        mclassPtr ~~ 0 ifTrue:[
1420
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1064
            mclassPtr isInteger ifTrue:[
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1065
                mclass := memory fetchObjectAt:mclassPtr.
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1066
                self at:mclassSlotOffset put:mclass.    
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1067
            ] ifFalse:[
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1068
                mclass := mclassPtr.
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1069
            ].
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1070
            mclass isImageBehavior ifFalse:[
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1071
                self halt
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1072
            ].
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1073
            ^ mclass
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1074
        ].
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1075
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1076
        "/ search my class ...
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1077
        memory image allClassesDo:[:eachClass |
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1078
            eachClass theNonMetaclass methodDictionary keysAndValuesDo:[:sel :mthdRef |
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1079
                mthdRef == self ifTrue:[
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1080
                    self at:mclassSlotOffset put:eachClass theNonMetaclass.    
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1081
                    ^ eachClass theNonMetaclass
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1082
                ].
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1083
            ].
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1084
            eachClass theMetaclass methodDictionary keysAndValuesDo:[:sel :mthdRef |
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1085
                mthdRef == self ifTrue:[
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1086
                    self at:mclassSlotOffset put:eachClass theMetaclass.    
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1087
                    ^ eachClass theMetaclass
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1088
                ].
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1089
            ]
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1090
        ].
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1091
        self halt.
1420
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1092
        ^ nil.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1093
    ].
1420
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1094
    ^ nil.
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1095
    self halt.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1096
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1097
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1098
numArgs
1469
b726d8a4b801 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1448
diff changeset
  1099
    |flags|
b726d8a4b801 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1448
diff changeset
  1100
b726d8a4b801 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1448
diff changeset
  1101
    flags := self flags.
b726d8a4b801 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1448
diff changeset
  1102
    ^ (flags bitAnd:(Method numArgsMaskInFlags)) bitShift:(Method numArgsShiftInFlags negated)   
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1103
!
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1104
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1105
package
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1106
    |packageSlotOffset packagePtr packageRef package|
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1107
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1108
    self isImageBehavior ifTrue:[
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1109
        self isMeta ifTrue:[
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1110
            ^ self theNonMetaclass package
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1111
        ].
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1112
        packageSlotOffset := Class instVarOffsetOf:'package'.
1420
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1113
    ] ifFalse:[
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1114
        self isMethod ifTrue:[
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1115
            packageSlotOffset := Method instVarOffsetOf:'package'.
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1116
        ] ifFalse:[
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1117
            self isLazyMethod ifTrue:[
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1118
                packageSlotOffset := Method instVarOffsetOf:'package'.
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1119
            ].
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1120
        ].
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1121
    ].
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1122
    packageSlotOffset notNil ifTrue:[
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1123
        packagePtr := self at:packageSlotOffset.
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1124
        packageRef := memory fetchObjectAt:packagePtr.
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1125
        packageRef isNil ifTrue:[^ nil].
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1126
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1127
        packageRef isImageSymbol ifFalse:[
1420
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1128
            packageRef isImageBytes ifFalse:[
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1129
                self halt.
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1130
            ].
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1131
            "/ mhmh - can be a string sometimes ...
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1132
        ].
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1133
        package := memory fetchStringFor:packageRef.
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1134
        ^ package asSymbol
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1135
    ].
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1136
    self isMeta ifTrue:[
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1137
        self halt
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1138
    ].
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1139
1420
9a649c1bb8cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1140
    ^ nil
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1141
!
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1142
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1143
previousVersion
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1144
    ^ nil
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1145
!
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1146
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1147
printStringForBrowserWithSelector:selector
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1148
    ^ selector
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1149
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1150
2164
3c5fe1d92046 *** empty log message ***
sr
parents: 2130
diff changeset
  1151
printStringForBrowserWithSelector:selector inClass:aClass
3c5fe1d92046 *** empty log message ***
sr
parents: 2130
diff changeset
  1152
    ^ selector
3c5fe1d92046 *** empty log message ***
sr
parents: 2130
diff changeset
  1153
!
3c5fe1d92046 *** empty log message ***
sr
parents: 2130
diff changeset
  1154
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1155
privacy
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1156
    ^ #public
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1157
!
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1158
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1159
resources
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1160
    ^ nil
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1161
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1162
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1163
source
1482
13fe76a0986b more caching (faster now)
Claus Gittinger <cg@exept.de>
parents: 1469
diff changeset
  1164
    self halt:'unimplemented'.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1165
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1166
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1167
sourceFilename
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1168
    "return the sourcefilename if source is extern; nil otherwise"
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1169
1486
d549a69ec127 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1485
diff changeset
  1170
    |sourcePtr sourceRef source|
1485
7e96892bc9df *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1171
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1172
    self isMethodOrLazyMethod ifTrue:[
1484
089067851973 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1173
        self sourcePosition notNil ifTrue:[
1486
d549a69ec127 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1485
diff changeset
  1174
            sourcePtr := self at:(Method instVarOffsetOf:'source').
d549a69ec127 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1485
diff changeset
  1175
            sourceRef := memory fetchObjectAt:sourcePtr.
d549a69ec127 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1485
diff changeset
  1176
            sourceRef isString ifFalse:[
d549a69ec127 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1485
diff changeset
  1177
                self halt.
1485
7e96892bc9df *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1178
            ].
1486
d549a69ec127 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1485
diff changeset
  1179
            source := memory printStringOfString:sourceRef.
1485
7e96892bc9df *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1484
diff changeset
  1180
            ^ source.
1484
089067851973 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1181
        ].
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1182
        ^ nil
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1183
    ].
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1184
    self halt.
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1185
!
1419
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1186
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1187
sourceLineNumber
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1188
    self isMethodOrLazyMethod ifTrue:[
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1189
        ^ 1
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1190
    ].
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1191
    self halt.
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1192
!
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1193
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1194
sourcePosition
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1195
    |sourcePosition|
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1196
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1197
    self isMethodOrLazyMethod ifTrue:[
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1198
        sourcePosition := self sourcePositionValue.
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1199
        sourcePosition isNil ifTrue:[^ sourcePosition].
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1200
        ^ sourcePosition abs
f808d17ff6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1201
    ].
1440
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423
diff changeset
  1202
    self halt.
f3eda2f72399 local source string was missing (if cvs access is not avaialable)
Claus Gittinger <cg@exept.de>
parents: 1423