src/JavaContext.st
author hlopkmar
Thu, 17 Nov 2011 18:13:31 +0000
branchjk_new_structure
changeset 1122 2f8e947cfda2
parent 1102 df54d5b34c6b
child 1152 040cba55a7d2
permissions -rw-r--r--
in-the-middle-of-work commit
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
     1
"
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
     2
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
     3
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
     4
                            SWING Research Group, Czech Technical University in Prague
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
     5
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
     6
 Parts of the code written by Claus Gittinger are under following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
     7
 license:
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
     8
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
     9
 This software is furnished under a license and may be used
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    10
 only in accordance with the terms of that license and with the
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    11
 inclusion of the above copyright notice.   This software may not
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    12
 be provided or otherwise made available to, or used by, any
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    13
 other person.  No title to or ownership of the software is
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    14
 hereby transferred.
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    15
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    16
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    17
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    18
 Permission is hereby granted, free of charge, to any person
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    19
 obtaining a copy of this software and associated documentation
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    20
 files (the 'Software'), to deal in the Software without
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    21
 restriction, including without limitation the rights to use,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    22
 copy, modify, merge, publish, distribute, sublicense, and/or sell
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    23
 copies of the Software, and to permit persons to whom the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    24
 Software is furnished to do so, subject to the following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    25
 conditions:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    26
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    27
 The above copyright notice and this permission notice shall be
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    28
 included in all copies or substantial portions of the Software.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    29
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    30
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    31
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    32
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    33
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    34
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    35
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    36
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    37
 OTHER DEALINGS IN THE SOFTWARE.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    38
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    39
 [1] Code written at SWING Research Group contain a signature
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    40
     of one of the above copright owners.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    41
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    42
"{ Package: 'stx:libjava' }"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    43
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    44
Context variableSubclass:#JavaContext
1093
255c230a1c55 hacking monitors, not working yet :P
hlopkmar
parents: 1022
diff changeset
    45
	instanceVariableNames:'exArg exPC byteCode constPool acqrMonitors'
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    46
	classVariableNames:''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    47
	poolDictionaries:''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    48
	category:'Languages-Java-Support'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    49
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    50
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    51
!JavaContext class methodsFor:'documentation'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    52
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    53
copyright
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    54
"
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    55
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    56
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    57
                            SWING Research Group, Czech Technical University in Prague
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    58
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    59
 Parts of the code written by Claus Gittinger are under following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    60
 license:
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    61
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    62
 This software is furnished under a license and may be used
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    63
 only in accordance with the terms of that license and with the
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    64
 inclusion of the above copyright notice.   This software may not
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    65
 be provided or otherwise made available to, or used by, any
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    66
 other person.  No title to or ownership of the software is
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    67
 hereby transferred.
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    68
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    69
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    70
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    71
 Permission is hereby granted, free of charge, to any person
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    72
 obtaining a copy of this software and associated documentation
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    73
 files (the 'Software'), to deal in the Software without
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    74
 restriction, including without limitation the rights to use,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    75
 copy, modify, merge, publish, distribute, sublicense, and/or sell
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    76
 copies of the Software, and to permit persons to whom the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    77
 Software is furnished to do so, subject to the following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    78
 conditions:
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    79
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    80
 The above copyright notice and this permission notice shall be
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    81
 included in all copies or substantial portions of the Software.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    82
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    83
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    84
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    85
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    86
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    87
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    88
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    89
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    90
 OTHER DEALINGS IN THE SOFTWARE.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    91
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    92
 [1] Code written at SWING Research Group contain a signature
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    93
     of one of the above copright owners.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    94
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    95
"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    96
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    97
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    98
!JavaContext methodsFor:'* As yet uncategorized *'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    99
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   100
markForException
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   101
    "set the exception handler flag in the receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   102
     The JVM needs this to enter an exception handler instead of restarting
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   103
     from the beginning (when the context is restarted).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   104
     - a highly internal mechanism and not for public use."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   105
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   106
%{  /* NOCONTEXT */
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   107
#ifdef __JAVA_EX_PEND
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   108
     /* actually no longer - only a non-nil exPC is now used as marker */
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   109
     __INST(flags) = (OBJ)((INT)__INST(flags) | __MASKSMALLINT(__JAVA_EX_PEND));
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   110
#endif
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   111
%}
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   112
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   113
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   114
    "Modified: / 13-12-1995 / 19:05:22 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   115
    "Modified: / 25-10-2010 / 17:19:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   116
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   117
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   118
!JavaContext methodsFor:'ST context mimicri'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   119
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   120
arg1Index
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   121
    "the java stack contains the receiver in a non-static
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   122
     method, as slot 0. Therefore, the first arg is found at slot2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   123
     if this is for a non-static method"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   124
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   125
    self method isStatic ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   126
	^ 1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   127
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   128
    ^ 2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   129
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   130
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   131
argAt:n
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   132
    "return the i'th argument (1..nArgs)"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   133
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   134
    ^ self at:(self arg1Index - 1 + n)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   135
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   136
    "Created: / 2.1.1998 / 17:54:13 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   137
    "Modified: / 2.1.1998 / 21:39:30 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   138
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   139
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   140
argAt:n put:value
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   141
    "change the i'th argument (1..nArgs)"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   142
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   143
    ^ super argAt:(self arg1Index - 1 + n) put:value
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   144
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   145
    "Created: / 2.1.1998 / 17:54:34 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   146
    "Modified: / 2.1.1998 / 21:35:19 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   147
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   148
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   149
args
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   150
    "return an array filled with the arguments of this context"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   151
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   152
    |n|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   153
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   154
    n := self numArgs.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   155
    n == 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   156
	"/ little optimization here - avoid creating empty containers
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   157
	^ #()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   158
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   159
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   160
    ^ (Array new:n) replaceFrom:1 to:n with:self startingAt:(self arg1Index).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   161
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   162
    "Created: / 2.1.1998 / 17:54:57 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   163
    "Modified: / 2.1.1998 / 21:34:44 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   164
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   165
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   166
argsAndVars
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   167
    "return an array filled with the arguments and variables of this context"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   168
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   169
    |n|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   170
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   171
    n := self numArgs + self numVars.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   172
    n == 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   173
	"/ little optimization here - avoid creating empty containers
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   174
	^ #()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   175
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   176
    ^ (Array new:n) replaceFrom:1 to:n with:self startingAt:(self arg1Index).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   177
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   178
    "Created: / 2.1.1998 / 17:55:14 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   179
    "Modified: / 13.1.1998 / 15:44:56 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   180
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   181
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   182
lineNumber
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   183
    |nr pc|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   184
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   185
    pc := self pc.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   186
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   187
"/ 'ask line for pc:' print. pc printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   188
    pc isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   189
	nr := self lineNumberFromMethod.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   190
	nr notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   191
	    ^ nr
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   192
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   193
	" '-> 0 [a]' printCR. "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   194
	^0
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   195
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   196
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   197
    nr := self method lineNumberForPC:pc.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   198
    nr isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   199
	nr := self lineNumberFromMethod.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   200
	nr notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   201
	    ^ nr
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   202
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   203
	" '-> 0 [b]' printCR. "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   204
	^ 0
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   205
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   206
"/ '-> ' print. nr printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   207
     ^ nr.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   208
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   209
    "Created: / 1.5.1996 / 15:05:47 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   210
    "Modified: / 15.1.1998 / 15:25:29 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   211
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   212
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   213
lineNumberFromMethod
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   214
    |m|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   215
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   216
    m := self method.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   217
    m notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   218
	^ m lineNumber
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   219
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   220
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   221
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   222
    "Created: / 4.1.1998 / 23:34:45 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   223
    "Modified: / 4.1.1998 / 23:35:55 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   224
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   225
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   226
method
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   227
    "the method may be found in the interpreter temps ..."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   228
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   229
    method isJavaMethod ifTrue:[^ method].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   230
    ^ super method
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   231
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   232
    "Created: / 1.5.1996 / 15:03:43 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   233
    "Modified: / 25.9.1999 / 23:26:40 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   234
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   235
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   236
numArgs
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   237
    "return the number of args.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   238
     Redefined since Java keeps the receiver of a non-static method
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   239
     at local slot 1."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   240
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   241
    |n|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   242
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   243
    n := super numArgs.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   244
    self method isStatic ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   245
	n := n - 1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   246
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   247
    ^ n
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   248
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   249
    "Created: / 2.1.1998 / 22:21:24 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   250
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   251
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   252
numTemps
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   253
    "return the number of temporary variables of the Method.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   254
     Redefined since Java keeps the receiver of a non-static method
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   255
     at local slot 1."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   256
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   257
    |n|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   258
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   259
    n := self size - super numVars - super numArgs.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   260
    ^ n
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   261
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   262
    "Created: / 13.1.1998 / 16:52:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   263
    "Modified: / 13.1.1998 / 17:23:27 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   264
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   265
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   266
numVars
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   267
    "return the number of locals.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   268
     Redefined since Java keeps the receiver of a non-static method
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   269
     at local slot 0 and holds the args as locals."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   270
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   271
    |n|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   272
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   273
    n := super numVars.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   274
    ^ (n - self numArgs) max:0
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   275
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   276
    "Created: / 13.1.1998 / 17:03:08 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   277
    "Modified: / 13.1.1998 / 17:25:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   278
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   279
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   280
pc
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   281
    lineNr isNil ifTrue:[^ nil].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   282
    ^ lineNr bitAnd:16rFFFF
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   283
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   284
    "Created: / 4.1.1998 / 23:33:48 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   285
    "Modified: / 10.11.1998 / 13:20:12 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   286
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   287
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   288
quickLineNumber
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   289
    "the lineNumber - without decompiling"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   290
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   291
    ^ self method quickLineNumberForPC:self pc
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   292
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   293
    "Created: / 10.11.1998 / 14:20:30 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   294
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   295
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   296
selector
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   297
    "the selector can be extracted from the method.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   298
     the method may be found in the interpreter temps ..."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   299
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   300
    |s m|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   301
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   302
    selector isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   303
	m := self method.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   304
	m notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   305
	    ^ m name
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   306
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   307
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   308
    ^ super selector
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   309
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   310
    "Modified: / 30.12.1997 / 17:22:06 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   311
    "Created: / 30.12.1997 / 17:23:47 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   312
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   313
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   314
setPC:newPC
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   315
    lineNr := newPC
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   316
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   317
    "Created: / 5.1.1998 / 00:09:02 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   318
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   319
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   320
temporaries
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   321
    "return an array filled with the arguments and variables of this context"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   322
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   323
    |n nSkipped|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   324
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   325
    "/ the flas-numVars includes the receiver and args
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   326
    nSkipped := super numVars "self numArgs + self numVars".
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   327
    "/ but my context setup is args+numvars.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   328
    nSkipped := super numArgs + super numVars.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   329
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   330
    n := self size - nSkipped.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   331
    n == 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   332
	"/ little optimization here - avaoid creating empty containers
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   333
	^ #()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   334
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   335
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   336
    ^ (Array new:n) replaceFrom:1 to:n with:self startingAt:nSkipped+1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   337
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   338
    "Created: / 13.1.1998 / 15:44:12 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   339
    "Modified: / 13.1.1998 / 17:22:54 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   340
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   341
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   342
vars
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   343
    "return an array filled with the local variables of this context"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   344
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   345
    |nonVars mySize|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   346
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   347
    mySize := self numVars.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   348
    mySize == 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   349
	"/ little optimization here - avaoid creating empty containers
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   350
	^ #()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   351
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   352
    nonVars := (self arg1Index-1) + self numArgs.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   353
    ^ (Array new:mySize) replaceFrom:1 to:mySize with:self startingAt:nonVars+1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   354
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   355
    "Created: / 13.1.1998 / 16:48:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   356
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   357
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   358
!JavaContext methodsFor:'accessing'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   359
1093
255c230a1c55 hacking monitors, not working yet :P
hlopkmar
parents: 1022
diff changeset
   360
acquiredMonitors
255c230a1c55 hacking monitors, not working yet :P
hlopkmar
parents: 1022
diff changeset
   361
^acqrMonitors
255c230a1c55 hacking monitors, not working yet :P
hlopkmar
parents: 1022
diff changeset
   362
255c230a1c55 hacking monitors, not working yet :P
hlopkmar
parents: 1022
diff changeset
   363
    "Created: / 08-11-2011 / 12:23:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
255c230a1c55 hacking monitors, not working yet :P
hlopkmar
parents: 1022
diff changeset
   364
!
255c230a1c55 hacking monitors, not working yet :P
hlopkmar
parents: 1022
diff changeset
   365
1096
c543f127c67a fixed some stupid mistakes, but still not working
hlopkmar
parents: 1095
diff changeset
   366
acquiredMonitorsDo: aBlock 
1102
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
   367
    acqrMonitors isNil ifTrue: [ ^self ].
1097
41def5679e28 finally working monitors yeeaah
hlopkmar
parents: 1096
diff changeset
   368
    acqrMonitors copy reverseDo: aBlock.
1094
68b154263d74 fixes in monitors, still not working
hlopkmar
parents: 1093
diff changeset
   369
68b154263d74 fixes in monitors, still not working
hlopkmar
parents: 1093
diff changeset
   370
    "Created: / 08-11-2011 / 15:03:31 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1102
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
   371
    "Modified: / 08-11-2011 / 21:46:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1094
68b154263d74 fixes in monitors, still not working
hlopkmar
parents: 1093
diff changeset
   372
!
68b154263d74 fixes in monitors, still not working
hlopkmar
parents: 1093
diff changeset
   373
1095
6d0bfccd9ae7 tiny logging of monitors
hlopkmar
parents: 1094
diff changeset
   374
addMonitor: mon 
1100
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
   375
    self assert: (acqrMonitors isNil or: [ acqrMonitors isOrderedCollection ]).
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
   376
    acqrMonitors ifNil: [ acqrMonitors := Stack new ].
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
   377
    acqrMonitors push: mon.
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1102
diff changeset
   378
    self markForUnwind.
1093
255c230a1c55 hacking monitors, not working yet :P
hlopkmar
parents: 1022
diff changeset
   379
255c230a1c55 hacking monitors, not working yet :P
hlopkmar
parents: 1022
diff changeset
   380
    "Created: / 08-11-2011 / 14:19:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1098
vranyj1
parents: 1097
diff changeset
   381
    "Modified: / 08-11-2011 / 21:40:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1102
diff changeset
   382
    "Modified: / 17-11-2011 / 19:13:15 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1093
255c230a1c55 hacking monitors, not working yet :P
hlopkmar
parents: 1022
diff changeset
   383
!
255c230a1c55 hacking monitors, not working yet :P
hlopkmar
parents: 1022
diff changeset
   384
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   385
programmingLanguage
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   386
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   387
    ^JavaLanguage instance
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   388
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   389
    "Created: / 17-03-2011 / 10:17:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1093
255c230a1c55 hacking monitors, not working yet :P
hlopkmar
parents: 1022
diff changeset
   390
!
255c230a1c55 hacking monitors, not working yet :P
hlopkmar
parents: 1022
diff changeset
   391
255c230a1c55 hacking monitors, not working yet :P
hlopkmar
parents: 1022
diff changeset
   392
removeMonitor: mon 
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1102
diff changeset
   393
    | poppedObject |
1095
6d0bfccd9ae7 tiny logging of monitors
hlopkmar
parents: 1094
diff changeset
   394
    acqrMonitors isNil ifTrue: [
1100
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
   395
        Logger 
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
   396
            log: ('removeMonitor: called but no monitors in acqrMonitors (%1)' 
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
   397
                    bindWith: self)
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
   398
            severity: #warn
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
   399
            facility: #JVM.
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
   400
        self breakPoint: #mh.
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
   401
        ^ self.
1094
68b154263d74 fixes in monitors, still not working
hlopkmar
parents: 1093
diff changeset
   402
    ].
1100
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
   403
    poppedObject := acqrMonitors top.
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
   404
    self assert: (poppedObject == mon).
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
   405
    acqrMonitors remove: mon
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
   406
        ifAbsent: [
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
   407
            Logger 
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
   408
                log: ('removeMonitor: called but no such monitor in acqrMonitors (%1)' 
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
   409
                        bindWith: self)
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
   410
                severity: #warn
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
   411
                facility: #JVM.
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
   412
            self breakPoint: #mh.
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
   413
            ^ self.
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1102
diff changeset
   414
        ].
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1102
diff changeset
   415
        acqrMonitors isEmpty ifTrue: [self unmarkForUnwind].
1093
255c230a1c55 hacking monitors, not working yet :P
hlopkmar
parents: 1022
diff changeset
   416
255c230a1c55 hacking monitors, not working yet :P
hlopkmar
parents: 1022
diff changeset
   417
    "Created: / 08-11-2011 / 14:19:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1098
vranyj1
parents: 1097
diff changeset
   418
    "Modified: / 08-11-2011 / 21:39:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1102
diff changeset
   419
    "Modified: / 17-11-2011 / 19:14:29 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   420
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   421
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   422
!JavaContext methodsFor:'exception handler support'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   423
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   424
exceptionArg:aJavaException
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   425
    exArg := aJavaException.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   426
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   427
    "Created: / 7.1.1998 / 21:36:56 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   428
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   429
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   430
exceptionArg:aJavaException pc:newPc
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   431
    exArg := aJavaException.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   432
    exPC := newPc.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   433
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   434
    "Created: / 7.1.1998 / 21:36:56 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   435
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   436
1098
vranyj1
parents: 1097
diff changeset
   437
!JavaContext methodsFor:'non local control flow'!
vranyj1
parents: 1097
diff changeset
   438
vranyj1
parents: 1097
diff changeset
   439
unwindAndRestartForJavaException
1102
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
   440
1098
vranyj1
parents: 1097
diff changeset
   441
    "Called by JavaVM>>throwException: unwinds the stack
vranyj1
parents: 1097
diff changeset
   442
     up to this context and restarts it so an exception handler
vranyj1
parents: 1097
diff changeset
   443
     executes"
1102
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
   444
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
   445
    | con wasMarked |
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
   446
1098
vranyj1
parents: 1097
diff changeset
   447
    "Each context that has a monitor acquired has
vranyj1
parents: 1097
diff changeset
   448
     and unwind action that release all monitors acquired.
vranyj1
parents: 1097
diff changeset
   449
     However, we DONT want my monitors to be released,
vranyj1
parents: 1097
diff changeset
   450
     so we temporarily unmark this context for unwind and
vranyj1
parents: 1097
diff changeset
   451
     then mark it again, eventually"
1102
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
   452
1098
vranyj1
parents: 1097
diff changeset
   453
    wasMarked := self isUnwindContext.
1102
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
   454
    wasMarked ifTrue:[self unmarkForUnwind].    
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
   455
    self senderIsNil ifFalse:[
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
   456
        con := thisContext evaluateUnwindActionsUpTo:self.
1098
vranyj1
parents: 1097
diff changeset
   457
    ].
1102
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
   458
    wasMarked ifTrue:[self markForUnwind].
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
   459
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
   460
    "oops, if nil, I am not on the calling chain;
1098
vranyj1
parents: 1097
diff changeset
   461
     (bad bad, unwind action have already been performed.
1102
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
   462
      should we check for this situation first and NOT evaluate
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
   463
      the unwind actions in this case ?)
1098
vranyj1
parents: 1097
diff changeset
   464
    "
1102
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
   465
    con isNil ifTrue:[
1098
vranyj1
parents: 1097
diff changeset
   466
        "
vranyj1
parents: 1097
diff changeset
   467
         tried to return to a context which is already dead
1102
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
   468
         (i.e. the method/block has already executed a return)
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
   469
        "
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
   470
        ^ self invalidReturnOrRestartError:#'unwindAndRestart:' with:nil
1098
vranyj1
parents: 1097
diff changeset
   471
    ].
1102
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
   472
    "
1098
vranyj1
parents: 1097
diff changeset
   473
     now, that all unwind-actions are done, I can use the
vranyj1
parents: 1097
diff changeset
   474
     low-level restart ...
vranyj1
parents: 1097
diff changeset
   475
    "
vranyj1
parents: 1097
diff changeset
   476
    ^ self restart
vranyj1
parents: 1097
diff changeset
   477
vranyj1
parents: 1097
diff changeset
   478
    "Created: / 08-11-2011 / 22:00:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vranyj1
parents: 1097
diff changeset
   479
! !
vranyj1
parents: 1097
diff changeset
   480
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   481
!JavaContext methodsFor:'printing & storing'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   482
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   483
receiverPrintString
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   484
    "return a string describing the receiver of the context"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   485
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   486
    |receiverClass receiverClassName newString implementorClass searchClass|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   487
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   488
"/ %{
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   489
"/     /*
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   490
"/      * special handling for (invalid) free objects.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   491
"/      * these only appear if some primitiveCode does not correctly use SEND macros,
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   492
"/      * which may lead to sends to free objects. In normal operation, this 'cannot' happen.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   493
"/      */
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   494
"/     if (__isNonNilObject(__INST(receiver)) && (__qClass(__INST(receiver))==nil)) {
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   495
"/         receiverClassName = __MKSTRING("FreeObject");
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   496
"/     }
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   497
"/ %}.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   498
"/    receiverClassName notNil ifTrue:[^ receiverClassName].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   499
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   500
    receiverClass := receiver class.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   501
    "/ java has no class-methods ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   502
    receiverClass := receiverClass theNonMetaclass.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   503
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   504
    receiverClassName := receiverClass nameInBrowser.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   505
    (receiverClass == SmallInteger) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   506
	newString := '(' , receiver printString , ') ' , receiverClassName
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   507
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   508
	newString := receiverClassName
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   509
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   510
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   511
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   512
     kludge to avoid slow search for containing class
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   513
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   514
    (selector ~~ #doIt and:[selector ~~ #doIt:]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   515
	implementorClass := self methodClass.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   516
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   517
    implementorClass notNil ifTrue: [
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   518
	(implementorClass ~~ receiverClass) ifTrue: [
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   519
	    newString := newString , '>>>',
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   520
			 implementorClass nameInBrowser printString
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   521
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   522
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   523
	searchClass := self searchClass.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   524
	searchClass ~~ receiverClass ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   525
	    newString := newString , '>>>' , searchClass nameInBrowser
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   526
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   527
"/        "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   528
"/         kludge for doIt - these unbound methods are not
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   529
"/         found in the classes methodDictionary
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   530
"/        "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   531
"/        (selector ~~ #doIt and:[selector ~~ #doIt:]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   532
"/            newString := newString , '>>>**NONE**'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   533
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   534
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   535
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   536
    ^ newString
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   537
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   538
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   539
!JavaContext methodsFor:'queries'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   540
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   541
hasStackToShow
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   542
    "private interface to the debugger.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   543
     Smalltalk contexts return false here - other language frames
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   544
     (i.e. Java frames) may want to show the evaluation stack"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   545
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   546
    ^ true
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   547
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   548
    "Modified: / 13.5.1997 / 16:31:12 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   549
    "Created: / 7.5.1998 / 01:23:57 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   550
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   551
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   552
isJavaContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   553
    "return true, if this is a javaContext."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   554
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   555
    ^ true
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   556
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   557
    "Created: / 8.5.1998 / 21:23:47 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   558
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   559
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   560
stackFrame
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   561
    "private interface to the debugger."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   562
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   563
    ^ (1 to:self size) collect:[:i | self at:i]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   564
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   565
    "Created: / 7.5.1998 / 01:26:19 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   566
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   567
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   568
!JavaContext class methodsFor:'documentation'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   569
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   570
version
1022
38b710d7dfbc svn properties fixed
vranyj1
parents: 923
diff changeset
   571
    ^ '$Id$'
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   572
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   573
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   574
version_SVN
1022
38b710d7dfbc svn properties fixed
vranyj1
parents: 923
diff changeset
   575
    ^ '$Id$'
1093
255c230a1c55 hacking monitors, not working yet :P
hlopkmar
parents: 1022
diff changeset
   576
! !