ObjectClass.hpp
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------*/
2 /* */
3 /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */
4 /* Copyright (c) 2005-2009 Rexx Language Association. All rights reserved. */
5 /* */
6 /* This program and the accompanying materials are made available under */
7 /* the terms of the Common Public License v1.0 which accompanies this */
8 /* distribution. A copy is also available at the following address: */
9 /* http://www.oorexx.org/license.html */
10 /* */
11 /* Redistribution and use in source and binary forms, with or */
12 /* without modification, are permitted provided that the following */
13 /* conditions are met: */
14 /* */
15 /* Redistributions of source code must retain the above copyright */
16 /* notice, this list of conditions and the following disclaimer. */
17 /* Redistributions in binary form must reproduce the above copyright */
18 /* notice, this list of conditions and the following disclaimer in */
19 /* the documentation and/or other materials provided with the distribution. */
20 /* */
21 /* Neither the name of Rexx Language Association nor the names */
22 /* of its contributors may be used to endorse or promote products */
23 /* derived from this software without specific prior written permission. */
24 /* */
25 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
26 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
27 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
28 /* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
29 /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
30 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
31 /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
32 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */
33 /* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
34 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
35 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
36 /* */
37 /*----------------------------------------------------------------------------*/
38 /******************************************************************************/
39 /* REXX Kernel ObjectClass.hpp */
40 /* */
41 /* Primitive Object Class Definitions */
42 /* */
43 /******************************************************************************/
44 /******************************************************************************/
45 #ifndef Included_RexxObject
46 #define Included_RexxObject
47 
48 #include "Numerics.hpp"
49 
50 #include <stddef.h>
51 
52  class RexxObject;
53  class RexxInteger;
54  class RexxBehaviour;
55  class RexxCompoundTail;
56  class RexxCompoundElement;
57  class RexxInternalStack;
58  class RexxSupplier;
59  class RexxEnvelope;
61  class RexxNumberString;
62  class RexxMethod;
63  class RexxMessage;
64  class ProtectedObject;
65  class SecurityManager;
66  class BaseExecutable;
67  class RexxActivity;
68 
69 
70  enum
71  {
72  LiveMask = 0xFFFC, // mask for the checking the mark bits
73  MarkMask = 0x0003, // mask use for checking the mark bits
74  OldSpaceBit = 0x0010, // location of the OldSpace bit
75  };
76 
77 typedef size_t HashCode; // a hash code value
78 
79  /* used ofor special constructor */
81 
82 
84 {
85 public:
87  {
88  // copy the relevant state
90  flags = h.flags;
91  return *this;
92  }
93 
94  inline size_t getObjectSize() { return (size_t)objectSize; }
95  inline void setObjectSize(size_t l)
96  {
97  objectSize = l;
98  }
99 
100  inline void makeProxiedObject() { flags |= ProxiedObject; }
101  inline bool requiresProxyObject() { return (flags & ProxiedObject) != 0; }
102  inline void makeProxy() { flags |= ProxyObject; }
103  inline bool isProxyObject() { return (flags & ProxyObject) != 0; }
104  inline void clearObjectMark() { flags &= LiveMask; }
105  inline void setObjectMark(size_t mark) { clearObjectMark(); flags |= mark; }
106  inline bool isObjectMarked(size_t mark) { return (flags & mark) != 0; }
107  inline bool isObjectLive(size_t mark) { return ((size_t)(flags & MarkMask)) == mark; }
108  inline bool isObjectDead(size_t mark) { return ((size_t)(flags & MarkMask)) != mark; }
109  inline void clear() { objectSize = 0; flags = 0; }
110  inline void setOldSpace() { flags |= OldSpaceBit; }
111  inline void clearOldSpace() { flags &= ~OldSpaceBit; }
112  inline void setNewSpace() { clearOldSpace(); }
113  inline bool isOldSpace() { return (flags & OldSpaceBit) != 0; }
114  inline bool isNewSpace() { return (flags & OldSpaceBit) == 0; }
115  inline void setHasNoReferences() { flags |= NoRefBit; }
116  inline void setHasReferences() { flags &= ~NoRefBit; }
117  inline bool hasReferences() { return (flags & NoRefBit) == 0; }
118  inline bool hasNoReferences() { return (flags & NoRefBit) != 0; }
119  inline void setNonPrimitive() { flags |= IsNonPrimitive; }
120  inline void setPrimitive() { flags &= ~IsNonPrimitive; }
121  inline bool isNonPrimitive() { return (flags & IsNonPrimitive) != 0; }
122  inline bool isPrimitive() { return (flags & IsNonPrimitive) == 0; }
123  inline void initHeader(size_t l, size_t mark)
124  {
125  objectSize = l;
126  flags = (uint16_t)mark; // the flags are cleared except for the mark.
127  }
128  inline void initHeader(size_t mark)
129  {
130  flags = (uint16_t)mark; // the flags are cleared except for the mark.
131  }
132 
133 protected:
134  enum
135 
136  {
137  MarkBit1 = 0x0001, // location of the first mark bit. Note: shared with IsNonPrimitive
138  MarkBit2 = 0x0002, // Second of the mark bits
139  ProxiedObject = 0x0004, // This requires a proxy
140  ProxyObject = 0x0008, // This object is a PROXY(String) Obj
141  IsNonPrimitive = 0x0010, // use for flattened objects to indicated behaviour status
142  NoRefBit = 0x0020 // location of No References Bit.
143 
144  };
145 
146  size_t objectSize; // allocated size of the object
147  union
148  {
149  uint16_t flags; // the object flag/type information
150  size_t sizePadding; // padding to make sure this is a full pointer size
151  };
152 
153 };
154 
155 
156  class RexxVirtualBase { /* create first base level class */
157  /* dummy virtual function to force */
158  /* the virtual function table to a */
159  /* specific location. Different */
160  /* compilers place the virtual */
161  /* function table pointer at */
162  /* different locations. This forces */
163  /* to the front location */
164  protected:
165  virtual ~RexxVirtualBase() { ; }
166  virtual void baseVirtual() {;}
167 
168  public:
169  // the following need to be defined at the base virtual level. When
170  // an exception is thrown from within an object constructor, the destructors
171  // unwind and the constructed object just ends up with a virtual base
172  // vft. If the garbage collector sees this, it will crash unless these
173  // are defined at this level.
174  virtual void live(size_t) {;}
175  virtual void liveGeneral(int reason) {;}
176  virtual void flatten(RexxEnvelope *) {;}
177  virtual RexxObject *unflatten(RexxEnvelope *) { return (RexxObject *)this; };
178  };
179 
180 class RexxObject;
181 
182 /******************************************************************************/
183 /* Method pointer special types */
184 /******************************************************************************/
185 
186  // With positional arguments only
187  typedef RexxObject * (RexxObject::*PCPPM0)();
195 
196  // With positional and named arguments
197  typedef RexxObject * (RexxObject::*PCPPM0N)(RexxObject **, size_t);
198  typedef RexxObject * (RexxObject::*PCPPM1N)(RexxObject *, RexxObject **, size_t);
199  typedef RexxObject * (RexxObject::*PCPPM2N)(RexxObject *, RexxObject *, RexxObject **, size_t);
205 
206  typedef RexxObject * (RexxObject::*PCPPMA1)(RexxArray *); // Not used ?
207  typedef RexxObject * (RexxObject::*PCPPMC1)(RexxObject **, size_t, size_t); // Signature of methods A_COUNT
208 
209  /* pointer to method function */
210  typedef RexxObject * (RexxObject::*PCPPM)();
211  #define CPPM(n) ((PCPPM)&n)
212 
213 
214 #define OREFSHIFT 3
215  /* generate hash value from OREF */
216 inline uintptr_t HASHOREF(RexxVirtualBase *r) { return ((uintptr_t)r) >> OREFSHIFT; }
217  /* Base Object REXX class */
219  public:
220 
221  void * operator new(size_t, RexxClass *);
222  void * operator new(size_t, RexxClass *, RexxObject **, size_t, size_t);
223  inline void *operator new(size_t size, void *ptr) {return ptr;}
224  inline void operator delete(void *) { ; }
225  inline void operator delete(void *p, void *ptr) { }
226  inline RexxInternalObject() {;};
227  /* Following constructor used to */
228  /* reconstruct the Virtual */
229  /* Functiosn table. */
230  /* So it doesn't need to do anything */
231  inline RexxInternalObject(RESTORETYPE restoreType) { ; };
232  virtual ~RexxInternalObject() {;};
233 
234  inline operator RexxObject*() { return (RexxObject *)this; };
235 
236  inline size_t getObjectSize() { return header.getObjectSize(); }
237  inline void setObjectSize(size_t s) { header.setObjectSize(s); }
238  // NB: I hope this doesn't add any padding
239  static inline size_t getObjectHeaderSize() { return sizeof(RexxInternalObject); }
240  inline size_t getObjectDataSize() { return getObjectSize() - getObjectHeaderSize(); }
241  inline void *getObjectDataSpace() { return ((char *)this) + getObjectHeaderSize(); }
242  // these clear everything after the hash value.
243  inline void clearObject() { memset(getObjectDataSpace(), '\0', getObjectDataSize()); }
244  inline void clearObject(size_t l) { memset(getObjectDataSpace(), '\0', l - getObjectHeaderSize()); }
245  inline void setVirtualFunctions(void *t) { *((void **)this) = t; }
246 
247  inline void setInitHeader(size_t s, size_t markword) { header.initHeader(s, markword); }
248  inline void setInitHeader(size_t markword) { header.initHeader(markword); }
249 
250  inline void setObjectLive(size_t markword) { header.setObjectMark(markword); }
253  inline bool hasReferences() { return header.hasReferences(); }
254  inline bool hasNoReferences() { return header.hasNoReferences(); }
255  inline void setPrimitive() { header.setPrimitive(); }
257  inline bool isPrimitive() { return header.isPrimitive(); }
258  inline bool isNonPrimitive() { return header.isNonPrimitive(); }
259  inline bool isObjectMarked(size_t markword) { return header.isObjectMarked(markword); }
260  inline void setObjectMark(size_t markword) { header.setObjectMark(markword); }
262  inline bool isObjectLive(size_t mark) { return header.isObjectLive(mark); }
263  inline bool isObjectDead(size_t mark) { return header.isObjectDead(mark); }
264  inline bool isOldSpace() { return header.isOldSpace(); }
265  inline bool isNewSpace() { return header.isNewSpace(); }
266  inline void setNewSpace() { header.setNewSpace(); }
267  inline void setOldSpace() { header.setOldSpace(); }
269  inline bool isProxyObject() { return header.isProxyObject(); }
270  bool isSubClassOrEnhanced();
271  bool isBaseClass();
272  size_t getObjectTypeNumber();
273  inline RexxBehaviour *getObjectType() { return behaviour; }
274  inline bool isObjectType(RexxBehaviour *b) { return b == behaviour; }
275  inline bool isObjectType(size_t t) { return getObjectTypeNumber() == t; }
276  inline bool isSameType(RexxInternalObject *o) { return behaviour == o->getObjectType(); }
277  inline void setBehaviour(RexxBehaviour *b) { behaviour = b; }
278 
279  virtual RexxObject *makeProxy(RexxEnvelope *);
280  virtual RexxObject *copy();
282  virtual RexxObject *getValue(RexxActivation *) { return OREF_NULL; }
286  virtual void uninit() {;}
287  virtual HashCode hash() { return getHashValue(); }
288  virtual HashCode getHashValue() { return identityHash(); }
289 
290  inline HashCode identityHash() { return HASHOREF(this); }
291 
292  virtual bool truthValue(int);
293  virtual bool logicalValue(logical_t &);
294  virtual RexxString *makeString();
295  virtual void copyIntoTail(RexxCompoundTail *buffer);
296  virtual RexxString *primitiveMakeString();
297  virtual RexxArray *makeArray();
298  virtual RexxString *stringValue();
299  virtual RexxInteger *integerValue(size_t);
300  virtual bool numberValue(wholenumber_t &result, size_t precision);
301  virtual bool numberValue(wholenumber_t &result);
302  virtual bool unsignedNumberValue(stringsize_t &result, size_t precision);
303  virtual bool unsignedNumberValue(stringsize_t &result);
304  virtual bool doubleValue(double &result);
305  virtual RexxNumberString *numberString();
306 
307  virtual bool isEqual(RexxObject *);
308  virtual bool isInstanceOf(RexxClass *);
311 
312  void hasUninit();
313  void removedUninit();
314  void printObject();
315  RexxObject *clone();
316 
317  ObjectHeader header; /* memory management header */
318  RexxBehaviour *behaviour; /* the object's behaviour */
319  };
320 
321 
322 
324  public:
325  void * operator new(size_t, RexxClass *);
326  void * operator new(size_t, RexxClass *, RexxObject **, size_t, size_t);
327  void * operator new(size_t size, void *objectPtr) { return objectPtr; };
328  inline void operator delete(void *, void *) {;}
329  inline void operator delete(void *) {;}
330  inline void operator delete(void *, RexxClass *) {;}
331  inline void operator delete(void *, RexxClass *, RexxObject **, size_t) {;}
332  // Followin are used to create new objects.
333  // Assumed that the message is sent to a class Object
334  // These may move to RexxClass in the future......
335  RexxObject *newRexx(RexxObject **arguments, size_t argCount, size_t named_argCount);
336  RexxObject *newObject() {return new ((RexxClass *)this) RexxObject; };
337 
338  operator RexxInternalObject*() { return (RexxInternalObject *)this; };
339  inline RexxObject(){;};
340  /* Following constructor used to */
341  /* reconstruct the Virtual */
342  /* Functiosn table. */
343  /* So it doesn't need to do anythin*/
344  inline RexxObject(RESTORETYPE restoreType) { ; };
345 
346 
347  // The following two methods probably should be on RexxInternalObject, but they
348  // need to reference the objectVariables field. That field could be moved to
349  // RexxInternalObject, but it would increase the size of all internal objects
350  // by 4 bytes. Since the minimum object size is large enough to always have
351  // that field, it's safe to clear this here.
352  inline void initializeNewObject(size_t size, size_t mark, void *vft, RexxBehaviour *b)
353  {
354  // we need to make this a function object of some type in case
355  // a GC cycle gets triggered before this is complete. By default,
356  // we make this a generic object
357  setVirtualFunctions(vft);
358  setBehaviour(b);
359  // this has a clean set of flags, except for the live mark
360  header.initHeader(size, mark);
361  // make sure the object is cleared in case this gets marked out of any of
362  // the constructors.
363  clearObject();
364  }
365 
366  inline void initializeNewObject(size_t mark, void *vft, RexxBehaviour *b)
367  {
368  // we need to make this a function object of some type in case
369  // a GC cycle gets triggered before this is complete. By default,
370  // we make this a generic object
371  setVirtualFunctions(vft);
372  setBehaviour(b);
373  // this has a clean set of flags, except for the live mark
374  header.initHeader(mark);
375  // make sure the object is cleared in case this gets marked out of any of
376  // the constructors.
377  clearObject();
378  }
379 
380  virtual ~RexxObject(){;};
381 
383  virtual RexxString *defaultName();
384 
385  virtual RexxObject *unknown(RexxString *msg, RexxArray *args, RexxDirectory *named_args){return OREF_NULL;};
386 
387  virtual RexxInteger *hasMethod(RexxString *msg);
388  bool hasUninitMethod();
389 
390  RexxObject *init();
391  void uninit();
392  void live(size_t);
393  void liveGeneral(int reason);
394  void flatten(RexxEnvelope *);
395  RexxObject *copy();
396  HashCode hash();
397  bool truthValue(int);
398  virtual bool logicalValue(logical_t &);
399  virtual bool numberValue(wholenumber_t &result, size_t precision);
400  virtual bool numberValue(wholenumber_t &result);
401  virtual bool unsignedNumberValue(stringsize_t &result, size_t precision);
402  virtual bool unsignedNumberValue(stringsize_t &result);
403  virtual bool doubleValue(double &result);
405  RexxInteger *integerValue(size_t);
408  void copyIntoTail(RexxCompoundTail *buffer);
409  RexxArray *makeArray();
413  RexxInteger *requestInteger(size_t);
414  bool requestNumber(wholenumber_t &, size_t);
415  bool requestUnsignedNumber(stringsize_t &, size_t);
418  RexxString *requiredString(RexxString *kind, size_t);
419  RexxString *requiredString(RexxString *kind, const char *);
421  RexxInteger *requiredInteger(RexxString *kind, size_t, size_t);
422  wholenumber_t requiredNumber(RexxString *kind, size_t position, size_t precision = Numerics::ARGUMENT_DIGITS);
423  stringsize_t requiredPositive(RexxString *kind, size_t position, size_t precision = Numerics::ARGUMENT_DIGITS);
424  stringsize_t requiredNonNegative(RexxString *kind, size_t position, size_t precision = Numerics::ARGUMENT_DIGITS);
425 
426  bool isEqual(RexxObject *);
427  bool isInstanceOf(RexxClass *);
439  RexxMessage *start(RexxObject **, size_t, size_t);
440  RexxMessage *startWith(RexxObject *, RexxArray *, /* named arguments*/ RexxObject **, size_t);
441  RexxObject *send(RexxObject **, size_t, size_t);
442  RexxObject *sendWith(RexxObject *, RexxArray *, /* named arguments*/ RexxObject **, size_t);
443  RexxMessage *startCommon(RexxObject *message, RexxObject **arguments, size_t argCount, size_t named_argCount);
444  static void decodeMessageName(RexxObject *target, RexxObject *message, RexxString *&messageName, RexxObject *&startScope);
445  RexxString *oref();
447  RexxObject *run(RexxObject **, size_t, size_t);
448 
449  bool messageSend(RexxString *, RexxObject **, size_t, size_t, ProtectedObject &, bool processUnknown=true);
450  bool messageSend(RexxString *, RexxObject **, size_t, size_t, RexxObject *, ProtectedObject &, bool processUnknown=true);
451 
453  void processUnknown(RexxString *, RexxObject **, size_t, size_t, ProtectedObject &);
454  void processProtectedMethod(RexxString *, RexxMethod *, RexxObject **, size_t, size_t, ProtectedObject &);
455 
456  // This method should be named "sendWith"
458 
459  inline void sendMessage(RexxString *message, RexxObject **args, size_t argCount, size_t named_argCount, ProtectedObject &result) { this->messageSend(message, args, argCount, named_argCount, result); };
460 
461  inline void sendMessage(RexxString *message, ProtectedObject &result) { this->messageSend(message, OREF_NULL, 0, 0, result); };
462  void sendMessage(RexxString *message, RexxObject *argument1, ProtectedObject &result);
467 
468  // This method should be named "sendWith"
470 
471  RexxObject *sendMessage(RexxString *message, RexxObject **args, size_t argCount, size_t named_argCount);
472 
473  RexxObject *sendMessage(RexxString *message);
474  RexxObject *sendMessage(RexxString *message, RexxObject *argument1);
479 
480  // Following are internal OREXX methods
491  inline RexxBehaviour *behaviourObject() { return this->behaviour; }
492 
493  const char *idString();
494  RexxString *id();
497  void guardOn(RexxActivity *activity, RexxObject *scope);
498  void guardOff(RexxActivity *activity, RexxObject *scope);
500  RexxObject *notEqual(RexxObject *other);
503 
505 
506  RexxObject *hashCode();
507 
514  RexxObject *copyRexx();
515 
516  // In setup.cpp, the methods "UNKOWN" are declared with 2 positional arguments and a list of named arguments.
517  // See CPPCode::run to see how the named arguments are passed to the native methods.
518  RexxObject *unknownRexx(RexxString *, RexxArray *, /* named arguments*/ RexxObject **, size_t);
519 
521  void *getCSelf();
522  void *getCSelf(RexxObject *scope);
523  // compare 2 values for equality, potentially falling back on the
524  // "==" method for the test.
525  bool inline equalValue(RexxObject *other)
526  {
527  // test first for direct equality, followed by value equality.
528  return (this == other) || this->isEqual(other);
529  }
531 
532  // Define operator methods here.
533 
534  koper (operator_plus)
535  koper (operator_minus)
536  koper (operator_multiply)
537  koper (operator_divide)
538  koper (operator_integerDivide)
539  koper (operator_remainder)
540  koper (operator_power)
541  koper (operator_abuttal)
542  koper (operator_concat)
543  koper (operator_concatBlank)
544  koper (operator_equal)
545  koper (operator_notEqual)
546  koper (operator_isGreaterThan)
547  koper (operator_isBackslashGreaterThan)
548  koper (operator_isLessThan)
549  koper (operator_isBackslashLessThan)
550  koper (operator_isGreaterOrEqual)
551  koper (operator_isLessOrEqual)
552  koper (operator_strictEqual)
553  koper (operator_strictNotEqual)
554  koper (operator_strictGreaterThan)
555  koper (operator_strictBackslashGreaterThan)
556  koper (operator_strictLessThan)
557  koper (operator_strictBackslashLessThan)
558  koper (operator_strictGreaterOrEqual)
559  koper (operator_strictLessOrEqual)
560  koper (operator_lessThanGreaterThan)
561  koper (operator_greaterThanLessThan)
562  koper (operator_and)
563  koper (operator_or)
564  koper (operator_xor)
565  koper (operator_not)
566 
567  RexxVariableDictionary *objectVariables; /* set of object variables */
569 
570  static void createInstance();
572 };
573 
574 
575 
576 
577 class RexxNilObject : public RexxObject {
578 public:
579  void * operator new(size_t);
580  void * operator new(size_t size, void *objectPtr) { return objectPtr; };
581  inline void operator delete(void *) { ; }
582  inline void operator delete(void *, void *) { ; }
583  RexxNilObject();
584  inline RexxNilObject(RESTORETYPE restoreType) { ; };
585  virtual ~RexxNilObject() {;};
586 
587  virtual HashCode getHashValue();
588 
590 
591 protected:
592  // we want .NIL to have a static hash value after the image restore, so
593  // this needs to be included in the object state
595 };
596 
597 class RexxList;
598 
599 
601 public:
602  inline RexxActivationBase() {;};
603  inline RexxActivationBase(RESTORETYPE restoreType) { ; };
604  virtual RexxObject *dispatch() {return NULL;};
605  virtual size_t digits() {return Numerics::DEFAULT_DIGITS;};
606  virtual size_t fuzz() {return Numerics::DEFAULT_FUZZ;};
607  virtual bool form() {return Numerics::DEFAULT_FORM;};
609  virtual RexxActivation *getRexxContext() { return OREF_NULL; }
610  virtual RexxActivation *findRexxContext() { return OREF_NULL; }
611  virtual void setDigits(size_t) {;};
612  virtual void setFuzz(size_t) {;};
613  virtual void setForm(bool) {;}
614  virtual bool trap(RexxString *, RexxDirectory *) {return false;};
615  virtual void setObjNotify(RexxMessage *) {;};
616  virtual void termination(){;};
618  virtual bool isForwarded() { return false; }
619  virtual bool isStackBase() { return false; }
620  virtual bool isRexxContext() { return false; }
621  virtual RexxObject *getReceiver() { return OREF_NULL; }
626 
627 protected:
630 
631 };
632 
633 
634 /**
635  * Block guard lock on an object instance.
636  */
638 {
639 public:
641  {
642  // just acquire the scope
644  }
645 
646  inline ~GuardLock()
647  {
649  }
650 
651 private:
652  RexxActivity *activity; // the activity we're running on
653  RexxObject *target; // the target object for the lock
654  RexxObject *scope; // the scope of the required guard lock
655 };
656 #endif
RexxObject *(RexxObject::* PCPPM7)(RexxObject *, RexxObject *, RexxObject *, RexxObject *, RexxObject *, RexxObject *, RexxObject *)
RexxObject *(RexxObject::* PCPPM5N)(RexxObject *, RexxObject *, RexxObject *, RexxObject *, RexxObject *, RexxObject **, size_t)
RexxObject *(RexxObject::* PCPPM7N)(RexxObject *, RexxObject *, RexxObject *, RexxObject *, RexxObject *, RexxObject *, RexxObject *, RexxObject **, size_t)
RexxObject *(RexxObject::* PCPPM2N)(RexxObject *, RexxObject *, RexxObject **, size_t)
RexxObject *(RexxObject::* PCPPM1N)(RexxObject *, RexxObject **, size_t)
RexxObject *(RexxObject::* PCPPMA1)(RexxArray *)
#define OREFSHIFT
RexxObject *(RexxObject::* PCPPM4N)(RexxObject *, RexxObject *, RexxObject *, RexxObject *, RexxObject **, size_t)
RESTORETYPE
Definition: ObjectClass.hpp:80
@ MOBILEUNFLATTEN
Definition: ObjectClass.hpp:80
@ METHODUNFLATTEN
Definition: ObjectClass.hpp:80
@ RESTOREIMAGE
Definition: ObjectClass.hpp:80
RexxObject *(RexxObject::* PCPPM1)(RexxObject *)
RexxObject *(RexxObject::* PCPPM3)(RexxObject *, RexxObject *, RexxObject *)
RexxObject *(RexxObject::* PCPPM5)(RexxObject *, RexxObject *, RexxObject *, RexxObject *, RexxObject *)
RexxObject *(RexxObject::* PCPPM2)(RexxObject *, RexxObject *)
uintptr_t HASHOREF(RexxVirtualBase *r)
RexxObject *(RexxObject::* PCPPMC1)(RexxObject **, size_t, size_t)
RexxObject *(RexxObject::* PCPPM)()
RexxObject *(RexxObject::* PCPPM6)(RexxObject *, RexxObject *, RexxObject *, RexxObject *, RexxObject *, RexxObject *)
RexxObject *(RexxObject::* PCPPM4)(RexxObject *, RexxObject *, RexxObject *, RexxObject *)
RexxObject *(RexxObject::* PCPPM6N)(RexxObject *, RexxObject *, RexxObject *, RexxObject *, RexxObject *, RexxObject *, RexxObject **, size_t)
size_t HashCode
Definition: ObjectClass.hpp:77
@ OldSpaceBit
Definition: ObjectClass.hpp:74
@ MarkMask
Definition: ObjectClass.hpp:73
@ LiveMask
Definition: ObjectClass.hpp:72
RexxObject *(RexxObject::* PCPPM3N)(RexxObject *, RexxObject *, RexxObject *, RexxObject **, size_t)
RexxObject *(RexxObject::* PCPPM0N)(RexxObject **, size_t)
RexxObject *(RexxObject::* PCPPM0)()
#define OREF_NULL
Definition: RexxCore.h:60
GuardLock(RexxActivity *a, RexxObject *o, RexxObject *s)
RexxActivity * activity
RexxObject * target
RexxObject * scope
static NumericSettings * getDefaultSettings()
Definition: Numerics.hpp:114
static const bool DEFAULT_FORM
Definition: Numerics.hpp:81
static const size_t DEFAULT_FUZZ
Definition: Numerics.hpp:79
static const size_t ARGUMENT_DIGITS
Definition: Numerics.hpp:68
static const size_t DEFAULT_DIGITS
Definition: Numerics.hpp:66
bool isOldSpace()
uint16_t flags
void clearObjectMark()
void setObjectMark(size_t mark)
bool hasNoReferences()
bool isProxyObject()
size_t sizePadding
size_t getObjectSize()
Definition: ObjectClass.hpp:94
void makeProxy()
void initHeader(size_t mark)
size_t objectSize
bool hasReferences()
void setOldSpace()
void setHasNoReferences()
bool isNonPrimitive()
ObjectHeader & operator=(ObjectHeader &h)
Definition: ObjectClass.hpp:86
void setPrimitive()
bool isNewSpace()
bool isPrimitive()
void clearOldSpace()
void setHasReferences()
bool isObjectLive(size_t mark)
void setObjectSize(size_t l)
Definition: ObjectClass.hpp:95
void setNewSpace()
bool requiresProxyObject()
void makeProxiedObject()
void setNonPrimitive()
bool isObjectMarked(size_t mark)
bool isObjectDead(size_t mark)
void initHeader(size_t l, size_t mark)
virtual void setFuzz(size_t)
virtual NumericSettings * getNumericSettings()
virtual bool form()
virtual RexxActivation * getRexxContext()
virtual size_t digits()
RexxActivationBase * previous
virtual bool trap(RexxString *, RexxDirectory *)
virtual size_t fuzz()
virtual bool isRexxContext()
virtual RexxObject * dispatch()
RexxObject * getExecutableObject()
virtual void termination()
BaseExecutable * executable
RexxActivationBase * getPreviousStackFrame()
virtual RexxObject * getReceiver()
BaseExecutable * getExecutable()
virtual bool isForwarded()
virtual bool isStackBase()
virtual void setForm(bool)
virtual SecurityManager * getSecurityManager()=0
RexxActivationBase(RESTORETYPE restoreType)
virtual RexxActivation * findRexxContext()
virtual void setDigits(size_t)
virtual void setObjNotify(RexxMessage *)
void setPreviousStackFrame(RexxActivationBase *p)
void setObjectMark(size_t markword)
virtual RexxInteger * integerValue(size_t)
bool isObjectType(RexxBehaviour *b)
virtual bool isInstanceOf(RexxClass *)
void setBehaviour(RexxBehaviour *b)
virtual RexxString * primitiveMakeString()
virtual bool unsignedNumberValue(stringsize_t &result, size_t precision)
virtual RexxObject * evaluate(RexxActivation *, RexxExpressionStack *)
virtual bool isEqual(RexxObject *)
void clearObject(size_t l)
void setInitHeader(size_t markword)
virtual void uninit()
virtual ~RexxInternalObject()
void setVirtualFunctions(void *t)
void setObjectSize(size_t s)
virtual RexxObject * getRealValue(RexxActivation *)
RexxInternalObject(RESTORETYPE restoreType)
virtual RexxObject * makeProxy(RexxEnvelope *)
size_t getObjectDataSize()
virtual bool doubleValue(double &result)
void setObjectLive(size_t markword)
bool isObjectLive(size_t mark)
virtual RexxString * stringValue()
ObjectHeader header
virtual RexxSupplier * instanceMethods(RexxClass *)
RexxObject * clone()
virtual RexxObject * getRealValue(RexxVariableDictionary *)
virtual RexxString * makeString()
static size_t getObjectHeaderSize()
virtual bool numberValue(wholenumber_t &result, size_t precision)
void setInitHeader(size_t s, size_t markword)
virtual RexxArray * makeArray()
virtual RexxObject * getValue(RexxVariableDictionary *)
virtual RexxMethod * instanceMethod(RexxString *)
bool isObjectMarked(size_t markword)
virtual void copyIntoTail(RexxCompoundTail *buffer)
bool isObjectDead(size_t mark)
virtual HashCode getHashValue()
virtual RexxObject * copy()
virtual RexxObject * getValue(RexxActivation *)
size_t getObjectTypeNumber()
RexxBehaviour * behaviour
virtual HashCode hash()
virtual RexxNumberString * numberString()
virtual bool truthValue(int)
HashCode identityHash()
bool isObjectType(size_t t)
virtual bool logicalValue(logical_t &)
bool isSameType(RexxInternalObject *o)
void * getObjectDataSpace()
RexxBehaviour * getObjectType()
static RexxObject * nilObject
HashCode hashValue
virtual HashCode getHashValue()
virtual ~RexxNilObject()
RexxNilObject(RESTORETYPE restoreType)
RexxObject * isInstanceOfRexx(RexxClass *)
RexxInteger * requiredInteger(RexxString *kind, size_t, size_t)
bool hasUninitMethod()
RexxString * stringRexx()
RexxString * defaultNameRexx()
bool messageSend(RexxString *, RexxObject **, size_t, size_t, ProtectedObject &, bool processUnknown=true)
stringsize_t requiredPositive(RexxString *kind, size_t position, size_t precision=Numerics::ARGUMENT_DIGITS)
RexxMessage * start(RexxObject **, size_t, size_t)
virtual wholenumber_t compareTo(RexxObject *)
RexxString * objectName()
RexxNumberString * numberString()
RexxMessage * startCommon(RexxObject *message, RexxObject **arguments, size_t argCount, size_t named_argCount)
RexxInteger * integerValue(size_t)
void initializeNewObject(size_t size, size_t mark, void *vft, RexxBehaviour *b)
RexxVariableDictionary * getObjectVariables(RexxObject *)
RexxObject * requestRexx(RexxString *)
static void decodeMessageName(RexxObject *target, RexxObject *message, RexxString *&messageName, RexxObject *&startScope)
RexxObject * sendWith(RexxObject *, RexxArray *, RexxObject **, size_t)
RexxString * concatRexx(RexxObject *)
RexxObject * unknownRexx(RexxString *, RexxArray *, RexxObject **, size_t)
bool requestUnsignedNumber(stringsize_t &, size_t)
static RexxClass * classInstance
stringsize_t requiredNonNegative(RexxString *kind, size_t position, size_t precision=Numerics::ARGUMENT_DIGITS)
RexxObject * hasMethodRexx(RexxString *)
RexxMethod * instanceMethodRexx(RexxString *)
void live(size_t)
Definition: ObjectClass.cpp:78
RexxObject * unsetMethod(RexxString *)
RexxString * primitiveMakeString()
RexxObject * setMdict(RexxObject *)
static void createInstance()
Definition: ObjectClass.cpp:72
RexxObject * superScope(RexxObject *)
virtual RexxInteger * hasMethod(RexxString *msg)
RexxObject * strictEqual(RexxObject *)
void guardOn(RexxActivity *activity, RexxObject *scope)
void initializeNewObject(size_t mark, void *vft, RexxBehaviour *b)
RexxMessage * startWith(RexxObject *, RexxArray *, RexxObject **, size_t)
void processUnknown(RexxString *, RexxObject **, size_t, size_t, ProtectedObject &)
virtual bool doubleValue(double &result)
RexxObject * pmdict()
RexxInteger * requestInteger(size_t)
RexxObject * setMethod(RexxString *, RexxMethod *, RexxString *a=OREF_NULL)
RexxMethod * methodLookup(RexxString *name)
virtual RexxObject * defMethod(RexxString *, RexxMethod *, RexxString *a=OREF_NULL)
RexxString * makeString()
RexxObject * send(RexxObject **, size_t, size_t)
RexxArray * makeArray()
void sendMessage(RexxString *message, ProtectedObject &result)
RexxObject * objectNameEquals(RexxObject *)
void guardOff(RexxActivity *activity, RexxObject *scope)
RexxString * oref()
virtual RexxObject * unknown(RexxString *msg, RexxArray *args, RexxDirectory *named_args)
RexxArray * requestArray()
RexxString * requiredString()
void * getCSelf()
void processProtectedMethod(RexxString *, RexxMethod *, RexxObject **, size_t, size_t, ProtectedObject &)
bool equalValue(RexxObject *other)
RexxObject * copy()
RexxString * stringValue()
RexxSupplier * instanceMethods(RexxClass *)
void flatten(RexxEnvelope *)
Definition: ObjectClass.cpp:94
RexxObject(RESTORETYPE restoreType)
RexxObject * equal(RexxObject *)
void sendMessage(RexxString *, RexxArray *, RexxDirectory *, ProtectedObject &)
koper(operator_plus) koper(operator_minus) koper(operator_multiply) koper(operator_divide) koper(operator_integerDivide) koper(operator_remainder) koper(operator_power) koper(operator_abuttal) koper(operator_concat) koper(operator_concatBlank) koper(operator_equal) koper(operator_notEqual) koper(operator_isGreaterThan) koper(operator_isBackslashGreaterThan) koper(operator_isLessThan) koper(operator_isBackslashLessThan) koper(operator_isGreaterOrEqual) koper(operator_isLessOrEqual) koper(operator_strictEqual) koper(operator_strictNotEqual) koper(operator_strictGreaterThan) koper(operator_strictBackslashGreaterThan) koper(operator_strictLessThan) koper(operator_strictBackslashLessThan) koper(operator_strictGreaterOrEqual) koper(operator_strictLessOrEqual) koper(operator_lessThanGreaterThan) koper(operator_greaterThanLessThan) koper(operator_and) koper(operator_or) koper(operator_xor) koper(operator_not) RexxVariableDictionary *objectVariables
void liveGeneral(int reason)
Definition: ObjectClass.cpp:86
RexxObject * notEqual(RexxObject *other)
bool requestNumber(wholenumber_t &, size_t)
RexxMethod * checkPrivate(RexxMethod *)
HashCode hash()
RexxInteger * identityHashRexx()
RexxObject * mdict()
RexxDirectory * requestDirectory()
RexxMethod * instanceMethod(RexxString *)
void addObjectVariables(RexxVariableDictionary *)
RexxString * requestString()
void copyIntoTail(RexxCompoundTail *buffer)
RexxObject * makeStringRexx()
virtual bool numberValue(wholenumber_t &result, size_t precision)
RexxObject * newRexx(RexxObject **arguments, size_t argCount, size_t named_argCount)
virtual ~RexxObject()
RexxObject * newObject()
RexxBehaviour * behaviourObject()
RexxObject * defMethods(RexxDirectory *)
bool isEqual(RexxObject *)
virtual RexxString * defaultName()
bool truthValue(int)
static PCPPM operatorMethods[]
RexxString * concatBlank(RexxObject *)
virtual bool unsignedNumberValue(stringsize_t &result, size_t precision)
RexxSupplier * instanceMethodsRexx(RexxClass *)
RexxString * requestStringNoNOSTRING()
RexxString * id()
RexxClass * classObject()
const char * idString()
RexxObject * copyRexx()
void setObjectVariable(RexxString *, RexxObject *, RexxObject *)
bool isInstanceOf(RexxClass *)
RexxObject * run(RexxObject **, size_t, size_t)
RexxObject * makeArrayRexx()
RexxMethod * superMethod(RexxString *, RexxObject *)
RexxObject * strictNotEqual(RexxObject *other)
RexxObject * getObjectVariable(RexxString *)
virtual bool logicalValue(logical_t &)
RexxObject * hashCode()
void copyObjectVariables(RexxObject *newObject)
void sendMessage(RexxString *message, RexxObject **args, size_t argCount, size_t named_argCount, ProtectedObject &result)
RexxObject * init()
wholenumber_t requiredNumber(RexxString *kind, size_t position, size_t precision=Numerics::ARGUMENT_DIGITS)
virtual void flatten(RexxEnvelope *)
virtual void liveGeneral(int reason)
virtual void live(size_t)
virtual RexxObject * unflatten(RexxEnvelope *)
virtual ~RexxVirtualBase()
virtual void baseVirtual()
size_t logical_t
Definition: rexx.h:231
ssize_t wholenumber_t
Definition: rexx.h:230
size_t stringsize_t
Definition: rexx.h:228
unsigned short uint16_t
UINT_PTR uintptr_t