8142968: Module System implementation

Initial integration of JEP 200, JEP 260, JEP 261, and JEP 282

Co-authored-by: Alex Buckley <alex.buckley@oracle.com>
Co-authored-by: Jonathan Gibbons <jonathan.gibbons@oracle.com>
Co-authored-by: Karen Kinnear <karen.kinnear@oracle.com>
Co-authored-by: Mandy Chung <mandy.chung@oracle.com>
Co-authored-by: Mark Reinhold <mark.reinhold@oracle.com>
Co-authored-by: Harold Seigel <harold.seigel@oracle.com>
Co-authored-by: Lois Foltan <lois.foltan@oracle.com>
Co-authored-by: Calvin Cheung <calvin.cheung@oracle.com>
Co-authored-by: Christian Tornqvist <christian.tornqvist@oracle.com>
Co-authored-by: Erik Joelsson <erik.joelsson@oracle.com>
Co-authored-by: George Triantafillou <george.triantafillou@oracle.com>
Co-authored-by: Igor Ignatyev <igor.ignatyev@oracle.com>
Co-authored-by: Ioi Lam <ioi.lam@oracle.com>
Co-authored-by: James Laskey <james.laskey@oracle.com>
Co-authored-by: Jean-Francois Denise <jean-francois.denise@oracle.com>
Co-authored-by: Jiangli Zhou <jiangli.zhou@oracle.com>
Co-authored-by: Markus Gronlund <markus.gronlund@oracle.com>
Co-authored-by: Serguei Spitsyn <serguei.spitsyn@oracle.com>
Co-authored-by: Staffan Larsen <staffan.larsen@oracle.com>
Co-authored-by: Sundararajan Athijegannathan <sundararajan.athijegannathan@oracle.com>
Reviewed-by: acorn, ccheung, coleenp, ctornqvi, dholmes, dsimms, gtriantafill, iklam, jiangli, mgronlun, mseledtsov, cjplummer, sspitsyn, stefank, twisti, hseigel, lfoltan, alanb, mchung, dfazunen
This commit is contained in:
Alan Bateman 2016-03-17 19:04:01 +00:00
parent 007b0fa3db
commit f30fc1c88b
297 changed files with 15848 additions and 2302 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2016, 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
@ -75,6 +75,7 @@ class JvmtiEnvBase : public CHeapObj<mtInternal> {
};
static jvmtiPhase get_phase() { return _phase; }
static jvmtiPhase get_phase(jvmtiEnv* env) { return ((JvmtiEnvBase*)JvmtiEnv_from_jvmti_env(env))->phase(); }
static void set_phase(jvmtiPhase phase) { _phase = phase; }
static bool is_vm_live() { return _phase == JVMTI_PHASE_LIVE; }
@ -140,6 +141,7 @@ class JvmtiEnvBase : public CHeapObj<mtInternal> {
public:
jvmtiPhase phase();
bool is_valid();
bool use_version_1_0_semantics(); // agent asked for version 1.0
@ -160,6 +162,10 @@ class JvmtiEnvBase : public CHeapObj<mtInternal> {
jvmtiCapabilities *get_prohibited_capabilities() { return &_prohibited_capabilities; }
bool early_vmstart_env() {
return get_capabilities()->can_generate_early_vmstart != 0;
}
static char** get_all_native_method_prefixes(int* count_ptr);
// This test will answer true when all environments have been disposed and some have
@ -689,4 +695,21 @@ class JvmtiMonitorClosure: public MonitorClosure {
jvmtiError error() { return _error;}
};
// Jvmti module closure to collect all modules loaded to the system.
class JvmtiModuleClosure : public StackObj {
private:
static GrowableArray<jobject> *_tbl; // Protected with Module_lock
static void do_module(ModuleEntry* entry) {
assert_locked_or_safepoint(Module_lock);
jobject module = entry->module();
guarantee(module != NULL, "module object is NULL");
_tbl->push(module);
}
public:
jvmtiError get_all_modules(JvmtiEnv* env, jint* module_count_ptr, jobject** modules_ptr);
};
#endif // SHARE_VM_PRIMS_JVMTIENVBASE_HPP