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