ExecutableFunction.st
author Claus Gittinger <cg@exept.de>
Mon, 31 Mar 2003 19:54:01 +0200
changeset 7150 a1fe0a0313a8
parent 7096 bdfda0c28b0c
child 7257 b9f0fb923c72
permissions -rw-r--r--
uses class-based exceptions
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
     1
"
1eba5946aea2 Initial revision
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1994 by Claus Gittinger
159
514c749165c3 *** empty log message ***
claus
parents: 131
diff changeset
     3
	      All Rights Reserved
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
     4
1eba5946aea2 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
1eba5946aea2 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
1eba5946aea2 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
1eba5946aea2 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
1eba5946aea2 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    11
"
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    12
5459
684192d793bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5284
diff changeset
    13
"{ Package: 'stx:libbasic' }"
684192d793bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5284
diff changeset
    14
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    15
Object subclass:#ExecutableFunction
1180
7f4a68385ac7 only ExecutableFunction is fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
    16
	instanceVariableNames:'code*'
7f4a68385ac7 only ExecutableFunction is fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
    17
	classVariableNames:'ExecutionErrorSignal InvalidCodeSignal'
7f4a68385ac7 only ExecutableFunction is fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
    18
	poolDictionaries:''
7f4a68385ac7 only ExecutableFunction is fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
    19
	category:'Kernel-Methods'
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    20
!
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    21
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    22
!ExecutableFunction class methodsFor:'documentation'!
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    23
88
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    24
copyright
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    25
"
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    26
 COPYRIGHT (c) 1994 by Claus Gittinger
159
514c749165c3 *** empty log message ***
claus
parents: 131
diff changeset
    27
	      All Rights Reserved
88
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    28
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    29
 This software is furnished under a license and may be used
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    30
 only in accordance with the terms of that license and with the
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    32
 be provided or otherwise made available to, or used by, any
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    33
 other person.  No title to or ownership of the software is
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    34
 hereby transferred.
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    35
"
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    36
!
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    37
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    38
documentation
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    39
"
88
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    40
    This is an abstract class, to merge common attributes of all kinds of
357
claus
parents: 345
diff changeset
    41
    executable code objects; i.e. non-ST functions, Blocks and Methods
claus
parents: 345
diff changeset
    42
    and whatever there might be in the future.
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    43
2244
20ca280cad60 commentary
Claus Gittinger <cg@exept.de>
parents: 1871
diff changeset
    44
    Instances of ExecutableCode are not meant to be created by user code -
1254
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
    45
    the compilers create instances of Method & Block, while compiling.
2244
20ca280cad60 commentary
Claus Gittinger <cg@exept.de>
parents: 1871
diff changeset
    46
    (the VM would not even know what to do with such an instance, and triggered
20ca280cad60 commentary
Claus Gittinger <cg@exept.de>
parents: 1871
diff changeset
    47
     and exception, if ever encountered during block/method execution).
20ca280cad60 commentary
Claus Gittinger <cg@exept.de>
parents: 1871
diff changeset
    48
1254
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
    49
1669
4951596746f7 comments & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1293
diff changeset
    50
    NOTICE: layout known by runtime system and compiler - do not change
4951596746f7 comments & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1293
diff changeset
    51
1254
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
    52
1293
02fb05148c98 documentation
Claus Gittinger <cg@exept.de>
parents: 1264
diff changeset
    53
    [Instance variables:]
225
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    54
      code        <not_an_object>   the function pointer to the machine code.
1254
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
    55
                                    Not accessable from smalltalk code.
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
    56
                                    (notice the '*' in the instVarNames definition)
225
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    57
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    58
1293
02fb05148c98 documentation
Claus Gittinger <cg@exept.de>
parents: 1264
diff changeset
    59
    [Class variables:]
225
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    60
      ExecutionErrorSignal          parent of all execution errors
1254
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
    61
                                    (not raised itself)
225
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    62
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    63
      InvalidCodeSignal             codeObject is not executable
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    64
1293
02fb05148c98 documentation
Claus Gittinger <cg@exept.de>
parents: 1264
diff changeset
    65
02fb05148c98 documentation
Claus Gittinger <cg@exept.de>
parents: 1264
diff changeset
    66
    [author:]
02fb05148c98 documentation
Claus Gittinger <cg@exept.de>
parents: 1264
diff changeset
    67
        Claus Gittinger
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    68
"
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    69
! !
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    70
107
f3e3e2dad7fd *** empty log message ***
claus
parents: 92
diff changeset
    71
!ExecutableFunction class methodsFor:'initialization'!
f3e3e2dad7fd *** empty log message ***
claus
parents: 92
diff changeset
    72
f3e3e2dad7fd *** empty log message ***
claus
parents: 92
diff changeset
    73
initialize
1254
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
    74
    "create signals raised by various errors"
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
    75
7150
a1fe0a0313a8 uses class-based exceptions
Claus Gittinger <cg@exept.de>
parents: 7096
diff changeset
    76
    "uses class-based exceptions now (but remain backward compatible)"
a1fe0a0313a8 uses class-based exceptions
Claus Gittinger <cg@exept.de>
parents: 7096
diff changeset
    77
107
f3e3e2dad7fd *** empty log message ***
claus
parents: 92
diff changeset
    78
    InvalidCodeSignal isNil ifTrue:[
7150
a1fe0a0313a8 uses class-based exceptions
Claus Gittinger <cg@exept.de>
parents: 7096
diff changeset
    79
"/        ExecutionErrorSignal := Error newSignalMayProceed:true.
a1fe0a0313a8 uses class-based exceptions
Claus Gittinger <cg@exept.de>
parents: 7096
diff changeset
    80
"/        ExecutionErrorSignal nameClass:self message:#executionErrorSignal.
a1fe0a0313a8 uses class-based exceptions
Claus Gittinger <cg@exept.de>
parents: 7096
diff changeset
    81
        ExecutionErrorSignal := ExecutionError.
1254
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
    82
        ExecutionErrorSignal notifierString:'execution error'.
159
514c749165c3 *** empty log message ***
claus
parents: 131
diff changeset
    83
7150
a1fe0a0313a8 uses class-based exceptions
Claus Gittinger <cg@exept.de>
parents: 7096
diff changeset
    84
"/        InvalidCodeSignal := ExecutionErrorSignal newSignalMayProceed:true.
a1fe0a0313a8 uses class-based exceptions
Claus Gittinger <cg@exept.de>
parents: 7096
diff changeset
    85
"/        InvalidCodeSignal nameClass:self message:#invalidCodeSignal.
a1fe0a0313a8 uses class-based exceptions
Claus Gittinger <cg@exept.de>
parents: 7096
diff changeset
    86
        InvalidCodeSignal := InvalidCodeError.
1254
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
    87
        InvalidCodeSignal notifierString:'invalid code-object - not executable'.
107
f3e3e2dad7fd *** empty log message ***
claus
parents: 92
diff changeset
    88
    ]
1254
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
    89
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
    90
    "Modified: 22.4.1996 / 16:34:13 / cg"
107
f3e3e2dad7fd *** empty log message ***
claus
parents: 92
diff changeset
    91
! !
f3e3e2dad7fd *** empty log message ***
claus
parents: 92
diff changeset
    92
345
claus
parents: 328
diff changeset
    93
!ExecutableFunction class methodsFor:'Signal constants'!
159
514c749165c3 *** empty log message ***
claus
parents: 131
diff changeset
    94
514c749165c3 *** empty log message ***
claus
parents: 131
diff changeset
    95
executionErrorSignal
514c749165c3 *** empty log message ***
claus
parents: 131
diff changeset
    96
    "return the parent-signal of all execution errors"
514c749165c3 *** empty log message ***
claus
parents: 131
diff changeset
    97
514c749165c3 *** empty log message ***
claus
parents: 131
diff changeset
    98
    ^ ExecutionErrorSignal
514c749165c3 *** empty log message ***
claus
parents: 131
diff changeset
    99
! !
514c749165c3 *** empty log message ***
claus
parents: 131
diff changeset
   100
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   101
!ExecutableFunction class methodsFor:'queries'!
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   102
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   103
isBuiltInClass
1264
8d916aa63bce commentary
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   104
    "return true if this class is known by the run-time-system.
8d916aa63bce commentary
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   105
     Here, true is returned for myself, false for subclasses."
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   106
2244
20ca280cad60 commentary
Claus Gittinger <cg@exept.de>
parents: 1871
diff changeset
   107
    ^ self == ExecutableFunction
1180
7f4a68385ac7 only ExecutableFunction is fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
   108
2244
20ca280cad60 commentary
Claus Gittinger <cg@exept.de>
parents: 1871
diff changeset
   109
    "Modified: 23.1.1997 / 13:47:58 / cg"
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   110
! !
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   111
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   112
!ExecutableFunction methodsFor:'accessing'!
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   113
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   114
code
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   115
    "return the code field. This is not an object but the address of the machine instructions. 
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   116
     Therefore an integer representing the code-address is returned"
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   117
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   118
%{  /* NOCONTEXT */
2870
2939917c5119 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   119
    unsigned INT addr;
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   120
1133
961f2b095c22 underline cleanup
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
   121
    if (__INST(code_) != nil) {
3421
78a276e71115 present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
   122
        
78a276e71115 present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
   123
        RETURN (__MKEXTERNALADDRESS(__INST(code_)));
78a276e71115 present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
   124
#ifdef OLD
78a276e71115 present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
   125
        addr = (unsigned INT)__INST(code_);
78a276e71115 present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
   126
        if (addr <= _MAX_INT) {
78a276e71115 present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
   127
            RETURN ( __MKSMALLINT(addr) );
78a276e71115 present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
   128
        }
78a276e71115 present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
   129
        RETURN ( __MKUINT(addr));
78a276e71115 present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
   130
#endif
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   131
    }
328
claus
parents: 326
diff changeset
   132
%}.
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   133
    ^ nil
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   134
!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   135
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   136
instVarAt:index
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   137
    "have to catch instVar access to code - since its no object"
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   138
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   139
    (index == 1) ifTrue:[^ self code].
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   140
    ^ super instVarAt:index
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   141
!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   142
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   143
instVarAt:index put:value
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   144
    "have to catch instVar access to code - since its no object"
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   145
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   146
    (index == 1) ifTrue:[^ self code:value].
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   147
    ^ super instVarAt:index put:value
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   148
! !
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   149
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   150
!ExecutableFunction methodsFor:'binary storage'!
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   151
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   152
readBinaryContentsFrom: stream manager: manager
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   153
    "make certain, that no invalid function addresses are created."
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   154
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   155
    super readBinaryContentsFrom: stream manager: manager.
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   156
    self code:nil.
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   157
! !
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   158
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   159
!ExecutableFunction methodsFor:'error handling'!
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   160
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   161
invalidCode
1871
d6e2d0570fa8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   162
    "{ Pragma: +optSpace }"
d6e2d0570fa8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   163
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   164
    "this error is triggered by the interpreter when something is wrong
107
f3e3e2dad7fd *** empty log message ***
claus
parents: 92
diff changeset
   165
     with the code object (any error not handled by Method-signals).
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   166
     In this case, the VM sends this to the bad method/block (the receiver).
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   167
     Can only happen when the Compiler/runtime system is broken or
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   168
     someone played around."
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   169
131
39599c151f30 return value of signal raise
claus
parents: 107
diff changeset
   170
    ^ InvalidCodeSignal raise.
1871
d6e2d0570fa8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   171
d6e2d0570fa8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   172
    "Modified: 4.11.1996 / 22:47:21 / cg"
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   173
! !
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   174
357
claus
parents: 345
diff changeset
   175
!ExecutableFunction methodsFor:'printing & storing'!
claus
parents: 345
diff changeset
   176
claus
parents: 345
diff changeset
   177
printOn:aStream
1254
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
   178
    "append a printed representation of the receiver to aStream"
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
   179
357
claus
parents: 345
diff changeset
   180
    |addr|
claus
parents: 345
diff changeset
   181
claus
parents: 345
diff changeset
   182
    addr := self code.
claus
parents: 345
diff changeset
   183
    addr isNil ifTrue:[^ super printOn:aStream].
claus
parents: 345
diff changeset
   184
3193
6eaf01d47d81 Use #nextPut to put a char
Stefan Vogel <sv@exept.de>
parents: 2880
diff changeset
   185
    aStream nextPutAll:self class name; nextPutAll:'(address: 0x'.
6eaf01d47d81 Use #nextPut to put a char
Stefan Vogel <sv@exept.de>
parents: 2880
diff changeset
   186
    addr printOn:aStream base:16.
6eaf01d47d81 Use #nextPut to put a char
Stefan Vogel <sv@exept.de>
parents: 2880
diff changeset
   187
    aStream nextPut:$)
1254
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
   188
3193
6eaf01d47d81 Use #nextPut to put a char
Stefan Vogel <sv@exept.de>
parents: 2880
diff changeset
   189
    "Modified: / 22.4.1996 / 16:36:05 / cg"
6eaf01d47d81 Use #nextPut to put a char
Stefan Vogel <sv@exept.de>
parents: 2880
diff changeset
   190
    "Modified: / 20.1.1998 / 14:10:46 / stefan"
1195
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   191
!
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   192
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   193
printStringForBrowserWithSelector:selector
1254
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
   194
    "return a printString to represent myself to the user in a browser."
1195
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   195
5284
37c436edfa71 printStringForBrowser
Claus Gittinger <cg@exept.de>
parents: 4977
diff changeset
   196
    ^ self printStringForBrowserWithSelector:selector inClass:nil
37c436edfa71 printStringForBrowser
Claus Gittinger <cg@exept.de>
parents: 4977
diff changeset
   197
37c436edfa71 printStringForBrowser
Claus Gittinger <cg@exept.de>
parents: 4977
diff changeset
   198
!
37c436edfa71 printStringForBrowser
Claus Gittinger <cg@exept.de>
parents: 4977
diff changeset
   199
37c436edfa71 printStringForBrowser
Claus Gittinger <cg@exept.de>
parents: 4977
diff changeset
   200
printStringForBrowserWithSelector:selector inClass:aClass
37c436edfa71 printStringForBrowser
Claus Gittinger <cg@exept.de>
parents: 4977
diff changeset
   201
    "return a printString to represent myself to the user in a browser."
37c436edfa71 printStringForBrowser
Claus Gittinger <cg@exept.de>
parents: 4977
diff changeset
   202
1195
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   203
    ^ selector
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   204
357
claus
parents: 345
diff changeset
   205
! !
claus
parents: 345
diff changeset
   206
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   207
!ExecutableFunction methodsFor:'private accessing'!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   208
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   209
code:anAddress
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   210
    "set the code field - DANGER ALERT. 
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   211
     This is not an object but the address of the machine instructions.
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   212
     Therefore the argument must be an integer representing this address.
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   213
     You can crash Smalltalk very badly when playing around here ...
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   214
     This method is for compiler support and very special cases (debugging) only
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   215
     - do not use"
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   216
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   217
%{  /* NOCONTEXT */
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   218
3421
78a276e71115 present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
   219
    if (__isExternalAddress(anAddress)) {
78a276e71115 present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
   220
        __INST(code_) = (OBJ)(__externalAddressVal(anAddress));
78a276e71115 present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
   221
    } else {
78a276e71115 present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
   222
        if (__isSmallInteger(anAddress))
78a276e71115 present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
   223
            __INST(code_) = (OBJ)(__intVal(anAddress));
78a276e71115 present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
   224
        else {
78a276e71115 present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
   225
            if (anAddress == nil) {
78a276e71115 present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
   226
                __INST(code_) = nil;
78a276e71115 present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
   227
            } else {
78a276e71115 present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
   228
                __INST(code_) = (OBJ)(__longIntVal(anAddress));
78a276e71115 present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
   229
            }
78a276e71115 present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
   230
        }
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   231
    }
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   232
%}
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   233
! !
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   234
1190
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   235
!ExecutableFunction methodsFor:'queries'!
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   236
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   237
category
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   238
    "return the category of this codeObject.
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   239
     Return nil here, to alow alien codeObjects to be handled by the
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   240
     browsers."
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   241
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   242
    ^ nil
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   243
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   244
    "Created: 16.4.1996 / 16:31:15 / cg"
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   245
!
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   246
3932
bbfde2a0eef1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3924
diff changeset
   247
hasCode
5459
684192d793bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5284
diff changeset
   248
    "return true, if this codeObject has machinecode to execute."
3932
bbfde2a0eef1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3924
diff changeset
   249
%{
bbfde2a0eef1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3924
diff changeset
   250
    if (__INST(code_)) {
bbfde2a0eef1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3924
diff changeset
   251
        RETURN (true);
bbfde2a0eef1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3924
diff changeset
   252
    }
5459
684192d793bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5284
diff changeset
   253
%}.
684192d793bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5284
diff changeset
   254
    ^ false
3932
bbfde2a0eef1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3924
diff changeset
   255
bbfde2a0eef1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3924
diff changeset
   256
    "Created: / 13.11.1998 / 23:13:29 / cg"
bbfde2a0eef1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3924
diff changeset
   257
!
bbfde2a0eef1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3924
diff changeset
   258
5534
bf00d9a2dfd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5533
diff changeset
   259
hasResource
bf00d9a2dfd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5533
diff changeset
   260
    "return true, if this codeObject has a resource (false here - only real methods have)."
bf00d9a2dfd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5533
diff changeset
   261
bf00d9a2dfd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5533
diff changeset
   262
    ^ false
bf00d9a2dfd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5533
diff changeset
   263
!
bf00d9a2dfd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5533
diff changeset
   264
2532
e555281237f1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
   265
isBreakpointed
e555281237f1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
   266
    "return true, if this is a wrapper method for a breakpoint.
e555281237f1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
   267
     False is returned here - this method is redefined in WrappedMethod"
e555281237f1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
   268
e555281237f1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
   269
    ^ false
e555281237f1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
   270
e555281237f1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
   271
    "Created: 7.4.1997 / 17:24:40 / cg"
e555281237f1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
   272
!
e555281237f1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
   273
1195
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   274
isExecutable
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   275
    "return true, if this codeObject is executable."
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   276
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   277
    self isInvalid ifTrue:[^ false].
3932
bbfde2a0eef1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3924
diff changeset
   278
    ^ self hasCode
1195
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   279
3932
bbfde2a0eef1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3924
diff changeset
   280
    "Created: / 16.4.1996 / 20:13:32 / cg"
bbfde2a0eef1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3924
diff changeset
   281
    "Modified: / 13.11.1998 / 23:16:32 / cg"
1195
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   282
!
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   283
1190
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   284
isInvalid
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   285
    "return true, if this codeObject is invalidated.
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   286
     Return false here, to alow alien codeObjects to be handled by the
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   287
     browsers."
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   288
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   289
    ^ false
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   290
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   291
    "Created: 16.4.1996 / 16:31:42 / cg"
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   292
!
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   293
3924
48aee282d627 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3421
diff changeset
   294
isJavaMethod
48aee282d627 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3421
diff changeset
   295
    ^ false
48aee282d627 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3421
diff changeset
   296
48aee282d627 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3421
diff changeset
   297
    "Created: / 10.11.1998 / 18:26:44 / cg"
48aee282d627 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3421
diff changeset
   298
!
48aee282d627 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3421
diff changeset
   299
1190
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   300
isLazyMethod
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   301
    "return true, if this is a lazy method.
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   302
     False is returned here - this method is redefined in LazyMethod"
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   303
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   304
    ^ false
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   305
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   306
    "Created: 16.4.1996 / 16:32:11 / cg"
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   307
    "Modified: 16.4.1996 / 16:32:36 / cg"
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   308
!
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   309
5936
97baccca8c8e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5904
diff changeset
   310
isObsolete
97baccca8c8e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5904
diff changeset
   311
    ^ false
97baccca8c8e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5904
diff changeset
   312
!
97baccca8c8e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5904
diff changeset
   313
2536
41f4c3159f6b #isTimed query
Claus Gittinger <cg@exept.de>
parents: 2532
diff changeset
   314
isTimed
41f4c3159f6b #isTimed query
Claus Gittinger <cg@exept.de>
parents: 2532
diff changeset
   315
    "return true, if this is a wrapper method for a time measurement.
41f4c3159f6b #isTimed query
Claus Gittinger <cg@exept.de>
parents: 2532
diff changeset
   316
     False is returned here - this method is redefined in WrappedMethod"
41f4c3159f6b #isTimed query
Claus Gittinger <cg@exept.de>
parents: 2532
diff changeset
   317
41f4c3159f6b #isTimed query
Claus Gittinger <cg@exept.de>
parents: 2532
diff changeset
   318
    ^ false
41f4c3159f6b #isTimed query
Claus Gittinger <cg@exept.de>
parents: 2532
diff changeset
   319
41f4c3159f6b #isTimed query
Claus Gittinger <cg@exept.de>
parents: 2532
diff changeset
   320
    "Created: 11.4.1997 / 17:06:32 / cg"
41f4c3159f6b #isTimed query
Claus Gittinger <cg@exept.de>
parents: 2532
diff changeset
   321
!
41f4c3159f6b #isTimed query
Claus Gittinger <cg@exept.de>
parents: 2532
diff changeset
   322
2532
e555281237f1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
   323
isTraced
e555281237f1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
   324
    "return true, if this is a wrapper method for a trace point.
e555281237f1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
   325
     False is returned here - this method is redefined in WrappedMethod"
e555281237f1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
   326
e555281237f1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
   327
    ^ false
e555281237f1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
   328
e555281237f1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
   329
    "Created: 7.4.1997 / 17:24:50 / cg"
e555281237f1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
   330
!
e555281237f1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
   331
1195
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   332
isUnloaded
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   333
    "return true, if the objects machine code has been unloaded
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   334
     from the system (i.e. it is not executable)."
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   335
3932
bbfde2a0eef1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3924
diff changeset
   336
    ^ self hasCode not
1195
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   337
3932
bbfde2a0eef1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3924
diff changeset
   338
    "Created: / 16.4.1996 / 20:15:52 / cg"
bbfde2a0eef1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3924
diff changeset
   339
    "Modified: / 13.11.1998 / 23:19:52 / cg"
1195
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   340
!
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   341
1190
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   342
isWrapped
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   343
    "return true, if this is a wrapper method.
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   344
     False is returned here - this method is redefined in WrappedMethod"
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   345
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   346
    ^ false
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   347
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   348
    "Created: 16.4.1996 / 16:33:24 / cg"
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   349
!
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   350
5904
5198e81b5669 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5537
diff changeset
   351
messagesSent
5198e81b5669 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5537
diff changeset
   352
    ^ #()       "/ actually: unknown here in this abstract class
5198e81b5669 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5537
diff changeset
   353
!
5198e81b5669 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5537
diff changeset
   354
5198e81b5669 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5537
diff changeset
   355
messagesSentToSelf
5198e81b5669 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5537
diff changeset
   356
    ^ #()       "/ actually: unknown here in this abstract class
5198e81b5669 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5537
diff changeset
   357
!
5198e81b5669 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5537
diff changeset
   358
1190
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   359
privacy
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   360
    "return a symbol describing the methods access rights (privacy);
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   361
     Currently, this is one of #private, #protected, #public or #ignored.
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   362
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   363
     Here we unconditionally return #public, to allow alien code objects
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   364
     to be handled by the browsers."
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   365
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   366
    ^ #public
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   367
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   368
    "Created: 16.4.1996 / 16:35:18 / cg"
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   369
!
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   370
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   371
referencesGlobal:aGlobalSymbol
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   372
    "return true, if this method references the global
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   373
     bound to aGlobalSymbol.
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   374
     Return false (we dont know) here, to allow alien code objects to be
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   375
     handled by the browsers."
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   376
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   377
     ^ false
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   378
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   379
    "Created: 16.4.1996 / 16:37:48 / cg"
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   380
!
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   381
4977
17a819360ad5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3932
diff changeset
   382
referencesGlobalMatching:aMatchPattern
17a819360ad5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3932
diff changeset
   383
    "return true, if this method references a global
17a819360ad5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3932
diff changeset
   384
     whose name matches aMatchPattern.
17a819360ad5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3932
diff changeset
   385
     Return false (we dont know) here, to allow alien code objects to be
17a819360ad5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3932
diff changeset
   386
     handled by the browsers."
17a819360ad5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3932
diff changeset
   387
17a819360ad5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3932
diff changeset
   388
     ^ false
17a819360ad5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3932
diff changeset
   389
17a819360ad5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3932
diff changeset
   390
    "Created: / 9.11.1999 / 16:58:48 / cg"
17a819360ad5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3932
diff changeset
   391
!
17a819360ad5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3932
diff changeset
   392
5533
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   393
referencesLiteral:aLiteral
5537
05d01dd462f6 comments
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
   394
    "return true, if this executable references the literal directly (i.e. a flat search).
5533
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   395
     Return false (we dont know) here, to allow alien code objects to be
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   396
     handled by the browsers."
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   397
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   398
     ^ false
5537
05d01dd462f6 comments
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
   399
05d01dd462f6 comments
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
   400
    "Modified: / 18.8.2000 / 21:18:43 / cg"
5533
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   401
!
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   402
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   403
refersToLiteral:aLiteral
5537
05d01dd462f6 comments
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
   404
    "return true, if this executable references the literal directly or indirectly (i.e. a deep search).
5533
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   405
     Return false (we dont know) here, to allow alien code objects to be
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   406
     handled by the browsers."
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   407
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   408
     ^ false
5537
05d01dd462f6 comments
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
   409
05d01dd462f6 comments
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
   410
    "Modified: / 18.8.2000 / 21:18:03 / cg"
5533
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   411
!
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   412
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   413
resources
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   414
    ^ nil
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   415
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   416
    "Created: / 3.11.1997 / 09:09:01 / cg"
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   417
!
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   418
1190
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   419
sends:aSelectorSymbol
5533
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   420
    "return true, if this code object contains a message-send with aSelectorSymbol as selector. 
1190
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   421
     - due to the simple check in the literal array, also simple uses 
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   422
       of aSelectorSymbol as symbol will return true.
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   423
       Should ask compiler, if there is really a send."
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   424
5533
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   425
    ^ self referencesLiteral:aSelectorSymbol
1190
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   426
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   427
    "Created: 16.4.1996 / 16:35:53 / cg"
5533
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   428
!
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   429
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   430
usedGlobals
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   431
    "return a collection with the global names referred to by the receiver.
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   432
     Uses Parser to parse methods source and extract them."
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   433
3bc865a859cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
   434
    ^ #()
1190
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   435
! !
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1180
diff changeset
   436
1180
7f4a68385ac7 only ExecutableFunction is fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
   437
!ExecutableFunction class methodsFor:'documentation'!
7f4a68385ac7 only ExecutableFunction is fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
   438
7f4a68385ac7 only ExecutableFunction is fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
   439
version
7150
a1fe0a0313a8 uses class-based exceptions
Claus Gittinger <cg@exept.de>
parents: 7096
diff changeset
   440
    ^ '$Header: /cvs/stx/stx/libbasic/ExecutableFunction.st,v 1.48 2003-03-31 17:53:48 cg Exp $'
1180
7f4a68385ac7 only ExecutableFunction is fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
   441
! !
7096
bdfda0c28b0c Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents: 5936
diff changeset
   442
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   443
ExecutableFunction initialize!