@@ -156,6 +156,14 @@ public class BaseMethodCompiler
156
156
/// </value>
157
157
public int ThreadID { get ; private set ; }
158
158
159
+ /// <summary>
160
+ /// Gets the method data.
161
+ /// </summary>
162
+ /// <value>
163
+ /// The method data.
164
+ /// </value>
165
+ public CompilerMethodData MethodData { get ; private set ; }
166
+
159
167
#endregion Properties
160
168
161
169
#region Construction
@@ -175,8 +183,8 @@ protected BaseMethodCompiler(BaseCompiler compiler, MosaMethod method, BasicBloc
175
183
Scheduler = compiler . CompilationScheduler ;
176
184
Architecture = compiler . Architecture ;
177
185
TypeSystem = compiler . TypeSystem ;
178
- TypeLayout = Compiler . TypeLayout ;
179
- Trace = Compiler . CompilerTrace ;
186
+ TypeLayout = compiler . TypeLayout ;
187
+ Trace = compiler . CompilerTrace ;
180
188
Linker = compiler . Linker ;
181
189
BasicBlocks = basicBlocks ?? new BasicBlocks ( ) ;
182
190
Pipeline = new CompilerPipeline ( ) ;
@@ -185,9 +193,12 @@ protected BaseMethodCompiler(BaseCompiler compiler, MosaMethod method, BasicBloc
185
193
LocalVariables = emptyOperandList ;
186
194
ThreadID = threadID ;
187
195
DominanceAnalysis = new Dominance ( Compiler . CompilerOptions . DominanceAnalysisFactory , BasicBlocks ) ;
188
- PluggedMethod = Compiler . PlugSystem . GetPlugMethod ( Method ) ;
196
+ PluggedMethod = compiler . PlugSystem . GetPlugMethod ( Method ) ;
189
197
stop = false ;
190
198
199
+ MethodData = compiler . CompilerData . GetCompilerMethodData ( Method ) ;
200
+ MethodData . Counters . Clear ( ) ;
201
+
191
202
EvaluateParameterOperands ( ) ;
192
203
}
193
204
@@ -202,7 +213,7 @@ protected void EvaluateParameterOperands()
202
213
{
203
214
int index = 0 ;
204
215
205
- //FIXME! Note: displacement is recalculated later
216
+ // Note: displacement is recalculated later
206
217
int displacement = 4 ;
207
218
208
219
if ( Method . HasThis || Method . HasExplicitThis )
@@ -249,6 +260,10 @@ public void Compile()
249
260
250
261
InitializeType ( ) ;
251
262
263
+ var log = new TraceLog ( TraceType . Counters , this . Method , string . Empty , Trace . TraceFilter . Active ) ;
264
+ log . Log ( MethodData . Counters . Export ( ) ) ;
265
+ Trace . TraceListener . OnNewTraceLog ( log ) ;
266
+
252
267
EndCompile ( ) ;
253
268
}
254
269
0 commit comments