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