mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
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:
parent
007b0fa3db
commit
f30fc1c88b
297 changed files with 15848 additions and 2302 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 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
|
||||
|
@ -25,8 +25,12 @@
|
|||
#include "precompiled.hpp"
|
||||
#include "classfile/classFileStream.hpp"
|
||||
#include "classfile/classLoader.hpp"
|
||||
#include "classfile/classLoaderData.inline.hpp"
|
||||
#include "classfile/javaAssertions.hpp"
|
||||
#include "classfile/javaClasses.inline.hpp"
|
||||
#include "classfile/moduleEntry.hpp"
|
||||
#include "classfile/modules.hpp"
|
||||
#include "classfile/packageEntry.hpp"
|
||||
#include "classfile/stringTable.hpp"
|
||||
#include "classfile/systemDictionary.hpp"
|
||||
#include "classfile/vmSymbols.hpp"
|
||||
|
@ -1047,6 +1051,58 @@ JVM_ENTRY(jclass, JVM_FindLoadedClass(JNIEnv *env, jobject loader, jstring name)
|
|||
(jclass) JNIHandles::make_local(env, k->java_mirror());
|
||||
JVM_END
|
||||
|
||||
// Module support //////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
JVM_ENTRY(void, JVM_DefineModule(JNIEnv *env, jobject module, jstring version, jstring location,
|
||||
jobjectArray packages))
|
||||
JVMWrapper("JVM_DefineModule");
|
||||
Modules::define_module(module, version, location, packages, CHECK);
|
||||
JVM_END
|
||||
|
||||
JVM_ENTRY(void, JVM_SetBootLoaderUnnamedModule(JNIEnv *env, jobject module))
|
||||
JVMWrapper("JVM_SetBootLoaderUnnamedModule");
|
||||
Modules::set_bootloader_unnamed_module(module, CHECK);
|
||||
JVM_END
|
||||
|
||||
JVM_ENTRY(void, JVM_AddModuleExports(JNIEnv *env, jobject from_module, jstring package, jobject to_module))
|
||||
JVMWrapper("JVM_AddModuleExports");
|
||||
Modules::add_module_exports_qualified(from_module, package, to_module, CHECK);
|
||||
JVM_END
|
||||
|
||||
JVM_ENTRY(void, JVM_AddModuleExportsToAllUnnamed(JNIEnv *env, jobject from_module, jstring package))
|
||||
JVMWrapper("JVM_AddModuleExportsToAllUnnamed");
|
||||
Modules::add_module_exports_to_all_unnamed(from_module, package, CHECK);
|
||||
JVM_END
|
||||
|
||||
JVM_ENTRY(void, JVM_AddModuleExportsToAll(JNIEnv *env, jobject from_module, jstring package))
|
||||
JVMWrapper("JVM_AddModuleExportsToAll");
|
||||
Modules::add_module_exports(from_module, package, NULL, CHECK);
|
||||
JVM_END
|
||||
|
||||
JVM_ENTRY (void, JVM_AddReadsModule(JNIEnv *env, jobject from_module, jobject source_module))
|
||||
JVMWrapper("JVM_AddReadsModule");
|
||||
Modules::add_reads_module(from_module, source_module, CHECK);
|
||||
JVM_END
|
||||
|
||||
JVM_ENTRY(jboolean, JVM_CanReadModule(JNIEnv *env, jobject asking_module, jobject source_module))
|
||||
JVMWrapper("JVM_CanReadModule");
|
||||
return Modules::can_read_module(asking_module, source_module, THREAD);
|
||||
JVM_END
|
||||
|
||||
JVM_ENTRY(jboolean, JVM_IsExportedToModule(JNIEnv *env, jobject from_module, jstring package, jobject to_module))
|
||||
JVMWrapper("JVM_IsExportedToModule");
|
||||
return Modules::is_exported_to_module(from_module, package, to_module, THREAD);
|
||||
JVM_END
|
||||
|
||||
JVM_ENTRY (void, JVM_AddModulePackage(JNIEnv *env, jobject module, jstring package))
|
||||
JVMWrapper("JVM_AddModulePackage");
|
||||
Modules::add_module_package(module, package, CHECK);
|
||||
JVM_END
|
||||
|
||||
JVM_ENTRY (jobject, JVM_GetModuleByPackageName(JNIEnv *env, jobject loader, jstring package))
|
||||
JVMWrapper("JVM_GetModuleByPackageName");
|
||||
return Modules::get_module_by_package_name(loader, package, THREAD);
|
||||
JVM_END
|
||||
|
||||
// Reflection support //////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue