/[dotgnu-pnet]/pnet/engine/cvmc.c
ViewVC logotype

Diff of /pnet/engine/cvmc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.46 by darkdust, Fri Apr 22 16:08:05 2005 UTC revision 1.47 by ktreichel, Tue Aug 23 10:45:52 2005 UTC
# Line 81  struct _tagILCVMCoder Line 81  struct _tagILCVMCoder
81          int                             flags;          int                             flags;
82          long                    nativeArgPosn;          long                    nativeArgPosn;
83          long                    nativeArgHeight;          long                    nativeArgHeight;
84            ILExecProcess  *process;                /* Backpointer to the owning process */
85  };  };
86    
87  /*  /*
88     * Convert a pointer to an ILCoder to a pointer to the ILCVMVoder instance
89     */
90    #define _ILCoderToILCVMCoder(coder) ((ILCVMCoder *)coder)
91    
92    /*
93   * Include the CVM code generation macros.   * Include the CVM code generation macros.
94   */   */
95  #include "cvmc_gen.h"  #include "cvmc_gen.h"
# Line 105  struct _tagILCVMCoder Line 111  struct _tagILCVMCoder
111  /*  /*
112   * Get the size of a type in stack words.   * Get the size of a type in stack words.
113   */   */
114  static ILUInt32 GetTypeSize(ILType *type)  static ILUInt32 GetTypeSize(ILExecProcess *process, ILType *type)
115  {  {
116          ILUInt32 size = _ILSizeOfTypeLocked(type);          ILUInt32 size = _ILSizeOfTypeLocked(process, type);
117          return (size + sizeof(CVMWord) - 1) / sizeof(CVMWord);          return (size + sizeof(CVMWord) - 1) / sizeof(CVMWord);
118  }  }
119    
120  /*  /*
121   * Get the size of a type in stack words, taking float expansion into account.   * Get the size of a type in stack words, taking float expansion into account.
122   */   */
123  static ILUInt32 GetStackTypeSize(ILType *type)  static ILUInt32 GetStackTypeSize(ILExecProcess *process, ILType *type)
124  {  {
125          ILUInt32 size;          ILUInt32 size;
126          if(type == ILType_Float32 || type == ILType_Float64)          if(type == ILType_Float32 || type == ILType_Float64)
# Line 123  static ILUInt32 GetStackTypeSize(ILType Line 129  static ILUInt32 GetStackTypeSize(ILType
129          }          }
130          else          else
131          {          {
132                  size = _ILSizeOfTypeLocked(type);                  size = _ILSizeOfTypeLocked(process, type);
133          }          }
134          return (size + sizeof(CVMWord) - 1) / sizeof(CVMWord);          return (size + sizeof(CVMWord) - 1) / sizeof(CVMWord);
135  }  }
# Line 131  static ILUInt32 GetStackTypeSize(ILType Line 137  static ILUInt32 GetStackTypeSize(ILType
137  /*  /*
138   * Create a new CVM coder instance.   * Create a new CVM coder instance.
139   */   */
140  static ILCoder *CVMCoder_Create(ILUInt32 size, unsigned long cachePageSize)  static ILCoder *CVMCoder_Create(ILExecProcess *process, ILUInt32 size,
141                                                                    unsigned long cachePageSize)
142  {  {
143          ILCVMCoder *coder;          ILCVMCoder *coder;
144          if((coder = (ILCVMCoder *)ILMalloc(sizeof(ILCVMCoder))) == 0)          if((coder = (ILCVMCoder *)ILMalloc(sizeof(ILCVMCoder))) == 0)
# Line 165  static ILCoder *CVMCoder_Create(ILUInt32 Line 172  static ILCoder *CVMCoder_Create(ILUInt32
172          coder->flags = 0;          coder->flags = 0;
173          coder->nativeArgPosn = 0;          coder->nativeArgPosn = 0;
174          coder->nativeArgHeight = 0;          coder->nativeArgHeight = 0;
175            coder->process = process;
176    
177          /* Call the interpreter to export the label tables for          /* Call the interpreter to export the label tables for
178             use in code generation for direct threading */             use in code generation for direct threading */

Legend:
Removed from v.1.46  
changed lines
  Added in v.1.47

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26