changeset 7752:52aa2e30e139

Add temporary support for module versioning
author hseigel
date Wed, 28 Jan 2015 12:54:13 -0500
parents 5c450268abbd
children 4fa6da7cd692
files src/share/vm/classfile/moduleEntry.cpp src/share/vm/classfile/moduleEntry.hpp
diffstat 2 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/classfile/moduleEntry.cpp	Wed Jan 28 05:49:24 2015 -0800
+++ b/src/share/vm/classfile/moduleEntry.cpp	Wed Jan 28 12:54:13 2015 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -272,9 +272,9 @@
 
 void ModuleEntry::print() {
   ResourceMark rm;
-  tty->print_cr("entry "PTR_FORMAT" oop "PTR_FORMAT" name %s loader %s pkgs_with_qexports %d next "PTR_FORMAT,
+  tty->print_cr("entry "PTR_FORMAT" oop "PTR_FORMAT" name %s loader %s version %s pkgs_with_qexports %d next "PTR_FORMAT,
                 p2i(this), p2i(literal()), name()->as_C_string(), loader()->loader_name(),
-                _pkgs_with_qexports, p2i(next()));
+                version(), _pkgs_with_qexports, p2i(next()));
 }
 #endif
 
--- a/src/share/vm/classfile/moduleEntry.hpp	Wed Jan 28 05:49:24 2015 -0800
+++ b/src/share/vm/classfile/moduleEntry.hpp	Wed Jan 28 12:54:13 2015 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -47,6 +47,7 @@
   Symbol* _name;
   ClassLoaderData* _loader;
   GrowableArray<ModuleEntry*>* _reads; // list of modules that are readable by this module
+  char* _version;  // module version number
   bool _pkgs_with_qexports; // this module contains 1 or more packages with qualified exports
 
 public:
@@ -54,6 +55,7 @@
     _name = NULL;
     _loader = NULL;
     _reads = NULL;
+    _version = (char *)"0";
     _pkgs_with_qexports = false;
   }
 
@@ -66,6 +68,9 @@
   ClassLoaderData*   loader() const                 { return _loader; }
   void               set_loader(ClassLoaderData* l) { _loader = l; }
 
+  char*              version()                      { return _version; }
+  void               set_version(char* version)     { _version = version; }
+
   bool               can_read(ModuleEntry* m) const;
   void               add_read(ModuleEntry* m);