2
* Copyright (C) 2007, 2008 Campanoni Simone, Anelli Stefano
4
* iljit - This is a Just-in-time for the CIL language specified with the ECMA-335
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
#ifndef IRSPECIALIZER_PERFORM_H
22
#define IRSPECIALIZER_PERFORM_H
26
#include "irprofiler.h"
27
#include "irspecializer.h"
29
/* Select if you want to use the first or the second way to implement the first profiler */
30
#define SPECIALIZER_FIRST_PROFILER_FIRST_WAY
31
#ifdef SPECIALIZER_FIRST_PROFILER_FIRST_WAY
32
#undef SPECIALIZER_FIRST_PROFILER_SECOND_WAY
34
#define SPECIALIZER_FIRST_PROFILER_SECOND_WAY
37
/* Select if you want to use the first or the second way to implement the second profiler */
38
#define SPECIALIZER_SECOND_PROFILER_FIRST_WAY
39
#ifdef SPECIALIZER_SECOND_PROFILER_FIRST_WAY
40
#undef SPECIALIZER_SECOND_PROFILER_SECOND_WAY
42
#define SPECIALIZER_SECOND_PROFILER_SECOND_WAY
45
/* Select if you want to use the first or the second way to implement the dispatcher */
46
#define SPECIALIZER_DISPATCHER_FIRST_WAY
47
#ifdef SPECIALIZER_DISPATCHER_FIRST_WAY
48
#undef SPECIALIZER_DISPATCHER_SECOND_WAY
50
#define SPECIALIZER_DISPATCHER_SECOND_WAY
52
/* Select if you want to use the first or the second way to implement the type dispatcher */
53
#define SPECIALIZER_TYPE_DISPATCHER_FIRST_WAY
54
#ifdef SPECIALIZER_TYPE_DISPATCHER_FIRST_WAY
55
#undef SPECIALIZER_TYPE_DISPATCHER_SECOND_WAY
57
#define SPECIALIZER_TYPE_DISPATCHER_SECOND_WAY
60
/* ----------------------------------------- Request for recompile method -----------------------------------------*/
62
* @brief Native call used inside the IR code to request method recompile
64
void specializer_method_recompile_request(specializer_method_wrapper_t* callerWrapper, specializer_method_callSite_t* callSite, ir_specializer_t* specializer);
67
*@brief Generate the call parameters for a IRICALL to specializer_method_recompile
69
XanList* specializer_method_recompile_getCallParameters(specializer_method_wrapper_t* callerWrapper, specializer_method_callSite_t* callSite, ir_specializer_t* specializer);
71
/* ----------------------------------------- First profiler remove and inject --------------------------------------------*/
72
void specializer_method_callSite_firstProfiler_inject(specializer_method_callSite_firstProfiler_t* profiler, specializer_method_wrapper_t* callerWrapper, ir_specializer_t* specializer);
73
void specializer_method_callSite_firstProfiler_remove(specializer_method_callSite_firstProfiler_t* profiler, specializer_method_wrapper_t* callerWrapper);
75
/* ----------------------------------------- Second profiler remove and inject --------------------------------------------*/
76
void specializer_method_callSite_secondProfiler_inject(specializer_method_callSite_secondProfiler_t* profiler, specializer_method_wrapper_t* callerWrapper, ir_specializer_t* specializer);
77
void specializer_method_callSite_secondProfiler_remove(specializer_method_callSite_secondProfiler_t* profiler, specializer_method_wrapper_t* callerWrapper);
79
/* ----------------------------------------- Dispatcher remove and inject --------------------------------------------*/
80
void specializer_method_callSite_dispatcher_inject(specializer_method_callSite_dispatcher_t* dispatcher, specializer_method_wrapper_t* callerWrapper, XanList* staticExpressions, ir_specializer_t* specializer);
81
void specializer_method_callSite_dispatcher_remove(specializer_method_callSite_dispatcher_t* dispatcher, specializer_method_wrapper_t* callerWrapper);
83
/* ----------------------------------------- Type Dispatcher remove and inject --------------------------------------------*/
84
JITBOOLEAN specializer_method_callSite_type_dispatcher_inject(specializer_method_callSite_type_dispatcher_t* dispatcher, specializer_method_wrapper_t* callerWrapper, JITUINT32* firstProfilerMemory, JITUINT32 firstProfilerCounter, ir_specializer_t* specializer);
85
void specializer_method_callSite_type_dispatcher_remove(specializer_method_callSite_type_dispatcher_t* dispatcher, specializer_method_wrapper_t* callerWrapper);