home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / oper_sys / emerald / emrldsys.lha / Language / Compiler / allocate.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-16  |  1.9 KB  |  81 lines

  1. /*
  2.  * @(#)allocate.h    1.3  9/24/87
  3.  */
  4. #ifndef allocate_h
  5. #define allocate_h
  6.  
  7. #ifndef nodes_h
  8. #include "nodes.h"
  9. #endif
  10.  
  11. #ifndef ecTypes_h
  12. #include "ecTypes.h"
  13. #endif
  14.  
  15. #ifndef regdefs_h
  16. #include "regdefs.h"
  17. #endif
  18.  
  19. #define NREGISTERS 16
  20. #define TEMPORARYREGS     ((1 << regs_scratch) | (1 << regs_arg1) |\
  21.   (1 << regs_arg2) | (1 << regs_arg3))
  22. #define LINKAGEREGS    ((1 << regs_pc) | (1 << regs_sp) | (1 << regs_l) |\
  23.   (1 << regs_g) | (1 << regs_b) | (1 << regs_ssp))
  24. #define NLINKAGEREGS 6
  25. #define ALLOCATABLEREGS (0xffff & ~LINKAGEREGS & ~TEMPORARYREGS)
  26. #define MINTEMPORARY regs_scratch
  27. #define MAXTEMPORARY regs_arg3
  28. #define MINALLOCATABLE (MAXTEMPORARY + 1)
  29. #define MAXALLOCATABLE (MINLINKAGE - 1)
  30. #define MINLINKAGE regs_ssp
  31.  
  32. #define NALLOCATABLE    (MAXALLOCATABLE - MINALLOCATABLE + 1)
  33.  
  34. typedef unsigned int AllocateKind;
  35. #define NUMKINDS 7
  36. #define AK_AttachedGlobal 0
  37. #define AK_Global 1
  38. #define AK_AttachedLocal 2
  39. #define AK_Local  3
  40. #define AK_Boring 4
  41. #define AK_Monitor 5
  42. #define AK_InvokeQueue 6
  43.  
  44. typedef struct sRAInfo {
  45.   Boolean        isAllocated    :1;
  46.   Boolean        isAttached    :1;
  47.   AllocateKind        itsKind        :7;
  48.   unsigned int        unused        :24;
  49. } RAInfo;
  50.  
  51. typedef struct sAllocationInfo {
  52.   NodePtr        scope;
  53.   NodePtr        identList;
  54.   NodePtr        paramList;
  55.   NodePtr        resultList;
  56.   Boolean        isDataArea    : 1;
  57.   Boolean        isActivation    : 1;
  58.   Boolean        unused        : 30;
  59.   RAInfo        regs[NALLOCATABLE];
  60.   int            parameterSize;
  61.   int            resultSize;
  62.   int            boringSize;
  63.   int            localSize;
  64.   int            attachedLocalSize;
  65.   int            globalSize;
  66.   int            attachedGlobalSize;
  67.   int            monitorSize;
  68.   int            conditionSize;
  69.   int            invokeQueueSize;
  70.   int            operationTempSize;
  71.   int            operationMaxStack;
  72. } AllocationInfo, *AllocationInfoPtr;
  73.  
  74. #define firstInstanceOffset 8
  75. #define firstLocalOffset 4
  76. #define firstParameterOffset 12
  77. extern AllocationInfoPtr fetchAllocationInfo(), allocateAllocationInfo();
  78. extern void doAllocate(), ATCTToSizeAndKind();
  79.  
  80. #endif
  81.