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/BCI/BCIEng/BCIEngProbe/BCIEngProbeInterface.cpp (+31 lines)
Lines 20-25 Link Here
20
#pragma convert(819)	/* see comment in CommonDef.h about this */
20
#pragma convert(819)	/* see comment in CommonDef.h about this */
21
#endif
21
#endif
22
22
23
#include <assert.h>
24
23
#ifdef MVS 
25
#ifdef MVS 
24
#include <unistd.h> /* for __atoe */
26
#include <unistd.h> /* for __atoe */
25
#endif
27
#endif
Lines 37-42 Link Here
37
39
38
#define TOK_WHITESPACE " \t"
40
#define TOK_WHITESPACE " \t"
39
41
42
int g_use_verifier;
40
//------------------------------------------------------------------------------
43
//------------------------------------------------------------------------------
41
inline static unsigned ExceptionToError(CBCIEngProbeInterfaceException& ex)
44
inline static unsigned ExceptionToError(CBCIEngProbeInterfaceException& ex)
42
{
45
{
Lines 341-346 Link Here
341
344
342
}
345
}
343
346
347
//------------------------------------------------------------------------------
348
void 
349
CBCIEngProbeInterface::UseStackMapRecalculation(bool a_use_recalculation)
350
{
351
	m_peng.m_use_external_verifier = a_use_recalculation;
352
}
344
353
345
//------------------------------------------------------------------------------
354
//------------------------------------------------------------------------------
346
void 
355
void 
Lines 439-444 Link Here
439
	try
448
	try
440
	{
449
	{
441
		CBCIEngProbeInterface* peng = (CBCIEngProbeInterface*)i_pbcieng;
450
		CBCIEngProbeInterface* peng = (CBCIEngProbeInterface*)i_pbcieng;
451
		peng->UseStackMapRecalculation(false);
452
		peng->Instrument(i_pInClass, i_cbInClass, o_ppOutClass, o_pcbOutClass);
453
	}
454
	catch (CBCIEngProbeInterfaceException& ex)
455
	{
456
		uErr = ExceptionToError(ex);
457
	}
458
	return uErr;
459
}
460
461
//------------------------------------------------------------------------------
462
unsigned Instrument2(pbcieng_t i_pbcieng, void* i_pInClass, size_t i_cbInClass, 
463
		            void** o_ppOutClass, size_t* o_pcbOutClass, void *(*pEnv)(void **))
464
{
465
	unsigned uErr = 0;
466
	initialize_dynamic(pEnv);
467
	try
468
	{
469
470
		CBCIEngProbeInterface* peng = (CBCIEngProbeInterface*)i_pbcieng;
471
		peng->UseStackMapRecalculation(true);
442
		peng->Instrument(i_pInClass, i_cbInClass, o_ppOutClass, o_pcbOutClass);
472
		peng->Instrument(i_pInClass, i_cbInClass, o_ppOutClass, o_pcbOutClass);
443
	}
473
	}
444
	catch (CBCIEngProbeInterfaceException& ex)
474
	catch (CBCIEngProbeInterfaceException& ex)
Lines 453-458 Link Here
453
{
483
{
454
	unsigned uErr = 0;
484
	unsigned uErr = 0;
455
	CBCIEngProbeInterface* peng = (CBCIEngProbeInterface*)i_pbcieng;
485
	CBCIEngProbeInterface* peng = (CBCIEngProbeInterface*)i_pbcieng;
486
	//assert(i_pfnMalloc);
456
	peng->SetAllocator(i_pfnMalloc);
487
	peng->SetAllocator(i_pfnMalloc);
457
	return uErr;
488
	return uErr;
458
}
489
}
(-)src-native/BCI/BCIEng/BCIEngProbe/BCIEngProbeInterface.h (+3 lines)
Lines 85-90 Link Here
85
85
86
private: 
86
private: 
87
	CBCIEngProbe m_peng;
87
	CBCIEngProbe m_peng;
88
	void UseStackMapRecalculation(bool a_use_recalculation);
89
	friend unsigned Instrument(pbcieng_t, void*, size_t , void** , size_t* );
90
	friend unsigned Instrument2(pbcieng_t, void*, size_t , void** , size_t*, void *(*f)(void **));
88
};
91
};
89
92
90
//------------------------------------------------------------------------------
93
//------------------------------------------------------------------------------
(-)src-native/BCI/BCIEng/BCIEngProbe/BCIEngProbe.cpp (-5 / +21 lines)
Lines 20-25 Link Here
20
#pragma convert(819)	/* see comment in CommonDef.h about this */
20
#pragma convert(819)	/* see comment in CommonDef.h about this */
21
#endif
21
#endif
22
22
23
#include <assert.h>
24
23
#ifdef WIN32
25
#ifdef WIN32
24
#pragma warning(disable:4786)
26
#pragma warning(disable:4786)
25
#endif
27
#endif
Lines 32-37 Link Here
32
#include "BCIEngProbe.h"			// BCI Engine for Probe Kit
34
#include "BCIEngProbe.h"			// BCI Engine for Probe Kit
33
#include "BCIEngInterface.h"		// for callback message number defines
35
#include "BCIEngInterface.h"		// for callback message number defines
34
36
37
35
#include <stdio.h> // for sprintf on Linux
38
#include <stdio.h> // for sprintf on Linux
36
#ifdef MVS
39
#ifdef MVS
37
#    include <unistd.h> /* for __etoa */
40
#    include <unistd.h> /* for __etoa */
Lines 1830-1839 Link Here
1830
	// Starting with the call to Open, we don't need to delete pClass any more:
1833
	// Starting with the call to Open, we don't need to delete pClass any more:
1831
	// The module owns it.
1834
	// The module owns it.
1832
	CModuleJ* pModuleJ = new CModuleJ;
1835
	CModuleJ* pModuleJ = new CModuleJ;
1836
	pModuleJ->UseStackMapCalculation(m_use_external_verifier);
1833
	pModuleJ->Open(pClass, true);
1837
	pModuleJ->Open(pClass, true);
1834
	pModuleJ->SetAccessFlags(pClass->GetAccessFlags());
1838
	pModuleJ->SetAccessFlags(pClass->GetAccessFlags());
1835
	pModuleJ->Parse();
1839
	if (pModuleJ->Parse() != 0) {
1836
1840
		*o_pcbOutClass = i_cbInClass;
1841
		*o_ppOutClass = i_pInClass;
1842
		delete pClass;
1843
		return false;
1844
	}
1845
	
1837
	// If we were asked to, then dump the module before and after instrumentation
1846
	// If we were asked to, then dump the module before and after instrumentation
1838
	const char *dump_output_file;
1847
	const char *dump_output_file;
1839
	if ((dump_output_file = getenv("PROBEKIT_DUMP_FILE")) != NULL) {
1848
	if ((dump_output_file = getenv("PROBEKIT_DUMP_FILE")) != NULL) {
Lines 1845-1850 Link Here
1845
		output_stream << "=========== DUMP BEFORE INSTRUMENTATION" << endl;
1854
		output_stream << "=========== DUMP BEFORE INSTRUMENTATION" << endl;
1846
		pModuleJ->Dump(output_stream);
1855
		pModuleJ->Dump(output_stream);
1847
1856
1857
1848
#if defined(MVS) || defined(__OS400__)
1858
#if defined(MVS) || defined(__OS400__)
1849
		/* On EBCDIC systems, convert ASCII to EBCDIC */
1859
		/* On EBCDIC systems, convert ASCII to EBCDIC */
1850
		char* data = output_stream.str();
1860
		char* data = output_stream.str();
Lines 1864-1870 Link Here
1864
	// to this module, but we still ran callsite probes against this
1874
	// to this module, but we still ran callsite probes against this
1865
	// module and maybe we didn't actually do anything.
1875
	// module and maybe we didn't actually do anything.
1866
	// In that case we should set out == in and return without calling emit.
1876
	// In that case we should set out == in and return without calling emit.
1867
1868
	pModuleJ->Emit();
1877
	pModuleJ->Emit();
1869
1878
1870
	// Tell the client that's driving us that we did something to this module
1879
	// Tell the client that's driving us that we did something to this module
Lines 1882-1887 Link Here
1882
#else
1891
#else
1883
		ofstream output_stream(dump_output_file, ios::app);
1892
		ofstream output_stream(dump_output_file, ios::app);
1884
#endif
1893
#endif
1894
1885
		output_stream << "=========== DUMP AFTER INSTRUMENTATION" << endl;
1895
		output_stream << "=========== DUMP AFTER INSTRUMENTATION" << endl;
1886
		pModuleJ->Dump(output_stream);
1896
		pModuleJ->Dump(output_stream);
1887
1897
Lines 1898-1903 Link Here
1898
	}
1908
	}
1899
1909
1900
	*o_pcbOutClass = pClass->GetSize();
1910
	*o_pcbOutClass = pClass->GetSize();
1911
	if (m_pfnMalloc == NULL) {
1912
		/*skipping*/
1913
		*o_pcbOutClass = i_cbInClass;
1914
		*o_ppOutClass = i_pInClass;
1915
		delete pClass;
1916
		return false;
1917
	}
1901
	*o_ppOutClass = m_pfnMalloc(*o_pcbOutClass);
1918
	*o_ppOutClass = m_pfnMalloc(*o_pcbOutClass);
1902
1919
1903
	CJMemStream		OutStream;					// Memory stream
1920
	CJMemStream		OutStream;					// Memory stream
Lines 1998-2004 Link Here
1998
	{
2015
	{
1999
		InstrumentMethod(*itrMeth); 
2016
		InstrumentMethod(*itrMeth); 
2000
	}
2017
	}
2001
2002
	// Process any staticInitializer fragments that matched this class,
2018
	// Process any staticInitializer fragments that matched this class,
2003
	// and default initializers for staticField elements in probes that matched.
2019
	// and default initializers for staticField elements in probes that matched.
2004
	HandleStaticInitializers(pmodj);
2020
	HandleStaticInitializers(pmodj);
Lines 3179-3185 Link Here
3179
	{
3195
	{
3180
		return;
3196
		return;
3181
	}
3197
	}
3182
3198
	
3183
	// Allow the client that's driving us to veto instrumentation of this module
3199
	// Allow the client that's driving us to veto instrumentation of this module
3184
	if (NULL != m_pfnCallback &&
3200
	if (NULL != m_pfnCallback &&
3185
		(m_wCBFlags & BCIENGINTERFACE_CALLBACK_METHOD) &&
3201
		(m_wCBFlags & BCIENGINTERFACE_CALLBACK_METHOD) &&
(-)src-native/BCI/BCIEng/BCIEngProbe/BCIEngProbe.dsp (-4 / +5 lines)
Lines 43-49 Link Here
43
# PROP Ignore_Export_Lib 0
43
# PROP Ignore_Export_Lib 0
44
# PROP Target_Dir ""
44
# PROP Target_Dir ""
45
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BCIENGPROBE_EXPORTS" /YX /FD /c
45
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BCIENGPROBE_EXPORTS" /YX /FD /c
46
# ADD CPP /nologo /MT /W3 /GX /Zi /O2 /I "..\..\BCIEng\\" /I "..\..\BCIEng\BCIEngJ" /I "..\..\JClass" /I "..\..\common" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /c
46
# ADD CPP /nologo /MT /W3 /GX /Zd /O2 /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /I "..\..\BCIEng\\" /I "..\..\BCIEng\BCIEngJ" /I "..\..\JClass" /I "..\..\common" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "STATIC_BUILD" /YX /FD /c
47
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
47
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
48
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
48
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
49
# ADD BASE RSC /l 0x409 /d "NDEBUG"
49
# ADD BASE RSC /l 0x409 /d "NDEBUG"
Lines 53-59 Link Here
53
# ADD BSC32 /nologo
53
# ADD BSC32 /nologo
54
LINK32=link.exe
54
LINK32=link.exe
55
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
55
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
56
# ADD LINK32 kernel32.lib bciengj.lib /nologo /dll /debug /machine:I386 /libpath:"..\..\..\bci\jclass\release" /libpath:"..\..\..\bci\bcieng\bciengj\release"
56
# ADD LINK32 bciengj.lib kernel32.lib verifier.lib /nologo /dll /debug /machine:I386 /libpath:"..\..\..\bci\jclass\release" /libpath:"..\..\..\bci\bcieng\bciengj\release" /libpath:"..\..\..\..\..\org.apache.harmony_vmcore_verifier\lib\windows\release\IA-32"
57
57
58
!ELSEIF  "$(CFG)" == "BCIEngProbe - Win32 Debug"
58
!ELSEIF  "$(CFG)" == "BCIEngProbe - Win32 Debug"
59
59
Lines 69-75 Link Here
69
# PROP Ignore_Export_Lib 0
69
# PROP Ignore_Export_Lib 0
70
# PROP Target_Dir ""
70
# PROP Target_Dir ""
71
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BCIENGPROBE_EXPORTS" /YX /FD /GZ /c
71
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BCIENGPROBE_EXPORTS" /YX /FD /GZ /c
72
# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\BCIEng\\" /I "..\..\BCIEng\BCIEngJ" /I "..\..\JClass" /I "..\..\common" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /FR /YX /FD /GZ /c
72
# ADD CPP /nologo /MDd /W3 /GX /Zd /Od /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /I "..\..\BCIEng\\" /I "..\..\BCIEng\BCIEngJ" /I "..\..\JClass" /I "..\..\common" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "STATIC_BUILD" /FR /YX /FD /GZ /c
73
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
73
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
74
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
74
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
75
# ADD BASE RSC /l 0x409 /d "_DEBUG"
75
# ADD BASE RSC /l 0x409 /d "_DEBUG"
Lines 79-85 Link Here
79
# ADD BSC32 /nologo
79
# ADD BSC32 /nologo
80
LINK32=link.exe
80
LINK32=link.exe
81
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
81
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
82
# ADD LINK32 bciengj.lib kernel32.lib /nologo /dll /incremental:no /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\bci\jclass\debug" /libpath:"..\..\..\bci\bcieng\bciengj\debug"
82
# ADD LINK32 verifier.lib bciengj.lib kernel32.lib /nologo /dll /incremental:no /debug /machine:I386 /out:"Debug/BCIEngProbe.dll " /pdbtype:sept /libpath:"..\..\..\bci\jclass\debug" /libpath:"..\..\..\bci\bcieng\bciengj\debug" /libpath:"..\..\..\..\..\org.apache.harmony_vmcore_verifier\lib\windows\debug\IA-32"
83
# SUBTRACT LINK32 /verbose
83
84
84
!ENDIF 
85
!ENDIF 
85
86
(-)src-native/BCI/BCIEng/BCIEngProbe/BCIEngProbe.h (+2 lines)
Lines 504-509 Link Here
504
	// These fields are reset and reused for each instrumented method
504
	// These fields are reset and reused for each instrumented method
505
	IP_t			m_ipFinally;				// Finally wrapper label
505
	IP_t			m_ipFinally;				// Finally wrapper label
506
	IP_t			m_ipCatchAll;				// catch-all wrapper label
506
	IP_t			m_ipCatchAll;				// catch-all wrapper label
507
friend class CBCIEngProbeInterface;
508
	bool m_use_external_verifier;
507
};
509
};
508
510
509
#endif // defined _BCIENGPROBE_H_
511
#endif // defined _BCIENGPROBE_H_
(-)src-native/BCI/BCIEng/BCIEngProbe/BCIEngProbe.mak (-6 / +8 lines)
Lines 74-80 Link Here
74
    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
74
    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
75
75
76
CPP=cl.exe
76
CPP=cl.exe
77
CPP_PROJ=/nologo /MT /W3 /GX /Zi /O2 /I "..\..\BCIEng\\" /I "..\..\BCIEng\BCIEngJ" /I "..\..\JClass" /I "..\..\common" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /Fp"$(INTDIR)\BCIEngProbe.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
77
CPP_PROJ=/nologo /MT /W3 /GX /Zd /O2 /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /I "..\..\BCIEng\\" /I "..\..\BCIEng\BCIEngJ" /I "..\..\JClass" /I "..\..\common" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "STATIC_BUILD" /Fp"$(INTDIR)\BCIEngProbe.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
78
78
79
.c{$(INTDIR)}.obj::
79
.c{$(INTDIR)}.obj::
80
   $(CPP) @<<
80
   $(CPP) @<<
Lines 114-124 Link Here
114
BSC32_SBRS= \
114
BSC32_SBRS= \
115
	
115
	
116
LINK32=link.exe
116
LINK32=link.exe
117
LINK32_FLAGS=kernel32.lib bciengj.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\BCIEngProbe.pdb" /debug /machine:I386 /out:"$(OUTDIR)\BCIEngProbe.dll" /implib:"$(OUTDIR)\BCIEngProbe.lib" /libpath:"..\..\jclass\release" /libpath:"..\..\bcieng\bciengj\release"
117
LINK32_FLAGS=bciengj.lib kernel32.lib verifier.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\BCIEngProbe.pdb" /debug /machine:I386 /out:"$(OUTDIR)\BCIEngProbe.dll" /implib:"$(OUTDIR)\BCIEngProbe.lib" /libpath:"..\..\..\bci\jclass\release" /libpath:"..\..\..\bci\bcieng\bciengj\release" /libpath:"..\..\..\..\..\org.apache.harmony_vmcore_verifier\lib\windows\release\IA-32" 
118
LINK32_OBJS= \
118
LINK32_OBJS= \
119
	"$(INTDIR)\BCIEngProbe.obj" \
119
	"$(INTDIR)\BCIEngProbe.obj" \
120
	"$(INTDIR)\BCIEngProbeInterface.obj" \
120
	"$(INTDIR)\BCIEngProbeInterface.obj" \
121
	"..\BCIEngJ\Release\BCIEngJ.lib"
121
	"..\BCIEngJ\Release\BCIEngJ.lib" \
122
	"..\..\JClass\Release\JClassStat.lib"
122
123
123
"$(OUTDIR)\BCIEngProbe.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
124
"$(OUTDIR)\BCIEngProbe.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
124
    $(LINK32) @<<
125
    $(LINK32) @<<
Lines 164-170 Link Here
164
    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
165
    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
165
166
166
CPP=cl.exe
167
CPP=cl.exe
167
CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\BCIEng\\" /I "..\..\BCIEng\BCIEngJ" /I "..\..\JClass" /I "..\..\common" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\BCIEngProbe.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
168
CPP_PROJ=/nologo /MDd /W3 /GX /Zd /Od /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /I "..\..\BCIEng\\" /I "..\..\BCIEng\BCIEngJ" /I "..\..\JClass" /I "..\..\common" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "STATIC_BUILD" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\BCIEngProbe.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
168
169
169
.c{$(INTDIR)}.obj::
170
.c{$(INTDIR)}.obj::
170
   $(CPP) @<<
171
   $(CPP) @<<
Lines 211-221 Link Here
211
<<
212
<<
212
213
213
LINK32=link.exe
214
LINK32=link.exe
214
LINK32_FLAGS=bciengj.lib kernel32.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\BCIEngProbe.pdb" /debug /machine:I386 /out:"$(OUTDIR)\BCIEngProbe.dll" /implib:"$(OUTDIR)\BCIEngProbe.lib" /pdbtype:sept /libpath:"..\..\jclass\debug" /libpath:"..\..\bcieng\bciengj\debug"
215
LINK32_FLAGS=bciengj.lib kernel32.lib verifier.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\BCIEngProbe.pdb" /debug /machine:I386 /out:"$(OUTDIR)\BCIEngProbe.dll" /implib:"$(OUTDIR)\BCIEngProbe.lib" /pdbtype:sept /libpath:"..\..\..\bci\jclass\debug" /libpath:"..\..\..\bci\bcieng\bciengj\debug" /libpath:"..\..\..\..\..\org.apache.harmony_vmcore_verifier\lib\windows\debug\IA-32" 
215
LINK32_OBJS= \
216
LINK32_OBJS= \
216
	"$(INTDIR)\BCIEngProbe.obj" \
217
	"$(INTDIR)\BCIEngProbe.obj" \
217
	"$(INTDIR)\BCIEngProbeInterface.obj" \
218
	"$(INTDIR)\BCIEngProbeInterface.obj" \
218
	"..\BCIEngJ\Debug\BCIEngJ.lib"
219
	"..\BCIEngJ\Debug\BCIEngJ.lib" \
220
	"..\..\JClass\Debug\JClassStat.lib"
219
221
220
"$(OUTDIR)\BCIEngProbe.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
222
"$(OUTDIR)\BCIEngProbe.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
221
    $(LINK32) @<<
223
    $(LINK32) @<<
(-)src-native/BCI/BCIEng/BCIEngProbe/BCIEngProbe.dep (+14 lines)
Lines 1-6 Link Here
1
# Microsoft Developer Studio Generated Dependency File, included by BCIEngProbe.mak
1
# Microsoft Developer Studio Generated Dependency File, included by BCIEngProbe.mak
2
2
3
.\BCIEngProbe.cpp : \
3
.\BCIEngProbe.cpp : \
4
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\common.h"\
5
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\hycomp.h"\
6
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\platform_types.h"\
7
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include\verifier.h"\
8
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier\x_class_interface.h"\
9
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier\x_verifier.h"\
4
	"..\..\common\commondef.h"\
10
	"..\..\common\commondef.h"\
5
	"..\..\common\javadef.h"\
11
	"..\..\common\javadef.h"\
6
	"..\..\Common\JavaHelpers.h"\
12
	"..\..\Common\JavaHelpers.h"\
Lines 10-15 Link Here
10
	"..\..\JClass\JMemStream.h"\
16
	"..\..\JClass\JMemStream.h"\
11
	"..\..\JClass\JStream.h"\
17
	"..\..\JClass\JStream.h"\
12
	"..\BCIEng.h"\
18
	"..\BCIEng.h"\
19
	"..\bcienginterface.h"\
20
	"..\BCIEngJ\class_inerface_int.h"\
13
	"..\BCIEngJ\ExtRefJ_StatMethod.h"\
21
	"..\BCIEngJ\ExtRefJ_StatMethod.h"\
14
	"..\BCIEngJ\JVMInsSet.h"\
22
	"..\BCIEngJ\JVMInsSet.h"\
15
	"..\BCIEngJ\ModuleJ.h"\
23
	"..\BCIEngJ\ModuleJ.h"\
Lines 19-24 Link Here
19
	
27
	
20
28
21
.\BCIEngProbeInterface.cpp : \
29
.\BCIEngProbeInterface.cpp : \
30
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\common.h"\
31
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\hycomp.h"\
32
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\platform_types.h"\
33
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include\verifier.h"\
34
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier\x_class_interface.h"\
35
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier\x_verifier.h"\
22
	"..\..\common\commondef.h"\
36
	"..\..\common\commondef.h"\
23
	"..\..\common\javadef.h"\
37
	"..\..\common\javadef.h"\
24
	"..\..\Common\JavaHelpers.h"\
38
	"..\..\Common\JavaHelpers.h"\
(-)src-native/BCI/BCIEng/Module.h (-1 / +2 lines)
Lines 132-138 Link Here
132
132
133
	virtual const vector<string>& GetSourceFileNames() = 0;
133
	virtual const vector<string>& GetSourceFileNames() = 0;
134
134
135
	virtual void	Parse()=0;
135
	virtual int	Parse()=0;
136
	virtual void	Emit();
136
	virtual void	Emit();
137
137
138
	CMethods*		GetMethods(){return m_pMethods;}
138
	CMethods*		GetMethods(){return m_pMethods;}
Lines 527-532 Link Here
527
		X_REASON_PARSE_ERROR,			// Parsing error
527
		X_REASON_PARSE_ERROR,			// Parsing error
528
		X_REASON_INVALID_CALL,			// Invalid method call (e.g. abstract method)
528
		X_REASON_INVALID_CALL,			// Invalid method call (e.g. abstract method)
529
		X_REASON_CODE_OVERRUN,			// Code overrun during emission
529
		X_REASON_CODE_OVERRUN,			// Code overrun during emission
530
		X_REASON_VERIFICATION_FAILED,	// Verifier stack map recalculation failed
530
		X_REASON_LAST
531
		X_REASON_LAST
531
	};
532
	};
532
533
(-)src-native/BCI/BCIEng/BCIEngInterface.h (+2 lines)
Lines 152-157 Link Here
152
	_BCIENGINTERFACE_EXT_REF unsigned Initialize(pbcieng_t i_pbcieng, const char* i_pchOptions, size_t i_cbOptions);
152
	_BCIENGINTERFACE_EXT_REF unsigned Initialize(pbcieng_t i_pbcieng, const char* i_pchOptions, size_t i_cbOptions);
153
	_BCIENGINTERFACE_EXT_REF unsigned Instrument(pbcieng_t i_pbcieng, void* i_pInClass, size_t i_cbInClass, 
153
	_BCIENGINTERFACE_EXT_REF unsigned Instrument(pbcieng_t i_pbcieng, void* i_pInClass, size_t i_cbInClass, 
154
							          void** o_ppOutClass, size_t* o_pcbOutClass);
154
							          void** o_ppOutClass, size_t* o_pcbOutClass);
155
	_BCIENGINTERFACE_EXT_REF unsigned Instrument2(pbcieng_t i_pbcieng, void* i_pInClass, size_t i_cbInClass, 
156
							          void** o_ppOutClass, size_t* o_pcbOutClass, void *(*)(void **));
155
	_BCIENGINTERFACE_EXT_REF unsigned SetAllocator(pbcieng_t i_pbcieng, pfnMalloc_t i_pfnMalloc);
157
	_BCIENGINTERFACE_EXT_REF unsigned SetAllocator(pbcieng_t i_pbcieng, pfnMalloc_t i_pfnMalloc);
156
	_BCIENGINTERFACE_EXT_REF unsigned SetCallback(pbcieng_t i_pbcieng, pfnCallback_t i_pfnCallback, unsigned i_uFlags);
158
	_BCIENGINTERFACE_EXT_REF unsigned SetCallback(pbcieng_t i_pbcieng, pfnCallback_t i_pfnCallback, unsigned i_uFlags);
157
159
(-)src-native/BCI/BCIEng/BCIEng.dsw (-8 / +8 lines)
Lines 3-9 Link Here
3
3
4
###############################################################################
4
###############################################################################
5
5
6
Project: "BCIEng"=.\BCIEng.dsp - Package Owner=<4>
6
Project: "BCIEng"=".\BCIEng.dsp" - Package Owner=<4>
7
7
8
Package=<5>
8
Package=<5>
9
{{{
9
{{{
Lines 15-21 Link Here
15
15
16
###############################################################################
16
###############################################################################
17
17
18
Project: "BCIEngJ"=.\BCIEngJ\BCIEngJ.dsp - Package Owner=<4>
18
Project: "BCIEngJ"=".\BCIEngJ\BCIEngJ.dsp" - Package Owner=<4>
19
19
20
Package=<5>
20
Package=<5>
21
{{{
21
{{{
Lines 30-36 Link Here
30
30
31
###############################################################################
31
###############################################################################
32
32
33
Project: "BCIEngProbe"=.\BCIEngProbe\BCIEngProbe.dsp - Package Owner=<4>
33
Project: "BCIEngProbe"=".\BCIEngProbe\BCIEngProbe.dsp" - Package Owner=<4>
34
34
35
Package=<5>
35
Package=<5>
36
{{{
36
{{{
Lines 48-54 Link Here
48
48
49
###############################################################################
49
###############################################################################
50
50
51
Project: "BciEngJTest"=.\BCIEngJ\BciEngJTest\BciEngJTest.dsp - Package Owner=<4>
51
Project: "BciEngJTest"=".\BCIEngJ\BciEngJTest\BciEngJTest.dsp" - Package Owner=<4>
52
52
53
Package=<5>
53
Package=<5>
54
{{{
54
{{{
Lines 60-66 Link Here
60
60
61
###############################################################################
61
###############################################################################
62
62
63
Project: "JClassStat"=..\JClass\JClassStat.dsp - Package Owner=<4>
63
Project: "JClassStat"="..\JClass\JClassStat.dsp" - Package Owner=<4>
64
64
65
Package=<5>
65
Package=<5>
66
{{{
66
{{{
Lines 72-78 Link Here
72
72
73
###############################################################################
73
###############################################################################
74
74
75
Project: "JDump"=..\JDump\JDump.dsp - Package Owner=<4>
75
Project: "JDump"="..\JDump\JDump.dsp" - Package Owner=<4>
76
76
77
Package=<5>
77
Package=<5>
78
{{{
78
{{{
Lines 90-96 Link Here
90
90
91
###############################################################################
91
###############################################################################
92
92
93
Project: "ProbeInstrumenter"=.\BCIEngProbe\ProbeInstrumenter\ProbeInstrumenter.dsp - Package Owner=<4>
93
Project: "ProbeInstrumenter"=".\BCIEngProbe\ProbeInstrumenter\ProbeInstrumenter.dsp" - Package Owner=<4>
94
94
95
Package=<5>
95
Package=<5>
96
{{{
96
{{{
Lines 105-111 Link Here
105
105
106
###############################################################################
106
###############################################################################
107
107
108
Project: "ProbeUnitTests"=.\ProbeUnitTests\ProbeUnitTests.dsp - Package Owner=<4>
108
Project: "ProbeUnitTests"=".\ProbeUnitTests\ProbeUnitTests.dsp" - Package Owner=<4>
109
109
110
Package=<5>
110
Package=<5>
111
{{{
111
{{{
(-)src-native/BCI/BCIEng/BCIEng.dsp (-1 / +3 lines)
Lines 23-28 Link Here
23
23
24
# Begin Project
24
# Begin Project
25
# PROP AllowPerConfigDependencies 0
25
# PROP AllowPerConfigDependencies 0
26
# PROP Scc_ProjName ""
27
# PROP Scc_LocalPath ""
26
CPP=cl.exe
28
CPP=cl.exe
27
RSC=rc.exe
29
RSC=rc.exe
28
30
Lines 62-68 Link Here
62
# PROP Intermediate_Dir "Debug"
64
# PROP Intermediate_Dir "Debug"
63
# PROP Target_Dir ""
65
# PROP Target_Dir ""
64
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
66
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
65
# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\Common" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
67
# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\Common" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /YX /FD /GZ /c
66
# ADD BASE RSC /l 0x409 /d "_DEBUG"
68
# ADD BASE RSC /l 0x409 /d "_DEBUG"
67
# ADD RSC /l 0x409 /d "_DEBUG"
69
# ADD RSC /l 0x409 /d "_DEBUG"
68
BSC32=bscmake.exe
70
BSC32=bscmake.exe
(-)src-native/BCI/JClass/JavaDef.h (-69 lines)
Removed Link Here
1
 /********************************************************************** 
2
 * Copyright (c) 2005, 2006 IBM Corporation and others. 
3
 * All rights reserved.   This program and the accompanying materials 
4
 * are made available under the terms of the Eclipse Public License v1.0 
5
 * which accompanies this distribution, and is available at 
6
 * http://www.eclipse.org/legal/epl-v10.html         
7
 * $Id: JavaDef.h,v 1.5 2006/03/24 22:00:45 hleung Exp $ 
8
 * 
9
 * Contributors: 
10
 * IBM - Initial API and implementation 
11
 **********************************************************************/ 
12
13
//==============================================================================
14
// JavaDef.h
15
//
16
// Some common Java definitions
17
//
18
//==============================================================================
19
20
//??? NameSpace ???
21
#ifndef _JAVADEF_H
22
#define _JAVADEF_H
23
24
#define JAVA_MAGIC					0xCAFEBABE;
25
26
// class_file.access_flags and field_info.access_flags values
27
#define ACC_PUBLIC					0x0001	// Public access
28
#define ACC_PRIVATE					0x0002	// Private access
29
#define ACC_PROTECTED				0x0004	// Protected access
30
#define ACC_STATIC					0x0008	// Static
31
#define ACC_FINAL					0x0010	// Final access
32
#define ACC_SUPER					0x0020	// Super access
33
#define ACC_SYNCHRONIZED			0x0020  // Synchronized (for methods)
34
#define ACC_INTERFACE				0x0200	// Interface acess
35
#define ACC_ABSTRACT				0x0400	// Abstract access
36
37
// cp_info.tag values
38
#define CONSTANT_Utf8				1		//
39
#define CONSTANT_Integer			3		//
40
#define CONSTANT_Float				4		//
41
#define CONSTANT_Long				5		//	
42
#define CONSTANT_Double				6		//
43
#define CONSTANT_Class				7		//	
44
#define CONSTANT_String				8		//
45
#define CONSTANT_Fieldref			9		//	
46
#define CONSTANT_Methodref			10		//
47
#define CONSTANT_InterfaceMethodref	11		//	
48
#define CONSTANT_NameAndType		12		//
49
50
#define CONSTANT_Unknown			0
51
52
// array types
53
#define T_BOOLEAN					4		// bool
54
#define T_CHAR						5		// char
55
#define T_FLOAT						6		// float
56
#define T_DOUBLE					7		// double
57
#define T_BYTE						8		// byte
58
#define T_SHORT						9		// short
59
#define T_INT						10		// int
60
#define T_LONG						11		// long
61
62
// ToDo: other Java specific definitions
63
typedef unsigned char				u1;		// 1 byte
64
typedef unsigned short				u2;		// 2 byte unsigned integer
65
typedef	unsigned int				u4;		// 4 byte unsigned integer
66
67
#endif	// _JAVADEF_H
68
69
//= End of JavaDef.h ===========================================================
(-)src-native/BCI/JClass/JClassBuilder.h (-1 / +2 lines)
Lines 62-68 Link Here
62
62
63
	// Constant pool manipulation
63
	// Constant pool manipulation
64
	CCPStringInfo* CreateStringConstant(CSTR i_szString);
64
	CCPStringInfo* CreateStringConstant(CSTR i_szString);
65
	CCPIntegerInfo* CreateIntegerConstant (JINTEGER i_int);
65
    CCPClassInfo* CreateClassConstant(CSTR i_szClassName);
66
    CCPIntegerInfo* CreateIntegerConstant (JINTEGER i_int);
66
	CCPLongInfo* CreateLongConstant(JLONG  i_long);
67
	CCPLongInfo* CreateLongConstant(JLONG  i_long);
67
	CCPFloatInfo* CreateFloatConstant(JFLOAT i_float);
68
	CCPFloatInfo* CreateFloatConstant(JFLOAT i_float);
68
	CCPDoubleInfo* CreateDoubleConstant(JDOUBLE i_double);
69
	CCPDoubleInfo* CreateDoubleConstant(JDOUBLE i_double);
(-)src-native/BCI/JClass/JClassStat.dsp (-1 / +1 lines)
Lines 41-47 Link Here
41
# PROP Intermediate_Dir "Release"
41
# PROP Intermediate_Dir "Release"
42
# PROP Target_Dir ""
42
# PROP Target_Dir ""
43
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
43
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
44
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\common" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /FD /c
44
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\common" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /Zl /FD /c
45
# ADD BASE RSC /l 0x409 /d "NDEBUG"
45
# ADD BASE RSC /l 0x409 /d "NDEBUG"
46
# ADD RSC /l 0x409 /d "NDEBUG"
46
# ADD RSC /l 0x409 /d "NDEBUG"
47
BSC32=bscmake.exe
47
BSC32=bscmake.exe
(-)src-native/BCI/JClass/JClassBuilder.cpp (-1 / +19 lines)
Lines 80-86 Link Here
80
string
80
string
81
CJClassBuilder::GetSuperClassName()
81
CJClassBuilder::GetSuperClassName()
82
{
82
{
83
	CCPUtf8Info* pcpUtf8 = (CCPUtf8Info*)((*m_pConstPool)[GetSuperClass()]);
83
	CCPClassInfo* pccpClassInfo = (CCPClassInfo*)((*m_pConstPool)[GetSuperClass()]);
84
	CCPUtf8Info* pcpUtf8 = (CCPUtf8Info*)((*m_pConstPool)[pccpClassInfo->GetClassInd()]);
84
	string strSuperClass = (string)*pcpUtf8;
85
	string strSuperClass = (string)*pcpUtf8;
85
	return strSuperClass;
86
	return strSuperClass;
86
}
87
}
Lines 245-250 Link Here
245
	CConstPool::iterator itr = m_pConstPool->begin();
246
	CConstPool::iterator itr = m_pConstPool->begin();
246
	while(itr != m_pConstPool->end())
247
	while(itr != m_pConstPool->end())
247
	{
248
	{
249
		if (*itr == NULL) return NULL;
248
		if((*itr)->GetTag() == CONSTANT_Class)
250
		if((*itr)->GetTag() == CONSTANT_Class)
249
		{
251
		{
250
			CCPClassInfo* pcpci = (CCPClassInfo*)*itr;
252
			CCPClassInfo* pcpci = (CCPClassInfo*)*itr;
Lines 278-283 Link Here
278
}
280
}
279
281
280
//------------------------------------------------------------------------------
282
//------------------------------------------------------------------------------
283
// CreateClassConstant
284
// In:
285
//	i_szClassName - class name
286
// Returns:
287
//	CCPClassInfo* - pointer to the class infoin the constant pool
288
//
289
CCPClassInfo* 
290
CJClassBuilder::CreateClassConstant(CSTR i_szClassName)
291
{
292
	u2 u2ClassName = m_pConstPool->Add(new CCPUtf8Info(i_szClassName));
293
	u2 u2ClassRef  = m_pConstPool->Add(new CCPClassInfo(u2ClassName));
294
	CCPClassInfo* pcpClass = (CCPClassInfo*)((*m_pConstPool)[u2ClassRef]);
295
	return pcpClass;
296
}
297
298
//------------------------------------------------------------------------------
281
// CreateIntegerConstant
299
// CreateIntegerConstant
282
// In:
300
// In:
283
//	i_int - Integer value to add
301
//	i_int - Integer value to add
(-)src-native/BCI/JClass/JClassFile.h (-1 / +289 lines)
Lines 82-87 Link Here
82
class CLineNumberTableAttribute;
82
class CLineNumberTableAttribute;
83
class CLocalVariableTableAttribute;
83
class CLocalVariableTableAttribute;
84
class CLocalVariableTypeTableAttribute;
84
class CLocalVariableTypeTableAttribute;
85
class CStackMapTableAttribute;
85
86
86
//------------------------------------------------------------------------------
87
//------------------------------------------------------------------------------
87
// Container classes
88
// Container classes
Lines 672-677 Link Here
672
	CLineNumberTableAttribute* GetLineNumbers();
673
	CLineNumberTableAttribute* GetLineNumbers();
673
	CLocalVariableTableAttribute* GetLocalVariables();
674
	CLocalVariableTableAttribute* GetLocalVariables();
674
	CLocalVariableTypeTableAttribute* GetLocalVariableTypes();
675
	CLocalVariableTypeTableAttribute* GetLocalVariableTypes();
676
    CStackMapTableAttribute* GetStackMaps();
677
    CStackMapTableAttribute* GetOrCreateStackMaps();
678
675
679
676
protected:
680
protected:
677
	u2			m_u2MaxStack;
681
	u2			m_u2MaxStack;
Lines 899-904 Link Here
899
};
903
};
900
904
901
//------------------------------------------------------------------------------
905
//------------------------------------------------------------------------------
906
// Verification Type Information (new in Java 6)
907
//
908
// Represents the following verification types: Top, Integer, Float, Double, Long, Null,
909
// UninitializedThis
910
//
911
class CVerificationTypeInfo
912
{
913
public:
914
    CVerificationTypeInfo(u1 i_u1Tag);
915
    ~CVerificationTypeInfo();
916
    virtual void Read(CJStream& i_jstream);
917
	virtual u2 Read(u1* i_tbl);
918
	virtual void Write(CJStream& i_jstream) const;
919
	virtual u4	 GetSize() const;
920
    virtual CVerificationTypeInfo* Clone() const
921
    {
922
        return new CVerificationTypeInfo(*this);
923
    }
924
925
    u1 GetTag() { return m_u1Tag; }
926
927
private:
928
    u1 m_u1Tag;
929
};
930
931
//------------------------------------------------------------------------------
932
// Verification Type Information Vector
933
//
934
class CVerificationTypes : public vector<CVerificationTypeInfo*>
935
{
936
public:
937
    CVerificationTypes() { clear(); }
938
    CVerificationTypes(const CVerificationTypes &i_VerTypes);
939
	~CVerificationTypes();
940
941
    CVerificationTypes& operator = (const CVerificationTypes &i_VerTypes);
942
    
943
    virtual void	Read(CJStream& i_jstream, u2 i_u2EntriesToRead);
944
	virtual void	Write(CJStream& i_jstream) const;
945
	virtual u4	    GetSize() const;
946
947
private:
948
};
949
950
//------------------------------------------------------------------------------
951
// Verification Type Information: Object (new in Java 6)
952
//
953
class CVerificationTypeObjectInfo : public CVerificationTypeInfo
954
{
955
public:
956
    CVerificationTypeObjectInfo(u1 i_u1Tag);
957
    ~CVerificationTypeObjectInfo();
958
    virtual void Read(CJStream& i_jstream);
959
	virtual void Write(CJStream& i_jstream) const;
960
	virtual u4	 GetSize() const;
961
    virtual CVerificationTypeInfo* Clone() const
962
    {
963
        return new CVerificationTypeObjectInfo(*this);
964
    }
965
966
    u2   GetCpoolIndex() { return m_u2CpoolIndex; }
967
    void SetCpoolIndex(u2 i_u2CpoolIndex) { m_u2CpoolIndex = i_u2CpoolIndex; }
968
969
private:
970
    u2 m_u2CpoolIndex;
971
};
972
973
//------------------------------------------------------------------------------
974
// Verification Type Information: Uninitialized Variable (new in Java 6)
975
//
976
class CVerificationTypeUninitializedVariableInfo : public CVerificationTypeInfo
977
{
978
public:
979
    CVerificationTypeUninitializedVariableInfo(u1 i_u1Tag);
980
    ~CVerificationTypeUninitializedVariableInfo();
981
    virtual void Read(CJStream& i_jstream);
982
	virtual void Write(CJStream& i_jstream) const;
983
	virtual u4	 GetSize() const;
984
    virtual CVerificationTypeInfo* Clone() const
985
    {
986
        return new CVerificationTypeUninitializedVariableInfo(*this);
987
    }
988
989
    u2   GetOffset() { return m_u2Offset; }
990
    void SetOffset(u2 i_u2Offset) { m_u2Offset = i_u2Offset; }
991
992
private:
993
    u2 m_u2Offset;
994
};
995
996
997
//------------------------------------------------------------------------------
998
// Stack Map Frame Information (new in Java 6)
999
//
1000
class CStackMapFrameInfo
1001
{
1002
    friend class CStackMapTable;
1003
public:
1004
    CStackMapFrameInfo(u1 i_u1FrameType);
1005
    CStackMapFrameInfo(const CStackMapFrameInfo &i_Other);
1006
    ~CStackMapFrameInfo();
1007
1008
    virtual void Read(CJStream& i_jstream);
1009
	virtual void Write(CJStream& i_jstream) const;
1010
	virtual u4	 GetSize() const;
1011
    virtual CStackMapFrameInfo* Clone() const = 0;
1012
    
1013
    u1 GetFrameType() const { return m_u1FrameType; }
1014
    u2 GetByteCodeOffset() { return m_u2ByteCodeOffset; }
1015
    void SetByteCodeOffset(u2 i_u2Offset);
1016
1017
protected:
1018
    virtual void AdjustOffsetDelta(int i_s2PrevFrameOffset);
1019
    
1020
    u2 m_u2ByteCodeOffset;
1021
    u2 m_u2OffsetDelta;
1022
    u1 m_u1FrameType;
1023
};
1024
1025
//------------------------------------------------------------------------------
1026
// Stack Map Frame Information: same_frame and same_frame_extended (new in Java 6)
1027
//
1028
class CStackMapSameFrameInfo : public CStackMapFrameInfo
1029
{
1030
    friend class CStackMapTable;
1031
public:
1032
    CStackMapSameFrameInfo(u1 i_u1FrameType, bool i_IsExtended);
1033
    ~CStackMapSameFrameInfo();
1034
1035
    virtual void Read(CJStream& i_jstream);
1036
	virtual void Write(CJStream& i_jstream) const;
1037
	virtual u4	 GetSize() const;
1038
    virtual CStackMapFrameInfo* Clone() const;
1039
1040
protected:
1041
    virtual void AdjustOffsetDelta(int i_s2PrevFrameOffset);
1042
1043
private:
1044
    bool m_IsExtended;
1045
};
1046
1047
//------------------------------------------------------------------------------
1048
// Stack Map Frame Information: chop_frame (new in Java 6)
1049
//
1050
class CStackMapChopFrameInfo : public CStackMapFrameInfo
1051
{
1052
public:
1053
    CStackMapChopFrameInfo(u1 i_u1FrameType);
1054
    ~CStackMapChopFrameInfo();
1055
1056
    virtual void Read(CJStream& i_jstream);
1057
	virtual void Write(CJStream& i_jstream) const;
1058
	virtual u4	 GetSize() const;
1059
    virtual CStackMapFrameInfo* Clone() const;
1060
1061
private:
1062
};
1063
1064
//------------------------------------------------------------------------------
1065
// Stack Map Frame Information: same_locals_1_stack_item_frame and 
1066
//                              same_locals_1_stack_item_frame_extended (new in Java 6)
1067
//
1068
class CStackMapSameLocals1StackItemFrameInfo : public CStackMapFrameInfo
1069
{
1070
    friend class CStackMapTable;
1071
public:
1072
    CStackMapSameLocals1StackItemFrameInfo(u1 i_u1FrameType, bool i_IsExtended);
1073
    CStackMapSameLocals1StackItemFrameInfo(const CStackMapSameLocals1StackItemFrameInfo &i_Other);
1074
    ~CStackMapSameLocals1StackItemFrameInfo();
1075
1076
    virtual void Read(CJStream& i_jstream);
1077
	virtual void Write(CJStream& i_jstream) const;
1078
	virtual u4	 GetSize() const;
1079
    virtual CStackMapFrameInfo* Clone() const;
1080
1081
    CVerificationTypes& GetStack() { return m_Stack; }
1082
1083
protected:
1084
    virtual void AdjustOffsetDelta(int i_s2PrevFrameOffset);
1085
1086
private:
1087
    CStackMapSameLocals1StackItemFrameInfo& operator = (CStackMapSameLocals1StackItemFrameInfo &i_Other);
1088
1089
    CVerificationTypes m_Stack;     // A vector with 1 entry
1090
    bool m_IsExtended;
1091
};
1092
1093
//------------------------------------------------------------------------------
1094
// Stack Map Frame Information: append_frame (new in Java 6)
1095
//
1096
class CStackMapAppendFrameInfo : public CStackMapFrameInfo
1097
{
1098
public:
1099
    CStackMapAppendFrameInfo(u1 i_u1FrameType);
1100
    CStackMapAppendFrameInfo(const CStackMapAppendFrameInfo &i_Other);
1101
    ~CStackMapAppendFrameInfo();
1102
1103
    virtual void Read(CJStream& i_jstream);
1104
	virtual void Write(CJStream& i_jstream) const;
1105
	virtual u4	 GetSize() const;
1106
    virtual CStackMapFrameInfo* Clone() const;
1107
1108
    CVerificationTypes& GetLocals() { return m_Locals; }
1109
1110
private:
1111
    CStackMapAppendFrameInfo& operator = (const CStackMapAppendFrameInfo &i_Other);
1112
1113
    CVerificationTypes m_Locals;
1114
};
1115
1116
//------------------------------------------------------------------------------
1117
// Stack Map Frame Information: full_frame (new in Java 6)
1118
//
1119
class CStackMapFullFrameInfo : public CStackMapFrameInfo
1120
{
1121
public:
1122
    CStackMapFullFrameInfo(u1 i_u1FrameType);
1123
    CStackMapFullFrameInfo(const CStackMapFullFrameInfo &i_Other);
1124
    ~CStackMapFullFrameInfo();
1125
1126
    virtual void Read(CJStream& i_jstream);
1127
	virtual void Write(CJStream& i_jstream) const;
1128
	virtual u4	 GetSize() const;
1129
    virtual CStackMapFrameInfo* Clone() const;
1130
1131
    CVerificationTypes& GetLocals() { return m_Locals; }
1132
    CVerificationTypes& GetStack()  { return m_Stack;  }
1133
    
1134
private:
1135
    CStackMapFullFrameInfo& operator = (const CStackMapFullFrameInfo &i_Other);
1136
1137
    u2 m_u2NumberOfLocals;
1138
    CVerificationTypes m_Locals;
1139
    u2 m_u2NumberOfStackItems;
1140
    CVerificationTypes m_Stack;
1141
};
1142
1143
1144
//------------------------------------------------------------------------------
1145
// Stack Map Table (new in Java 6)
1146
//
1147
class CStackMapTable : public vector<CStackMapFrameInfo*>
1148
{
1149
public:
1150
    CStackMapTable() { clear(); }
1151
	~CStackMapTable();
1152
	virtual void	Read(CJStream& i_jstream);
1153
	virtual void	Write(CJStream& i_jstream) const;
1154
	virtual u4	    GetSize() const;
1155
1156
    void                AdjustOffsetDeltas();
1157
    CStackMapFrameInfo* GetFrameAtOffset(u2 i_u2Offset);
1158
	
1159
    CStackMapTable& operator = (const CStackMapTable& i_StackMaps);
1160
};
1161
1162
//------------------------------------------------------------------------------
1163
// Stack Map Table Attribute (new in Java 6 - [4.8.4])
1164
//
1165
class CStackMapTableAttribute : public CAttributeInfo
1166
{
1167
	friend class CStackMapTable;
1168
public:
1169
    CStackMapTableAttribute(CJClassFile* i_pClassFile);
1170
    ~CStackMapTableAttribute();
1171
	virtual void	Read(CJStream& i_jstream);
1172
	virtual void	Write(CJStream& i_jstream) const;
1173
	virtual u4	    GetSize() const;
1174
	virtual u4		GetLength() const;
1175
1176
    CStackMapTable& GetStackMapTable() { return m_StackMapTable; }
1177
	void SetStackMapTable(const CStackMapTable& i_stackmap) {m_StackMapTable = i_stackmap;}
1178
	void RereadFromBuffer(u1 *i_u1Tbl);
1179
1180
private:
1181
    CStackMapTable m_StackMapTable;
1182
1183
    // Disable assignment operator.
1184
    // To enable, implement these functions as public
1185
    CStackMapTableAttribute& operator = (const CStackMapTableAttribute& i_other) {}
1186
};
1187
1188
//------------------------------------------------------------------------------
902
// Interface information
1189
// Interface information
903
//
1190
//
904
class CInterfaceInfo
1191
class CInterfaceInfo
Lines 999-1004 Link Here
999
	virtual u4	 GetSize() const;
1286
	virtual u4	 GetSize() const;
1000
1287
1001
	u2			GetAccessFlags() {return m_u2AccessFlags;}
1288
	u2			GetAccessFlags() {return m_u2AccessFlags;}
1289
    void        SetAccessFlags(u2 i_u2AccessFlags) {m_u2AccessFlags = i_u2AccessFlags;}
1002
	u2			GetNameInd() const {return m_u2NameInd;}
1290
	u2			GetNameInd() const {return m_u2NameInd;}
1003
	u2			GetDescriptorInd() const {return m_u2DescriptorInd;}
1291
	u2			GetDescriptorInd() const {return m_u2DescriptorInd;}
1004
	CJAttribs&	GetAttribs()	{return m_Attribs;}
1292
	CJAttribs&	GetAttribs()	{return m_Attribs;}
Lines 1070-1076 Link Here
1070
class CJClassFile  
1358
class CJClassFile  
1071
{
1359
{
1072
public:
1360
public:
1073
	enum {MajorVersion = 3, MinorVersion = 46};	// TODO: comment on version 
1361
	enum {MajorVersion = 46, MinorVersion = 3};	// J2SE 1.2
1074
	CJClassFile();
1362
	CJClassFile();
1075
	virtual ~CJClassFile();
1363
	virtual ~CJClassFile();
1076
1364
(-)src-native/BCI/JClass/JClassStat.dep (-4 / +22 lines)
Lines 13-43 Link Here
13
# Microsoft Developer Studio Generated Dependency File, included by JClassStat.mak
13
# Microsoft Developer Studio Generated Dependency File, included by JClassStat.mak
14
# Hand-edited by apratt to remove absolute paths and other silliness
14
# Hand-edited by apratt to remove absolute paths and other silliness
15
15
16
17
..\Common\JavaHelpers.cpp : \
18
	"..\common\commondef.h"\
19
	"..\common\JavaDef.h"\
20
	"..\Common\JavaHelpers.h"\
21
	
22
23
.\JClassBuilder.cpp : \
24
	"..\common\commondef.h"\
25
	"..\common\JavaDef.h"\
26
	"..\Common\JavaHelpers.h"\
27
	".\JBaseStream.h"\
28
	".\JClassBuilder.h"\
29
	".\JClassFile.h"\
30
	".\JStream.h"\
31
	
32
16
.\JClassFile.cpp : \
33
.\JClassFile.cpp : \
17
	"..\common\commondef.h"\
34
	"..\common\commondef.h"\
18
	".\JavaDef.h"\
35
	"..\common\JavaDef.h"\
19
	".\JBaseStream.h"\
36
	".\JBaseStream.h"\
20
	".\JClassFile.h"\
37
	".\JClassFile.h"\
38
	".\JMemStream.h"\
21
	".\JStream.h"\
39
	".\JStream.h"\
22
	
40
	
23
41
24
.\JFileStream.cpp : \
42
.\JFileStream.cpp : \
25
	"..\common\commondef.h"\
43
	"..\common\commondef.h"\
26
	".\JavaDef.h"\
44
	"..\common\JavaDef.h"\
27
	".\JBaseStream.h"\
45
	".\JBaseStream.h"\
28
	".\JFileStream.h"\
46
	".\JFileStream.h"\
29
	
47
	
30
48
31
.\JMemStream.cpp : \
49
.\JMemStream.cpp : \
32
	"..\common\commondef.h"\
50
	"..\common\commondef.h"\
33
	".\JavaDef.h"\
51
	"..\common\JavaDef.h"\
34
	".\JBaseStream.h"\
52
	".\JBaseStream.h"\
35
	".\JMemStream.h"\
53
	".\JMemStream.h"\
36
	
54
	
37
55
38
.\JStream.cpp : \
56
.\JStream.cpp : \
39
	"..\common\commondef.h"\
57
	"..\common\commondef.h"\
40
	".\JavaDef.h"\
58
	"..\common\JavaDef.h"\
41
	".\JBaseStream.h"\
59
	".\JBaseStream.h"\
42
	".\JStream.h"\
60
	".\JStream.h"\
43
	
61
	
(-)src-native/BCI/JClass/JClassFile.cpp (-9 / +806 lines)
Lines 47-54 Link Here
47
#  include <iostream>
47
#  include <iostream>
48
#endif
48
#endif
49
49
50
#include "JavaDef.h"
50
#include "CommonDef.h"
51
#include "CommonDef.h"
52
51
#include "JClassFile.h"
53
#include "JClassFile.h"
54
#include "JMemStream.h"
52
55
53
USE_NAMESPACE(std);
56
USE_NAMESPACE(std);
54
57
Lines 259-266 Link Here
259
void
262
void
260
CCPUtf8Info::Read(CJStream& i_jstream)
263
CCPUtf8Info::Read(CJStream& i_jstream)
261
{
264
{
262
	i_jstream >> m_u2Length;
265
	i_jstream >> m_u2Length; 
263
	m_pu1Bytes = new u1[m_u2Length];
266
	m_pu1Bytes = new u1[m_u2Length + 1];
267
	m_pu1Bytes[m_u2Length] = 0; /*Helps standard string functions find end of the string*/
264
	i_jstream.ReadUtf8((void*)m_pu1Bytes, m_u2Length);
268
	i_jstream.ReadUtf8((void*)m_pu1Bytes, m_u2Length);
265
}
269
}
266
270
Lines 1738-1743 Link Here
1738
		{
1742
		{
1739
			pCurrent = new CLocalVariableTypeTableAttribute(m_pClassFile);
1743
			pCurrent = new CLocalVariableTypeTableAttribute(m_pClassFile);
1740
		}
1744
		}
1745
 		else if(*pcpUtf8 == "StackMapTable")
1746
		{
1747
			pCurrent = new CStackMapTableAttribute(m_pClassFile);
1748
		}
1741
		else if(*pcpUtf8 == "Exceptions")
1749
		else if(*pcpUtf8 == "Exceptions")
1742
		{
1750
		{
1743
			pCurrent = new CExceptionsAttribute(m_pClassFile);
1751
			pCurrent = new CExceptionsAttribute(m_pClassFile);
Lines 2119-2124 Link Here
2119
	return NULL;
2127
	return NULL;
2120
}
2128
}
2121
2129
2130
//------------------------------------------------------------------------------
2131
CStackMapTableAttribute* 
2132
CCodeAttribute::GetStackMaps()
2133
{
2134
	for(CJAttribs::iterator iter = m_Attribs.begin(); iter < m_Attribs.end(); iter++)
2135
	{
2136
		if(*(*iter)->GetName() == "StackMapTable")
2137
			return (CStackMapTableAttribute*)*iter;
2138
	}
2139
	return NULL;
2140
}
2141
2142
//------------------------------------------------------------------------------
2143
CStackMapTableAttribute* 
2144
CCodeAttribute::GetOrCreateStackMaps()
2145
{
2146
    // Return the StackMapTable attribute of this Code attribute, creating a new one
2147
    // if such an attribute does not exist
2148
2149
    CStackMapTableAttribute* result = NULL;
2150
	for(CJAttribs::iterator iter = m_Attribs.begin(); iter < m_Attribs.end(); iter++)
2151
	{
2152
		if(*(*iter)->GetName() == "StackMapTable")
2153
        {
2154
			result = (CStackMapTableAttribute*)*iter;
2155
        }
2156
	}
2157
2158
    if (result == NULL)
2159
    {
2160
        result = new CStackMapTableAttribute(m_pClassFile);
2161
        m_Attribs.push_back(result);
2162
    }
2163
    return result;
2164
}
2122
2165
2123
//==============================================================================
2166
//==============================================================================
2124
// CExceptionsAttribute implementation
2167
// CExceptionsAttribute implementation
Lines 2500-2505 Link Here
2500
{}
2543
{}
2501
2544
2502
//==============================================================================
2545
//==============================================================================
2546
// CStackMapTableAttribute implementation
2547
//
2548
CVerificationTypeInfo::CVerificationTypeInfo(u1 i_u1Tag)
2549
: m_u1Tag(i_u1Tag)
2550
{
2551
}
2552
2553
CVerificationTypeInfo::~CVerificationTypeInfo()
2554
{
2555
}
2556
2557
void
2558
CVerificationTypeInfo::Read(CJStream& i_jstream)
2559
{
2560
    // m_u1Tag is read by the CVerificationTypes container.
2561
}
2562
2563
u2
2564
CVerificationTypeInfo::Read(u1 *i_tbl)
2565
{
2566
    // m_u1Tag is read by the CVerificationTypes container.
2567
	return 0;
2568
}
2569
2570
void
2571
CVerificationTypeInfo::Write(CJStream& i_jstream) const
2572
{
2573
    i_jstream << m_u1Tag;
2574
}
2575
2576
u4
2577
CVerificationTypeInfo::GetSize() const
2578
{
2579
    return sizeof(m_u1Tag);
2580
}
2581
2582
//------------------------------------------------------------------------------
2583
CVerificationTypes::~CVerificationTypes()
2584
{
2585
    for (iterator iter = begin(); iter != end(); iter++)
2586
    {
2587
        delete *iter;
2588
    }
2589
}
2590
2591
CVerificationTypes::CVerificationTypes(const CVerificationTypes &i_VerTypes)
2592
{
2593
    *this = i_VerTypes;
2594
}
2595
2596
CVerificationTypes&
2597
CVerificationTypes::operator =(const CVerificationTypes &i_VerTypes)
2598
{
2599
	for(iterator iter = begin(); iter != end(); iter++)
2600
	{
2601
		delete *iter;
2602
	}
2603
	if(!i_VerTypes.empty())
2604
	{
2605
		const_iterator iterIn;
2606
		clear();
2607
		for(iterIn = i_VerTypes.begin(); iterIn != i_VerTypes.end(); iterIn++)
2608
		{
2609
			push_back((*iterIn)->Clone());
2610
		}
2611
	}
2612
	return *this;
2613
}
2614
2615
void
2616
CVerificationTypes::Read(CJStream& i_jstream, u2 i_u2EntriesToRead)
2617
{
2618
    CVerificationTypeInfo* pCurrent;
2619
    
2620
    resize(i_u2EntriesToRead);
2621
    for(u2 u2Ind = 0; u2Ind < i_u2EntriesToRead; u2Ind++)
2622
    {
2623
        u1 u1Tag;
2624
        i_jstream >> u1Tag;
2625
        switch (u1Tag)
2626
        {
2627
        case ITEM_Top:
2628
        case ITEM_Integer:
2629
        case ITEM_Float:
2630
        case ITEM_Double:
2631
        case ITEM_Long:
2632
        case ITEM_Null:
2633
        case ITEM_UninitializedThis:
2634
            pCurrent = new CVerificationTypeInfo(u1Tag);
2635
            break;
2636
        case ITEM_Object:
2637
            pCurrent = new CVerificationTypeObjectInfo(u1Tag);
2638
            break;
2639
        case ITEM_Uninitialized:
2640
            pCurrent = new CVerificationTypeUninitializedVariableInfo(u1Tag);
2641
            break;
2642
        default:
2643
            throw CJClassFileException(CJClassFileException::X_INTERNAL_ERROR);
2644
        }
2645
2646
        pCurrent->Read(i_jstream);
2647
        (*this)[u2Ind] = pCurrent;
2648
    }
2649
}
2650
2651
void 
2652
CVerificationTypes::Write(CJStream& i_jstream) const
2653
{
2654
    for (u2 u2Ind = 0; u2Ind < size(); u2Ind++)
2655
    {
2656
        (*this)[u2Ind]->Write(i_jstream);
2657
    }
2658
}
2659
2660
u4
2661
CVerificationTypes::GetSize() const
2662
{
2663
    u4 u4Size = 0;
2664
	for (const_iterator iter = begin(); iter != end(); iter++)
2665
	{
2666
		u4Size += (*iter)->GetSize();
2667
	}
2668
    return u4Size;
2669
}
2670
2671
//------------------------------------------------------------------------------
2672
CVerificationTypeObjectInfo::CVerificationTypeObjectInfo(u1 i_u1Tag)
2673
: CVerificationTypeInfo(i_u1Tag)
2674
{
2675
}
2676
2677
CVerificationTypeObjectInfo::~CVerificationTypeObjectInfo()
2678
{
2679
}
2680
2681
void
2682
CVerificationTypeObjectInfo::Read(CJStream& i_jstream)
2683
{
2684
    CVerificationTypeInfo::Read(i_jstream);
2685
    i_jstream >> m_u2CpoolIndex;
2686
}
2687
2688
void
2689
CVerificationTypeObjectInfo::Write(CJStream& i_jstream) const
2690
{
2691
    CVerificationTypeInfo::Write(i_jstream);
2692
    i_jstream << m_u2CpoolIndex;
2693
}
2694
2695
u4
2696
CVerificationTypeObjectInfo::GetSize() const
2697
{
2698
    u4 u4Size = CVerificationTypeInfo::GetSize()
2699
        + sizeof(m_u2CpoolIndex);
2700
    return u4Size;
2701
}
2702
2703
//------------------------------------------------------------------------------
2704
CVerificationTypeUninitializedVariableInfo::CVerificationTypeUninitializedVariableInfo(u1 i_u1Tag)
2705
: CVerificationTypeInfo(i_u1Tag)
2706
{
2707
}
2708
2709
CVerificationTypeUninitializedVariableInfo::~CVerificationTypeUninitializedVariableInfo()
2710
{
2711
}
2712
2713
void
2714
CVerificationTypeUninitializedVariableInfo::Read(CJStream& i_jstream)
2715
{
2716
    CVerificationTypeInfo::Read(i_jstream);
2717
    i_jstream >> m_u2Offset;
2718
}
2719
2720
void
2721
CVerificationTypeUninitializedVariableInfo::Write(CJStream& i_jstream) const
2722
{
2723
    CVerificationTypeInfo::Write(i_jstream);
2724
    i_jstream << m_u2Offset;
2725
}
2726
2727
u4
2728
CVerificationTypeUninitializedVariableInfo::GetSize() const
2729
{
2730
    u4 u4Size = CVerificationTypeInfo::GetSize()
2731
        + sizeof(m_u2Offset);
2732
    return u4Size;
2733
}
2734
2735
//------------------------------------------------------------------------------
2736
CStackMapFrameInfo::CStackMapFrameInfo(u1 i_u1FrameType)
2737
: m_u1FrameType(i_u1FrameType)
2738
{
2739
    m_u2ByteCodeOffset = 0;
2740
    m_u2OffsetDelta = 0;
2741
}
2742
2743
CStackMapFrameInfo::~CStackMapFrameInfo()
2744
{
2745
}
2746
2747
void
2748
CStackMapFrameInfo::Read(CJStream& i_jstream)
2749
{
2750
    // m_u1FrameType is read by the CStackMapTable container
2751
}
2752
2753
void
2754
CStackMapFrameInfo::Write(CJStream& i_jstream) const
2755
{
2756
    i_jstream << m_u1FrameType;
2757
}
2758
2759
u4
2760
CStackMapFrameInfo::GetSize() const
2761
{
2762
    return sizeof(m_u1FrameType);
2763
}
2764
2765
void 
2766
CStackMapFrameInfo::SetByteCodeOffset(u2 i_u2Offset) 
2767
{ 
2768
    m_u2ByteCodeOffset = i_u2Offset; 
2769
}
2770
2771
void
2772
CStackMapFrameInfo::AdjustOffsetDelta(int i_s2PrevFrameOffset)
2773
{
2774
    int newOffsetDelta = m_u2ByteCodeOffset - 1 - i_s2PrevFrameOffset;
2775
    if (newOffsetDelta < 0)
2776
    {
2777
        // Frame order was changed. This is not supported
2778
        throw CJClassFileException(CJClassFileException::X_INTERNAL_ERROR);
2779
    }
2780
    m_u2OffsetDelta = (u2)newOffsetDelta; // this is a safe cast since newDelta >= 1
2781
}
2782
2783
CStackMapFrameInfo::CStackMapFrameInfo(const CStackMapFrameInfo &i_Other)
2784
: m_u2ByteCodeOffset(i_Other.m_u2ByteCodeOffset), m_u2OffsetDelta(i_Other.m_u2OffsetDelta),
2785
    m_u1FrameType(i_Other.m_u1FrameType)
2786
{
2787
}
2788
2789
//------------------------------------------------------------------------------
2790
CStackMapSameFrameInfo::CStackMapSameFrameInfo(u1 i_u1FrameType, bool i_IsExtended)
2791
: CStackMapFrameInfo(i_u1FrameType), m_IsExtended(i_IsExtended)
2792
{
2793
}
2794
2795
CStackMapSameFrameInfo::~CStackMapSameFrameInfo()
2796
{
2797
}
2798
2799
void
2800
CStackMapSameFrameInfo::Read(CJStream& i_jstream)
2801
{
2802
    CStackMapFrameInfo::Read(i_jstream);
2803
    if (m_IsExtended)
2804
    {
2805
        // SAME_FRAME_EXTENDED type
2806
        i_jstream >> m_u2OffsetDelta;
2807
    }
2808
    else        
2809
    {
2810
        // SAME frame type. offset_delta is stored in the tag
2811
        m_u2OffsetDelta = GetFrameType();
2812
    }
2813
}
2814
2815
void
2816
CStackMapSameFrameInfo::Write(CJStream& i_jstream) const
2817
{
2818
    CStackMapFrameInfo::Write(i_jstream);
2819
    if (m_IsExtended)
2820
    {
2821
        // SAME_FRAME_EXTENDED type
2822
        i_jstream << m_u2OffsetDelta;
2823
    }
2824
}
2825
2826
u4
2827
CStackMapSameFrameInfo::GetSize() const
2828
{
2829
    u4 u4Size = CStackMapFrameInfo::GetSize();
2830
    if (m_IsExtended)
2831
    {
2832
        u4Size += sizeof(m_u2OffsetDelta);
2833
    }
2834
    return u4Size;
2835
}
2836
2837
void
2838
CStackMapSameFrameInfo::AdjustOffsetDelta(int i_s2PrevFrameOffset)
2839
{
2840
    CStackMapFrameInfo::AdjustOffsetDelta(i_s2PrevFrameOffset);
2841
    if (m_u2OffsetDelta > 63)
2842
    {
2843
        // Frame type is SAME_FRAME_EXTENDED
2844
        m_u1FrameType = SAME_FRAME_EXTENDED;
2845
        m_IsExtended = true;
2846
    }
2847
    else
2848
    {
2849
        // Frame type is SAME_FRAME. offset_delta is stored in the tag
2850
        m_u1FrameType = (u1)m_u2OffsetDelta; // this is safe since m_u2OffsetDelta <= 63
2851
        m_IsExtended = false;
2852
    }
2853
}
2854
2855
CStackMapFrameInfo*
2856
CStackMapSameFrameInfo::Clone() const
2857
{
2858
    return new CStackMapSameFrameInfo(*this);
2859
}
2860
2861
//------------------------------------------------------------------------------
2862
CStackMapChopFrameInfo::CStackMapChopFrameInfo(u1 i_u1FrameType)
2863
: CStackMapFrameInfo(i_u1FrameType)
2864
{
2865
}
2866
2867
CStackMapChopFrameInfo::~CStackMapChopFrameInfo()
2868
{
2869
}
2870
2871
void
2872
CStackMapChopFrameInfo::Read(CJStream& i_jstream)
2873
{
2874
    CStackMapFrameInfo::Read(i_jstream);
2875
    i_jstream >> m_u2OffsetDelta;
2876
}
2877
2878
void
2879
CStackMapChopFrameInfo::Write(CJStream& i_jstream) const
2880
{
2881
    CStackMapFrameInfo::Write(i_jstream);
2882
    i_jstream << m_u2OffsetDelta;
2883
}
2884
2885
u4
2886
CStackMapChopFrameInfo::GetSize() const
2887
{
2888
    u4 u4Size = CStackMapFrameInfo::GetSize()
2889
        + sizeof(m_u2OffsetDelta);
2890
    return u4Size;
2891
}
2892
2893
CStackMapFrameInfo*
2894
CStackMapChopFrameInfo::Clone() const
2895
{
2896
    return new CStackMapChopFrameInfo(*this);
2897
}
2898
2899
//------------------------------------------------------------------------------
2900
CStackMapSameLocals1StackItemFrameInfo::CStackMapSameLocals1StackItemFrameInfo(u1 i_u1FrameType, 
2901
                                                                               bool i_IsExtended)
2902
: CStackMapFrameInfo(i_u1FrameType), m_IsExtended(i_IsExtended)
2903
{
2904
}
2905
2906
CStackMapSameLocals1StackItemFrameInfo::~CStackMapSameLocals1StackItemFrameInfo()
2907
{
2908
}
2909
2910
void
2911
CStackMapSameLocals1StackItemFrameInfo::Read(CJStream& i_jstream)
2912
{
2913
    CStackMapFrameInfo::Read(i_jstream);
2914
    if (m_IsExtended)
2915
    {
2916
        // SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED type
2917
        i_jstream >> m_u2OffsetDelta;
2918
    }
2919
    else        
2920
    {
2921
        // SAME_LOCALS_1_STACK_ITEM_FRAME frame type
2922
        m_u2OffsetDelta = GetFrameType() - 64;
2923
    }
2924
    m_Stack.Read(i_jstream, 1); // must hold exactly one stack item
2925
}
2926
2927
void
2928
CStackMapSameLocals1StackItemFrameInfo::Write(CJStream& i_jstream) const
2929
{
2930
    CStackMapFrameInfo::Write(i_jstream);
2931
    if (m_IsExtended)
2932
    {
2933
        // SAME_FRAME_EXTENDED type
2934
        i_jstream << m_u2OffsetDelta;
2935
    }
2936
    m_Stack.Write(i_jstream);
2937
}
2938
2939
u4
2940
CStackMapSameLocals1StackItemFrameInfo::GetSize() const
2941
{
2942
    u4 u4Size = CStackMapFrameInfo::GetSize();
2943
    if (m_IsExtended)
2944
    {
2945
        u4Size += sizeof(m_u2OffsetDelta);
2946
    }
2947
    u4Size += m_Stack.GetSize();
2948
    return u4Size;
2949
}
2950
2951
void
2952
CStackMapSameLocals1StackItemFrameInfo::AdjustOffsetDelta(int i_s2PrevFrameOffset)
2953
{
2954
    CStackMapFrameInfo::AdjustOffsetDelta(i_s2PrevFrameOffset);
2955
    if (m_u2OffsetDelta + 64 > 127)
2956
    {
2957
        // Frame type is SAME_LOCALS_1_STACK_FRAME_EXTENDED
2958
        m_u1FrameType = SAME_LOCALS_1_STACK_ITEM_EXTENDED;
2959
        m_IsExtended = true;
2960
    }
2961
    else
2962
    {
2963
        // Frame type is SAME_LOCALS_1_STACK_FRAME. offset_delta is stored in the tag
2964
        m_u1FrameType = (u1)(m_u2OffsetDelta + 64); // this is safe since m_u2OffsetDelta <= 63
2965
        m_IsExtended = false;
2966
    }
2967
}
2968
2969
CStackMapFrameInfo*
2970
CStackMapSameLocals1StackItemFrameInfo::Clone() const
2971
{
2972
    return new CStackMapSameLocals1StackItemFrameInfo(*this);
2973
}
2974
2975
CStackMapSameLocals1StackItemFrameInfo::CStackMapSameLocals1StackItemFrameInfo(const CStackMapSameLocals1StackItemFrameInfo &i_Other)
2976
: CStackMapFrameInfo(i_Other), m_Stack(i_Other.m_Stack), m_IsExtended(i_Other.m_IsExtended)
2977
{
2978
}
2979
2980
//------------------------------------------------------------------------------
2981
CStackMapAppendFrameInfo::CStackMapAppendFrameInfo(u1 i_u1FrameType)
2982
: CStackMapFrameInfo(i_u1FrameType)
2983
{
2984
}
2985
2986
CStackMapAppendFrameInfo::~CStackMapAppendFrameInfo()
2987
{
2988
}
2989
2990
void
2991
CStackMapAppendFrameInfo::Read(CJStream& i_jstream)
2992
{
2993
    CStackMapFrameInfo::Read(i_jstream);
2994
    i_jstream >> m_u2OffsetDelta;
2995
    m_Locals.Read(i_jstream, GetFrameType() - 251);
2996
}
2997
2998
void
2999
CStackMapAppendFrameInfo::Write(CJStream& i_jstream) const
3000
{
3001
    CStackMapFrameInfo::Write(i_jstream);
3002
    i_jstream << m_u2OffsetDelta;
3003
    m_Locals.Write(i_jstream);
3004
}
3005
3006
u4
3007
CStackMapAppendFrameInfo::GetSize() const
3008
{
3009
    u4 u4Size = CStackMapFrameInfo::GetSize()
3010
        + sizeof(m_u2OffsetDelta)
3011
        + m_Locals.GetSize();
3012
    return u4Size;
3013
}
3014
3015
CStackMapFrameInfo*
3016
CStackMapAppendFrameInfo::Clone() const
3017
{
3018
    return new CStackMapAppendFrameInfo(*this);
3019
}
3020
3021
CStackMapAppendFrameInfo::CStackMapAppendFrameInfo(const CStackMapAppendFrameInfo &i_Other)
3022
: CStackMapFrameInfo(i_Other), m_Locals(i_Other.m_Locals)
3023
{
3024
}
3025
3026
//------------------------------------------------------------------------------
3027
CStackMapFullFrameInfo::CStackMapFullFrameInfo(u1 i_u1FrameType)
3028
: CStackMapFrameInfo(i_u1FrameType), m_u2NumberOfLocals(0), m_u2NumberOfStackItems(0)
3029
{
3030
}
3031
3032
CStackMapFullFrameInfo::~CStackMapFullFrameInfo()
3033
{
3034
}
3035
3036
void
3037
CStackMapFullFrameInfo::Read(CJStream& i_jstream)
3038
{
3039
    CStackMapFrameInfo::Read(i_jstream);
3040
    i_jstream >> m_u2OffsetDelta
3041
              >> m_u2NumberOfLocals;
3042
    m_Locals.Read(i_jstream, m_u2NumberOfLocals);
3043
    i_jstream >> m_u2NumberOfStackItems;
3044
    m_Stack.Read(i_jstream, m_u2NumberOfStackItems);
3045
}
3046
3047
void
3048
CStackMapFullFrameInfo::Write(CJStream& i_jstream) const
3049
{
3050
    CStackMapFrameInfo::Write(i_jstream);
3051
    i_jstream << m_u2OffsetDelta
3052
              << m_u2NumberOfLocals;
3053
    m_Locals.Write(i_jstream);
3054
    i_jstream << m_u2NumberOfStackItems;
3055
    m_Stack.Write(i_jstream);
3056
}
3057
3058
u4
3059
CStackMapFullFrameInfo::GetSize() const
3060
{
3061
    u4 u4Size = CStackMapFrameInfo::GetSize()
3062
        + sizeof(m_u2OffsetDelta)
3063
        + sizeof(m_u2NumberOfLocals)
3064
        + m_Locals.GetSize()
3065
        + sizeof(m_u2NumberOfStackItems)
3066
        + m_Stack.GetSize();
3067
    return u4Size;
3068
}
3069
3070
CStackMapFrameInfo*
3071
CStackMapFullFrameInfo::Clone() const
3072
{
3073
    return new CStackMapFullFrameInfo(*this);
3074
}
3075
3076
CStackMapFullFrameInfo::CStackMapFullFrameInfo(const CStackMapFullFrameInfo &i_Other)
3077
: CStackMapFrameInfo(i_Other), m_Locals(i_Other.m_Locals), m_Stack(i_Other.m_Stack),
3078
    m_u2NumberOfLocals(i_Other.m_u2NumberOfLocals), 
3079
    m_u2NumberOfStackItems(i_Other.m_u2NumberOfStackItems)
3080
{
3081
}
3082
3083
//------------------------------------------------------------------------------
3084
CStackMapTable::~CStackMapTable()
3085
{
3086
    for (iterator iter = begin(); iter != end(); iter++)
3087
    {
3088
        delete *iter;
3089
    }
3090
}
3091
3092
void
3093
CStackMapTable::Read(CJStream& i_jstream)
3094
{
3095
    u2 u2Size;
3096
    CStackMapFrameInfo* pCurrent;
3097
    int s2PrevFrameOffset = -1;
3098
3099
    i_jstream >> u2Size;
3100
    resize(u2Size);
3101
    for(u2 u2Ind = 0; u2Ind < u2Size; u2Ind++)
3102
    {
3103
        u1 u1FrameType;
3104
        i_jstream >> u1FrameType;
3105
        if (u1FrameType >= 0 && u1FrameType <= 63)
3106
        {
3107
            pCurrent = new CStackMapSameFrameInfo(u1FrameType, false);
3108
        }
3109
        else if (u1FrameType >= 64 && u1FrameType <= 127)
3110
        {
3111
            pCurrent = new CStackMapSameLocals1StackItemFrameInfo(u1FrameType, false);
3112
        }
3113
        else if (u1FrameType == SAME_LOCALS_1_STACK_ITEM_EXTENDED)
3114
        {
3115
            pCurrent = new CStackMapSameLocals1StackItemFrameInfo(u1FrameType, true);
3116
        }
3117
        else if (u1FrameType >= 248 && u1FrameType <= 250)
3118
        {
3119
            pCurrent = new CStackMapChopFrameInfo(u1FrameType);
3120
        }
3121
        else if (u1FrameType == SAME_FRAME_EXTENDED)
3122
        {
3123
            pCurrent = new CStackMapSameFrameInfo(u1FrameType, true);
3124
        }
3125
        else if (u1FrameType >= 252 && u1FrameType <= 254)
3126
        {
3127
            pCurrent = new CStackMapAppendFrameInfo(u1FrameType);
3128
        }
3129
        else if (u1FrameType == FULL_FRAME)
3130
        {
3131
            pCurrent = new CStackMapFullFrameInfo(u1FrameType);
3132
        }
3133
        else
3134
        {
3135
            // Unknown frame type
3136
            throw CJClassFileException(CJClassFileException::X_INTERNAL_ERROR);
3137
        }
3138
        
3139
        pCurrent->Read(i_jstream);
3140
        pCurrent->SetByteCodeOffset(s2PrevFrameOffset + 1 + pCurrent->m_u2OffsetDelta);
3141
        (*this)[u2Ind] = pCurrent;
3142
        s2PrevFrameOffset = pCurrent->GetByteCodeOffset();
3143
    }
3144
}
3145
3146
void
3147
CStackMapTable::AdjustOffsetDeltas()
3148
{
3149
    // Recalculate offset deltas for all frames. This function must be called before
3150
    // writing the Stack Map Table to the class file or calculating its size
3151
    CStackMapFrameInfo* pCurrent;
3152
    int s2PrevFrameOffset = -1;
3153
3154
    for (u2 u2Ind = 0; u2Ind < size(); u2Ind++)
3155
    {
3156
        pCurrent = (*this)[u2Ind];
3157
        pCurrent->AdjustOffsetDelta(s2PrevFrameOffset);
3158
        s2PrevFrameOffset = pCurrent->GetByteCodeOffset();
3159
    }
3160
}
3161
3162
CStackMapFrameInfo*
3163
CStackMapTable::GetFrameAtOffset(u2 i_u2Offset)
3164
{
3165
    bool found = false;
3166
    iterator it = begin();
3167
    for (; it != end(); ++it)
3168
    {
3169
        if ((*it)->GetByteCodeOffset() == i_u2Offset)
3170
        {
3171
            found = true;
3172
            break;
3173
        }
3174
    }
3175
3176
    if (found)
3177
    {
3178
        return (*it);
3179
    }
3180
    else
3181
    {
3182
        return NULL;
3183
    }
3184
}
3185
3186
void
3187
CStackMapTable::Write(CJStream& i_jstream) const
3188
{
3189
    i_jstream << (u2)size(); // the number_of_entries field
3190
3191
    CStackMapFrameInfo* pCurrent;
3192
    int s2PrevFrameOffset = -1;
3193
3194
    for (u2 u2Ind = 0; u2Ind < size(); u2Ind++)
3195
    {
3196
        pCurrent = (*this)[u2Ind];
3197
        pCurrent->Write(i_jstream);
3198
        s2PrevFrameOffset = pCurrent->GetByteCodeOffset();
3199
    }
3200
}
3201
3202
u4
3203
CStackMapTable::GetSize() const
3204
{
3205
    u4 u4Size = sizeof(u2); // the number_of_entries field
3206
    for (const_iterator iter = begin(); iter != end(); iter++)
3207
    {
3208
        u4Size += (*iter)->GetSize();
3209
    }
3210
    return u4Size;
3211
}
3212
3213
CStackMapTable& 
3214
CStackMapTable::operator = (const CStackMapTable& i_StackMaps)
3215
{
3216
	for(iterator iter = begin(); iter != end(); iter++)
3217
	{
3218
		delete *iter;
3219
	}
3220
	if(!i_StackMaps.empty())
3221
	{
3222
		const_iterator iterIn;
3223
		clear();
3224
		for(iterIn = i_StackMaps.begin(); iterIn != i_StackMaps.end(); iterIn++)
3225
		{
3226
			push_back((*iterIn)->Clone());
3227
		}
3228
	}
3229
	return *this;
3230
}
3231
3232
//------------------------------------------------------------------------------
3233
CStackMapTableAttribute::CStackMapTableAttribute(CJClassFile* i_pClassFile)
3234
: CAttributeInfo(i_pClassFile)
3235
{
3236
    u2 u2NameInd = i_pClassFile->GetConstPool()->Add(new CCPUtf8Info("StackMapTable"));
3237
    m_u2NameInd = u2NameInd;
3238
    m_StackMapTable.clear();
3239
}
3240
3241
CStackMapTableAttribute::~CStackMapTableAttribute()
3242
{
3243
}
3244
3245
void
3246
CStackMapTableAttribute::Read(CJStream& i_jstream)
3247
{
3248
	CAttributeInfo::Read(i_jstream);
3249
    m_StackMapTable.Read(i_jstream);
3250
}
3251
3252
void
3253
CStackMapTableAttribute::Write(CJStream& i_jstream) const
3254
{
3255
	const u4 u4Length = GetLength() - CAttributeInfo::SizeOf();
3256
	i_jstream	<<	m_u2NameInd
3257
				<<	u4Length;
3258
    m_StackMapTable.Write(i_jstream);
3259
}
3260
3261
u4
3262
CStackMapTableAttribute::GetSize() const
3263
{
3264
    return GetLength();
3265
}
3266
3267
u4
3268
CStackMapTableAttribute::GetLength() const
3269
{
3270
    u4 u4Length = CAttributeInfo::SizeOf()
3271
        + m_StackMapTable.GetSize();
3272
    return u4Length;
3273
}
3274
3275
void
3276
CStackMapTableAttribute::RereadFromBuffer(u1 *i_u1Tbl) 
3277
{
3278
	u2 u2skip = 0;
3279
	u4 u4attributeLenght = 0;
3280
	
3281
	if (i_u1Tbl == NULL) return;
3282
3283
	u2skip = i_u1Tbl[0];
3284
	u2skip <<= 8;
3285
	u2skip |= i_u1Tbl[1];
3286
3287
	u4attributeLenght = i_u1Tbl[2];
3288
	u4attributeLenght <<= 8;
3289
	u4attributeLenght |= i_u1Tbl[3];
3290
	u4attributeLenght <<= 8;
3291
	u4attributeLenght |= i_u1Tbl[4];
3292
	u4attributeLenght <<= 8;
3293
	u4attributeLenght |= i_u1Tbl[5];
3294
	m_u4Length = u4attributeLenght;
3295
	CJMemStream memstream;
3296
	memstream.Open(&i_u1Tbl[2], u4attributeLenght 
3297
		+ sizeof(u2) /*part of attribute header (its length)*/
3298
		+ 2 /*workaround for end buffer checking*/);
3299
	CJStream mem_jstream(&memstream);
3300
	//GetStackMapTable().RereadFromBuffer(&i_u1Tbl[6]);
3301
	this->Read(mem_jstream);
3302
}
3303
//==============================================================================
2503
// CJClassFile implementation
3304
// CJClassFile implementation
2504
//
3305
//
2505
3306
Lines 2544-2555 Link Here
2544
	{
3345
	{
2545
		throw CJClassFileException(CJClassFileException::X_BAD_MAGIC);
3346
		throw CJClassFileException(CJClassFileException::X_BAD_MAGIC);
2546
	}
3347
	}
2547
	i_jstream	>>	m_u2MajorVersion;
2548
	if(CJClassFile::MajorVersion < m_u2MajorVersion)
2549
	{
2550
		throw CJClassFileException(CJClassFileException::X_BAD_VERSION);
2551
	}
2552
	i_jstream	>>	m_u2MinorVersion;
3348
	i_jstream	>>	m_u2MinorVersion;
3349
	i_jstream	>>	m_u2MajorVersion;
2553
	m_pConstPool->Read(i_jstream);
3350
	m_pConstPool->Read(i_jstream);
2554
	i_jstream	>>	m_u2AccessFlags
3351
	i_jstream	>>	m_u2AccessFlags
2555
				>>	m_u2ThisClass
3352
				>>	m_u2ThisClass
Lines 2565-2572 Link Here
2565
CJClassFile::Write(CJStream& i_jstream) const
3362
CJClassFile::Write(CJStream& i_jstream) const
2566
{
3363
{
2567
	i_jstream	<<	m_u4Magic
3364
	i_jstream	<<	m_u4Magic
2568
				<<	m_u2MajorVersion
3365
				<<	m_u2MinorVersion
2569
				<<	m_u2MinorVersion;
3366
				<<	m_u2MajorVersion;
2570
	m_pConstPool->Write(i_jstream);
3367
	m_pConstPool->Write(i_jstream);
2571
	i_jstream	<<	m_u2AccessFlags
3368
	i_jstream	<<	m_u2AccessFlags
2572
				<<	m_u2ThisClass
3369
				<<	m_u2ThisClass
(-)src-native/BCI/BCIEng/BCIEngProbe/ProbeInstrumenter/ProbeInstrumenter.mak (-2 / +2 lines)
Lines 74-80 Link Here
74
"$(OUTDIR)" :
74
"$(OUTDIR)" :
75
    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
75
    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
76
76
77
CPP_PROJ=/nologo /ML /W3 /GX /Zi /O2 /I "..\..\..\Common" /I "..\..\..\jclass" /I "..\..\..\bcieng" /I "..\..\..\bcieng\bciengj" /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FR"..\Release\\" /Fp"$(INTDIR)\ProbeInstrumenter.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
77
CPP_PROJ=/nologo /ML /W3 /GX /Zi /O2 /I "..\..\..\Common" /I "..\..\..\jclass" /I "..\..\..\bcieng" /I "..\..\..\bcieng\bciengj" /I ".." /I "..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include" /I "..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include" /I "..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "STATIC_BUILD" /FR"..\Release\\" /Fp"$(INTDIR)\ProbeInstrumenter.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
78
BSC32=bscmake.exe
78
BSC32=bscmake.exe
79
BSC32_FLAGS=/nologo /o"$(OUTDIR)\ProbeInstrumenter.bsc" 
79
BSC32_FLAGS=/nologo /o"$(OUTDIR)\ProbeInstrumenter.bsc" 
80
BSC32_SBRS= \
80
BSC32_SBRS= \
Lines 134-140 Link Here
134
"$(INTDIR)" :
134
"$(INTDIR)" :
135
    if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
135
    if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
136
136
137
CPP_PROJ=/nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\Common" /I "..\..\..\jclass" /I "..\..\..\bcieng" /I "..\..\..\bcieng\bciengj" /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\ProbeInstrumenter.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
137
CPP_PROJ=/nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\Common" /I "..\..\..\jclass" /I "..\..\..\bcieng" /I "..\..\..\bcieng\bciengj" /I ".." /I "..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include" /I "..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include" /I "..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "STATIC_BUILD" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\ProbeInstrumenter.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
138
BSC32=bscmake.exe
138
BSC32=bscmake.exe
139
BSC32_FLAGS=/nologo /o"$(OUTDIR)\ProbeInstrumenter.bsc" 
139
BSC32_FLAGS=/nologo /o"$(OUTDIR)\ProbeInstrumenter.bsc" 
140
BSC32_SBRS= \
140
BSC32_SBRS= \
(-)src-native/BCI/BCIEng/BCIEngProbe/ProbeInstrumenter/ProbeInstrumenter.dsp (-2 / +2 lines)
Lines 42-48 Link Here
42
# PROP Ignore_Export_Lib 0
42
# PROP Ignore_Export_Lib 0
43
# PROP Target_Dir ""
43
# PROP Target_Dir ""
44
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
44
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
45
# ADD CPP /nologo /W3 /GX /Zi /O2 /I "..\..\..\Common" /I "..\..\..\jclass" /I "..\..\..\bcieng" /I "..\..\..\bcieng\bciengj" /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FR"..\Release\\" /YX /FD /c
45
# ADD CPP /nologo /W3 /GX /Zi /O2 /I "..\..\..\Common" /I "..\..\..\jclass" /I "..\..\..\bcieng" /I "..\..\..\bcieng\bciengj" /I ".." /I "..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include" /I "..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include" /I "..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "STATIC_BUILD" /FR"..\Release\\" /YX /FD /c
46
# ADD BASE RSC /l 0x409 /d "NDEBUG"
46
# ADD BASE RSC /l 0x409 /d "NDEBUG"
47
# ADD RSC /l 0x409 /d "NDEBUG"
47
# ADD RSC /l 0x409 /d "NDEBUG"
48
BSC32=bscmake.exe
48
BSC32=bscmake.exe
Lines 66-72 Link Here
66
# PROP Ignore_Export_Lib 0
66
# PROP Ignore_Export_Lib 0
67
# PROP Target_Dir ""
67
# PROP Target_Dir ""
68
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
68
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
69
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\Common" /I "..\..\..\jclass" /I "..\..\..\bcieng" /I "..\..\..\bcieng\bciengj" /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
69
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\Common" /I "..\..\..\jclass" /I "..\..\..\bcieng" /I "..\..\..\bcieng\bciengj" /I ".." /I "..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include" /I "..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include" /I "..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "STATIC_BUILD" /FR /YX /FD /GZ /c
70
# ADD BASE RSC /l 0x409 /d "_DEBUG"
70
# ADD BASE RSC /l 0x409 /d "_DEBUG"
71
# ADD RSC /l 0x409 /d "_DEBUG"
71
# ADD RSC /l 0x409 /d "_DEBUG"
72
BSC32=bscmake.exe
72
BSC32=bscmake.exe
(-)src-native/BCI/BCIEng/BCIEngProbe/ProbeInstrumenter/ProbeInstrumenter.dep (+7 lines)
Lines 1-6 Link Here
1
# Microsoft Developer Studio Generated Dependency File, included by ProbeInstrumenter.mak
1
# Microsoft Developer Studio Generated Dependency File, included by ProbeInstrumenter.mak
2
2
3
.\ProbeInstrumenter.cpp : \
3
.\ProbeInstrumenter.cpp : \
4
	"..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\common.h"\
5
	"..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\hycomp.h"\
6
	"..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\platform_types.h"\
7
	"..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include\verifier.h"\
8
	"..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier\x_class_interface.h"\
9
	"..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier\x_verifier.h"\
4
	"..\..\..\common\commondef.h"\
10
	"..\..\..\common\commondef.h"\
5
	"..\..\..\common\javadef.h"\
11
	"..\..\..\common\javadef.h"\
6
	"..\..\..\Common\JavaHelpers.h"\
12
	"..\..\..\Common\JavaHelpers.h"\
Lines 10-15 Link Here
10
	"..\..\..\JClass\JStream.h"\
16
	"..\..\..\JClass\JStream.h"\
11
	"..\..\BCIEng.h"\
17
	"..\..\BCIEng.h"\
12
	"..\..\BCIEngInterface.h"\
18
	"..\..\BCIEngInterface.h"\
19
	"..\..\BCIEngJ\class_inerface_int.h"\
13
	"..\..\BCIEngJ\ModuleJ.h"\
20
	"..\..\BCIEngJ\ModuleJ.h"\
14
	"..\..\InsSet.h"\
21
	"..\..\InsSet.h"\
15
	"..\..\Module.h"\
22
	"..\..\Module.h"\
(-)src-native/BCI/Common/CommonDef.h (-9 / +14 lines)
Lines 22-35 Link Here
22
// For this header to work, you need to define one of these ARCH symbols:
22
// For this header to work, you need to define one of these ARCH symbols:
23
//
23
//
24
//	WIN32 (means x86)
24
//	WIN32 (means x86)
25
//	IA32_ARCH (means x86)
25
//  IPF_ARCH (means Itanium Processor Family)
26
//  IPF_ARCH (means Itanium Processor Family)
26
//  EM64T_ARCH (means Intel/AMD 64-bit processors)
27
//  EM64T_ARCH (means Intel/AMD 64-bit processors)
27
//	IA32_ARCH (means x86)
28
//	SPARC_ARCH
28
//	SPARC_ARCH
29
//	HPPA_ARCH
29
//	HPPA_ARCH
30
//	ALPHA_ARCH
30
//	ALPHA_ARCH
31
//	PPC_ARCH
31
//	PPC_ARCH
32
//  LINUX_PPC_ARCH  (LINUX PPC64)
33
//	OS390_ARCH (means zSeries)
32
//	OS390_ARCH (means zSeries)
34
//	AS400_ARCH (means iSeries)
33
//	AS400_ARCH (means iSeries)
35
//
34
//
Lines 72-81 Link Here
72
    // This brings _WINDOWS_ into scope. Use _WINDOWS_ to wrap Windows code.
71
    // This brings _WINDOWS_ into scope. Use _WINDOWS_ to wrap Windows code.
73
#   include <windows.h>           /* for lots o' stuff, but esp. _WINDOWS_ */
72
#   include <windows.h>           /* for lots o' stuff, but esp. _WINDOWS_ */
74
#   include <malloc.h>            /* for alloca */
73
#   include <malloc.h>            /* for alloca */
75
#elif defined(IPF_ARCH) || (EM64T_ARCH) || (LINUX_PPC_ARCH)
74
#elif defined(IPF_ARCH) || (EM64T_ARCH)
76
#   include <stdint.h>         /* for int64_t and uint64_t */
75
#   include <stdint.h>         /* for int64_t and uint64_t */
77
#endif
76
#endif
78
77
78
/* On LinuxPPC64 we need this to get int64_t */
79
#if defined(PPC_ARCH)
80
#   include </usr/include/sys/types.h>
81
#endif
79
/* Only on OS400, we need this to get malloc/free */
82
/* Only on OS400, we need this to get malloc/free */
80
#ifdef OS400
83
#ifdef OS400
81
#include <stdlib.h>
84
#include <stdlib.h>
Lines 113-127 Link Here
113
	typedef signed long long int int64_t;
116
	typedef signed long long int int64_t;
114
	typedef unsigned long long int uint64_t;
117
	typedef unsigned long long int uint64_t;
115
#else
118
#else
116
#if defined(_WINDOWS_)
119
#   if defined(_WINDOWS_)
117
		typedef __int64 int64_t;
120
		typedef __int64 int64_t;
118
		typedef unsigned __int64 uint64_t;
121
		typedef unsigned __int64 uint64_t;
119
#else
122
#elif defined(PPC_ARCH)
120
#       if !defined(IPF_ARCH) && !defined(EM64T_ARCH) && !defined(LINUX_PPC_ARCH) // Already being declared in stdint.h
121
		typedef long long int64_t;
122
		typedef unsigned long long uint64_t;
123
		typedef unsigned long long uint64_t;
124
#   else
125
#       if !defined(IPF_ARCH) && !defined(EM64T_ARCH)
126
	        typedef long long int64_t;
127
			typedef unsigned long long uint64_t;
123
#       endif
128
#       endif
124
#endif
129
#   endif
125
#endif
130
#endif
126
131
127
//------------------------------------------------------------------------------
132
//------------------------------------------------------------------------------
Lines 197-203 Link Here
197
///////
202
///////
198
#if defined(WIN32) || defined(IA32_ARCH) || defined(IPF_ARCH) || defined(EM64T_ARCH) || defined(ALPHA_ARCH)
203
#if defined(WIN32) || defined(IA32_ARCH) || defined(IPF_ARCH) || defined(EM64T_ARCH) || defined(ALPHA_ARCH)
199
#   define BIG_ENDIAN_HW
204
#   define BIG_ENDIAN_HW
200
#elif defined(SPARC_ARCH) || defined(HPPA_ARCH) || defined(PPC_ARCH) || defined(AS400_ARCH) || defined(OS390_ARCH) || defined(LINUX_PPC_ARCH)
205
#elif defined(SPARC_ARCH) || defined(HPPA_ARCH) || defined(PPC_ARCH) || defined(AS400_ARCH) || defined(OS390_ARCH)
201
#   define LITTLE_ENDIAN_HW
206
#   define LITTLE_ENDIAN_HW
202
#else
207
#else
203
#   error "Platform-specific configuration required"
208
#   error "Platform-specific configuration required"
(-)src-native/BCI/Common/JavaDef.h (-1 / +16 lines)
Lines 50-55 Link Here
50
#define CONSTANT_InterfaceMethodref	11		// Interface method refernce constant 
50
#define CONSTANT_InterfaceMethodref	11		// Interface method refernce constant 
51
#define CONSTANT_NameAndType		12		// Name and type constant
51
#define CONSTANT_NameAndType		12		// Name and type constant
52
52
53
#define CONSTANT_Unknown			0
53
// Array types
54
// Array types
54
#define T_BOOLEAN					4		// bool
55
#define T_BOOLEAN					4		// bool
55
#define T_CHAR						5		// char
56
#define T_CHAR						5		// char
Lines 60-66 Link Here
60
#define T_INT						10		// int
61
#define T_INT						10		// int
61
#define T_LONG						11		// long
62
#define T_LONG						11		// long
62
63
63
#define CONSTANT_Unknown			0
64
// stack map frame types (new in Java 6.0)
65
#define SAME_LOCALS_1_STACK_ITEM_EXTENDED   247
66
#define SAME_FRAME_EXTENDED                 251
67
#define FULL_FRAME                          255
68
69
// verification types (new in Java 6.0)
70
#define ITEM_Top                    0
71
#define ITEM_Integer                1
72
#define ITEM_Float                  2
73
#define ITEM_Double                 3
74
#define ITEM_Long                   4
75
#define ITEM_Null                   5
76
#define ITEM_UninitializedThis      6
77
#define ITEM_Object                 7
78
#define ITEM_Uninitialized          8
64
79
65
// ToDo: other Java specific definitions
80
// ToDo: other Java specific definitions
66
typedef unsigned char				u1;		// 1 byte
81
typedef unsigned char				u1;		// 1 byte
(-)src-native/BCI/BCIEng/BCIEngJ/BCIEngJ.mak (-2 / +23 lines)
Lines 63-68 Link Here
63
!ELSE 
63
!ELSE 
64
CLEAN :
64
CLEAN :
65
!ENDIF 
65
!ENDIF 
66
	-@erase "$(INTDIR)\class_interface.obj"
66
	-@erase "$(INTDIR)\ExtRefJ_Interface.obj"
67
	-@erase "$(INTDIR)\ExtRefJ_Interface.obj"
67
	-@erase "$(INTDIR)\ExtRefJ_StatMethod.obj"
68
	-@erase "$(INTDIR)\ExtRefJ_StatMethod.obj"
68
	-@erase "$(INTDIR)\JVMInsSet.obj"
69
	-@erase "$(INTDIR)\JVMInsSet.obj"
Lines 74-80 Link Here
74
"$(OUTDIR)" :
75
"$(OUTDIR)" :
75
    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
76
    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
76
77
77
CPP_PROJ=/nologo /MT /W3 /GX /Zi /O2 /I "..\\" /I "..\..\jclass" /I "..\..\..\sun" /I "..\..\common" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /Fp"$(INTDIR)\BCIEngJ.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
78
CPP_PROJ=/nologo /MT /W3 /GX /Zi /O2 /I "..\..\Common" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /I "..\\" /I "..\..\jclass" /I "..\..\..\sun" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "STATIC_BUILD" /Fp"$(INTDIR)\BCIEngJ.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
78
BSC32=bscmake.exe
79
BSC32=bscmake.exe
79
BSC32_FLAGS=/nologo /o"$(OUTDIR)\BCIEngJ.bsc" 
80
BSC32_FLAGS=/nologo /o"$(OUTDIR)\BCIEngJ.bsc" 
80
BSC32_SBRS= \
81
BSC32_SBRS= \
Lines 82-87 Link Here
82
LIB32=link.exe -lib
83
LIB32=link.exe -lib
83
LIB32_FLAGS=/nologo /out:"$(OUTDIR)\BCIEngJ.lib" 
84
LIB32_FLAGS=/nologo /out:"$(OUTDIR)\BCIEngJ.lib" 
84
LIB32_OBJS= \
85
LIB32_OBJS= \
86
	"$(INTDIR)\class_interface.obj" \
85
	"$(INTDIR)\ExtRefJ_Interface.obj" \
87
	"$(INTDIR)\ExtRefJ_Interface.obj" \
86
	"$(INTDIR)\ExtRefJ_StatMethod.obj" \
88
	"$(INTDIR)\ExtRefJ_StatMethod.obj" \
87
	"$(INTDIR)\JVMInsSet.obj" \
89
	"$(INTDIR)\JVMInsSet.obj" \
Lines 117-122 Link Here
117
!ELSE 
119
!ELSE 
118
CLEAN :
120
CLEAN :
119
!ENDIF 
121
!ENDIF 
122
	-@erase "$(INTDIR)\class_interface.obj"
123
	-@erase "$(INTDIR)\class_interface.sbr"
120
	-@erase "$(INTDIR)\ExtRefJ_Interface.obj"
124
	-@erase "$(INTDIR)\ExtRefJ_Interface.obj"
121
	-@erase "$(INTDIR)\ExtRefJ_Interface.sbr"
125
	-@erase "$(INTDIR)\ExtRefJ_Interface.sbr"
122
	-@erase "$(INTDIR)\ExtRefJ_StatMethod.obj"
126
	-@erase "$(INTDIR)\ExtRefJ_StatMethod.obj"
Lines 133-142 Link Here
133
"$(OUTDIR)" :
137
"$(OUTDIR)" :
134
    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
138
    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
135
139
136
CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Common" /I "..\\" /I "..\..\jclass" /I "..\..\..\sun" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\BCIEngJ.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
140
CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Common" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /I "..\\" /I "..\..\jclass" /I "..\..\..\sun" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "STATIC_BUILD" /FR"$(INTDIR)\\" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
137
BSC32=bscmake.exe
141
BSC32=bscmake.exe
138
BSC32_FLAGS=/nologo /o"$(OUTDIR)\BCIEngJ.bsc" 
142
BSC32_FLAGS=/nologo /o"$(OUTDIR)\BCIEngJ.bsc" 
139
BSC32_SBRS= \
143
BSC32_SBRS= \
144
	"$(INTDIR)\class_interface.sbr" \
140
	"$(INTDIR)\ExtRefJ_Interface.sbr" \
145
	"$(INTDIR)\ExtRefJ_Interface.sbr" \
141
	"$(INTDIR)\ExtRefJ_StatMethod.sbr" \
146
	"$(INTDIR)\ExtRefJ_StatMethod.sbr" \
142
	"$(INTDIR)\JVMInsSet.sbr" \
147
	"$(INTDIR)\JVMInsSet.sbr" \
Lines 205-210 Link Here
205
210
206
211
207
!IF "$(CFG)" == "BCIEngJ - Win32 Release" || "$(CFG)" == "BCIEngJ - Win32 Debug"
212
!IF "$(CFG)" == "BCIEngJ - Win32 Release" || "$(CFG)" == "BCIEngJ - Win32 Debug"
213
SOURCE=.\class_interface.cpp
214
215
!IF  "$(CFG)" == "BCIEngJ - Win32 Release"
216
217
218
"$(INTDIR)\class_interface.obj" : $(SOURCE) "$(INTDIR)"
219
220
221
!ELSEIF  "$(CFG)" == "BCIEngJ - Win32 Debug"
222
223
224
"$(INTDIR)\class_interface.obj"	"$(INTDIR)\class_interface.sbr" : $(SOURCE) "$(INTDIR)"
225
226
227
!ENDIF 
228
208
SOURCE=.\ExtRefJ_Interface.cpp
229
SOURCE=.\ExtRefJ_Interface.cpp
209
230
210
!IF  "$(CFG)" == "BCIEngJ - Win32 Release"
231
!IF  "$(CFG)" == "BCIEngJ - Win32 Release"
(-)src-native/BCI/BCIEng/BCIEngJ/BCIEngJ.dep (+50 lines)
Lines 12-18 Link Here
12
12
13
# Microsoft Developer Studio Generated Dependency File, included by BCIEngJ.mak
13
# Microsoft Developer Studio Generated Dependency File, included by BCIEngJ.mak
14
14
15
.\class_interface.cpp : \
16
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\common.h"\
17
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\hycomp.h"\
18
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\platform_types.h"\
19
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include\verifier.h"\
20
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier\x_class_interface.h"\
21
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier\x_verifier.h"\
22
	"..\..\common\commondef.h"\
23
	"..\..\common\javadef.h"\
24
	"..\..\Common\JavaHelpers.h"\
25
	"..\..\JClass\JBaseStream.h"\
26
	"..\..\JClass\JClassBuilder.h"\
27
	"..\..\JClass\JClassFile.h"\
28
	"..\..\JClass\JMemStream.h"\
29
	"..\..\JClass\JStream.h"\
30
	"..\BCIEng.h"\
31
	"..\InsSet.h"\
32
	"..\Module.h"\
33
	".\class_inerface_int.h"\
34
	".\ModuleJ.h"\
35
	
36
15
.\ExtRefJ_Interface.cpp : \
37
.\ExtRefJ_Interface.cpp : \
38
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\common.h"\
39
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\hycomp.h"\
40
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\platform_types.h"\
41
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include\verifier.h"\
42
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier\x_class_interface.h"\
43
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier\x_verifier.h"\
16
	"..\..\common\commondef.h"\
44
	"..\..\common\commondef.h"\
17
	"..\..\common\javadef.h"\
45
	"..\..\common\javadef.h"\
18
	"..\..\Common\JavaHelpers.h"\
46
	"..\..\Common\JavaHelpers.h"\
Lines 22-32 Link Here
22
	"..\..\JClass\JStream.h"\
50
	"..\..\JClass\JStream.h"\
23
	"..\InsSet.h"\
51
	"..\InsSet.h"\
24
	"..\Module.h"\
52
	"..\Module.h"\
53
	".\class_inerface_int.h"\
25
	".\ExtRefJ_Interface.h"\
54
	".\ExtRefJ_Interface.h"\
26
	".\ModuleJ.h"\
55
	".\ModuleJ.h"\
27
	
56
	
28
57
29
.\ExtRefJ_StatMethod.cpp : \
58
.\ExtRefJ_StatMethod.cpp : \
59
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\common.h"\
60
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\hycomp.h"\
61
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\platform_types.h"\
62
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include\verifier.h"\
63
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier\x_class_interface.h"\
64
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier\x_verifier.h"\
30
	"..\..\common\commondef.h"\
65
	"..\..\common\commondef.h"\
31
	"..\..\common\javadef.h"\
66
	"..\..\common\javadef.h"\
32
	"..\..\Common\JavaHelpers.h"\
67
	"..\..\Common\JavaHelpers.h"\
Lines 36-46 Link Here
36
	"..\..\JClass\JStream.h"\
71
	"..\..\JClass\JStream.h"\
37
	"..\InsSet.h"\
72
	"..\InsSet.h"\
38
	"..\Module.h"\
73
	"..\Module.h"\
74
	".\class_inerface_int.h"\
39
	".\ExtRefJ_StatMethod.h"\
75
	".\ExtRefJ_StatMethod.h"\
40
	".\ModuleJ.h"\
76
	".\ModuleJ.h"\
41
	
77
	
42
78
43
.\JVMInsSet.cpp : \
79
.\JVMInsSet.cpp : \
80
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\common.h"\
81
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\hycomp.h"\
82
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\platform_types.h"\
83
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include\verifier.h"\
84
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier\x_class_interface.h"\
85
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier\x_verifier.h"\
44
	"..\..\common\commondef.h"\
86
	"..\..\common\commondef.h"\
45
	"..\..\common\javadef.h"\
87
	"..\..\common\javadef.h"\
46
	"..\..\Common\JavaHelpers.h"\
88
	"..\..\Common\JavaHelpers.h"\
Lines 50-61 Link Here
50
	"..\..\JClass\JStream.h"\
92
	"..\..\JClass\JStream.h"\
51
	"..\InsSet.h"\
93
	"..\InsSet.h"\
52
	"..\Module.h"\
94
	"..\Module.h"\
95
	".\class_inerface_int.h"\
53
	".\jvmins.def"\
96
	".\jvmins.def"\
54
	".\JVMInsSet.h"\
97
	".\JVMInsSet.h"\
55
	".\ModuleJ.h"\
98
	".\ModuleJ.h"\
56
	
99
	
57
100
58
.\ModuleJ.cpp : \
101
.\ModuleJ.cpp : \
102
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\common.h"\
103
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\hycomp.h"\
104
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\platform_types.h"\
105
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include\verifier.h"\
106
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier\x_class_interface.h"\
107
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier\x_verifier.h"\
59
	"..\..\common\commondef.h"\
108
	"..\..\common\commondef.h"\
60
	"..\..\common\javadef.h"\
109
	"..\..\common\javadef.h"\
61
	"..\..\Common\JavaHelpers.h"\
110
	"..\..\Common\JavaHelpers.h"\
Lines 66-71 Link Here
66
	"..\..\JClass\JStream.h"\
115
	"..\..\JClass\JStream.h"\
67
	"..\InsSet.h"\
116
	"..\InsSet.h"\
68
	"..\Module.h"\
117
	"..\Module.h"\
118
	".\class_inerface_int.h"\
69
	".\JVMInsSet.h"\
119
	".\JVMInsSet.h"\
70
	".\ModuleJ.h"\
120
	".\ModuleJ.h"\
71
	
121
	
(-)src-native/BCI/BCIEng/BCIEngJ/ModuleJ.cpp (-6 / +98 lines)
Lines 34-41 Link Here
34
#include <iostream>
34
#include <iostream>
35
#endif
35
#endif
36
36
37
static CInsSetJ InsSet;
37
#include <assert.h>
38
38
39
static CInsSetJ InsSet;
39
//==============================================================================
40
//==============================================================================
40
// CModuleJ implementation
41
// CModuleJ implementation
41
//------------------------------------------------------------------------------
42
//------------------------------------------------------------------------------
Lines 51-56 Link Here
51
	m_fDestroyClass = false;
52
	m_fDestroyClass = false;
52
	m_fAccessFlags = 0;
53
	m_fAccessFlags = 0;
53
	m_sourceFileNamesPopulated = false;
54
	m_sourceFileNamesPopulated = false;
55
	m_verificationContext = NULL;
56
	m_classHandler = NULL;
57
	m_methodContexts = NULL;
58
	m_use_stack_map_recalculation = false;
54
}
59
}
55
60
56
//------------------------------------------------------------------------------
61
//------------------------------------------------------------------------------
Lines 63-68 Link Here
63
	{
68
	{
64
		delete m_pClass;
69
		delete m_pClass;
65
	}
70
	}
71
	if (m_verificationContext != NULL) {
72
		free_verification_context(m_verificationContext);
73
		m_verificationContext = NULL; 
74
	}
75
	if (m_classHandler != NULL) {
76
		free(m_classHandler);
77
		m_classHandler = NULL;
78
	}
79
	if (m_methodContexts != NULL) {
80
		free(m_methodContexts);
81
		m_methodContexts = NULL;
82
	}
66
}
83
}
67
84
68
//------------------------------------------------------------------------------
85
//------------------------------------------------------------------------------
Lines 83-88 Link Here
83
	m_fDestroyClass = true;
100
	m_fDestroyClass = true;
84
	FileStreamIn.Close();
101
	FileStreamIn.Close();
85
	Verify();
102
	Verify();
103
	
86
}
104
}
87
105
88
//------------------------------------------------------------------------------
106
//------------------------------------------------------------------------------
Lines 184-190 Link Here
184
}
202
}
185
203
186
//------------------------------------------------------------------------------
204
//------------------------------------------------------------------------------
187
void	
205
int	
188
CModuleJ::Parse()
206
CModuleJ::Parse()
189
{
207
{
190
	CJMethods* pMethods	= m_pClass->GetMethods();
208
	CJMethods* pMethods	= m_pClass->GetMethods();
Lines 227-238 Link Here
227
		}
245
		}
228
		m_pMethods->push_back(pMtd);
246
		m_pMethods->push_back(pMtd);
229
	}
247
	}
248
249
	vf_Result status;
250
	int ind;
251
	if (GetClassBuilder().GetMajorVersion() >= 50 
252
		&& IsStackMapCalculationUsed()) {
253
		m_classHandler = get_class_handler_from_builder(this);
254
		assert(m_classHandler);
255
		m_verificationContext = allocate_verification_context(m_classHandler);
256
		assert(m_verificationContext);
257
		m_methodContexts = (method_handler *)malloc(m_pMethods->size() * sizeof(method_handler));
258
		assert(m_methodContexts);
259
		memset(m_methodContexts, 0, m_pMethods->size() * sizeof(method_handler));
260
		//fprintf(stderr, "class : %s is java6 compiled\n", m_strName.c_str());
261
	}
230
	
262
	
231
	CMethods::iterator iterm;
263
	CMethods::iterator iterm;
232
	for(iterm =  m_pMethods->begin(); iterm < m_pMethods->end(); iterm++)
264
	for(iterm =  m_pMethods->begin(), ind = 0; iterm < m_pMethods->end(); iterm++, ind++)
233
	{
265
	{
234
		(*iterm)->Parse();
266
		(*iterm)->Parse();
267
		if (GetClassBuilder().GetMajorVersion() >= 50
268
			&& IsStackMapCalculationUsed()) {
269
			m_methodContexts[ind] = get_method_handler_for_cmethod(*iterm);
270
			assert(m_methodContexts[ind]);
271
			status = init_verification_context_for_method(m_methodContexts[ind], m_verificationContext);
272
			if (status != VF_OK) {
273
				//fprintf(stderr, "class was skiped: %s\n", m_strName.c_str());
274
				return (1); /*skip*/
275
			}
276
			//fprintf(stderr, "class was instrumented: %s\n", m_strName.c_str());
277
			((CMethodJ *)(*iterm))->SetMethodHandler(m_methodContexts[ind]);
278
		}
235
	}
279
	}
280
	return (0);
236
}
281
}
237
282
238
//------------------------------------------------------------------------------
283
//------------------------------------------------------------------------------
Lines 385-392 Link Here
385
	m_pMtdExTable->Emit();
430
	m_pMtdExTable->Emit();
386
431
387
	//-------
432
	//-------
388
	// Loop over instructions and patch the local variable info table
433
	// Loop over instructions and patch the local variable info table, 
434
    // local variable type table (Java 5.0) and stack map table (Java 6.0)
389
	//
435
	//
436
	
437
	
390
438
391
	// Local variable table LVT
439
	// Local variable table LVT
392
	CLocalVariableTableAttribute* pLclAttr = m_pCodeAttr->GetLocalVariables();
440
	CLocalVariableTableAttribute* pLclAttr = m_pCodeAttr->GetLocalVariables();
Lines 403-408 Link Here
403
	CLocalVariableTypeTable  LclTypeTableSav;
451
	CLocalVariableTypeTable  LclTypeTableSav;
404
	CLocalVariableTypeTable::iterator itrLclType, itrLclTypeSav; // LVTT Iterator
452
	CLocalVariableTypeTable::iterator itrLclType, itrLclTypeSav; // LVTT Iterator
405
453
454
    // The smtNull variable is for reference initialization in case the method does not have
455
    // a Stack Map Table attribute
456
    CStackMapTable smtNull;
457
    CStackMapTableAttribute* pSmtAttr = m_pCodeAttr->GetStackMaps();
458
    CStackMapTable& StackMapTable = pSmtAttr?pSmtAttr->GetStackMapTable():smtNull;
459
    CStackMapTable::iterator itrStackMapFrame = StackMapTable.begin();
460
406
	CInsBlocks::iterator iterBlocks;
461
	CInsBlocks::iterator iterBlocks;
407
	IP_t ip = 0;
462
	IP_t ip = 0;
408
463
Lines 458-463 Link Here
458
					}
513
					}
459
				}
514
				}
460
			}
515
			}
516
			
517
            // Scan for a relevant entry in the Stack Map Table and fix it
518
            while (itrStackMapFrame != StackMapTable.end()
519
                && (*itrStackMapFrame)->GetByteCodeOffset() < ipOrig)
520
            {
521
                ++itrStackMapFrame;
522
            }
523
            if (itrStackMapFrame != StackMapTable.end()
524
                && (*itrStackMapFrame)->GetByteCodeOffset() == ipOrig)
525
            {
526
                (*itrStackMapFrame)->SetByteCodeOffset(ip);
527
            }
461
528
462
			// Advance ip
529
			// Advance ip
463
			ip += (*iterIns)->GetSize(ip);
530
			ip += (*iterIns)->GetSize(ip);
Lines 503-513 Link Here
503
			}
570
			}
504
		}
571
		}
505
	}
572
	}
573
	// Replace the method body
574
	m_pCodeAttr->SetCode(m_pBody->GetCodeSize(), m_pBody->GiveAvayCode());
506
575
576
	// Calculate new stack depth
507
	CalcStackDepth();
577
	CalcStackDepth();
508
578
509
	// Replace the method body
579
	if (((CModuleJ *)GetModule())->GetClassBuilder().GetMajorVersion() >= 50 
510
	m_pCodeAttr->SetCode(m_pBody->GetCodeSize(), m_pBody->GiveAvayCode());
580
		&& ((CModuleJ *)GetModule())->IsStackMapCalculationUsed()) {
581
	
582
		u1 *tbl;
583
		vf_Result status;
584
		status = recompute_stackmaptable((uint8 **)&tbl, m_methodHandler, ((CModuleJ *)GetModule())->GetVerificationContext());
585
		if (status != VF_OK) {
586
			throw CModuleException(CModuleException::X_REASON_VERIFICATION_FAILED, "stack map recalcualtion failed");
587
		}
588
		else {
589
			//CStackMapTable smt (tbl);
590
			CStackMapTableAttribute* smta = GetCodeAttribute()->GetOrCreateStackMaps();
591
			if (tbl != NULL) {
592
				smta->RereadFromBuffer(tbl); //skiping name
593
				smta->GetStackMapTable().AdjustOffsetDeltas();
594
			}
595
		}
596
	}
597
    // Final Stack Map Table handling: adjust offset deltas
598
    //StackMapTable.AdjustOffsetDeltas();
599
600
    
601
511
602
512
}
603
}
513
604
Lines 628-633 Link Here
628
				}
719
				}
629
			}
720
			}
630
		}
721
		}
722
		
631
		CJException jex = CJException(uType, ipStart, ipRealEnd, ipHandler); 
723
		CJException jex = CJException(uType, ipStart, ipRealEnd, ipHandler); 
632
		extblj.push_back(jex);
724
		extblj.push_back(jex);
633
	}
725
	}
(-)src-native/BCI/BCIEng/BCIEngJ/ModuleJ.h (-2 / +14 lines)
Lines 28-33 Link Here
28
#pragma warning(disable:4786)
28
#pragma warning(disable:4786)
29
#endif
29
#endif
30
30
31
#include "class_inerface_int.h"
31
#include "Module.h"
32
#include "Module.h"
32
#include "JClassBuilder.h"
33
#include "JClassBuilder.h"
33
34
Lines 57-75 Link Here
57
	virtual void	Open(CJClassBuilder* io_pClass, bool i_fDestroyClass = false);
58
	virtual void	Open(CJClassBuilder* io_pClass, bool i_fDestroyClass = false);
58
	virtual void	AddExtRef(CExtRef& i_ExtRef);
59
	virtual void	AddExtRef(CExtRef& i_ExtRef);
59
	virtual void	AddStringAttrib(CSTR i_szName, CSTR i_szValue);
60
	virtual void	AddStringAttrib(CSTR i_szName, CSTR i_szValue);
60
	virtual void	Parse();
61
	virtual int	Parse();
61
	virtual void	Emit();
62
	virtual void	Emit();
62
63
63
	void	Emit(CJStream& i_jstream);	// Java specific emission
64
	void	Emit(CJStream& i_jstream);	// Java specific emission
64
	CJClassFile&	GetClass();
65
	CJClassFile&	GetClass();
65
	CJClassBuilder& GetClassBuilder();
66
	CJClassBuilder& GetClassBuilder();
67
	class_handler GetClassHandler() {return m_classHandler;}
68
	verification_context GetVerificationContext(){return m_verificationContext;}
66
69
67
	virtual const vector<string>& GetSourceFileNames();
70
	virtual const vector<string>& GetSourceFileNames();
68
71
69
	// Module modification methods
72
	// Module modification methods
70
	CCPFieldrefInfo*	CreateFieldRef(u2 i_u2AccFlags, CSTR i_szName, CJavaType i_jtype);
73
	CCPFieldrefInfo*	CreateFieldRef(u2 i_u2AccFlags, CSTR i_szName, CJavaType i_jtype);
71
	CMethodJ*			CreateMethod(u2 i_u2AccFlags, CSTR i_szName, CSTR i_szSignature);
74
	CMethodJ*			CreateMethod(u2 i_u2AccFlags, CSTR i_szName, CSTR i_szSignature);
72
75
	bool IsStackMapCalculationUsed() const {return m_use_stack_map_recalculation;}
76
	void UseStackMapCalculation(bool a_use_stack_map_recalculation) {m_use_stack_map_recalculation = a_use_stack_map_recalculation;}
73
protected:
77
protected:
74
78
75
private:
79
private:
Lines 85-90 Link Here
85
	// Storage in support of GetSourceFileNames:
89
	// Storage in support of GetSourceFileNames:
86
	vector<string>	m_sourceFileNames;
90
	vector<string>	m_sourceFileNames;
87
	bool			m_sourceFileNamesPopulated;
91
	bool			m_sourceFileNamesPopulated;
92
	verification_context m_verificationContext; /*verifier context for support java 6.0 and latter*/
93
	class_handler m_classHandler; /* class descriptor used for verification needs(recalculations) introduced in java 6.0*/
94
	method_handler *m_methodContexts; /*collections of method handlers*/
95
	bool m_use_stack_map_recalculation;
88
};
96
};
89
97
90
//==============================================================================
98
//==============================================================================
Lines 100-105 Link Here
100
		m_strSignature = i_szSignature;
108
		m_strSignature = i_szSignature;
101
		m_pCodeAttr = i_pCodeAttr;
109
		m_pCodeAttr = i_pCodeAttr;
102
		m_u2AccessFlags = i_u2AccessFlags;
110
		m_u2AccessFlags = i_u2AccessFlags;
111
		
103
112
104
		// Set the "hasThis" attribute, which is accessible to all CMethod users
113
		// Set the "hasThis" attribute, which is accessible to all CMethod users
105
		SetHasThis(!(m_u2AccessFlags & ACC_STATIC));
114
		SetHasThis(!(m_u2AccessFlags & ACC_STATIC));
Lines 110-115 Link Here
110
	CSTR	GetSignature() const {return m_strSignature.c_str();}
119
	CSTR	GetSignature() const {return m_strSignature.c_str();}
111
	bool IsAbstract() { return ((m_u2AccessFlags & ACC_ABSTRACT) != 0); };
120
	bool IsAbstract() { return ((m_u2AccessFlags & ACC_ABSTRACT) != 0); };
112
    u2 GetAccessFlags() const { return m_u2AccessFlags; }
121
    u2 GetAccessFlags() const { return m_u2AccessFlags; }
122
	void SetMethodHandler(method_handler i_methodHandler) {m_methodHandler = i_methodHandler;}
123
	method_handler GetMethodHandler() {return m_methodHandler;}
113
124
114
	virtual void Parse();
125
	virtual void Parse();
115
	virtual void Emit();
126
	virtual void Emit();
Lines 121-126 Link Here
121
	CCodeAttribute*		m_pCodeAttr;		// Code attribute from CJClassFile
132
	CCodeAttribute*		m_pCodeAttr;		// Code attribute from CJClassFile
122
	u2					m_u2AccessFlags;	// Method access flags
133
	u2					m_u2AccessFlags;	// Method access flags
123
	IP_t				m_origCodeLength;	// Saved code length from Parse to Emit
134
	IP_t				m_origCodeLength;	// Saved code length from Parse to Emit
135
	method_handler		m_methodHandler;
124
};
136
};
125
137
126
138
(-)src-native/BCI/BCIEng/BCIEngJ/BCIEngJ.dsp (-2 / +11 lines)
Lines 41-47 Link Here
41
# PROP Intermediate_Dir "Release"
41
# PROP Intermediate_Dir "Release"
42
# PROP Target_Dir ""
42
# PROP Target_Dir ""
43
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
43
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
44
# ADD CPP /nologo /MT /W3 /GX /Zi /O2 /I "..\\" /I "..\..\jclass" /I "..\..\..\sun" /I "..\..\common" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
44
# ADD CPP /nologo /MT /W3 /GX /Zi /O2 /I "..\..\Common" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /I "..\\" /I "..\..\jclass" /I "..\..\..\sun" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "STATIC_BUILD" /YX /FD /c
45
# ADD BASE RSC /l 0x409 /d "NDEBUG"
45
# ADD BASE RSC /l 0x409 /d "NDEBUG"
46
# ADD RSC /l 0x409 /d "NDEBUG"
46
# ADD RSC /l 0x409 /d "NDEBUG"
47
BSC32=bscmake.exe
47
BSC32=bscmake.exe
Lines 64-70 Link Here
64
# PROP Intermediate_Dir "Debug"
64
# PROP Intermediate_Dir "Debug"
65
# PROP Target_Dir ""
65
# PROP Target_Dir ""
66
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
66
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
67
# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Common" /I "..\\" /I "..\..\jclass" /I "..\..\..\sun" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /YX /FD /GZ /c
67
# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Common" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /I "..\\" /I "..\..\jclass" /I "..\..\..\sun" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "STATIC_BUILD" /FR /FD /GZ /c
68
# SUBTRACT CPP /YX
68
# ADD BASE RSC /l 0x409 /d "_DEBUG"
69
# ADD BASE RSC /l 0x409 /d "_DEBUG"
69
# ADD RSC /l 0x409 /d "_DEBUG"
70
# ADD RSC /l 0x409 /d "_DEBUG"
70
BSC32=bscmake.exe
71
BSC32=bscmake.exe
Lines 85-90 Link Here
85
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
86
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
86
# Begin Source File
87
# Begin Source File
87
88
89
SOURCE=.\class_interface.cpp
90
# End Source File
91
# Begin Source File
92
88
SOURCE=.\ExtRefJ_Interface.cpp
93
SOURCE=.\ExtRefJ_Interface.cpp
89
# End Source File
94
# End Source File
90
# Begin Source File
95
# Begin Source File
Lines 105-110 Link Here
105
# PROP Default_Filter "h;hpp;hxx;hm;inl"
110
# PROP Default_Filter "h;hpp;hxx;hm;inl"
106
# Begin Source File
111
# Begin Source File
107
112
113
SOURCE=.\class_inerface_int.h
114
# End Source File
115
# Begin Source File
116
108
SOURCE=.\ExtRefJ_Interface.h
117
SOURCE=.\ExtRefJ_Interface.h
109
# End Source File
118
# End Source File
110
# Begin Source File
119
# Begin Source File
(-)src-native/BCI/BCIEng/BCIEngJ/BCIEngJTest/BciEngJTest.mak (-4 / +4 lines)
Lines 58-64 Link Here
58
    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
58
    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
59
59
60
CPP=cl.exe
60
CPP=cl.exe
61
CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "..\\" /I "..\..\\" /I "..\..\..\commmon" /I "..\..\..\JClass" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\BciEngJTest.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
61
CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "..\\" /I "..\..\\" /I "..\..\..\common" /I "..\..\..\JClass" /I "..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include" /I "..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include" /I "..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "STATIC_BUILD" /Fp"$(INTDIR)\BciEngJTest.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
62
62
63
.c{$(INTDIR)}.obj::
63
.c{$(INTDIR)}.obj::
64
   $(CPP) @<<
64
   $(CPP) @<<
Lines 96-102 Link Here
96
BSC32_SBRS= \
96
BSC32_SBRS= \
97
	
97
	
98
LINK32=link.exe
98
LINK32=link.exe
99
LINK32_FLAGS=kernel32.lib JClassStat.lib BCIEng.lib BCIEngJ.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\BciEngJTest.pdb" /machine:I386 /out:"$(OUTDIR)\BciEngJTest.exe" /libpath:"..\..\..\JClass\Release" /libpath:"..\..\Release" /libpath:"..\Release" 
99
LINK32_FLAGS=BCIEng.lib BCIEngJ.lib kernel32.lib JClassStat.lib verifier.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\BciEngJTest.pdb" /machine:I386 /out:"$(OUTDIR)\BciEngJTest.exe" /libpath:"..\..\..\JClass\Release" /libpath:"..\..\Release" /libpath:"..\Release" /libpath:"..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\lib\windows\release\IA-32" 
100
LINK32_OBJS= \
100
LINK32_OBJS= \
101
	"$(INTDIR)\BCIEngJTest.obj"
101
	"$(INTDIR)\BCIEngJTest.obj"
102
102
Lines 127-133 Link Here
127
    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
127
    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
128
128
129
CPP=cl.exe
129
CPP=cl.exe
130
CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\\" /I "..\..\\" /I "..\..\..\commmon" /I "..\..\..\JClass" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\BciEngJTest.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
130
CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\\" /I "..\..\\" /I "..\..\..\common" /I "..\..\..\JClass" /I "..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include" /I "..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include" /I "..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "STATIC_BUILD" /Fp"$(INTDIR)\BciEngJTest.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
131
131
132
.c{$(INTDIR)}.obj::
132
.c{$(INTDIR)}.obj::
133
   $(CPP) @<<
133
   $(CPP) @<<
Lines 165-171 Link Here
165
BSC32_SBRS= \
165
BSC32_SBRS= \
166
	
166
	
167
LINK32=link.exe
167
LINK32=link.exe
168
LINK32_FLAGS=BCIEng.lib BCIEngJ.lib kernel32.lib JClassStat.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\BciEngJTest.pdb" /debug /machine:I386 /out:"$(OUTDIR)\BciEngJTest.exe" /pdbtype:sept /libpath:"..\..\..\JClass\Debug" /libpath:"..\..\Debug" /libpath:"..\Debug" /fixed:no 
168
LINK32_FLAGS=BCIEng.lib BCIEngJ.lib kernel32.lib JClassStat.lib verifier.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\BciEngJTest.pdb" /debug /machine:I386 /out:"$(OUTDIR)\BciEngJTest.exe" /pdbtype:sept /libpath:"..\..\..\JClass\Debug" /libpath:"..\..\Debug" /libpath:"..\Debug" /libpath:"..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\lib\windows\debug\IA-32" /fixed:no 
169
LINK32_OBJS= \
169
LINK32_OBJS= \
170
	"$(INTDIR)\BCIEngJTest.obj"
170
	"$(INTDIR)\BCIEngJTest.obj"
171
171
(-)src-native/BCI/BCIEng/BCIEngJ/BCIEngJTest/BciEngJTest.dep (-13 / +12 lines)
Lines 1-24 Link Here
1
#############################################################
2
# Copyright (c) 2005, 2006 IBM Corporation and others. 
3
# All rights reserved.   This program and the accompanying materials 
4
# are made available under the terms of the Eclipse Public License v1.0 
5
# which accompanies this distribution, and is available at 
6
# http://www.eclipse.org/legal/epl-v10.html         
7
# $Id: BciEngJTest.dep,v 1.6 2006/03/24 21:58:18 hleung Exp $ 
8
#  
9
# Contributors: 
10
# IBM - Initial contribution
11
#############################################################
12
13
# Microsoft Developer Studio Generated Dependency File, included by BciEngJTest.mak
1
# Microsoft Developer Studio Generated Dependency File, included by BciEngJTest.mak
14
2
15
.\BCIEngJTest.cpp : \
3
.\BCIEngJTest.cpp : \
16
	"..\..\..\JClass\JavaDef.h"\
4
	"..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\common.h"\
5
	"..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\hycomp.h"\
6
	"..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\platform_types.h"\
7
	"..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include\verifier.h"\
8
	"..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier\x_class_interface.h"\
9
	"..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier\x_verifier.h"\
10
	"..\..\..\common\commondef.h"\
11
	"..\..\..\common\javadef.h"\
12
	"..\..\..\Common\JavaHelpers.h"\
17
	"..\..\..\JClass\JBaseStream.h"\
13
	"..\..\..\JClass\JBaseStream.h"\
14
	"..\..\..\JClass\JClassBuilder.h"\
18
	"..\..\..\JClass\JClassFile.h"\
15
	"..\..\..\JClass\JClassFile.h"\
19
	"..\..\..\JClass\JFileStream.h"\
16
	"..\..\..\JClass\JFileStream.h"\
20
	"..\..\..\JClass\JStream.h"\
17
	"..\..\..\JClass\JStream.h"\
21
	"..\..\InsSet.h"\
18
	"..\..\InsSet.h"\
22
	"..\..\Module.h"\
19
	"..\..\Module.h"\
20
	"..\class_inerface_int.h"\
23
	"..\ModuleJ.h"\
21
	"..\ModuleJ.h"\
22
	"c:\program files\microsoft visual studio\vc98\include\basetsd.h"\
24
	
23
	
(-)src-native/BCI/BCIEng/BCIEngJ/BCIEngJTest/BciEngJTest.dsp (-4 / +4 lines)
Lines 42-48 Link Here
42
# PROP Ignore_Export_Lib 0
42
# PROP Ignore_Export_Lib 0
43
# PROP Target_Dir ""
43
# PROP Target_Dir ""
44
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
44
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
45
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\\" /I "..\..\\" /I "..\..\..\common" /I "..\..\..\JClass" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
45
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\\" /I "..\..\\" /I "..\..\..\common" /I "..\..\..\JClass" /I "..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include" /I "..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include" /I "..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "STATIC_BUILD" /YX /FD /c
46
# ADD BASE RSC /l 0x409 /d "NDEBUG"
46
# ADD BASE RSC /l 0x409 /d "NDEBUG"
47
# ADD RSC /l 0x409 /d "NDEBUG"
47
# ADD RSC /l 0x409 /d "NDEBUG"
48
BSC32=bscmake.exe
48
BSC32=bscmake.exe
Lines 50-56 Link Here
50
# ADD BSC32 /nologo
50
# ADD BSC32 /nologo
51
LINK32=link.exe
51
LINK32=link.exe
52
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
52
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
53
# ADD LINK32 kernel32.lib JClassStat.lib BCIEng.lib BCIEngJ.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\JClass\Release" /libpath:"..\..\Release" /libpath:"..\Release"
53
# ADD LINK32 BCIEng.lib BCIEngJ.lib kernel32.lib JClassStat.lib verifier.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\JClass\Release" /libpath:"..\..\Release" /libpath:"..\Release" /libpath:"..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\lib\windows\release\IA-32"
54
54
55
!ELSEIF  "$(CFG)" == "BciEngJTest - Win32 Debug"
55
!ELSEIF  "$(CFG)" == "BciEngJTest - Win32 Debug"
56
56
Lines 66-72 Link Here
66
# PROP Ignore_Export_Lib 0
66
# PROP Ignore_Export_Lib 0
67
# PROP Target_Dir ""
67
# PROP Target_Dir ""
68
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
68
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
69
# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\\" /I "..\..\\" /I "..\..\..\common" /I "..\..\..\JClass" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
69
# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\\" /I "..\..\\" /I "..\..\..\common" /I "..\..\..\JClass" /I "..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include" /I "..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include" /I "..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "STATIC_BUILD" /YX /FD /GZ /c
70
# ADD BASE RSC /l 0x409 /d "_DEBUG"
70
# ADD BASE RSC /l 0x409 /d "_DEBUG"
71
# ADD RSC /l 0x409 /d "_DEBUG"
71
# ADD RSC /l 0x409 /d "_DEBUG"
72
BSC32=bscmake.exe
72
BSC32=bscmake.exe
Lines 74-80 Link Here
74
# ADD BSC32 /nologo
74
# ADD BSC32 /nologo
75
LINK32=link.exe
75
LINK32=link.exe
76
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
76
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
77
# ADD LINK32 BCIEng.lib BCIEngJ.lib kernel32.lib JClassStat.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\JClass\Debug" /libpath:"..\..\Debug" /libpath:"..\Debug" /fixed:no
77
# ADD LINK32 BCIEng.lib BCIEngJ.lib kernel32.lib JClassStat.lib verifier.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\JClass\Debug" /libpath:"..\..\Debug" /libpath:"..\Debug" /libpath:"..\..\..\..\..\..\org.apache.harmony_vmcore_verifier\lib\windows\debug\IA-32" /fixed:no
78
# SUBTRACT LINK32 /pdb:none
78
# SUBTRACT LINK32 /pdb:none
79
79
80
!ENDIF 
80
!ENDIF 
(-)src-native/BCI/BCIEng/BCIEngJ/BCIEngJTest/BCIEngJTest.cpp (-3 / +3 lines)
Lines 144-153 Link Here
144
void 
144
void 
145
CBCIEngJTest::OpenClass(const char* i_szClassName)
145
CBCIEngJTest::OpenClass(const char* i_szClassName)
146
{
146
{
147
	CJFileStream	InStream(i_szClassName);	// File stream
147
	CJFileStream	InStream(i_szClassName);	 // File stream
148
	CJStream		JStreamIn(&InStream);		// Java input stream
148
	CJStream		JStreamIn(&InStream);		 // Java input stream
149
	CModuleJ*		pModuleJ = new CModuleJ;
149
	CModuleJ*		pModuleJ = new CModuleJ;
150
	CJClassFile* pClass = new CJClassFile;      // Will be deleted in the module destructor
150
	CJClassBuilder* pClass = new CJClassBuilder; // Will be deleted in the module destructor
151
	pClass->Read(JStreamIn);
151
	pClass->Read(JStreamIn);
152
	pModuleJ->Open(pClass, true);
152
	pModuleJ->Open(pClass, true);
153
	pModuleJ->SetAccessFlags(pClass->GetAccessFlags());
153
	pModuleJ->SetAccessFlags(pClass->GetAccessFlags());
(-)src-native/BCI/BCIEng/ProbeUnitTests/ProbeUnitTests.dsp (-4 / +6 lines)
Lines 23-28 Link Here
23
23
24
# Begin Project
24
# Begin Project
25
# PROP AllowPerConfigDependencies 0
25
# PROP AllowPerConfigDependencies 0
26
# PROP Scc_ProjName ""
27
# PROP Scc_LocalPath ""
26
CPP=cl.exe
28
CPP=cl.exe
27
RSC=rc.exe
29
RSC=rc.exe
28
30
Lines 40-46 Link Here
40
# PROP Ignore_Export_Lib 0
42
# PROP Ignore_Export_Lib 0
41
# PROP Target_Dir ""
43
# PROP Target_Dir ""
42
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
44
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
43
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\BCIEngProbe" /I "..\BCIEngJ" /I ".." /I "..\..\JClass" /I "..\..\common" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
45
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\BCIEngProbe" /I "..\BCIEngJ" /I ".." /I "..\..\JClass" /I "..\..\common" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "STATIC_BUILD" /YX /FD /c
44
# ADD BASE RSC /l 0x409 /d "NDEBUG"
46
# ADD BASE RSC /l 0x409 /d "NDEBUG"
45
# ADD RSC /l 0x409 /d "NDEBUG"
47
# ADD RSC /l 0x409 /d "NDEBUG"
46
BSC32=bscmake.exe
48
BSC32=bscmake.exe
Lines 48-54 Link Here
48
# ADD BSC32 /nologo
50
# ADD BSC32 /nologo
49
LINK32=link.exe
51
LINK32=link.exe
50
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
52
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
51
# ADD LINK32 kernel32.lib ..\..\jclass\release\jclassstat.lib ..\release\bcieng.lib ..\bciengj\release\bciengj.lib /nologo /subsystem:console /machine:I386
53
# ADD LINK32 verifier.lib kernel32.lib ..\..\jclass\release\jclassstat.lib ..\release\bcieng.lib ..\bciengj\release\bciengj.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\..\..\org.apache.harmony_vmcore_verifier\lib\windows\release\IA-32"
52
54
53
!ELSEIF  "$(CFG)" == "ProbeUnitTests - Win32 Debug"
55
!ELSEIF  "$(CFG)" == "ProbeUnitTests - Win32 Debug"
54
56
Lines 64-70 Link Here
64
# PROP Ignore_Export_Lib 0
66
# PROP Ignore_Export_Lib 0
65
# PROP Target_Dir ""
67
# PROP Target_Dir ""
66
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
68
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
67
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\BCIEngProbe" /I "..\BCIEngJ" /I ".." /I "..\..\JClass" /I "..\..\common" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
69
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\BCIEngProbe" /I "..\BCIEngJ" /I ".." /I "..\..\JClass" /I "..\..\common" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "STATIC_BUILD" /FR /YX /FD /GZ /c
68
# ADD BASE RSC /l 0x409 /d "_DEBUG"
70
# ADD BASE RSC /l 0x409 /d "_DEBUG"
69
# ADD RSC /l 0x409 /d "_DEBUG"
71
# ADD RSC /l 0x409 /d "_DEBUG"
70
BSC32=bscmake.exe
72
BSC32=bscmake.exe
Lines 72-78 Link Here
72
# ADD BSC32 /nologo
74
# ADD BSC32 /nologo
73
LINK32=link.exe
75
LINK32=link.exe
74
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
76
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
75
# ADD LINK32 kernel32.lib ..\..\jclass\debug\jclassstat.lib ..\debug\bcieng.lib ..\bciengj\debug\bciengj.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
77
# ADD LINK32 verifier.lib kernel32.lib ..\..\jclass\debug\jclassstat.lib ..\debug\bcieng.lib ..\bciengj\debug\bciengj.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\..\org.apache.harmony_vmcore_verifier\lib\windows\debug\IA-32"
76
78
77
!ENDIF 
79
!ENDIF 
78
80
(-)src-native/BCI/BCIEng/ProbeUnitTests/ProbeUnitTests.mak (-6 / +6 lines)
Lines 62-68 Link Here
62
    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
62
    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
63
63
64
CPP=cl.exe
64
CPP=cl.exe
65
CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "..\BCIEngProbe" /I "..\BCIEngJ" /I ".." /I "..\..\JClass" /I "..\..\common" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\ProbeUnitTests.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
65
CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "..\BCIEngProbe" /I "..\BCIEngJ" /I ".." /I "..\..\JClass" /I "..\..\common" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "STATIC_BUILD" /Fp"$(INTDIR)\ProbeUnitTests.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
66
66
67
.c{$(INTDIR)}.obj::
67
.c{$(INTDIR)}.obj::
68
   $(CPP) @<<
68
   $(CPP) @<<
Lines 100-106 Link Here
100
BSC32_SBRS= \
100
BSC32_SBRS= \
101
	
101
	
102
LINK32=link.exe
102
LINK32=link.exe
103
LINK32_FLAGS=kernel32.lib ..\..\jclass\release\jclassstat.lib ..\release\bcieng.lib ..\bciengj\release\bciengj.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\ProbeUnitTests.pdb" /machine:I386 /out:"$(OUTDIR)\ProbeUnitTests.exe" 
103
LINK32_FLAGS=verifier.lib kernel32.lib ..\..\jclass\release\jclassstat.lib ..\release\bcieng.lib ..\bciengj\release\bciengj.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\ProbeUnitTests.pdb" /machine:I386 /out:"$(OUTDIR)\ProbeUnitTests.exe" /libpath:"..\..\..\..\..\org.apache.harmony_vmcore_verifier\lib\windows\release\IA-32" 
104
LINK32_OBJS= \
104
LINK32_OBJS= \
105
	"$(INTDIR)\BCIEngProbe.obj" \
105
	"$(INTDIR)\BCIEngProbe.obj" \
106
	"$(INTDIR)\ProbeUnitTests.obj" \
106
	"$(INTDIR)\ProbeUnitTests.obj" \
Lines 141-147 Link Here
141
    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
141
    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
142
142
143
CPP=cl.exe
143
CPP=cl.exe
144
CPP_PROJ=/nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\BCIEngProbe" /I "..\BCIEngJ" /I ".." /I "..\..\JClass" /I "..\..\common" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\ProbeUnitTests.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
144
CPP_PROJ=/nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\BCIEngProbe" /I "..\BCIEngJ" /I ".." /I "..\..\JClass" /I "..\..\common" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "STATIC_BUILD" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\ProbeUnitTests.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
145
145
146
.c{$(INTDIR)}.obj::
146
.c{$(INTDIR)}.obj::
147
   $(CPP) @<<
147
   $(CPP) @<<
Lines 187-193 Link Here
187
<<
187
<<
188
188
189
LINK32=link.exe
189
LINK32=link.exe
190
LINK32_FLAGS=kernel32.lib ..\..\jclass\debug\jclassstat.lib ..\debug\bcieng.lib ..\bciengj\debug\bciengj.lib /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\ProbeUnitTests.pdb" /debug /machine:I386 /out:"$(OUTDIR)\ProbeUnitTests.exe" /pdbtype:sept 
190
LINK32_FLAGS=verifier.lib kernel32.lib ..\..\jclass\debug\jclassstat.lib ..\debug\bcieng.lib ..\bciengj\debug\bciengj.lib /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\ProbeUnitTests.pdb" /debug /machine:I386 /out:"$(OUTDIR)\ProbeUnitTests.exe" /pdbtype:sept /libpath:"..\..\..\..\..\org.apache.harmony_vmcore_verifier\lib\windows\debug\IA-32" 
191
LINK32_OBJS= \
191
LINK32_OBJS= \
192
	"$(INTDIR)\BCIEngProbe.obj" \
192
	"$(INTDIR)\BCIEngProbe.obj" \
193
	"$(INTDIR)\ProbeUnitTests.obj" \
193
	"$(INTDIR)\ProbeUnitTests.obj" \
Lines 249-255 Link Here
249
249
250
!IF  "$(CFG)" == "ProbeUnitTests - Win32 Release"
250
!IF  "$(CFG)" == "ProbeUnitTests - Win32 Release"
251
251
252
CPP_SWITCHES=/nologo /MD /W3 /GX /O2 /I "..\BCIEngProbe" /I "..\BCIEngJ" /I ".." /I "..\..\JClass" /I "..\..\common" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\ProbeUnitTests.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
252
CPP_SWITCHES=/nologo /MD /W3 /GX /O2 /I "..\BCIEngProbe" /I "..\BCIEngJ" /I ".." /I "..\..\JClass" /I "..\..\common" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "STATIC_BUILD" /Fp"$(INTDIR)\ProbeUnitTests.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
253
253
254
"$(INTDIR)\StdAfx.obj"	"$(INTDIR)\ProbeUnitTests.pch" : $(SOURCE) "$(INTDIR)"
254
"$(INTDIR)\StdAfx.obj"	"$(INTDIR)\ProbeUnitTests.pch" : $(SOURCE) "$(INTDIR)"
255
	$(CPP) @<<
255
	$(CPP) @<<
Lines 259-265 Link Here
259
259
260
!ELSEIF  "$(CFG)" == "ProbeUnitTests - Win32 Debug"
260
!ELSEIF  "$(CFG)" == "ProbeUnitTests - Win32 Debug"
261
261
262
CPP_SWITCHES=/nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\BCIEngProbe" /I "..\BCIEngJ" /I ".." /I "..\..\JClass" /I "..\..\common" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\ProbeUnitTests.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
262
CPP_SWITCHES=/nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\BCIEngProbe" /I "..\BCIEngJ" /I ".." /I "..\..\JClass" /I "..\..\common" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include" /I "..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "STATIC_BUILD" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\ProbeUnitTests.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
263
263
264
"$(INTDIR)\StdAfx.obj"	"$(INTDIR)\StdAfx.sbr"	"$(INTDIR)\ProbeUnitTests.pch" : $(SOURCE) "$(INTDIR)"
264
"$(INTDIR)\StdAfx.obj"	"$(INTDIR)\StdAfx.sbr"	"$(INTDIR)\ProbeUnitTests.pch" : $(SOURCE) "$(INTDIR)"
265
	$(CPP) @<<
265
	$(CPP) @<<
(-)src-native/BCI/BCIEng/ProbeUnitTests/ProbeUnitTests.dep (-2 / +21 lines)
Lines 2-14 Link Here
2
# Hand-edited by apratt to remove absolute paths and other silliness
2
# Hand-edited by apratt to remove absolute paths and other silliness
3
3
4
..\BCIEngProbe\BCIEngProbe.cpp : \
4
..\BCIEngProbe\BCIEngProbe.cpp : \
5
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\common.h"\
6
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\hycomp.h"\
7
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\platform_types.h"\
8
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include\verifier.h"\
9
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier\x_class_interface.h"\
10
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier\x_verifier.h"\
5
	"..\..\common\commondef.h"\
11
	"..\..\common\commondef.h"\
6
	"..\..\JClass\JavaDef.h"\
12
	"..\..\common\javadef.h"\
13
	"..\..\Common\JavaHelpers.h"\
7
	"..\..\JClass\JBaseStream.h"\
14
	"..\..\JClass\JBaseStream.h"\
15
	"..\..\JClass\JClassBuilder.h"\
8
	"..\..\JClass\JClassFile.h"\
16
	"..\..\JClass\JClassFile.h"\
9
	"..\..\JClass\JMemStream.h"\
17
	"..\..\JClass\JMemStream.h"\
10
	"..\..\JClass\JStream.h"\
18
	"..\..\JClass\JStream.h"\
11
	"..\BCIEng.h"\
19
	"..\BCIEng.h"\
20
	"..\bcienginterface.h"\
21
	"..\BCIEngJ\class_inerface_int.h"\
12
	"..\BCIEngJ\ExtRefJ_StatMethod.h"\
22
	"..\BCIEngJ\ExtRefJ_StatMethod.h"\
13
	"..\BCIEngJ\JVMInsSet.h"\
23
	"..\BCIEngJ\JVMInsSet.h"\
14
	"..\BCIEngJ\ModuleJ.h"\
24
	"..\BCIEngJ\ModuleJ.h"\
Lines 18-29 Link Here
18
	
28
	
19
29
20
.\ProbeUnitTests.cpp : \
30
.\ProbeUnitTests.cpp : \
31
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\common.h"\
32
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\hycomp.h"\
33
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\include\open\platform_types.h"\
34
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\include\verifier.h"\
35
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier\x_class_interface.h"\
36
	"..\..\..\..\..\org.apache.harmony_vmcore_verifier\src\vmcore\src\verifier-3363\x_verifier\x_verifier.h"\
21
	"..\..\common\commondef.h"\
37
	"..\..\common\commondef.h"\
22
	"..\..\JClass\JavaDef.h"\
38
	"..\..\common\javadef.h"\
39
	"..\..\Common\JavaHelpers.h"\
23
	"..\..\JClass\JBaseStream.h"\
40
	"..\..\JClass\JBaseStream.h"\
41
	"..\..\JClass\JClassBuilder.h"\
24
	"..\..\JClass\JClassFile.h"\
42
	"..\..\JClass\JClassFile.h"\
25
	"..\..\JClass\JStream.h"\
43
	"..\..\JClass\JStream.h"\
26
	"..\BCIEng.h"\
44
	"..\BCIEng.h"\
45
	"..\BCIEngJ\class_inerface_int.h"\
27
	"..\BCIEngJ\ModuleJ.h"\
46
	"..\BCIEngJ\ModuleJ.h"\
28
	"..\BCIEngProbe\BCIEngProbe.h"\
47
	"..\BCIEngProbe\BCIEngProbe.h"\
29
	"..\InsSet.h"\
48
	"..\InsSet.h"\
(-)src-native/BCI/JDump/JDump.mak (-2 / +2 lines)
Lines 117-123 Link Here
117
<<
117
<<
118
118
119
LINK32=link.exe
119
LINK32=link.exe
120
LINK32_FLAGS=kernel32.lib user32.lib JclassStat.lib ..\bcieng\release\bcieng.lib ..\bcieng\bciengj\release\bciengj.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\JDump.pdb" /machine:I386 /out:"$(OUTDIR)\JDump.exe" /libpath:"..\JClass\Release" 
120
LINK32_FLAGS=kernel32.lib user32.lib JclassStat.lib ..\bcieng\release\bcieng.lib ..\bcieng\bciengj\release\bciengj.lib verifier.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\JDump.pdb" /machine:I386 /out:"$(OUTDIR)\JDump.exe" /libpath:"..\JClass\Release" /libpath:"..\..\..\..\org.apache.harmony_vmcore_verifier\lib\windows\release\IA-32" 
121
LINK32_OBJS= \
121
LINK32_OBJS= \
122
	"$(INTDIR)\Command.obj" \
122
	"$(INTDIR)\Command.obj" \
123
	"$(INTDIR)\JDump.obj" \
123
	"$(INTDIR)\JDump.obj" \
Lines 212-218 Link Here
212
<<
212
<<
213
213
214
LINK32=link.exe
214
LINK32=link.exe
215
LINK32_FLAGS=kernel32.lib JClassStat.lib ..\bcieng\debug\bcieng.lib ..\bcieng\bciengj\debug\bciengj.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\JDump.pdb" /map:"$(INTDIR)\JDump.map" /debug /machine:I386 /out:"$(OUTDIR)\JDump.exe" /libpath:"..\JClass\debug\\" /fixed:no 
215
LINK32_FLAGS=kernel32.lib JClassStat.lib ..\bcieng\debug\bcieng.lib ..\bcieng\bciengj\debug\bciengj.lib verifier.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\JDump.pdb" /map:"$(INTDIR)\JDump.map" /debug /machine:I386 /out:"$(OUTDIR)\JDump.exe" /libpath:"..\JClass\debug" /libpath:"..\..\..\..\org.apache.harmony_vmcore_verifier\lib\windows\debug\IA-32" /fixed:no 
216
LINK32_OBJS= \
216
LINK32_OBJS= \
217
	"$(INTDIR)\Command.obj" \
217
	"$(INTDIR)\Command.obj" \
218
	"$(INTDIR)\JDump.obj" \
218
	"$(INTDIR)\JDump.obj" \
(-)src-native/BCI/JDump/JDump.dsp (-2 / +4 lines)
Lines 23-28 Link Here
23
23
24
# Begin Project
24
# Begin Project
25
# PROP AllowPerConfigDependencies 0
25
# PROP AllowPerConfigDependencies 0
26
# PROP Scc_ProjName ""
27
# PROP Scc_LocalPath ""
26
CPP=cl.exe
28
CPP=cl.exe
27
RSC=rc.exe
29
RSC=rc.exe
28
30
Lines 48-54 Link Here
48
# ADD BSC32 /nologo
50
# ADD BSC32 /nologo
49
LINK32=link.exe
51
LINK32=link.exe
50
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
52
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
51
# ADD LINK32 kernel32.lib user32.lib JclassStat.lib ..\bcieng\release\bcieng.lib ..\bcieng\bciengj\release\bciengj.lib /nologo /subsystem:console /machine:I386 /libpath:"..\JClass\Release"
53
# ADD LINK32 kernel32.lib user32.lib JclassStat.lib ..\bcieng\release\bcieng.lib ..\bcieng\bciengj\release\bciengj.lib verifier.lib /nologo /subsystem:console /machine:I386 /libpath:"..\JClass\Release" /libpath:"..\..\..\..\org.apache.harmony_vmcore_verifier\lib\windows\release\IA-32"
52
54
53
!ELSEIF  "$(CFG)" == "JDump - Win32 Debug"
55
!ELSEIF  "$(CFG)" == "JDump - Win32 Debug"
54
56
Lines 72-78 Link Here
72
# ADD BSC32 /nologo
74
# ADD BSC32 /nologo
73
LINK32=link.exe
75
LINK32=link.exe
74
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
76
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
75
# ADD LINK32 kernel32.lib JClassStat.lib ..\bcieng\debug\bcieng.lib ..\bcieng\bciengj\debug\bciengj.lib /nologo /subsystem:console /incremental:no /map /debug /machine:I386 /libpath:"..\JClass\debug\\" /fixed:no
77
# ADD LINK32 kernel32.lib JClassStat.lib ..\bcieng\debug\bcieng.lib ..\bcieng\bciengj\debug\bciengj.lib verifier.lib /nologo /subsystem:console /incremental:no /map /debug /machine:I386 /libpath:"..\JClass\debug" /libpath:"..\..\..\..\org.apache.harmony_vmcore_verifier\lib\windows\debug\IA-32" /fixed:no
76
# SUBTRACT LINK32 /pdb:none
78
# SUBTRACT LINK32 /pdb:none
77
79
78
!ENDIF 
80
!ENDIF 
(-)src-native/BCI/BCIEng/BCIEngJ/class_interface_x.h (+46 lines)
Added Link Here
1
/********************************************************************** 
2
 * Copyright (c) 2008 IBM Corporation and others. 
3
 * All rights reserved.   This program and the accompanying materials 
4
 * are made available under the terms of the Eclipse Public License v1.0 
5
 * which accompanies this distribution, and is available at 
6
 * http://www.eclipse.org/legal/epl-v10.html         
7
 * $Id$ 
8
 * 
9
 * Contributors: 
10
 * Intel - Initial API and implementation 
11
 **********************************************************************/ 
12
13
#ifndef _CLASS_INTERFACE_X_H_
14
#define _CLASS_INTERFACE_X_H_
15
16
typedef unsigned long intptr;
17
18
19
#ifdef __cplusplus
20
//extern "C" {
21
#endif
22
23
#if 0
24
#include "class_interface.h"
25
#include "x_verifier.h"
26
#else
27
#define __INSURE__
28
#include "verifier-ext/class_interface.h"
29
#include "verifier-ext/x_verifier.h"
30
#endif
31
32
// removes given exception handler (handlers with greater indexes shift)
33
void method_remove_exc_handler( method_handler method, unsigned short idx );
34
35
//modifies start_pc, end_pc 
36
void method_modify_exc_handler_info(method_handler method, 
37
                                    unsigned short idx, 
38
                                    unsigned short start_pc,
39
                                    unsigned short end_pc, 
40
                                    unsigned short handler_pc, 
41
                                    unsigned short handler_cp_index );
42
unsigned short class_get_cp_class_entry(class_handler k_class, const char* name);
43
#ifdef __cplusplus
44
//}
45
#endif
46
#endif /*!_CLASS_INTERFACE_X_H_*/
(-)src-native/BCI/BCIEng/BCIEngJ/class_inerface_int.h (+41 lines)
Added Link Here
1
/********************************************************************** 
2
 * Copyright (c) 2008 IBM Corporation and others. 
3
 * All rights reserved.   This program and the accompanying materials 
4
 * are made available under the terms of the Eclipse Public License v1.0 
5
 * which accompanies this distribution, and is available at 
6
 * http://www.eclipse.org/legal/epl-v10.html         
7
 * $Id$ 
8
 * 
9
 * Contributors: 
10
 * Intel - Initial API and implementation 
11
 **********************************************************************/ 
12
13
#ifndef _CLASS_INTERFACE_INT_H_
14
#define _CLASS_INTERFACE_INT_H_
15
16
//typedef u1 uint8;
17
//typedef u2 uint16;
18
//#include "class_interface.h"
19
//#include "class_interface_x.h"
20
21
#include "x_class_interface.h"
22
#include "x_verifier.h"
23
24
#include "JClassBuilder.h"
25
26
typedef Class_Handle class_handler;
27
typedef Method_Handle method_handler;
28
typedef void *(*get_vm_pointer_t)(void **);
29
30
class_handler get_class_handler_from_builder(class CModuleJ *);
31
method_handler get_method_handler_for_cmethod(class CMethod *);
32
33
//extern "C" {
34
//unsigned method_get_bytecode_length( method_handler);
35
//}
36
37
extern int initialize_dynamic(get_vm_pointer_t);
38
39
int initialize_static();
40
41
#endif
(-)src-native/BCI/BCIEng/BCIEngJ/class_interface.cpp (+1250 lines)
Added Link Here
1
/********************************************************************** 
2
 * Copyright (c) 2008 IBM Corporation and others. 
3
 * All rights reserved.   This program and the accompanying materials 
4
 * are made available under the terms of the Eclipse Public License v1.0 
5
 * which accompanies this distribution, and is available at 
6
 * http://www.eclipse.org/legal/epl-v10.html         
7
 * $Id$ 
8
 * 
9
 * Contributors: 
10
 * Intel - Initial API and implementation 
11
 **********************************************************************/ 
12
#ifdef WIN32
13
#pragma warning(disable:4786)
14
#endif
15
16
#include <stdlib.h>
17
#include <string.h>
18
19
#include <map>
20
21
#include <assert.h>
22
23
#include "class_inerface_int.h"
24
#include "BCIEng.h"
25
#include "JClassBuilder.h"
26
#include "ModuleJ.h"
27
28
#include "JMemStream.h"
29
30
#include <jni.h>
31
32
typedef unsigned long intptr;
33
34
static JNIEnv *(*m_get_vm_pointer)(void **);
35
36
static jclass m_j_l_class;
37
static jclass m_j_l_classloader;
38
static jmethodID m_j_l_class_getName; /*()Ljava/lang/String;*/
39
static jmethodID m_j_l_class_isInterface;/* ()Z */
40
static jmethodID m_j_l_class_getClassLoader; /*()Ljava/lang/ClassLoader;*/
41
static jmethodID m_j_l_classloader_findLoadedClass; /*(Ljava/lang/String;)Ljava/lang/Class;*/
42
static jmethodID m_j_l_classloader_getSystemClassLoader; /*()Ljava/lang/ClassLoader;*/
43
static jobject m_system_classloader;
44
/**
45
 * Define class handler
46
 */
47
/*[0xdead0001 - simplefied, 0xdead0002 - instrumented, 0xdead0000 - none]*/
48
#define CLASS_HANDLER_MASK 0xdeadffff
49
#define CLASS_HANDLER_SIMPLEFIED 0xdead0001
50
#define CLASS_HANDLER_INSTRUMENTED 0xdead0002
51
#define CLASS_HANDLER_NONE 0xdead0000
52
#define IS_CLASS_INSTRUMENTED(x) (((x)->magic & CLASS_HANDLER_MASK) == CLASS_HANDLER_INSTRUMENTED)
53
struct Class{
54
	int magic; 
55
	struct {
56
		class CModuleJ *instrumented_class;
57
		void *simplefied_class;
58
	} X; /*XXX: possible union here will be more applieble */
59
	int loaded;
60
	const char *class_name; /*used if loaded = 0*/
61
	struct Class *super_class;
62
};
63
64
typedef std::map<std::string,class_handler> name2ch_t;
65
static name2ch_t m_name2ch;
66
67
#define MEHTOD_HANDLER_MASK 0xbabeffff
68
#define METHOD_HANDLER_SELF 0xbabe0001
69
#define METHOD_HANDLER_EXT 0xbabe0002
70
#define METHOD_HANDLER_NONE 0xbabe0000
71
struct Method {
72
	int magic; 
73
	struct {
74
		class CMethodJ *instrumented_method;
75
		void *simplefied_method;
76
	} X; /*XXX: possible union here will be more applieble */
77
	class_handler class_owner;
78
	const char *method_name; /*used for METHOD_HANDLER_EXT only*/
79
	const char *method_descriptor; /*used for METHOD_HANDLER_EXT only*/
80
};
81
82
static struct Class *m_j_l_object_ch; 
83
/**
84
 * Define field handler
85
 */
86
typedef struct Field_ * field_handler;
87
88
/**
89
 * Define method handler
90
 */
91
//typedef struct Method_ * method_handler;
92
93
/**
94
 * Define class loader handler
95
 */
96
typedef struct ClassLoader_ * classloader_handler;
97
98
static int 
99
create_class_handler(class_handler *pch, int flag, const char *class_name, int loaded, void *dsk)
100
{
101
	class_handler ch0 = m_name2ch[class_name]; /*for debug*/
102
	if (m_name2ch[class_name] != NULL 
103
		&& m_name2ch[class_name]->magic == flag) {
104
			*pch = m_name2ch[class_name];
105
			return (0);
106
	} 
107
	class_handler ch = (class_handler)malloc(sizeof(struct Class));
108
	memset(ch, 0, sizeof(struct Class));
109
	assert(ch);
110
	ch->loaded = loaded;
111
	if (loaded == 0) {
112
		ch->class_name = class_name;
113
	}
114
	ch->magic = flag;
115
	switch(flag) {
116
	case (CLASS_HANDLER_SIMPLEFIED):
117
		ch->X.simplefied_class = dsk;
118
		if (loaded == 0) {
119
			ch->class_name = class_name;
120
		}
121
		ch->loaded = loaded;
122
		break;
123
	case (CLASS_HANDLER_INSTRUMENTED):
124
		ch->X.instrumented_class = (CModuleJ *)dsk;
125
		break;
126
	default:
127
		assert(!"shouldn't be here!!!");
128
	}
129
	*pch = ch;
130
	m_name2ch[class_name] = ch;
131
	return (0);
132
}
133
134
extern "C" int
135
create_method_handler(method_handler *pmh, class_handler ch, int flag, void *dsk) 
136
{
137
	method_handler mh = (method_handler)malloc(sizeof(struct Method));
138
	assert(mh);
139
	memset(mh, 0, sizeof(struct Method));
140
	switch (flag) {
141
	case METHOD_HANDLER_SELF:
142
		mh->X.instrumented_method = (class CMethodJ *)dsk;
143
		break;
144
	case METHOD_HANDLER_EXT:
145
		mh->X.simplefied_method = dsk;
146
		break;
147
	default:
148
		assert(!"shouldn't enter here");
149
	}
150
	mh->magic = (IS_CLASS_INSTRUMENTED(ch))?METHOD_HANDLER_SELF:flag;
151
	mh->class_owner = ch;
152
	*pmh = mh;
153
	return (0);
154
}
155
/**
156
 * Class interface
157
 */
158
159
/**
160
 * Function returns class major version.
161
 * @param klass - class handler
162
 * @return Class name bytes.
163
 * @note Assertion is raised if klass is equal to null.
164
 */
165
extern "C" unsigned short 
166
class_get_version( class_handler klass ) {
167
	if (IS_CLASS_INSTRUMENTED(klass)) {
168
		return klass->X.instrumented_class->GetClassBuilder().GetMajorVersion();
169
	} else {
170
		assert (!"not implemented yet!");
171
	}
172
	return (0);
173
}
174
175
/** 
176
 * Function returns class name.
177
 * @param klass - class handler
178
 * @return Class name bytes.
179
 * @note Assertion is raised if klass is equal to null.
180
 */
181
extern "C" const char *
182
class_get_name( class_handler klass ) 
183
{
184
	JNIEnv *env;
185
	jstring class_name;
186
	if (IS_CLASS_INSTRUMENTED(klass)) {
187
		return klass->X.instrumented_class->GetName();
188
	} 
189
	else {
190
		if (klass->loaded == 0) {
191
			return(klass->class_name);
192
		}
193
		env = m_get_vm_pointer((void **)&env);
194
		class_name = (jstring)env->CallObjectMethod((jobject)klass->X.simplefied_class, m_j_l_class_getName);
195
		if (class_name == NULL)
196
			return (NULL);
197
		char *class_name_simple = (char *)env->GetStringUTFChars(class_name, NULL);
198
		char *ch = strchr(class_name_simple, '.');
199
		while (ch != NULL) {
200
			*ch = '/';
201
			ch = strchr(ch, '.');
202
		}
203
		return(class_name_simple);
204
	
205
	}
206
	return (NULL);
207
}
208
209
/** 
210
 * Function returns class loader.
211
 * @param klass - class handler
212
 * @return Class class loader handler.
213
 * @note Assertion is raised if klass is equal to null.
214
 */
215
extern "C" classloader_handler
216
class_get_class_loader( class_handler klass )
217
{
218
	if (IS_CLASS_INSTRUMENTED(klass)) {
219
		return (0);
220
	} else {
221
		assert(!"simplefied");
222
	}
223
	return (NULL);
224
}
225
226
/** 
227
 * Function returns super class of current class.
228
 * @param klass - class handler
229
 * @return Super class of current class.
230
 * @note Assertion is raised if klass is equal to null.
231
 */
232
extern "C" class_handler
233
class_get_super_class( class_handler klass )
234
{
235
236
	const char *class_name;
237
	const char *super_class_name = NULL;
238
	jobject this_class = NULL;
239
	jobject super_class;
240
	JNIEnv *env = NULL;
241
	env = m_get_vm_pointer((void **)&env);
242
	assert(env);
243
	int loaded = 1;
244
	if (klass->loaded == 0 && strcmp(klass->class_name,"java/lang/Object") == 0) return (NULL);
245
	if (klass->super_class != NULL) return (klass->super_class);
246
	
247
	if (IS_CLASS_INSTRUMENTED(klass)) {
248
		class_name = klass->X.instrumented_class->GetName();
249
		CConstPool* cpool = klass->X.instrumented_class->GetClass().GetConstPool();
250
		CCPUtf8Info* utfinfo = cpool->GetClass(klass->X.instrumented_class->GetClass().GetSuperClass());
251
		super_class_name = (const char *)utfinfo->GetBytes();
252
		assert(super_class_name);	
253
		super_class = (jclass)env->FindClass(super_class_name);		
254
	} 
255
	else {
256
		if (klass->loaded == 0) {
257
			assert(klass->class_name);
258
			this_class = (jclass)env->FindClass(klass->class_name);
259
			if (this_class == NULL && env->ExceptionCheck()) {
260
				env->ExceptionDescribe();
261
				env->ExceptionClear();
262
				//XXX: class wasn't found or loaded
263
				return (m_j_l_object_ch);
264
				//return (NULL);
265
			}
266
		}
267
		this_class = this_class?this_class:(jobject)klass->X.simplefied_class;
268
		super_class = (jobject)env->GetSuperclass((jclass)this_class);
269
	}
270
271
	if (super_class == NULL) {
272
		if (env->ExceptionCheck()) {
273
			env->ExceptionDescribe();
274
			env->ExceptionClear();
275
			//XXX: class wasn't found or loaded
276
			loaded = 0;
277
			//return (NULL);
278
		}
279
		else {
280
			klass->super_class = m_j_l_object_ch;
281
			return (m_j_l_object_ch);
282
			//return (NULL); /*it happends when klass is java.lang.Object*/
283
		}
284
	}
285
	else {
286
		jstring jclass_name = (jstring)env->CallObjectMethod(super_class, m_j_l_class_getName);
287
		if (jclass_name == NULL) {
288
			return (m_j_l_object_ch);
289
		}
290
		char *class_name_simple = (char *)env->GetStringUTFChars(jclass_name, NULL);
291
		assert (class_name_simple);
292
		char *ch = strchr(class_name_simple, '.');
293
		while (ch != NULL) {
294
			*ch = '/';
295
			ch = strchr(ch, '.');
296
		}
297
		super_class_name = class_name_simple;
298
	}
299
	
300
	//assert(super_class);
301
	class_handler ch;
302
	int status = create_class_handler(&ch, CLASS_HANDLER_SIMPLEFIED, super_class_name, loaded, super_class);
303
	assert(status == 0);
304
	return (ch);
305
}
306
307
/** 
308
 * Function checks if classes are equal.
309
 * @param klass1 - class handler
310
 * @param klass2 - class handler
311
 * @return If classes are equal returns <code>true</code>, else returns <code>false</code>.
312
 * @note Assertion is raised if klass1 or klass2 are equal to null.
313
 */
314
extern "C" unsigned
315
class_is_same_class( class_handler klass1, class_handler klass2 )
316
{
317
	assert(!"verifier entered!!");
318
	return 0;
319
}
320
321
static char* 
322
package_name(const char* kname)
323
{
324
	char *tokp;
325
	char *tok0;
326
	tokp = tok0 = (char *)&kname[0];
327
	tok0 = strchr(kname, '/');
328
	while (tok0 != NULL) {
329
		tokp = tok0;
330
		tok0 = strchr(tok0 + 1, '/');
331
	}
332
	return (tokp);
333
}
334
335
/** 
336
 * Function checks if classes have the same package.
337
 * @param klass1 - class handler
338
 * @param klass2 - class handler
339
 * @return If classes have the same package returns <code>true</code>, else returns <code>false</code>.
340
 * @note Assertion is raised if klass1 or klass2 are equal to null.
341
 */
342
extern "C" unsigned
343
class_is_same_package( class_handler klass1, class_handler klass2 ) 
344
{
345
	if (klass1 == klass2) {
346
		return (1);
347
	}
348
	else {
349
		const char *klass1_name = class_get_name(klass1);
350
		const char *klass2_name = class_get_name(klass2);
351
		char* package1 = package_name(klass1_name);
352
		char* package2 = package_name(klass2_name);
353
		int package1_len = (package1 - klass1_name);
354
		int package2_len = (package2 - klass2_name);
355
		if (package1_len != package2_len)
356
			return (0);
357
		return(strncmp(klass1_name, klass2_name, package2_len) == 0);
358
		assert(!"verifier entered!!");
359
	}
360
	return (0);
361
}
362
363
/**
364
 * Function checks if current class is interface.
365
 * @param klass - class handler
366
 * @return If class is interface returns <code>true</code>, else returns <code>false</code>.
367
 * @note Assertion is raised if klass is equal to null.
368
 */
369
// FIXME - There is a macro class_is_interface in Class.h
370
extern "C" unsigned
371
class_is_interface( class_handler klass ) 
372
{
373
	JNIEnv *env;
374
	env = m_get_vm_pointer((void **)&env);
375
	assert(env);
376
	if (IS_CLASS_INSTRUMENTED(klass)) {
377
		return (0);
378
	} 
379
	else {
380
		return (unsigned)(env->CallBooleanMethod((jobject)klass->X.simplefied_class, m_j_l_class_isInterface));
381
	}
382
	
383
	return (0);
384
}
385
386
/**
387
 * Function checks if current class is array.
388
 * @param klass - class handler
389
 * @return If class is array returns <code>true</code>, else returns <code>false</code>.
390
 * @note Assertion is raised if klass is equal to null.
391
 */
392
extern "C" unsigned
393
class_is_array( class_handler klass ) 
394
{
395
	assert(!"verifier entered!!");
396
	return (0);
397
}
398
399
/**
400
 * Function checks if current class is final.
401
 * @param klass - class handler
402
 * @return If class is final returns <code>true</code>, else returns <code>false</code>.
403
 * @note Assertion is raised if klass is equal to null.
404
 */
405
// FIXME - There is a macro class_is_final in Class.h
406
extern "C" unsigned
407
class_is_final_( class_handler klass ) 
408
{
409
	assert(!"verifier entered!!");
410
	return (0);
411
}
412
413
/**
414
 * Function receives number of super interfaces of class.
415
 * @param klass - class handler
416
 * @return Number of super interfaces of class.
417
 * @note Assertion is raised if klass is equal to null.
418
 */
419
extern "C" unsigned short
420
class_get_superinterface_number( class_handler klass )
421
{
422
	assert(!"verifier entered!!");
423
	return (0);
424
}
425
426
/**
427
 * Function receives super interface of class.
428
 * @param klass - class handler
429
 * @param index - super interface number
430
 * @return Super interface of class.
431
 * @note Assertion is raised if klass is equal to null or index is out of range.
432
 */
433
extern "C" class_handler
434
class_get_superinterface( class_handler klass, unsigned short index )
435
{
436
	assert(!"verifier entered!!");
437
	return (NULL);
438
}
439
440
/**
441
 * Function receives element class of array class.
442
 * @param klass - class handler
443
 * @return Element class of array class.
444
 * @note Assertion is raised if klass is equal to null or isn't array class.
445
 */
446
extern "C" class_handler
447
class_get_array_element_class( class_handler klass )
448
{
449
	assert(!"verifier entered!!");
450
	return (NULL);
451
}
452
453
454
/**
455
 * Function checks if class extends current class with given name.
456
 * @param klass      - checked klass
457
 * @param super_name - parent class name
458
 * @return If given class extends current class with given name,
459
 *         function returns its class handler, else function returns 0.
460
 * @note Assertion is raised if <i>klass</i> or <i>super_name</i> are equal to null.
461
 */
462
extern "C" class_handler
463
class_get_extended_class( class_handler klass, const char *super_name )
464
{
465
	return (NULL);
466
}
467
468
/**
469
 * Function returns number of methods for current class.
470
 * @param klass - class handler
471
 * @return Number of methods for class.
472
 * @note Assertion is raised if klass is equal to null.
473
 */
474
extern "C" unsigned short
475
class_get_method_number( class_handler klass )
476
{
477
	assert(!"verifier entered!!");
478
	return (0);
479
}
480
481
/** 
482
 * Function returns method of current class.
483
 * @param klass - class handler
484
 * @param index - method index
485
 * @return Method handler.
486
 * @note Assertion is raised if klass is equal to null or index is out of range.
487
 */
488
extern "C" method_handler
489
class_get_method( class_handler klass, unsigned short index )
490
{
491
	assert(!"verifier entered!!");
492
	return (NULL);
493
}
494
495
496
/**
497
 * Constant pool inteface
498
 */
499
500
/** 
501
 * Function returns class constant pool size.
502
 * @param klass - class handler
503
 * @return constant pool size
504
 * @note Assertion is raised if klass is equal to null.
505
 */
506
extern "C" unsigned short
507
class_cp_get_size( class_handler klass )
508
{
509
	assert(klass);
510
	if (IS_CLASS_INSTRUMENTED(klass)) {
511
		assert(klass->X.instrumented_class);
512
		assert(klass->X.instrumented_class->GetClassBuilder().GetConstPool());
513
		return klass->X.instrumented_class->GetClassBuilder().GetConstPool()->GetSize();
514
	} else {
515
		assert (!"not implemented yet!");
516
	}
517
	assert(!"verifier entered!!");
518
	return (0);
519
}
520
521
522
/** 
523
 * Function returns constant pool entry tag.
524
 * @param klass - class handler
525
 * @param index - constant pool entry index
526
 * @return constant pool entry tag
527
 * @note Assertion is raised if klass is equal to null or index is out of range.
528
 */
529
extern "C" unsigned char
530
class_cp_get_tag( class_handler klass, unsigned short index )
531
{
532
	if (IS_CLASS_INSTRUMENTED(klass)) {
533
		return (*klass->X.instrumented_class->GetClassBuilder().GetConstPool())[index]->GetTag();
534
	} else {
535
		assert (!"not implemented yet!");
536
	}
537
	return (0);
538
}
539
540
/** 
541
 * Function returns class name entry index in constant pool.
542
 * @param klass - class handler
543
 * @param index - constant pool entry index
544
 * @return class name entry index
545
 * @note Function is legal only for constant pool entry with CONSTANT_Class tags.
546
 * @note Assertion is raised if klass is equal to null or index is out of range.
547
 */
548
extern "C" unsigned short
549
class_cp_get_class_name_index( class_handler klass, unsigned short index )
550
{
551
	if (IS_CLASS_INSTRUMENTED(klass)) {
552
		CCPInfo * ccinfo = (*klass->X.instrumented_class->GetClassBuilder().GetConstPool())[index];
553
		assert(ccinfo->GetTag() == CONSTANT_Class);
554
		return ((CCPClassInfo *)ccinfo)->GetClassInd();
555
	} else {
556
		assert (!"not implemented yet!");
557
	}
558
	return (0);
559
}
560
561
/** 
562
 * Function returns class name entry index in constant pool.
563
 * @param klass - class handler
564
 * @param index - constant pool entry index
565
 * @return class name entry index
566
 * @note Function is legal for constant pool entry with 
567
 *       CONSTANT_Fieldref, CONSTANT_Methodref and CONSTANT_InterfaceMethodref tags.
568
 * @note Assertion is raised if klass is equal to null or index is out of range.
569
 */
570
extern "C" unsigned short
571
class_cp_get_ref_class_index( class_handler klass, unsigned short index )
572
{
573
	if (IS_CLASS_INSTRUMENTED(klass)) {
574
		CCPInfo * ccinfo = (*klass->X.instrumented_class->GetClassBuilder().GetConstPool())[index];
575
		unsigned char tag = ccinfo->GetTag();
576
		switch(tag) {
577
		case CONSTANT_Fieldref:
578
			return ((CCPFieldrefInfo *)ccinfo)->GetClassInd();
579
		break;
580
		case CONSTANT_Methodref:
581
			return ((CCPMethodrefInfo *)ccinfo)->GetClassInd();
582
		break;
583
		case CONSTANT_InterfaceMethodref:
584
			return ((CCPInterfaceMethodrefInfo *)ccinfo)->GetClassInd();
585
		break;
586
		default:
587
			assert(!"unsupported tag");
588
		}
589
	} else {
590
		assert (!"not implemented yet!");
591
	}
592
	return (0);
593
}
594
595
/** 
596
 * Function returns name_and_type entry index in constant pool.
597
 * @param klass - class handler
598
 * @param index - constant pool entry index
599
 * @return name_and_type entry index
600
 * @note Function is legal for constant pool entry with 
601
 *       CONSTANT_Fieldref, CONSTANT_Methodref and CONSTANT_InterfaceMethodref tags.
602
 * @note Assertion is raised if klass is equal to null or index is out of range.
603
 */
604
extern "C" unsigned short
605
class_cp_get_ref_name_and_type_index( class_handler klass, unsigned short index )
606
{
607
	if (IS_CLASS_INSTRUMENTED(klass)) {
608
		CCPInfo * ccinfo = (*klass->X.instrumented_class->GetClassBuilder().GetConstPool())[index];
609
		unsigned char tag = ccinfo->GetTag();
610
		switch(tag) {
611
		case CONSTANT_Fieldref:
612
			return ((CCPFieldrefInfo *)ccinfo)->GetNameAndTypeInd();
613
		break;
614
		case CONSTANT_Methodref:
615
			return ((CCPMethodrefInfo *)ccinfo)->GetNameAndTypeInd();
616
		break;
617
		case CONSTANT_InterfaceMethodref:
618
			return ((CCPInterfaceMethodrefInfo *)ccinfo)->GetNameAndTypeInd();
619
		break;
620
		default:
621
			assert(!"unsupported tag");
622
		}
623
	} else {
624
		assert (!"not implemented yet!");
625
	}
626
	return (0);
627
}
628
629
/** 
630
 * Function returns string entry index in constant pool.
631
 * @param klass - class handler
632
 * @param index - constant pool entry index
633
 * @return string entry index
634
 * @note Function is legal for constant pool entry with CONSTANT_String tags.
635
 * @note Assertion is raised if klass is equal to null or index is out of range.
636
 */
637
extern "C" unsigned short
638
class_cp_get_string_index( class_handler klass, unsigned short index )
639
{
640
	assert(!"verifier entered!!");
641
	return (0);
642
}
643
644
/** 
645
 * Function returns name entry index in constant pool.
646
 * @param klass - class handler
647
 * @param index - constant pool entry index
648
 * @return name entry index
649
 * @note Function is legal for constant pool entry with CONSTANT_NameAndType tags.
650
 * @note Assertion is raised if klass is equal to null or index is out of range.
651
 */
652
extern "C" unsigned short
653
class_cp_get_name_index( class_handler klass, unsigned short index )
654
{
655
	if (IS_CLASS_INSTRUMENTED(klass)) {
656
		CCPInfo * ccinfo = (*klass->X.instrumented_class->GetClassBuilder().GetConstPool())[index];
657
		unsigned char tag = ccinfo->GetTag();
658
		assert(tag == CONSTANT_NameAndType);
659
		return ((CCPNameAndTypeInfo *)ccinfo)->GetNameInd();
660
	} else {
661
		assert (!"not implemented yet!");
662
	}
663
	return (0);
664
}
665
666
/** 
667
 * Function returns descriptor entry index in constant pool.
668
 * @param klass - class handler
669
 * @param index - constant pool entry index
670
 * @return descriptor entry index
671
 * @note Function is legal for constant pool entry with CONSTANT_NameAndType tags.
672
 * @note Assertion is raised if klass is equal to null or index is out of range.
673
 */
674
extern "C" unsigned short
675
class_cp_get_descriptor_index( class_handler klass, unsigned short index )
676
{
677
	if (IS_CLASS_INSTRUMENTED(klass)) {
678
		CCPInfo * ccinfo = (*klass->X.instrumented_class->GetClassBuilder().GetConstPool())[index];
679
		unsigned char tag = ccinfo->GetTag();
680
		assert(tag == CONSTANT_NameAndType);
681
		return ((CCPNameAndTypeInfo *)ccinfo)->GetDescriptorInd();
682
	} else {
683
		assert (!"not implemented yet!");
684
	}
685
	return (0);
686
}
687
688
/** 
689
 * Function returns bytes for UTF8 constant pool entry.
690
 * @param klass - class handler
691
 * @param index - constant pool entry index
692
 * @return bytes for UTF8 constant pool entry
693
 * @note Function is legal for constant pool entry with CONSTANT_UTF8 tags.
694
 * @note Assertion is raised if klass is equal to null or index is out of range.
695
 */
696
extern "C" const char *
697
class_cp_get_utf8_bytes( class_handler klass, unsigned short index )
698
{
699
	if (IS_CLASS_INSTRUMENTED(klass)) {
700
		return (const char *)((CCPUtf8Info *)(*klass->X.instrumented_class->GetClassBuilder().GetConstPool())[index])->GetBytes();
701
	} else {
702
		assert (!"not implemented yet!");
703
	}
704
	return (0);
705
}
706
707
/**
708
 * Function sets verify data to a given class.
709
 * @param klass     - class handler
710
 * @param data      - verify data
711
 * @note Assertion is raised if class is equal to null.
712
 * @note Function makes non thread save operation and 
713
 *       must be called in thread safe point.
714
 */
715
extern "C" void
716
class_set_verify_data_ptr( class_handler klass, void *data )
717
{
718
	assert(!"verifier entered!!");
719
	return;
720
}
721
722
/**
723
 * Function returns verify data for a given class.
724
 * @param klass - class handler
725
 * @return Verify data for a given class.
726
 * @note Assertion is raised if klass is equal to null.
727
 */
728
extern "C" void *
729
class_get_verify_data_ptr( class_handler klass )
730
{
731
	assert(!"verifier entered!!");
732
	return (NULL);
733
}
734
735
/**
736
 * Function resolves class nonstatic method for constant pool entry.
737
 *
738
 * @param klass - class handle
739
 * @param index - constant pool entry index
740
 * @param exc   - pointer to exception
741
 *
742
 * @return Return nonstatic method resolved for constant pool entry.
743
 */
744
extern "C" method_handler
745
class_resolve_method( class_handler klass, unsigned short index )
746
{
747
	assert(!"verifier entered!!");
748
	return (NULL);
749
}
750
751
/**
752
 * Function resolves class nonstatic field for constant pool entry.
753
 *
754
 * @param klass - class handle
755
 * @param index - constant pool entry index
756
 * @param exc   - pointer to exception
757
 *
758
 * @return Return nonstatic field resolved for constant pool entry.
759
 */
760
extern "C" field_handler
761
class_resolve_nonstatic_field( class_handler klass, unsigned short index )
762
{
763
	assert(!"verifier entered!!");
764
	return (NULL);
765
}
766
767
/**
768
 * Method interface
769
 */
770
771
/**
772
 * Function returns a class in which the method is declared.
773
 * @param method - method handler
774
 * @return Return a class in which the method is declared.
775
 * @note Assertion is raised if <i>method</i> is equal to null.
776
 */
777
extern "C" class_handler
778
method_get_class( method_handler hmethod )
779
{
780
781
	if (hmethod == NULL) return (NULL);
782
	else
783
		return hmethod->class_owner;
784
#if 0
785
	if (hmethod->magic == METHOD_HANDLER_SELF) {
786
		if (hmethod->X.instrumented_method) return (NULL);
787
		return (((CModuleJ *)hmethod->X.instrumented_method->GetModule())->GetClassHandler());
788
	}
789
	else {
790
		assert(!"verifier entered!!");
791
	}
792
793
	return (NULL);
794
#endif
795
}
796
797
/**
798
 * Function returns method name.
799
 * @param method - method handler
800
 * @return Method name bytes.
801
 * @note Assertion is raised if method is equal to null.
802
 */
803
extern "C" const char *
804
method_get_name( method_handler method )
805
{
806
	if (method->magic == METHOD_HANDLER_SELF) {
807
		return (method->X.instrumented_method->GetName());
808
	}
809
	else {
810
		assert(!"verifier entered!!");
811
	}
812
	return (NULL);
813
}
814
815
/**
816
 * Function returns method descriptor.
817
 * @param method - method handler
818
 * @return Method descriptor bytes.
819
 * @note Assertion is raised if method is equal to null.
820
 */
821
extern "C" const char *
822
method_get_descriptor( method_handler method )
823
{
824
	if (method->magic == METHOD_HANDLER_SELF) {
825
		return (method->X.instrumented_method->GetSignature());
826
	}
827
	else {
828
		assert(!"verifier entered!!");
829
	}
830
	return (NULL);
831
}
832
833
/**
834
 * Function returns method code length.
835
 * @param method - method handler
836
 * @return Method code length.
837
 * @note Assertion is raised if method is equal to null.
838
 */
839
extern "C" unsigned
840
method_get_bytecode_length( method_handler method )
841
{
842
	/*insert check about instrumentation*/
843
	if (method->magic == METHOD_HANDLER_SELF) {
844
		unsigned size = 0;
845
		CInstructions::const_iterator insIterator;
846
		if (method->X.instrumented_method->GetCodeAttribute() == NULL) return (0);
847
		return (method->X.instrumented_method->GetCodeAttribute()->GetCodeLength());
848
	}
849
	else {
850
		assert(!"verifier entered!!");
851
	}
852
	return (0);	
853
}
854
855
/**
856
 * Function returns method bytecode array.
857
 * @param method - method handler
858
 * @return Method bytecode array.
859
 * @note Assertion is raised if method is equal to null.
860
 */
861
extern "C" unsigned char *
862
method_get_bytecode( method_handler method )
863
{
864
	if (method->magic == METHOD_HANDLER_SELF) {
865
		return (method->X.instrumented_method->GetCodeAttribute()->GetCode());
866
	}
867
	else {
868
		assert(!"verifier entered!!");
869
	}
870
	return (NULL);	
871
}
872
873
/**
874
 * Function returns maximal local variables number of method.
875
 * @param method - method handler
876
 * @return Maximal local variables number of method.
877
 * @note Assertion is raised if method is equal to null.
878
 */
879
extern "C" unsigned
880
method_get_max_locals( method_handler method )
881
{
882
	if (method->magic == METHOD_HANDLER_SELF) {
883
		/*XXX: add check for instrumented method*/
884
		CMethodJ * jmethod = (CMethodJ *)(method->X.instrumented_method);
885
		return (jmethod->GetCodeAttribute()->GetMaxLocals());
886
	}
887
	else {
888
		assert(!"verifier entered!!");
889
	}
890
	return (0);	
891
	
892
}
893
894
/**
895
 * Function returns maximal stack deep of method.
896
 * @param method - method handler
897
 * @return Maximal stack deep of method.
898
 * @note Assertion is raised if method is equal to null.
899
 */
900
extern "C" unsigned 
901
method_get_max_stack( method_handler method )
902
{
903
	if (method->magic == METHOD_HANDLER_SELF) {
904
		CMethodJ * jmethod = (CMethodJ *)(method->X.instrumented_method);
905
		return (jmethod->GetCodeAttribute()->GetMaxStack());
906
	}
907
	else {
908
		assert(!"verifier entered!!");
909
	}
910
	return (0);	
911
}
912
913
/**
914
 * Function checks if method is static.
915
 * @param method - method handler
916
 * @return If method is static, function returns <code>true</code>,
917
 *         else returns <code>false</code>.
918
 * @note Assertion is raised if method is equal to null.
919
 */
920
extern "C" unsigned
921
method_is_static( method_handler method )
922
{
923
	if (method->magic == METHOD_HANDLER_SELF) {
924
		return (method->X.instrumented_method->GetAccessFlags() & ACC_STATIC);
925
	}
926
	else {
927
		//assert(!"verifier entered!!");
928
		return (0); /*we're assuming that this function called after class_resolve_method and couldn't return static methods*/
929
	}
930
	return (0);	
931
	
932
}
933
934
/**
935
 * Function checks if a given method is protected.
936
 *
937
 * @param method - method handle
938
 *
939
 * @return Return <code>TRUE</code> if a given method is protected.
940
 *
941
 * @note Assertion is raised if <i>method</i> is equal to null.
942
 */
943
extern "C" unsigned
944
method_is_protected( method_handler method )
945
{
946
	assert(!"verifier entered!!");
947
	return (0);
948
}
949
950
/**
951
 * Method exception handler
952
 */
953
954
/**
955
 * Function returns number of method exception handlers.
956
 * @param method - method handler
957
 * @return Number of method exception handlers.
958
 * @note Assertion is raised if method is equal to null.
959
 */
960
extern "C" unsigned short
961
method_get_exc_handler_number( method_handler method )
962
{
963
	return (method->X.instrumented_method->GetExTable()->size());
964
}
965
966
/**
967
 * Function obtains method exception handler info.
968
 * @param method     - method handler
969
 * @param index      - exception handler index number
970
 * @param start_pc   - resulting pointer to exception handler start program count
971
 * @param end_pc     - resulting pointer to exception handler end program count
972
 * @param handler_pc - resulting pointer to exception handler program count
973
 * @param catch_type - resulting pointer to constant pool entry index
974
 * @note Assertion is raised if method is equal to null or
975
 *       exception handler index is out of range or
976
 *       any pointer is equal to null.
977
 */
978
extern "C" void
979
method_get_exc_handler_info( method_handler method, unsigned short index,
980
                             unsigned short *start_pc, unsigned short *end_pc,
981
                             unsigned short *handler_pc, unsigned short *catch_type )
982
{
983
	class CExTable& exc = method->X.instrumented_method->GetCodeAttribute()->GetExTable();
984
	*start_pc = exc[index].GetStartPC();
985
	*end_pc = exc[index].GetEndPC();
986
	*handler_pc = exc[index].GetHandlerPC();
987
	*catch_type = exc[index].GetCatchtype();
988
989
	return;
990
}
991
992
/**
993
 * Gets number of exceptions a method can throw.
994
 * Parameter <i>hmethod</i> must not equal to <code>NULL</code>.
995
 *
996
 * @param hmethod   method handle
997
 *
998
 * @return          number of exceptions
999
 */
1000
extern "C" unsigned short
1001
method_get_number_exc_method_can_throw( method_handler hmethod )
1002
{
1003
	assert(!"verifier entered!!");
1004
	return (0);
1005
}
1006
1007
/**
1008
 * Gets name of exception a method can throw.
1009
 * Parameter <i>hmethod</i> must not equal to <code>NULL</code>.
1010
 * If parameter <i>index</i> is out of range, returns <code>NULL</code>.
1011
 *
1012
 * @param hmethod   method handle
1013
 * @param index     index of exception
1014
 *
1015
 * @return          name of exception
1016
 */
1017
extern "C" const char *
1018
method_get_exc_method_can_throw( method_handler hmethod, unsigned short index )
1019
{
1020
	assert(!"verifier entered!!");
1021
	return (NULL);
1022
}
1023
1024
1025
/**
1026
 * Gets StackMapTable attribute.
1027
 * Parameter <i>hmethod</i> must not equal to <code>NULL</code>.
1028
 * If parameter <i>index</i> is out of range, returns <code>NULL</code>.
1029
 *
1030
 * @param hmethod   method handle
1031
 *
1032
 * @return          StackMapTable bytes
1033
 */
1034
extern "C" unsigned char *
1035
method_get_stackmaptable( method_handler hmethod )
1036
{
1037
	
1038
	CStackMapTableAttribute *attr = hmethod->X.instrumented_method->GetCodeAttribute()->GetStackMaps();
1039
	if (attr == NULL)
1040
		return (NULL);
1041
	u4 length = attr->GetLength();
1042
	u1 *stackmap = (u1 *)malloc(length);
1043
	CJMemStream mem_stream;
1044
	mem_stream.Open(stackmap, length);
1045
	CJStream stream(&mem_stream);
1046
	attr->Write(stream);
1047
	//return (attr->GetInfo());
1048
	return (stackmap);
1049
}
1050
1051
1052
//modifies start_pc, end_pc 
1053
extern "C" void 
1054
method_modify_exc_handler_info(method_handler method, 
1055
                                    unsigned short idx, 
1056
                                    unsigned short start_pc,
1057
                                    unsigned short end_pc, 
1058
                                    unsigned short handler_pc, 
1059
                                    unsigned short handler_cp_index )
1060
{
1061
1062
	assert(!"verifier entered!!");
1063
	return;
1064
}
1065
1066
// removes given exception handler (handlers with greater indexes shift)
1067
extern "C" void 
1068
method_remove_exc_handler( method_handler method, unsigned short idx )
1069
{
1070
	assert(!"verifier entered!!");
1071
	return;
1072
}
1073
1074
/**
1075
 * Class loader interface
1076
 */
1077
1078
/**
1079
 * Function sets verify data in class loader.
1080
 * @param classloader - class loader handler
1081
 * @param data        - verify data
1082
 * @note Assertion is raised if classloader is equal to null.
1083
 * @note Function makes non thread save operation and 
1084
 *       must be called in thread safe point.
1085
 */
1086
extern "C" void
1087
class_loader_set_verifier_data_ptr( classloader_handler classloader, void *data )
1088
{
1089
	assert(!"verifier entered!!");
1090
	return;
1091
}
1092
1093
/**
1094
 * Function returns verify data in class loader.
1095
 * @param classloader - class loader handler
1096
 * @return Verify data in class loader.
1097
 * @note Assertion is raised if classloader is equal to null.
1098
 */
1099
extern "C" void *
1100
class_loader_get_verifier_data_ptr( classloader_handler classloader )
1101
{
1102
	assert(!"verifier entered!!");
1103
	return (NULL);
1104
}
1105
1106
/**
1107
 * Function locks class loader.
1108
 * @param classloader - class loader handler
1109
 * @note Assertion is raised if classloader is equal to null.
1110
 */
1111
extern "C" void
1112
class_loader_lock( classloader_handler classloader )
1113
{
1114
	assert(!"verifier entered!!");
1115
	return;
1116
}
1117
1118
/**
1119
 * Function releases class loader.
1120
 * @param classloader - class loader handler
1121
 * @note Assertion is raised if classloader is equal to null.
1122
 */
1123
extern "C" void
1124
class_loader_unlock( classloader_handler classloader )
1125
{
1126
	assert(!"verifier entered!!");
1127
	return;
1128
}
1129
1130
/**
1131
 * Function returns loaded class in class loader.
1132
 * @param classloader - class loader handler
1133
 * @param name        - class name
1134
 * @return Loaded class in classloader or null if class isn't loaded in class loader.
1135
 * @note Assertion is raised if classloader or name are equal to null.
1136
 */
1137
extern "C" class_handler
1138
class_loader_lookup_class( classloader_handler classloader, const char *name )
1139
{
1140
	if (m_name2ch[name] != NULL && IS_CLASS_INSTRUMENTED(m_name2ch[name])) 
1141
		return (m_name2ch[name]);
1142
	else
1143
		return (NULL);
1144
}
1145
1146
/**
1147
 * Function returns loaded class in class loader.
1148
 * @param classloader - class loader handler
1149
 * @param name        - class name
1150
 * @return Loaded class in classloader if class isn't loaded in class loader 
1151
 *         function loads it.
1152
 * @note Assertion is raised if classloader or name are equal to null.
1153
 */
1154
extern "C" class_handler
1155
class_loader_load_class( classloader_handler classloader, const char *name )
1156
{
1157
	assert(!"verifier entered!!");
1158
	return (NULL);
1159
}
1160
1161
/**
1162
 * Function checks if the field is protected.
1163
 * @param field - field handler
1164
 * @return Returns <code>TRUE</code> if the field is protected.
1165
 */
1166
extern "C" unsigned
1167
field_is_protected( field_handler field )
1168
{
1169
	assert(!"verifier entered!!");
1170
	return (0);
1171
}
1172
1173
class_handler
1174
get_class_handler_from_builder(class CModuleJ *module) 
1175
{
1176
	class_handler ch;
1177
1178
	m_name2ch.clear();
1179
	int status = create_class_handler(&m_j_l_object_ch, CLASS_HANDLER_SIMPLEFIED, "java/lang/Object", 0, NULL);
1180
	assert(!status);
1181
	
1182
	status = create_class_handler(&ch, CLASS_HANDLER_INSTRUMENTED, module->GetName(), 1, module);
1183
	assert(!status);
1184
	return (ch);
1185
}
1186
1187
method_handler 
1188
get_method_handler_for_cmethod(class CMethod *method)
1189
{
1190
	class_handler ch = NULL;
1191
	method_handler mh = NULL;
1192
	int status;
1193
	status = create_class_handler(&ch, CLASS_HANDLER_INSTRUMENTED, (const char *)method->GetModule()->GetName(), 1, method->GetModule());
1194
	assert(!status);
1195
	status = create_method_handler(&mh, ch, METHOD_HANDLER_SELF, method);
1196
	assert(!status);
1197
	return (mh);
1198
}
1199
1200
extern "C" unsigned short
1201
class_cp_get_class_entry(class_handler klass, const char* name)
1202
{
1203
1204
	
1205
	CCPClassInfo *cinfo;
1206
	if (IS_CLASS_INSTRUMENTED(klass)) {
1207
		/*for this class we'll have entry somewhere in some future */
1208
		if (strcmp(klass->X.instrumented_class->GetName(), name) == 0) {
1209
			return (klass->X.instrumented_class->GetClass().GetThisClass());
1210
		}
1211
		assert(name);
1212
		cinfo = (klass->X.instrumented_class->GetClassBuilder().FindClass(name));
1213
		if (cinfo == NULL) {
1214
			/*should be created new class antry */
1215
			cinfo = *klass->X.instrumented_class->GetClassBuilder().CreateClassConstant(name);
1216
			assert(cinfo);
1217
		} 
1218
		return(cinfo->GetCpIndex());
1219
	} else {
1220
		assert (!"not implemented yet!");
1221
	}
1222
	return (0);
1223
}
1224
1225
int
1226
initialize_dynamic(get_vm_pointer_t a_get_vm_pointer)
1227
{
1228
	m_get_vm_pointer = (JNIEnv *(*)(void **))a_get_vm_pointer;
1229
	JNIEnv *env;
1230
	env = m_get_vm_pointer((void **)&env);
1231
	assert(env);
1232
	if (m_j_l_class) return (0);
1233
	
1234
	m_j_l_class = env->FindClass("java/lang/Class");
1235
	assert(m_j_l_class);
1236
	m_j_l_class_getName = env->GetMethodID(m_j_l_class, "getName", "()Ljava/lang/String;");
1237
	assert(m_j_l_class_getName);
1238
	m_j_l_class_getClassLoader = env->GetMethodID(m_j_l_class, "getClassLoader", "()Ljava/lang/ClassLoader;");
1239
	assert(m_j_l_class_getClassLoader);
1240
	m_j_l_class_isInterface = env->GetMethodID(m_j_l_class, "isInterface", "()Z");
1241
	assert(m_j_l_class_isInterface);
1242
	
1243
	m_j_l_classloader = env->FindClass("java/lang/ClassLoader");
1244
	assert(m_j_l_classloader);
1245
	m_j_l_classloader_findLoadedClass = env->GetMethodID(m_j_l_classloader, "findLoadedClass", "(Ljava/lang/String;)Ljava/lang/Class;"); 
1246
	assert(m_j_l_classloader_findLoadedClass);
1247
1248
	return (0);
1249
}
1250

Return to bug 148629