Imported Upstream version 3.10.0

Former-commit-id: 172c8e3c300b39d5785c7a3e8dfb08ebdbc1a99b
This commit is contained in:
Jo Shields
2014-10-04 11:27:48 +01:00
parent fe777c5c82
commit 8b9b85e7f5
970 changed files with 20242 additions and 31308 deletions

View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2011 Jeroen Frijters
Copyright (C) 2011-2014 Jeroen Frijters
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -21,6 +21,7 @@
jeroen@frijters.net
*/
using System;
#if !FIRST_PASS
using java.lang.management;
#endif
@@ -32,6 +33,41 @@ static class Java_sun_management_ClassLoadingImpl
}
}
static class Java_sun_management_FileSystemImpl
{
public static void init0()
{
}
public static bool isSecuritySupported0(string path)
{
throw new NotSupportedException();
}
public static bool isAccessUserOnly0(string path)
{
throw new NotSupportedException();
}
}
static class Java_sun_management_GcInfoBuilder
{
public static int getNumGcExtAttributes(object _this, object gc)
{
throw new NotSupportedException();
}
public static void fillGcAttributeInfo(object _this, object gc, int numAttributes, string[] attributeNames, char[] types, string[] descriptions)
{
throw new NotSupportedException();
}
public static object getLastGcInfo0(object _this, object gc, int numExtAtts, object[] extAttValues, char[] extAttTypes, object[] before, object[] after)
{
throw new NotSupportedException();
}
}
static class Java_sun_management_MemoryImpl
{
public static object getMemoryPools0()
@@ -67,11 +103,58 @@ static class Java_sun_management_MemoryImpl
}
}
static class Java_sun_management_OperatingSystemImpl
{
public static long getCommittedVirtualMemorySize0(object _this)
{
throw new System.NotImplementedException();
}
public static long getTotalSwapSpaceSize(object _this)
{
throw new System.NotImplementedException();
}
public static long getFreeSwapSpaceSize(object _this)
{
throw new System.NotImplementedException();
}
public static long getProcessCpuTime(object _this)
{
throw new System.NotImplementedException();
}
public static long getFreePhysicalMemorySize(object _this)
{
throw new System.NotImplementedException();
}
public static long getTotalPhysicalMemorySize(object _this)
{
throw new System.NotImplementedException();
}
public static double getSystemCpuLoad(object _this)
{
throw new System.NotImplementedException();
}
public static double getProcessCpuLoad(object _this)
{
throw new System.NotImplementedException();
}
public static void initialize()
{
}
}
static class Java_sun_management_ThreadImpl
{
public static object getThreads()
{
return IKVM.NativeCode.java.lang.Thread.getThreads();
return Java_java_lang_Thread.getThreads();
}
private const int JVMTI_THREAD_STATE_ALIVE = 0x0001;
@@ -161,9 +244,28 @@ static class Java_sun_management_ThreadImpl
#endif
}
private static int GetCurrentThreadId()
{
#pragma warning disable 618
// On the CLR and Mono on Windows this is the (obsolete) equivalent of kernel32!GetCurrentThreadId
return System.AppDomain.GetCurrentThreadId();
#pragma warning restore 618
}
public static long getThreadTotalCpuTime0(long id)
{
throw new System.NotImplementedException();
if (id == 0) {
int currentId = GetCurrentThreadId();
System.Diagnostics.ProcessThreadCollection threads = System.Diagnostics.Process.GetCurrentProcess().Threads;
foreach (System.Diagnostics.ProcessThread t in threads) {
if (t.Id == currentId) {
return (long)(t.TotalProcessorTime.Ticks * 100);
}
}
return 0;
} else {
throw new System.NotImplementedException("Only current Thread is supported.");
}
}
public static void getThreadTotalCpuTime1(long[] ids, long[] result)
@@ -188,7 +290,7 @@ static class Java_sun_management_ThreadImpl
public static void setThreadCpuTimeEnabled0(bool enable)
{
throw new System.NotImplementedException();
//ignoring, we need nothing to enable
}
public static void setThreadAllocatedMemoryEnabled0(bool enable)