Imported Upstream version 4.2.1.36

Former-commit-id: fb75898888a02f4d3a74cf0a5b841681bc4c7fa8
This commit is contained in:
Xamarin Public Jenkins
2015-09-24 06:06:07 -04:00
committed by Jo Shields
parent 9668de7cb8
commit dd547c45d4
172 changed files with 6570 additions and 11015 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -48,6 +48,7 @@ public class VM {
return suspended;
}
@SuppressWarnings("deprecation")
public static boolean allowThreadSuspension(ThreadGroup g, boolean b) {
return g.allowThreadSuspension(b);
}
@@ -145,7 +146,9 @@ public class VM {
*/
// public native static void writeJavaProfilerReport();
private static volatile boolean booted = false;
private static final Object lock = new Object();
static {
// [IKVM] force System properties initialization ("booting")
@@ -163,13 +166,27 @@ public class VM {
// the booted flag to determine whether it is safe to query the system
// properties).
public static void booted() {
booted = true;
synchronized (lock) {
booted = true;
lock.notifyAll();
}
}
public static boolean isBooted() {
return booted;
}
// Waits until VM completes initialization
//
// This method is invoked by the Finalizer thread
public static void awaitBooted() throws InterruptedException {
synchronized (lock) {
while (!booted) {
lock.wait();
}
}
}
// Returns the maximum amount of allocatable direct buffer memory.
// The directMemory variable is initialized during system initialization
// in the saveAndRemoveProperties method.
@@ -216,6 +233,14 @@ public class VM {
return allowArraySyntax;
}
/**
* Returns true if the given class loader is in the system domain
* in which all permissions are granted.
*/
public static boolean isSystemDomainLoader(ClassLoader loader) {
return loader == null;
}
/**
* Returns the system property of the specified key saved at
* system initialization time. This method should only be used
@@ -282,6 +307,9 @@ public class VM {
// used by sun.launcher.LauncherHelper
props.remove("sun.java.launcher.diag");
// used by sun.misc.URLClassPath
props.remove("sun.cds.enableSharedLookupCache");
}
// Initialize any miscellenous operating system settings that need to be
@@ -361,6 +389,12 @@ public class VM {
private final static int JVMTI_THREAD_STATE_WAITING_INDEFINITELY = 0x0010;
private final static int JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT = 0x0020;
/*
* Returns the first non-null class loader up the execution stack,
* or null if only code from the null class loader is on the stack.
*/
public static native ClassLoader latestUserDefinedLoader();
static {
initialize();
}