Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 148629 | Differences between
and this patch

Collapse All | Expand All

(-)src-native/src/Martini/Infrastructure/JIE/JIEImpl.h (+4 lines)
Lines 27-32 Link Here
27
        // IJIE methods
27
        // IJIE methods
28
        virtual IJavaClass *GetClassInterface(const unsigned char *pucClassFile,
28
        virtual IJavaClass *GetClassInterface(const unsigned char *pucClassFile,
29
                                              unsigned int uiClassSize) const;
29
                                              unsigned int uiClassSize) const;
30
        virtual void EnableStackMapCalculation() const;
31
        
32
    private:
33
        TResult BindJpiFunctions() const;
30
        
34
        
31
    }; // class CJIE
35
    }; // class CJIE
32
36
(-)src-native/src/Martini/Infrastructure/JIE/JIE.dsp (-7 / +11 lines)
Lines 49-55 Link Here
49
# PROP Target_Dir ""
49
# PROP Target_Dir ""
50
F90=df.exe
50
F90=df.exe
51
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\Include" /I "..\..\Include" /I "..\..\..\Include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JIE_EXPORTS" /FD /c
51
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\Include" /I "..\..\Include" /I "..\..\..\Include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JIE_EXPORTS" /FD /c
52
# ADD CPP /nologo /MT /W3 /GX /Zi /O2 /I "..\Include" /I "..\..\Include" /I "..\..\..\..\include\Martini" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\Common" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\BCIEng" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\BCIEng\BCIEngJ" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\JClass" /D "NDEBUG" /D "IA32_ARCH" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JIE_EXPORTS" /D "MARTINI_JIE" /FD /c
52
# ADD CPP /nologo /MT /W3 /GX /Zi /O2 /I "..\Include" /I "..\..\Include" /I "..\..\..\..\include\Martini" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\Common" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\BCIEng" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\BCIEng\BCIEngJ" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\JClass" /D "NDEBUG" /D "IA32_ARCH" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JIE_EXPORTS" /D "MARTINI_JIE" /D "VERIFIER_STANDALONE" /FD /c
53
# SUBTRACT CPP /Fr
53
# SUBTRACT CPP /Fr
54
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
54
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
55
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
55
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
Lines 79-85 Link Here
79
# PROP Target_Dir ""
79
# PROP Target_Dir ""
80
F90=df.exe
80
F90=df.exe
81
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\Include" /I "..\..\Include" /I "..\..\..\Include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JIE_EXPORTS" /FR /FD /GZ /c
81
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\Include" /I "..\..\Include" /I "..\..\..\Include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JIE_EXPORTS" /FR /FD /GZ /c
82
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\Include" /I "..\..\Include" /I "..\..\..\..\include\Martini" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\Common" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\BCIEng" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\BCIEng\BCIEngJ" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\JClass" /D "_DEBUG" /D "IA32_ARCH" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JIE_EXPORTS" /D "MARTINI_JIE" /FR /FD /GZ /c
82
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\Include" /I "..\..\Include" /I "..\..\..\..\include\Martini" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\Common" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\BCIEng" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\BCIEng\BCIEngJ" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\JClass" /I "$(HARMONY_VERIFIER)\include" /I "$(HARMONY_VERIFIER)\verifier-3363\x_verifier" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "_DEBUG" /D "IA32_ARCH" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JIE_EXPORTS" /D "MARTINI_JIE" /D "VERIFIER_STANDALONE" /FR /FD /GZ /c
83
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
83
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
84
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
84
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
85
# ADD BASE RSC /l 0x409 /d "_DEBUG"
85
# ADD BASE RSC /l 0x409 /d "_DEBUG"
Lines 89-95 Link Here
89
# ADD BSC32 /nologo
89
# ADD BSC32 /nologo
90
LINK32=link.exe
90
LINK32=link.exe
91
# ADD BASE LINK32 kernel32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
91
# ADD BASE LINK32 kernel32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
92
# ADD LINK32 kernel32.lib MartiniOSA.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\bin\windows\debug\IA-32"
92
# ADD LINK32 kernel32.lib MartiniOSA.lib verifier.lib /nologo /dll /map /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\bin\windows\debug\IA-32" /libpath:"$(HARMONY_VERIFIER)\verifier\verifier_6\verifier\Debug"
93
# SUBTRACT LINK32 /incremental:no
93
# SUBTRACT LINK32 /incremental:no
94
94
95
!ELSEIF  "$(CFG)" == "JIE - Win32 EM64T Debug"
95
!ELSEIF  "$(CFG)" == "JIE - Win32 EM64T Debug"
Lines 108-114 Link Here
108
# PROP Target_Dir ""
108
# PROP Target_Dir ""
109
F90=df.exe
109
F90=df.exe
110
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\Include" /I "..\..\Include" /I "..\..\..\Include" /I "..\Include\win" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JIE_EXPORTS" /FR /FD /GZ /c
110
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\Include" /I "..\..\Include" /I "..\..\..\Include" /I "..\Include\win" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JIE_EXPORTS" /FR /FD /GZ /c
111
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\Include" /I "..\..\Include" /I "..\..\..\..\include\Martini" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\Common" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\BCIEng" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\BCIEng\BCIEngJ" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\JClass" /D "_DEBUG" /D "EM64T_ARCH" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JIE_EXPORTS" /D "MARTINI_JIE" /FD /GZ /c
111
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\Include" /I "..\..\Include" /I "..\..\..\..\include\Martini" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\Common" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\BCIEng" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\BCIEng\BCIEngJ" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\JClass" /D "_DEBUG" /D "EM64T_ARCH" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JIE_EXPORTS" /D "MARTINI_JIE" /D "VERIFIER_STANDALONE" /FD /GZ /c
112
# SUBTRACT CPP /Fr
112
# SUBTRACT CPP /Fr
113
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
113
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
114
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
114
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
Lines 138-144 Link Here
138
# PROP Target_Dir ""
138
# PROP Target_Dir ""
139
F90=df.exe
139
F90=df.exe
140
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\Include" /I "..\..\Include" /I "..\..\..\Include" /I "..\Include\win" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JIE_EXPORTS" /FD /c
140
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\Include" /I "..\..\Include" /I "..\..\..\Include" /I "..\Include\win" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JIE_EXPORTS" /FD /c
141
# ADD CPP /nologo /MT /W3 /GX /Zi /O2 /I "..\Include" /I "..\..\Include" /I "..\..\..\..\include\Martini" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\Common" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\BCIEng" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\BCIEng\BCIEngJ" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\JClass" /D "NDEBUG" /D "EM64T_ARCH" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JIE_EXPORTS" /D "MARTINI_JIE" /FD /c
141
# ADD CPP /nologo /MT /W3 /GX /Zi /O2 /I "..\Include" /I "..\..\Include" /I "..\..\..\..\include\Martini" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\Common" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\BCIEng" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\BCIEng\BCIEngJ" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\JClass" /D "NDEBUG" /D "EM64T_ARCH" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JIE_EXPORTS" /D "MARTINI_JIE" /D "VERIFIER_STANDALONE" /FD /c
142
# SUBTRACT CPP /Fr
142
# SUBTRACT CPP /Fr
143
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
143
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
144
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
144
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
Lines 168-174 Link Here
168
# PROP Target_Dir ""
168
# PROP Target_Dir ""
169
F90=df.exe
169
F90=df.exe
170
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\Include" /I "..\..\Include" /I "..\..\..\Include" /I "..\Include\win" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JIE_EXPORTS" /FD /c
170
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\Include" /I "..\..\Include" /I "..\..\..\Include" /I "..\Include\win" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JIE_EXPORTS" /FD /c
171
# ADD CPP /nologo /MT /W3 /GX /Zi /O2 /I "..\Include" /I "..\..\Include" /I "..\..\..\..\include\Martini" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\Common" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\BCIEng" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\BCIEng\BCIEngJ" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\JClass" /D "NDEBUG" /D "IPF_ARCH" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JIE_EXPORTS" /D "MARTINI_JIE" /FD /c
171
# ADD CPP /nologo /MT /W3 /GX /Zi /O2 /I "..\Include" /I "..\..\Include" /I "..\..\..\..\include\Martini" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\Common" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\BCIEng" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\BCIEng\BCIEngJ" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\JClass" /D "NDEBUG" /D "IPF_ARCH" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JIE_EXPORTS" /D "MARTINI_JIE" /D "VERIFIER_STANDALONE" /FD /c
172
# SUBTRACT CPP /Fr
172
# SUBTRACT CPP /Fr
173
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
173
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
174
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
174
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
Lines 198-204 Link Here
198
# PROP Target_Dir ""
198
# PROP Target_Dir ""
199
F90=df.exe
199
F90=df.exe
200
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\Include" /I "..\..\Include" /I "..\..\..\Include" /I "..\Include\win" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JIE_EXPORTS" /FR /FD /GZ /c
200
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\Include" /I "..\..\Include" /I "..\..\..\Include" /I "..\Include\win" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JIE_EXPORTS" /FR /FD /GZ /c
201
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\Include" /I "..\..\Include" /I "..\..\..\..\include\Martini" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\Common" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\BCIEng" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\BCIEng\BCIEngJ" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\JClass" /D "_DEBUG" /D "IPF_ARCH" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JIE_EXPORTS" /D "MARTINI_JIE" /FD /GZ /c
201
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\Include" /I "..\..\Include" /I "..\..\..\..\include\Martini" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\Common" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\BCIEng" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\BCIEng\BCIEngJ" /I "..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\JClass" /D "_DEBUG" /D "IPF_ARCH" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JIE_EXPORTS" /D "MARTINI_JIE" /D "VERIFIER_STANDALONE" /FD /GZ /c
202
# SUBTRACT CPP /Fr
202
# SUBTRACT CPP /Fr
203
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
203
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
204
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
204
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
Lines 235-240 Link Here
235
# End Source File
235
# End Source File
236
# Begin Source File
236
# Begin Source File
237
237
238
SOURCE="..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\BCIEng\BCIEngJ\class_interface.cpp"
239
# End Source File
240
# Begin Source File
241
238
SOURCE="..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\Common\Command.cpp"
242
SOURCE="..\..\..\..\..\..\org.eclipse.hyades.probekit\src-native\BCI\Common\Command.cpp"
239
# End Source File
243
# End Source File
240
# Begin Source File
244
# Begin Source File
(-)src-native/src/Martini/Infrastructure/JIE/JavaClass.cpp (+34 lines)
Lines 29-34 Link Here
29
#include "JStream.h"
29
#include "JStream.h"
30
#include "JMemStream.h"
30
#include "JMemStream.h"
31
#include "JVMInsSet.h"
31
#include "JVMInsSet.h"
32
#include "class_inerface_int.h"
32
#include "MIEInstructionFactory.h"
33
#include "MIEInstructionFactory.h"
33
#include "BciUtils.h"
34
#include "BciUtils.h"
34
35
Lines 40-45 Link Here
40
//////////////////////////////////////////////////////////////////////////
41
//////////////////////////////////////////////////////////////////////////
41
// class CJavaClass implementation
42
// class CJavaClass implementation
42
43
44
static void* g_pJniEnv = NULL;
45
46
static void *
47
get_vm_pointer(void **pJniEnv) 
48
{
49
    *pJniEnv = g_pJniEnv;
50
    return g_pJniEnv;
51
}
52
43
// constructs a CJavaClass object
53
// constructs a CJavaClass object
44
CJavaClass::CJavaClass(const unsigned char *pubClassFile, unsigned int uiClassSize)
54
CJavaClass::CJavaClass(const unsigned char *pubClassFile, unsigned int uiClassSize)
45
    : m_pStaticInitializer(NULL), m_bModuleParsed(false), m_bMethodListCreated(false),
55
    : m_pStaticInitializer(NULL), m_bModuleParsed(false), m_bMethodListCreated(false),
Lines 50-55 Link Here
50
    //_CrtSetBreakAlloc(2189);
60
    //_CrtSetBreakAlloc(2189);
51
#endif
61
#endif
52
62
63
    if (CJieGlobals::Instance()->isStackMapCalcEnabled)
64
    {
65
        TResult res = CJieGlobals::Instance()->pfnJPI_AttachCurrentThread(
66
            &m_pJniEnv, &m_isThreadAttached);
67
        if (MRTE_SUCCEEDED(res))
68
        {
69
            g_pJniEnv = m_pJniEnv;
70
            initialize_dynamic(get_vm_pointer);
71
        }
72
        else
73
        {
74
            CJieGlobals::Instance()->isStackMapCalcEnabled = false;
75
            m_isThreadAttached = false;
76
            m_pJniEnv = NULL;
77
        }
78
    }
79
53
	CJMemStream		memStream;					// Memory stream
80
	CJMemStream		memStream;					// Memory stream
54
	CJStream		jsIn(&memStream);		    // Java input stream
81
	CJStream		jsIn(&memStream);		    // Java input stream
55
    // read class file
82
    // read class file
Lines 62-67 Link Here
62
    // is deleted.
89
    // is deleted.
63
	m_pModule->Open(m_pClassBuilder, true);
90
	m_pModule->Open(m_pClassBuilder, true);
64
	m_pModule->SetAccessFlags(m_pClassBuilder->GetAccessFlags());
91
	m_pModule->SetAccessFlags(m_pClassBuilder->GetAccessFlags());
92
	m_pModule->UseStackMapCalculation(CJieGlobals::Instance()->isStackMapCalcEnabled);
65
}
93
}
66
94
67
// destructor
95
// destructor
Lines 100-105 Link Here
100
    // deallocate the instruction factory
128
    // deallocate the instruction factory
101
    CMIEInstructionFactory::Free();
129
    CMIEInstructionFactory::Free();
102
130
131
    // detach the current thread from the JVM (if needed)
132
    if (CJieGlobals::Instance()->isStackMapCalcEnabled && m_isThreadAttached)
133
    {
134
        CJieGlobals::Instance()->pfnJPI_DetachCurrentThread();
135
    }
136
103
    // deallocate the JavaClass object
137
    // deallocate the JavaClass object
104
    delete this;
138
    delete this;
105
}
139
}
(-)src-native/src/Martini/Infrastructure/JIE/JIEUtils.h (+36 lines)
Lines 20-25 Link Here
20
#include "MString.h"
20
#include "MString.h"
21
#include "JavaHelpers.h"
21
#include "JavaHelpers.h"
22
22
23
#include "jni.h"
24
23
///////////////////////////////////////////////////////////////////////////////
25
///////////////////////////////////////////////////////////////////////////////
24
// Global constants
26
// Global constants
25
27
Lines 35-38 Link Here
35
U16 WCharToUtf8(U8 *pDest, unsigned int uiDesBufferSize, const WCHAR *pSource);
37
U16 WCharToUtf8(U8 *pDest, unsigned int uiDesBufferSize, const WCHAR *pSource);
36
U16 CharToUtf8(U8 *pDest, unsigned int uiDesBufferSize, const char *pSource);
38
U16 CharToUtf8(U8 *pDest, unsigned int uiDesBufferSize, const char *pSource);
37
39
40
typedef TResult (*TJpiAttachCurrentThread) (JNIEnv **ppJNIEnv, bool *bAttached);
41
typedef void (*TJpiDetachCurrentThread) ();
42
43
namespace Martini { namespace JIE {
44
45
    class CJieGlobals
46
    {
47
    public:
48
49
        static CJieGlobals* Instance() 
50
        {
51
            if (0 == s_pInstance)
52
            {
53
                s_pInstance = new CJieGlobals();
54
            }
55
            return s_pInstance;
56
        }
57
58
        TJpiAttachCurrentThread pfnJPI_AttachCurrentThread;
59
        TJpiDetachCurrentThread pfnJPI_DetachCurrentThread;
60
        
61
        bool isStackMapCalcEnabled;
62
63
    protected:
64
        static CJieGlobals* s_pInstance;
65
66
        CJieGlobals(): 
67
            pfnJPI_AttachCurrentThread(0), pfnJPI_DetachCurrentThread(0),
68
            isStackMapCalcEnabled(false)
69
            {}
70
71
    };
72
}} // namespace Martini::JIE
73
38
#endif // MRTE_JIEUTILS
74
#endif // MRTE_JIEUTILS
(-)src-native/src/Martini/Infrastructure/JIE/JIEUtils.cpp (+3 lines)
Lines 221-224 Link Here
221
	return ret;
221
	return ret;
222
}
222
}
223
223
224
//////////////////////////////////////////////////////////////////////////
225
// CJieGlobals implementation
224
226
227
Martini::JIE::CJieGlobals* Martini::JIE::CJieGlobals::s_pInstance = NULL;
(-)src-native/src/Martini/Infrastructure/JIE/JavaClass.h (+9 lines)
Lines 20-25 Link Here
20
#include "JavaFields.h"
20
#include "JavaFields.h"
21
#include "ModuleJ.h"
21
#include "ModuleJ.h"
22
22
23
#include "jni.h"
24
23
namespace Martini { namespace JIE {
25
namespace Martini { namespace JIE {
24
26
25
    class CJavaClass : public IJavaClass
27
    class CJavaClass : public IJavaClass
Lines 108-113 Link Here
108
        // create a new field
110
        // create a new field
109
        IJavaField* InternalAddField(u2 uiFlags, const char *szName, CJavaType fieldType);
111
        IJavaField* InternalAddField(u2 uiFlags, const char *szName, CJavaType fieldType);
110
112
113
        // JNI environment pointer for Java 6 StackMap calculation
114
        JNIEnv* m_pJniEnv;
115
116
        // Whether the current thread was actively attached to the JVM during instantiation of 
117
        // this class
118
        bool m_isThreadAttached; 
119
111
    }; // class CJavaClass
120
    }; // class CJavaClass
112
121
113
}} // namespace JIE
122
}} // namespace JIE
(-)src-native/src/Martini/Infrastructure/JIE/JIE.cpp (+42 lines)
Lines 13-24 Link Here
13
#pragma warning (disable:4786)
13
#pragma warning (disable:4786)
14
14
15
#include "JIEImpl.h"
15
#include "JIEImpl.h"
16
#include "JIEUtils.h"
16
#include "JavaClass.h"
17
#include "JavaClass.h"
17
18
19
#include "LibraryLoader.h"
20
#include "OSA.h"
21
18
// first ids are reserved for threads in the prf resolution
22
// first ids are reserved for threads in the prf resolution
19
#define JIE_FIRST_METHOD_ID 0x10000 
23
#define JIE_FIRST_METHOD_ID 0x10000 
20
24
21
using namespace Martini::JIE;
25
using namespace Martini::JIE;
26
using namespace Martini::OSA;
22
27
23
extern "C" JIE_API IJIE *GetJIEInstance()
28
extern "C" JIE_API IJIE *GetJIEInstance()
24
{
29
{
Lines 26-31 Link Here
26
    return (IJIE*)&s_jie;
31
    return (IJIE*)&s_jie;
27
}
32
}
28
33
34
29
//////////////////////////////////////////////////////////////////////////
35
//////////////////////////////////////////////////////////////////////////
30
// class CJIE implementation
36
// class CJIE implementation
31
37
Lines 51-53 Link Here
51
    }
57
    }
52
    return pClass; 
58
    return pClass; 
53
}
59
}
60
61
void CJIE::EnableStackMapCalculation() const
62
{
63
    TResult res = BindJpiFunctions();
64
    if (MRTE_SUCCEEDED(res))
65
    {
66
        CJieGlobals::Instance()->isStackMapCalcEnabled = true;
67
    }
68
}
69
70
TResult CJIE::BindJpiFunctions() const
71
{
72
    ILibraryLoader *pJpiLoader = LoadBistroLibrary("JPI");
73
    if (!pJpiLoader)
74
    {
75
        return MRTE_ERROR_FAIL;
76
    }
77
78
    CJieGlobals::Instance()->pfnJPI_AttachCurrentThread = 
79
        (TJpiAttachCurrentThread)pJpiLoader->GetEntry("JPI_AttachCurrentThread");
80
    if (!CJieGlobals::Instance()->pfnJPI_AttachCurrentThread)
81
    {
82
        return MRTE_ERROR_FAIL;
83
    }
84
85
    CJieGlobals::Instance()->pfnJPI_DetachCurrentThread = 
86
        (TJpiDetachCurrentThread)pJpiLoader->GetEntry("JPI_DetachCurrentThread");
87
    if (!CJieGlobals::Instance()->pfnJPI_DetachCurrentThread)
88
    {
89
        return MRTE_ERROR_FAIL;
90
    }
91
    
92
    pJpiLoader->Destroy();
93
94
    return MRTE_RESULT_OK;
95
}
(-)src-native/src/Martini/Infrastructure/Include/ThreadAdaptor.h (-1 / +2 lines)
Lines 60-66 Link Here
60
        // IInstrumentationAdaptor methods
60
        // IInstrumentationAdaptor methods
61
61
62
        virtual TResult Init(Infrastructure::ILogAssert *pLogger = NULL,
62
        virtual TResult Init(Infrastructure::ILogAssert *pLogger = NULL,
63
                             MPI::IEventFilter *pFilter = NULL);
63
                             MPI::IEventFilter *pFilter = NULL,
64
                             MPI::BitSet configFlags = MPI::CF_NONE);
64
65
65
        virtual TResult ModifyClass(MPI::TId classId, 
66
        virtual TResult ModifyClass(MPI::TId classId, 
66
                                    const Infrastructure::SClassFile &classToInstrument,
67
                                    const Infrastructure::SClassFile &classToInstrument,
(-)src-native/src/Martini/Infrastructure/Include/MPI.h (-1 / +1 lines)
Lines 109-115 Link Here
109
109
110
        virtual TResult Configure(BitSet configuration, SConfigData *pConfigData)
110
        virtual TResult Configure(BitSet configuration, SConfigData *pConfigData)
111
        {
111
        {
112
			return (m_pKernel->Configure (configuration));
112
			return (m_pKernel->Configure(configuration));
113
        }
113
        }
114
114
115
        virtual TResult MessageLog(TId clientId, EMessageType msgType, BitSet msgDest, 
115
        virtual TResult MessageLog(TId clientId, EMessageType msgType, BitSet msgDest, 
(-)src-native/src/Martini/Infrastructure/Include/InstrumentationAdaptorBase.h (-5 / +9 lines)
Lines 109-122 Link Here
109
         * Implements initialization common to all adaptors. Adaptor implementations should
109
         * Implements initialization common to all adaptors. Adaptor implementations should
110
         * call this function during initialization.
110
         * call this function during initialization.
111
         *
111
         *
112
         * @param[in] pLogger   : A pointer to an initialized Logger object, to be used
112
         * @param[in] pLogger       : A pointer to an initialized Logger object, to be used
113
         *                        by the instrumentation adaptor for logging messages and 
113
         *                            by the instrumentation adaptor for logging messages and 
114
         *                        reporting fatal errors.
114
         *                            reporting fatal errors.
115
         * @param[in] configFlags   : Optional configuration flags passed to the Martini tool
116
         *                            during its initialization (see MPI::EConfigurationFlags)
115
         *
117
         *
116
         * @retval MRTE_RESULT_OK                   Success
118
         * @retval MRTE_RESULT_OK                   Success
117
         * @retval MRTE_ERROR_FAIL                  Initialization error
119
         * @retval MRTE_ERROR_FAIL                  Initialization error
118
         */
120
         */
119
        TResult Init(Infrastructure::ILogAssert *pLogger = NULL);
121
        TResult Init(Infrastructure::ILogAssert *pLogger = NULL,
122
                     MPI::BitSet configFlags = MPI::CF_NONE);
120
123
121
        /**
124
        /**
122
         * @brief Retrieves Java class information
125
         * @brief Retrieves Java class information
Lines 193-199 Link Here
193
        bool m_bJVMInitDone;                    // Indicates whether the JVM has initialized
196
        bool m_bJVMInitDone;                    // Indicates whether the JVM has initialized
194
        JIE::IJIE* m_pJIE;                      // Java Instrumentation Engine instance
197
        JIE::IJIE* m_pJIE;                      // Java Instrumentation Engine instance
195
        Infrastructure::ILogAssert *m_pLogger;  // Logger instance
198
        Infrastructure::ILogAssert *m_pLogger;  // Logger instance
196
199
        MPI::BitSet m_configFlags;              // Configuration flags
200
        
197
    private:
201
    private:
198
202
199
        /**
203
        /**
(-)src-native/src/Martini/Infrastructure/Include/JPI.H (-1 / +1 lines)
Lines 16-22 Link Here
16
16
17
#include <iostream>
17
#include <iostream>
18
#include "OSA.h"
18
#include "OSA.h"
19
#include "jvmpi.h"
19
#include "jvmti.h"
20
#include "MPI.h"
20
#include "MPI.h"
21
21
22
#ifdef JPI_EXPORTS
22
#ifdef JPI_EXPORTS
(-)src-native/src/Martini/Infrastructure/Include/CGAdaptor.h (-3 / +5 lines)
Lines 61-67 Link Here
61
        // IInstrumentationAdaptor methods
61
        // IInstrumentationAdaptor methods
62
62
63
        virtual TResult Init(Infrastructure::ILogAssert *pLogger = NULL,
63
        virtual TResult Init(Infrastructure::ILogAssert *pLogger = NULL,
64
                             MPI::IEventFilter* pFilter = NULL);
64
                             MPI::IEventFilter* pFilter = NULL,
65
                             MPI::BitSet configFlags = MPI::CF_NONE);
65
66
66
        virtual TResult ModifyClass(MPI::TId classId, 
67
        virtual TResult ModifyClass(MPI::TId classId, 
67
                                    const Infrastructure::SClassFile &classToInstrument,
68
                                    const Infrastructure::SClassFile &classToInstrument,
Lines 125-131 Link Here
125
                                 MIE::TVariableID isJVMInitVar,
126
                                 MIE::TVariableID isJVMInitVar,
126
                                 JIE::TConstantPoolIndex cpiMethodId,
127
                                 JIE::TConstantPoolIndex cpiMethodId,
127
                                 JIE::TConstantPoolIndex cpiLeaveCallback,
128
                                 JIE::TConstantPoolIndex cpiLeaveCallback,
128
                                 bool bJVMInitDone);
129
                                 bool bJVMInitDone,
130
                                 bool bIsConstructor);
129
131
130
        // Adds a static private boolean field to the specified Java class
132
        // Adds a static private boolean field to the specified Java class
131
        // which is used to determine whether a method was called for the first time
133
        // which is used to determine whether a method was called for the first time
Lines 134-140 Link Here
134
                                                MPI::TId methodMPIId);
136
                                                MPI::TId methodMPIId);
135
137
136
        bool IsProblematicMethod(const char *szClassName, const char *szMethodName);
138
        bool IsProblematicMethod(const char *szClassName, const char *szMethodName);
137
        //bool IsConstructor(const JIE::SJavaMethodInfo &methodInfo);
139
        bool IsConstructor(const char *szMethodName);
138
140
139
    }; // class CCGAdaptor
141
    }; // class CCGAdaptor
140
142
(-)src-native/src/Martini/Infrastructure/Include/IKernel.h (-1 / +1 lines)
Lines 25-31 Link Here
25
                                          const char *szOptions) = 0;
25
                                          const char *szOptions) = 0;
26
        virtual SClientInfo *GetClientInfo(MPI::TId id) = 0;
26
        virtual SClientInfo *GetClientInfo(MPI::TId id) = 0;
27
        virtual SClientInfo *GetClientInfo(const char* szProfiler) = 0;
27
        virtual SClientInfo *GetClientInfo(const char* szProfiler) = 0;
28
		virtual TResult Configure(unsigned int configuration) = 0;
28
        virtual TResult Configure(MPI::BitSet configuration) = 0;
29
        virtual TResult SuspendVM() = 0;
29
        virtual TResult SuspendVM() = 0;
30
        virtual TResult ResumeVM() = 0;
30
        virtual TResult ResumeVM() = 0;
31
        virtual TResult RunGC() = 0;
31
        virtual TResult RunGC() = 0;
(-)src-native/src/Martini/Infrastructure/Include/InstrumentationAdaptor.h (-9 / +12 lines)
Lines 69-82 Link Here
69
         *
69
         *
70
         * This function initializes the Instrumentation Adaptor. It is called
70
         * This function initializes the Instrumentation Adaptor. It is called
71
         * prior to any other Adaptor function.
71
         * prior to any other Adaptor function.
72
         *
72
         * 
73
         * @param[in] pLogger   : A pointer to an initialized Logger object, to be used
73
         * @param[in] pLogger       : A pointer to an initialized Logger object, to be used
74
         *                        by the instrumentation adaptor for logging messages and 
74
         *                            by the instrumentation adaptor for logging messages and 
75
         *                        reporting fatal errors.
75
         *                            reporting fatal errors.
76
         * @param[in] pFilter   : An optional pointer to an object implementing the
76
         * @param[in] pFilter       : An optional pointer to an object implementing the
77
         *                        IEventFilter interface. The Adaptor uses this 
77
         *                            IEventFilter interface. The Adaptor uses this 
78
         *                        object to determine which elements of the class file
78
         *                            object to determine which elements of the class file
79
         *                        should be instrumented.
79
         *                            should be instrumented.
80
         * @param[in] configFlags   : Optional configuration flags passed to the Martini tool
81
         *                            during its initialization (see MPI::EConfigurationFlags)
80
         *
82
         *
81
         * @retval MRTE_RESULT_OK                   Success
83
         * @retval MRTE_RESULT_OK                   Success
82
         * @retval MRTE_ERROR_FAIL                  Initialization error
84
         * @retval MRTE_ERROR_FAIL                  Initialization error
Lines 84-90 Link Here
84
         *                                          by the adaptor module
86
         *                                          by the adaptor module
85
         */
87
         */
86
        virtual TResult Init(Infrastructure::ILogAssert *pLogger = NULL,
88
        virtual TResult Init(Infrastructure::ILogAssert *pLogger = NULL,
87
                             MPI::IEventFilter* pFilter = NULL) = 0;
89
                             MPI::IEventFilter* pFilter = NULL,
90
                             MPI::BitSet configFlags = MPI::CF_NONE) = 0;
88
91
89
        /**
92
        /**
90
         * @brief Modifies a Java class file
93
         * @brief Modifies a Java class file
(-)src-native/src/Martini/Infrastructure/Include/HeapAdaptor.h (-1 / +2 lines)
Lines 69-75 Link Here
69
        // IInstrumentationAdaptor methods
69
        // IInstrumentationAdaptor methods
70
70
71
        virtual TResult Init(Infrastructure::ILogAssert *pLogger = NULL,
71
        virtual TResult Init(Infrastructure::ILogAssert *pLogger = NULL,
72
                             MPI::IEventFilter* pFilter = NULL);
72
                             MPI::IEventFilter* pFilter = NULL,
73
                             MPI::BitSet configFlags = MPI::CF_NONE);
73
74
74
        virtual TResult ModifyClass(MPI::TId classId, 
75
        virtual TResult ModifyClass(MPI::TId classId, 
75
                                    const Infrastructure::SClassFile &classToInstrument,
76
                                    const Infrastructure::SClassFile &classToInstrument,
(-)src-native/src/JPIAgent/Options.h (+5 lines)
Lines 54-59 Link Here
54
        unsigned int allocSites:1;                 /* Print allocsites information*/
54
        unsigned int allocSites:1;                 /* Print allocsites information*/
55
        enum TraceFormat format;				   /* Binary or XML output format*/
55
        enum TraceFormat format;				   /* Binary or XML output format*/
56
        unsigned int contAnalysis:1;               /* Provide information for contention analysis*/
56
        unsigned int contAnalysis:1;               /* Provide information for contention analysis*/
57
        unsigned int calcStackMap:1;               /* Enables recalculation of the StackMapTable attribute for Java class versions >= 50.0 */
57
        enum StackInfo stackInfo;                  /* Stack maintenance mode  (StackInfoContiguous)*/
58
        enum StackInfo stackInfo;                  /* Stack maintenance mode  (StackInfoContiguous)*/
58
        char *invocationOptions;                   /* The invocation options from the command line */
59
        char *invocationOptions;                   /* The invocation options from the command line */
59
        char *filterFileName;                      /* Name of the filters file (filters.txt)*/
60
        char *filterFileName;                      /* Name of the filters file (filters.txt)*/
Lines 159-164 Link Here
159
            return m_jvmtiAgent_Options.contAnalysis == 1;
160
            return m_jvmtiAgent_Options.contAnalysis == 1;
160
        }
161
        }
161
        
162
        
163
        // Is StackMap calculation enabled for Java class file versions >= 50.0 (Java 6)
164
        bool isCalcStackMap() {
165
            return m_jvmtiAgent_Options.calcStackMap == 1;
166
        }
162
167
163
        const char* getUnknownOptionByName( const char* name );
168
        const char* getUnknownOptionByName( const char* name );
164
169
(-)src-native/src/JPIAgent/Options.cpp (-3 / +11 lines)
Lines 70-76 Link Here
70
        ,1                         /* Call graph profiler specific option.*/
70
        ,1                         /* Call graph profiler specific option.*/
71
        ,0
71
        ,0
72
        ,XmlFormat		           /* Default output format.*/
72
        ,XmlFormat		           /* Default output format.*/
73
		,0						   /* */
73
		,0						   /* ThreadProf option: contention analysis (off) */
74
        ,0                         /* Global option: StackMapTable calculation (off) */
74
        ,StackInfoNormal           /* Stack mode preference (default) */
75
        ,StackInfoNormal           /* Stack mode preference (default) */
75
        ,0                         /* The invocation options from the command line */
76
        ,0                         /* The invocation options from the command line */
76
        ,0                         /* Filter File  (to be initialized) */
77
        ,0                         /* Filter File  (to be initialized) */
Lines 78-84 Link Here
78
        ,0                         /* Default process type (to be initialized) */
79
        ,0                         /* Default process type (to be initialized) */
79
        ,0                         /* Default trace file name (to be initialized) */
80
        ,0                         /* Default trace file name (to be initialized) */
80
        ,0                         /* Default profile file name (to be initialized) */
81
        ,0                         /* Default profile file name (to be initialized) */
81
        ,0                         /* Defualt working dir (to be initialized) */
82
        ,0                         /* Default working dir (to be initialized) */
82
        ,0                         /* currently no unknown options */ 
83
        ,0                         /* currently no unknown options */ 
83
};
84
};
84
85
Lines 137-143 Link Here
137
        "\n"
138
        "\n"
138
        "Supported option names and values:\n"
139
        "Supported option names and values:\n"
139
        "  server=standalone|enabled|controlled\n" 
140
        "  server=standalone|enabled|controlled\n" 
140
        "  api=true|false\tWhether to enable the Profiler API (true) or not (false). Default is false.\n" 
141
        "  api=true|false\tWhether to enable the Profiler API or not.\n"
142
        "  \t\t\tDefault is false.\n" 
143
        "  stackmap=true|false\tWhether to recalculate the StackMapTable attribute of\n"
144
        "  \t\t\tinstrumented methods.\n"
145
        "  \t\t\tUse only when experiencing verification errors in \n"
146
        "  \t\t\tJava 1.6+. Default is false.\n"
141
        "  file=<file>\t\tOutput file (default is %s)\n"
147
        "  file=<file>\t\tOutput file (default is %s)\n"
142
        "  \t\t\tOnly applicable when server=standalone\n"
148
        "  \t\t\tOnly applicable when server=standalone\n"
143
        "  filters=<file>\tFilter definition file (default is %s)\n"
149
        "  filters=<file>\tFilter definition file (default is %s)\n"
Lines 302-307 Link Here
302
        m_jvmtiAgent_Options.allocSites = setBooleanOption(value, key, m_jvmtiAgent_Options.allocSites);
308
        m_jvmtiAgent_Options.allocSites = setBooleanOption(value, key, m_jvmtiAgent_Options.allocSites);
303
    } else if (STRICOLL(key, "CONTANALYSIS") == 0) {
309
    } else if (STRICOLL(key, "CONTANALYSIS") == 0) {
304
        m_jvmtiAgent_Options.contAnalysis = setBooleanOption(value, key, m_jvmtiAgent_Options.contAnalysis);
310
        m_jvmtiAgent_Options.contAnalysis = setBooleanOption(value, key, m_jvmtiAgent_Options.contAnalysis);
311
    } else if (STRICOLL(key, "STACKMAP") == 0) {
312
        m_jvmtiAgent_Options.calcStackMap = setBooleanOption(value, key, m_jvmtiAgent_Options.calcStackMap);
305
    } else {
313
    } else {
306
        /* 60879 add the unknown profiling option to the 'unknowns' list so that we 
314
        /* 60879 add the unknown profiling option to the 'unknowns' list so that we 
307
        can echo it back to the UI */ 
315
        can echo it back to the UI */ 
(-)src-native/src/JPIAgent/ECWrapper.cpp (+7 lines)
Lines 596-601 Link Here
596
}
596
}
597
597
598
EC_EXPORT bool ECCALL
598
EC_EXPORT bool ECCALL
599
isCalcStackMap(EC_Env* env)
600
{
601
    return ECWrapper::m_pCOptions->isCalcStackMap();
602
}
603
604
EC_EXPORT bool ECCALL
599
isStackMemoryFree(EC_Env* env)
605
isStackMemoryFree(EC_Env* env)
600
{
606
{
601
    return ECWrapper::m_pCOptions->isStackMemoryFree();
607
    return ECWrapper::m_pCOptions->isStackMemoryFree();
Lines 690-695 Link Here
690
    ECWrapper::m_ECFunctions.isEnabled = &isEnabled;
696
    ECWrapper::m_ECFunctions.isEnabled = &isEnabled;
691
    ECWrapper::m_ECFunctions.isAllocSitesSupported = &isAllocSitesSupported;
697
    ECWrapper::m_ECFunctions.isAllocSitesSupported = &isAllocSitesSupported;
692
    ECWrapper::m_ECFunctions.isContentionAnalysisSupported = &isContentionAnalysisSupported;
698
    ECWrapper::m_ECFunctions.isContentionAnalysisSupported = &isContentionAnalysisSupported;
699
    ECWrapper::m_ECFunctions.isCalcStackMap = &isCalcStackMap;
693
    ECWrapper::m_ECFunctions.getUnknownOptionByName = &getUnknownOptionByName;
700
    ECWrapper::m_ECFunctions.getUnknownOptionByName = &getUnknownOptionByName;
694
    ECWrapper::m_ECFunctions.VMInitDone = &VMInitDone;
701
    ECWrapper::m_ECFunctions.VMInitDone = &VMInitDone;
695
    ECWrapper::m_EC_Env.functions = &ECWrapper::m_ECFunctions;
702
    ECWrapper::m_EC_Env.functions = &ECWrapper::m_ECFunctions;
(-)src-native/src/Martini/Infrastructure/HeapAdaptor/HeapAdaptor.cpp (-2 / +4 lines)
Lines 80-89 Link Here
80
    }
80
    }
81
}
81
}
82
82
83
TResult CHeapAdaptor::Init(ILogAssert *pLogger, MPI::IEventFilter* pFilter)
83
TResult CHeapAdaptor::Init(ILogAssert *pLogger, 
84
                           MPI::IEventFilter* pFilter,
85
                           MPI::BitSet configFlags)
84
{
86
{
85
    // Call common initializer
87
    // Call common initializer
86
    TResult res = CInstrumentationAdaptorBase::Init(pLogger);
88
    TResult res = CInstrumentationAdaptorBase::Init(pLogger, configFlags);
87
    if (MRTE_FAILED(res))
89
    if (MRTE_FAILED(res))
88
    {
90
    {
89
        return MRTE_ERROR_FAIL;
91
        return MRTE_ERROR_FAIL;
(-)src-native/src/Martini/Infrastructure/JPI/JpiGlobals.cpp (-1 / +1 lines)
Lines 29-35 Link Here
29
    : pfnMethodEnterHandler(NULL), pfnMethodLeaveHandler(NULL), 
29
    : pfnMethodEnterHandler(NULL), pfnMethodLeaveHandler(NULL), 
30
    pfnMethodLeaveWithExcetionHandler(NULL), pfnObjectAllocHandler(NULL),
30
    pfnMethodLeaveWithExcetionHandler(NULL), pfnObjectAllocHandler(NULL),
31
    pfnArrayAllocHandler(NULL), pJvmInterface(NULL), bJvmInitDone(false),
31
    pfnArrayAllocHandler(NULL), pJvmInterface(NULL), bJvmInitDone(false),
32
    m_ptlsMpiThreadStatus(NULL)
32
    m_ptlsMpiThreadStatus(NULL), configFlags(MPI::CF_NONE), pConfigData(NULL)
33
{
33
{
34
    if (!m_ptlsMpiThreadStatus)
34
    if (!m_ptlsMpiThreadStatus)
35
    {
35
    {
(-)src-native/src/Martini/Infrastructure/JPI/JPIKernel.cpp (+6 lines)
Lines 491-493 Link Here
491
491
492
    return res;
492
    return res;
493
}
493
}
494
495
TResult CJPIKernel::Configure(BitSet configuration)
496
{
497
    CJpiGlobals::Instance()->configFlags = configuration;
498
    return MRTE_RESULT_OK;
499
}
(-)src-native/src/Martini/Infrastructure/JPI/JpiGlobals.h (+6 lines)
Lines 128-133 Link Here
128
128
129
        // VM initialization status
129
        // VM initialization status
130
        bool bJvmInitDone;
130
        bool bJvmInitDone;
131
132
        // JPI Configuration flags (one or more MPI::EConfigurationFlags values)
133
        MPI::BitSet configFlags;
134
135
        // JPI Configuration data
136
        MPI::SConfigData* pConfigData;
131
        
137
        
132
    private:
138
    private:
133
        CJpiGlobals();
139
        CJpiGlobals();
(-)src-native/src/Martini/Infrastructure/JPI/JavaInstrumentorManager.cpp (-7 / +24 lines)
Lines 295-301 Link Here
295
//////////////////////////////////////////////////////////////////////////
295
//////////////////////////////////////////////////////////////////////////
296
// CCgAdaptorDelegate
296
// CCgAdaptorDelegate
297
297
298
TResult CCgAdaptorDelegate::Init(ILogAssert *pLogger, MPI::IEventFilter *pFilter)
298
TResult CCgAdaptorDelegate::Init(ILogAssert *pLogger, 
299
                                 MPI::IEventFilter *pFilter,
300
                                 MPI::BitSet configFlags)
299
{
301
{
300
    MPI::ICallGraphFilter *pCgFilter = (MPI::ICallGraphFilter*)pFilter;
302
    MPI::ICallGraphFilter *pCgFilter = (MPI::ICallGraphFilter*)pFilter;
301
    m_CGFilterProxy.Init(pCgFilter);
303
    m_CGFilterProxy.Init(pCgFilter);
Lines 326-332 Link Here
326
    }
328
    }
327
329
328
    // Initialize the Adaptor
330
    // Initialize the Adaptor
329
    TResult res = m_pAdaptor->Init(CLogAssert::GetInstance(), &m_CGFilterProxy);
331
    TResult res = m_pAdaptor->Init(CLogAssert::GetInstance(), &m_CGFilterProxy, configFlags);
330
    return res;    
332
    return res;    
331
}
333
}
332
334
Lines 479-485 Link Here
479
481
480
482
481
483
482
TResult CThreadAdaptorDelegate::Init(ILogAssert *pLogger, MPI::IEventFilter *pFilter)
484
TResult CThreadAdaptorDelegate::Init(ILogAssert *pLogger, 
485
                                     MPI::IEventFilter *pFilter,
486
                                     MPI::BitSet configFlags)
483
{
487
{
484
    //Add filtering support
488
    //Add filtering support
485
    MPI::IThreadInteractionFilter *pThreadInteractionFilter = (MPI::IThreadInteractionFilter*)pFilter;
489
    MPI::IThreadInteractionFilter *pThreadInteractionFilter = (MPI::IThreadInteractionFilter*)pFilter;
Lines 511-517 Link Here
511
    }
515
    }
512
516
513
    // Initialize the Adaptor
517
    // Initialize the Adaptor
514
    TResult res = m_pAdaptor->Init(CLogAssert::GetInstance(), &m_ThreadInteractionFilterProxy); 
518
    TResult res = m_pAdaptor->Init(CLogAssert::GetInstance(), &m_ThreadInteractionFilterProxy,
519
        configFlags); 
515
    return MRTE_RESULT_OK;
520
    return MRTE_RESULT_OK;
516
}
521
}
517
522
Lines 730-736 Link Here
730
//////////////////////////////////////////////////////////////////////////
735
//////////////////////////////////////////////////////////////////////////
731
// CHeapAdaptorDelegate
736
// CHeapAdaptorDelegate
732
737
733
TResult CHeapAdaptorDelegate::Init(ILogAssert *pLogger, MPI::IEventFilter *pFilter)
738
TResult CHeapAdaptorDelegate::Init(ILogAssert *pLogger, 
739
                                   MPI::IEventFilter *pFilter,
740
                                   MPI::BitSet configFlags)
734
{
741
{
735
    if (!m_pAdaptor)
742
    if (!m_pAdaptor)
736
    {
743
    {
Lines 758-764 Link Here
758
    }
765
    }
759
766
760
    // Initialize the Adaptor
767
    // Initialize the Adaptor
761
    TResult res = m_pAdaptor->Init(CLogAssert::GetInstance());
768
    TResult res = m_pAdaptor->Init(CLogAssert::GetInstance(), NULL, configFlags);
762
    return res;    
769
    return res;    
763
}
770
}
764
771
Lines 1036-1042 Link Here
1036
    m_pAdaptor = CAdaptorFactory::Instance()->CreateAdaptor(group);
1043
    m_pAdaptor = CAdaptorFactory::Instance()->CreateAdaptor(group);
1037
    if (NULL != m_pAdaptor)
1044
    if (NULL != m_pAdaptor)
1038
    {
1045
    {
1039
        res = m_pAdaptor->Init(CLogAssert::GetInstance(), pEventFilter);
1046
        res = m_pAdaptor->Init(CLogAssert::GetInstance(), pEventFilter, 
1047
            CJpiGlobals::Instance()->configFlags);
1040
    }
1048
    }
1041
    return res;
1049
    return res;
1042
}
1050
}
Lines 1211-1216 Link Here
1211
        return;
1219
        return;
1212
    }
1220
    }
1213
1221
1222
    // If StackMapTable attribute calculation is enabled, then bootstrap classes
1223
    // (i.e., classes loaded before VMInit) are not instrumented.
1224
    if ((CJpiGlobals::Instance()->configFlags & MPI::CF_JAVA_ENABLE_STACKMAP_CALC)
1225
        && !m_bJVMInit)
1226
    {
1227
        SetClassFileNotInstrumented(pJVMEvent);
1228
        return;
1229
    }
1230
1214
    TResult iRetVal = MRTE_RESULT_OK;
1231
    TResult iRetVal = MRTE_RESULT_OK;
1215
    if (m_bIsTentativeInstrumentation && !m_bHasFirstClassLoadHookArrived)
1232
    if (m_bIsTentativeInstrumentation && !m_bHasFirstClassLoadHookArrived)
1216
    {
1233
    {
(-)src-native/src/Martini/Infrastructure/JPI/JPIKernel.h (-5 / +1 lines)
Lines 50-60 Link Here
50
                                          const char *szOptions);
50
                                          const char *szOptions);
51
        virtual Infrastructure::SClientInfo *GetClientInfo(MPI::TId id);
51
        virtual Infrastructure::SClientInfo *GetClientInfo(MPI::TId id);
52
        virtual Infrastructure::SClientInfo *GetClientInfo(const char* szClientName);
52
        virtual Infrastructure::SClientInfo *GetClientInfo(const char* szClientName);
53
        virtual TResult Configure(unsigned int configuration) 
53
        virtual TResult Configure(MPI::BitSet configuration);
54
        {
55
            return MRTE_ERROR_NOT_SUPPORTED;
56
        }
57
58
        virtual TResult SuspendVM();
54
        virtual TResult SuspendVM();
59
        virtual TResult ResumeVM();
55
        virtual TResult ResumeVM();
60
        virtual TResult RunGC();
56
        virtual TResult RunGC();
(-)src-native/src/Martini/Infrastructure/JPI/JavaInstrumentorManager.h (-3 / +6 lines)
Lines 79-85 Link Here
79
        // IInstrumentationAdaptor methods
79
        // IInstrumentationAdaptor methods
80
80
81
        virtual TResult Init(Infrastructure::ILogAssert *pLogger = NULL,
81
        virtual TResult Init(Infrastructure::ILogAssert *pLogger = NULL,
82
                             MPI::IEventFilter* pFilter = NULL);
82
                             MPI::IEventFilter* pFilter = NULL,
83
                             MPI::BitSet configFlags = MPI::CF_NONE);
83
        virtual TResult ModifyClass(MPI::TId classId, 
84
        virtual TResult ModifyClass(MPI::TId classId, 
84
                                    const Infrastructure::SClassFile &classToInstrument,
85
                                    const Infrastructure::SClassFile &classToInstrument,
85
                                    TMemoryAllocatorFunc funcAllocator,
86
                                    TMemoryAllocatorFunc funcAllocator,
Lines 122-128 Link Here
122
        // IInstrumentationAdaptor methods
123
        // IInstrumentationAdaptor methods
123
124
124
        virtual TResult Init(Infrastructure::ILogAssert *pLogger = NULL,
125
        virtual TResult Init(Infrastructure::ILogAssert *pLogger = NULL,
125
                             MPI::IEventFilter* pFilter = NULL);
126
                             MPI::IEventFilter* pFilter = NULL,
127
                             MPI::BitSet configFlags = MPI::CF_NONE);
126
        virtual TResult ModifyClass(MPI::TId classId, 
128
        virtual TResult ModifyClass(MPI::TId classId, 
127
                                    const Infrastructure::SClassFile &classToInstrument,
129
                                    const Infrastructure::SClassFile &classToInstrument,
128
                                    TMemoryAllocatorFunc funcAllocator,
130
                                    TMemoryAllocatorFunc funcAllocator,
Lines 146-152 Link Here
146
        // IInstrumentationAdaptor methods
148
        // IInstrumentationAdaptor methods
147
149
148
        virtual TResult Init(Infrastructure::ILogAssert *pLogger = NULL,
150
        virtual TResult Init(Infrastructure::ILogAssert *pLogger = NULL,
149
                             MPI::IEventFilter *pFilter = NULL);
151
                             MPI::IEventFilter* pFilter = NULL,
152
                             MPI::BitSet configFlags = MPI::CF_NONE);
150
        virtual TResult ModifyClass(MPI::TId classId, 
153
        virtual TResult ModifyClass(MPI::TId classId, 
151
                                    const Infrastructure::SClassFile &classToInstrument,
154
                                    const Infrastructure::SClassFile &classToInstrument,
152
                                    TMemoryAllocatorFunc funcAllocator,
155
                                    TMemoryAllocatorFunc funcAllocator,
(-)src-native/include/JPIAgent/EC_Env.h (+5 lines)
Lines 96-101 Link Here
96
    bool (ECCALL *isEnabled)(EC_Env* env);
96
    bool (ECCALL *isEnabled)(EC_Env* env);
97
    bool (ECCALL *isAllocSitesSupported)(EC_Env* env);
97
    bool (ECCALL *isAllocSitesSupported)(EC_Env* env);
98
    bool (ECCALL *isContentionAnalysisSupported)(EC_Env* env);
98
    bool (ECCALL *isContentionAnalysisSupported)(EC_Env* env);
99
    bool (ECCALL *isCalcStackMap)(EC_Env* env);
99
100
100
	const char*(ECCALL *getUnknownOptionByName)(EC_Env* env, const char* name);
101
	const char*(ECCALL *getUnknownOptionByName)(EC_Env* env, const char* name);
101
102
Lines 242-247 Link Here
242
        return functions->isContentionAnalysisSupported(this);
243
        return functions->isContentionAnalysisSupported(this);
243
    }
244
    }
244
245
246
    bool isCalcStackMap() {
247
        return functions->isCalcStackMap(this);
248
    }
249
245
	const char* getUnknownOptionByName( const char* name ) {
250
	const char* getUnknownOptionByName( const char* name ) {
246
		return functions->getUnknownOptionByName(this, name);
251
		return functions->getUnknownOptionByName(this, name);
247
	}
252
	}
(-)src-native/src/Martini/Infrastructure/ThreadAdaptor/ThreadAdaptor.cpp (-2 / +4 lines)
Lines 86-95 Link Here
86
{
86
{
87
}
87
}
88
88
89
TResult CThreadAdaptor::Init(ILogAssert *pLogger, MPI::IEventFilter *pFilter)
89
TResult CThreadAdaptor::Init(ILogAssert *pLogger, 
90
                             MPI::IEventFilter *pFilter,
91
                             MPI::BitSet configFlags)
90
{
92
{
91
    // Call common initializer
93
    // Call common initializer
92
    TResult res = CInstrumentationAdaptorBase::Init(pLogger);
94
    TResult res = CInstrumentationAdaptorBase::Init(pLogger, configFlags);
93
    if (MRTE_FAILED(res))
95
    if (MRTE_FAILED(res))
94
    {
96
    {
95
        return MRTE_ERROR_FAIL;
97
        return MRTE_ERROR_FAIL;
(-)src-native/src/Martini/Infrastructure/CGAdaptor/CGAdaptor.cpp (-13 / +68 lines)
Lines 17-22 Link Here
17
#include "HeapProxy.h"
17
#include "HeapProxy.h"
18
#include "ThreadProxy.h"
18
#include "ThreadProxy.h"
19
#include "ValidityChecks.h"
19
#include "ValidityChecks.h"
20
#include "MRTEInfrastructureDefinitions.h"
20
21
21
#include <assert.h>
22
#include <assert.h>
22
#include <string.h>
23
#include <string.h>
Lines 67-76 Link Here
67
    }
68
    }
68
}
69
}
69
70
70
TResult CCGAdaptor::Init(ILogAssert *pLogger, MPI::IEventFilter* pFilter)
71
TResult CCGAdaptor::Init(ILogAssert *pLogger, 
72
                         MPI::IEventFilter* pFilter,
73
                         MPI::BitSet configFlags)
71
{
74
{
72
    // Call common initializer
75
    // Call common initializer
73
    TResult res = CInstrumentationAdaptorBase::Init(pLogger);
76
    TResult res = CInstrumentationAdaptorBase::Init(pLogger, configFlags);
74
    if (MRTE_FAILED(res))
77
    if (MRTE_FAILED(res))
75
    {
78
    {
76
        return MRTE_ERROR_FAIL;
79
        return MRTE_ERROR_FAIL;
Lines 378-384 Link Here
378
    // If no methods were instrumented, modify the return code to indicate this
381
    // If no methods were instrumented, modify the return code to indicate this
379
    if (MRTE_SUCCEEDED(res) && instrMethodCount == 0)
382
    if (MRTE_SUCCEEDED(res) && instrMethodCount == 0)
380
    {
383
    {
381
        LOG_INFORMATIVE1("CGAdaptor", 3, false, "Class %s was not instrumented because all its methods were excluded", 
384
        LOG_INFORMATIVE1("CGAdaptor", 3, false, 
385
            "Class %s was not instrumented because all its methods were excluded", 
382
            classInfo.szClassName);
386
            classInfo.szClassName);
383
        res = MRTE_ERROR_INSTRUMENTATION_NOT_NEEDED;
387
        res = MRTE_ERROR_INSTRUMENTATION_NOT_NEEDED;
384
    }
388
    }
Lines 681-687 Link Here
681
    }
685
    }
682
686
683
    res = InjectEpilogCode(pMethod, pInstructionsIter, pOriginalFirstInstr, isJVMInitVar, 
687
    res = InjectEpilogCode(pMethod, pInstructionsIter, pOriginalFirstInstr, isJVMInitVar, 
684
        cpMethodId, cpLeaveCallback, bJVMInitDone);
688
        cpMethodId, cpLeaveCallback, bJVMInitDone,
689
        IsConstructor(pInfo->szName));
690
691
    if (MRTE_RESULT_OK != res)
692
    {
693
        return res;
694
    }
685
695
686
    pInstructionsIter->Free();
696
    pInstructionsIter->Free();
687
    res = pMethod->ApplyInstrumentation();
697
    res = pMethod->ApplyInstrumentation();
Lines 837-843 Link Here
837
                                     TVariableID isJVMInitVar,
847
                                     TVariableID isJVMInitVar,
838
                                     TConstantPoolIndex cpiMethodId,
848
                                     TConstantPoolIndex cpiMethodId,
839
                                     TConstantPoolIndex cpiLeaveCallback,
849
                                     TConstantPoolIndex cpiLeaveCallback,
840
                                     bool bJVMInitDone)
850
                                     bool bJVMInitDone,
851
                                     bool bIsConstructor)
841
{
852
{
842
    TResult res;
853
    TResult res;
843
854
Lines 899-906 Link Here
899
    // whether the method terminates normally or abnormally
910
    // whether the method terminates normally or abnormally
900
911
901
    IInstruction *pStartTry;
912
    IInstruction *pStartTry;
902
    pInstructionsIter->GetFirst();
913
    if (bIsConstructor)
903
    pStartTry = pOriginalFirstMethodInst;
914
    {
915
        // The instrumented method is a constructor. The protected block should start
916
        // only after the call to the constructor of the superclass (or another constructor
917
        // of the current class) to prevent verification issues 
918
        // (see https://bugs.eclipse.org/170075)
919
920
        // Find where the original method code starts (need to skip the injected prolog)
921
        pStartTry = pInstructionsIter->GetFirst();
922
        while (pStartTry != pOriginalFirstMethodInst && pStartTry != NULL)
923
        {
924
            pStartTry = pInstructionsIter->GetNext();
925
        }
926
        if (NULL == pStartTry)
927
        {
928
            LOG_INFORMATIVE("CGAdaptor", 0, false, 
929
                "Cannot find the first instruction of the method");
930
            return MRTE_ERROR_FAIL;
931
        }
932
933
        // Search for the first "invokespecial" instruction.
934
        // Since this is a constructor, it is expected to have an "invokespecial" of another
935
        // constructor in this class or in its superclass
936
        //
937
        // If this is not the case (may happen for generated or instrumented code) the
938
        // constructor will not be instrumented
939
        while (pStartTry != NULL
940
            && pStartTry->GetMnemonic() != MNM_INVOKESPECIAL)
941
        {
942
            pStartTry = pInstructionsIter->GetNext();
943
        }
944
        if (pStartTry != NULL 
945
            && pStartTry->GetMnemonic() == MNM_INVOKESPECIAL)
946
        {
947
            // Assume this is the constructor invocation
948
            pStartTry = pInstructionsIter->GetNext();
949
        }
950
        else
951
        {
952
            LOG_INFORMATIVE("CGAdaptor", 0, false, 
953
                "Constructor method does not start with invocation of super-constructor. "
954
                "Method will not be instrumented");
955
            return MRTE_ERROR_UNABLE_TO_INSTRUMENT;
956
        }
957
    }
958
    else
959
    {
960
        // Regular method. The protected block spans the entire (original) method code
961
        pStartTry = pOriginalFirstMethodInst;
962
    }
904
    res = pMethod->BindTryFinallyBlock(pStartTry, pLastMethodInstruction,
963
    res = pMethod->BindTryFinallyBlock(pStartTry, pLastMethodInstruction,
905
        pFirstInstInFinally, pLastInstInFinally);
964
        pFirstInstInFinally, pLastInstInFinally);
906
965
Lines 953-964 Link Here
953
    return MRTE_RESULT_OK;
1012
    return MRTE_RESULT_OK;
954
}
1013
}
955
1014
956
/*
1015
bool CCGAdaptor::IsConstructor(const char *szMethodName)
957
bool CCGAdaptor::IsConstructor(const SJavaMethodInfo &methodInfo)
958
{
1016
{
959
    bool bIsCtor;
1017
    bool bIsCtor;
960
    char *szName = CWideStringUtils::WideStringToCString(methodInfo.methodName);
1018
    if (strcmp(szMethodName, JAVA_INSTANCE_CONSTRUCTOR_NAME) == 0)
961
    if (strcmp(szName, JAVA_INSTANCE_CONSTRUCTOR_NAME) == 0)
962
    {
1019
    {
963
        bIsCtor = true;
1020
        bIsCtor = true;
964
    }
1021
    }
Lines 966-975 Link Here
966
    {
1023
    {
967
        bIsCtor = false;
1024
        bIsCtor = false;
968
    }
1025
    }
969
    delete szName;
970
    return bIsCtor;
1026
    return bIsCtor;
971
}
1027
}
972
*/
973
1028
974
bool CCGAdaptor::IsProblematicMethod(const char *szClassName, 
1029
bool CCGAdaptor::IsProblematicMethod(const char *szClassName, 
975
                                     const char *szMethodName)
1030
                                     const char *szMethodName)
(-)src-native/src/Martini/Infrastructure/CGAdaptor/.cvsignore (+1 lines)
Line 1 Link Here
1
debug
1
debug
2
CGAdaptor.plg
(-)src-native/src/BaseProf/BaseProfiler.cpp (+5 lines)
Lines 64-69 Link Here
64
        return retVal;
64
        return retVal;
65
    }
65
    }
66
66
67
    if (m_pProfEnv.ec_env->isCalcStackMap()) {
68
        pMpiApi->Configure(CF_JAVA_ENABLE_STACKMAP_CALC);
69
    }
70
71
67
    retVal = InitFilter();
72
    retVal = InitFilter();
68
    return retVal;
73
    return retVal;
69
}
74
}
(-)src-native/src/Martini/Infrastructure/common/InstrumentationAdaptorBase.cpp (-2 / +9 lines)
Lines 46-52 Link Here
46
// Default constructor
46
// Default constructor
47
//
47
//
48
CInstrumentationAdaptorBase::CInstrumentationAdaptorBase()
48
CInstrumentationAdaptorBase::CInstrumentationAdaptorBase()
49
    : m_bJVMInitDone(false), m_pLogger(NULL)
49
: m_bJVMInitDone(false), m_pLogger(NULL), m_configFlags(MPI::CF_NONE)
50
{
50
{
51
}
51
}
52
52
Lines 57-75 Link Here
57
{
57
{
58
}
58
}
59
59
60
TResult CInstrumentationAdaptorBase::Init(ILogAssert *pLogger)
60
TResult CInstrumentationAdaptorBase::Init(ILogAssert *pLogger /* = NULL */, 
61
                                          MPI::BitSet configFlags /* = MPI::CF_NONE */)
61
{
62
{
62
    m_pLogger = pLogger;
63
    m_pLogger = pLogger;
64
    m_configFlags = configFlags;
63
    m_pJIE = InitJIE();
65
    m_pJIE = InitJIE();
64
    if (NULL == m_pJIE)
66
    if (NULL == m_pJIE)
65
    {
67
    {
66
        return MRTE_ERROR_FAIL;
68
        return MRTE_ERROR_FAIL;
67
    }
69
    }
70
68
    return MRTE_RESULT_OK;
71
    return MRTE_RESULT_OK;
69
}
72
}
70
73
71
void CInstrumentationAdaptorBase::JvmInitDone()
74
void CInstrumentationAdaptorBase::JvmInitDone()
72
{
75
{
76
    if (m_configFlags & MPI::CF_JAVA_ENABLE_STACKMAP_CALC)
77
    {
78
        m_pJIE->EnableStackMapCalculation();
79
    }
73
    m_bJVMInitDone = true;
80
    m_bJVMInitDone = true;
74
}
81
}
75
82
(-)src-native/src/Martini/Include/JIE.h (+9 lines)
Lines 584-589 Link Here
584
         */
584
         */
585
        virtual IJavaClass *GetClassInterface(const unsigned char *pucClassFile,
585
        virtual IJavaClass *GetClassInterface(const unsigned char *pucClassFile,
586
                                              unsigned int uiClassSize) const = 0;
586
                                              unsigned int uiClassSize) const = 0;
587
588
589
        /**
590
         * @brief enable the creation of the StackMapTable method
591
         * attribute when instrumenting Java classes with version >= 50.0 
592
         * (Java 6 and above)
593
         */
594
        virtual void EnableStackMapCalculation() const = 0;
595
587
    };
596
    };
588
597
589
    /**
598
    /**
(-)src-native/include/Martini/MpiAPI.h (-1 / +6 lines)
Lines 170-175 Link Here
170
        //!< None
170
        //!< None
171
        CF_NONE                                                 = 0x00000000,
171
        CF_NONE                                                 = 0x00000000,
172
172
173
        //! @brief Set this to enable the creation of the StackMapTable method
174
        //! attribute when instrumenting Java classes with version >= 50.0 
175
        //! (Java 6 and above)
176
        CF_JAVA_ENABLE_STACKMAP_CALC                            = 0x00000001,
177
173
		//! @brief Set this to receive native VM id's instead of MPI allocated id's. 
178
		//! @brief Set this to receive native VM id's instead of MPI allocated id's. 
174
        //! Applies for the following MPI elements: thread, module, class and method
179
        //! Applies for the following MPI elements: thread, module, class and method
175
        CF_DOTNET_USE_VM_IDS                                    = 0x00010000,  
180
        CF_DOTNET_USE_VM_IDS                                    = 0x00010000,  
Lines 181-187 Link Here
181
		CF_DOTNET_DISABLE_PREJIT_USE                            = 0x00040000,
186
		CF_DOTNET_DISABLE_PREJIT_USE                            = 0x00040000,
182
187
183
        //! @brief End sentinel
188
        //! @brief End sentinel
184
        CF_LAST                                                 = 0x80080000
189
        CF_LAST                                                 = 0x80100000
185
    };
190
    };
186
191
187
    /**
192
    /**
(-)readme.txt (-2 / +7 lines)
Lines 1-5 Link Here
1
/****************************************************************************
1
/****************************************************************************
2
 * Copyright (c) 2005 - 2007 Intel Corporation.
2
 * Copyright (c) 2005 - 2008 Intel Corporation.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 20-25 Link Here
20
    (Martini SDK)
20
    (Martini SDK)
21
Alexander Alexeev, Intel
21
Alexander Alexeev, Intel
22
Stanislav V. Polevic, Intel
22
Stanislav V. Polevic, Intel
23
Vasily Levchenko, Intel
23
24
24
JVMTI Profiler in TPTP 4.4
25
JVMTI Profiler in TPTP 4.4
25
26
Lines 79-85 Link Here
79
                      a file named jvmti.pro in the current directory 
80
                      a file named jvmti.pro in the current directory 
80
                      (if such file exists). 
81
                      (if such file exists). 
81
                      Only applicable when server=standalone.
82
                      Only applicable when server=standalone.
82
83
    api=true|false - Whether to enable the Profiler API or not. Default is false.
84
    stackmap=true|false - Whether to recalculate the StackMapTable attribute of
85
                          instrumented methods. 
86
                          Use only when experiencing verification errors in 
87
						  Java 1.6+. Default is false.
83
  <profiler> - the profiler to launch:
88
  <profiler> - the profiler to launch:
84
    CGProf – execution time analysis
89
    CGProf – execution time analysis
85
    Supported options:
90
    Supported options:

Return to bug 148629