--- a/hotspot/src/share/vm/oops/constMethod.hpp Sat Jul 22 15:54:27 2017 -0400
+++ b/hotspot/src/share/vm/oops/constMethod.hpp Wed Aug 02 18:06:38 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, 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
@@ -198,6 +198,9 @@
// multiple threads, so is volatile.
volatile uint64_t _fingerprint;
+ // If you add a new field that points to any metaspace object, you
+ // must add this field to ConstMethod::metaspace_pointers_do().
+
ConstantPool* _constants; // Constant pool
// Raw stackmap data for the method
@@ -369,6 +372,10 @@
int size() const { return _constMethod_size;}
void set_constMethod_size(int size) { _constMethod_size = size; }
+
+ // ConstMethods should be stored in the read-only region of CDS archive.
+ static bool is_read_only_by_default() { return true; }
+
#if INCLUDE_SERVICES
void collect_statistics(KlassSizeStats *sz) const;
#endif
@@ -529,6 +536,8 @@
bool is_klass() const { return false; }
DEBUG_ONLY(bool on_stack() { return false; })
+ void metaspace_pointers_do(MetaspaceClosure* it);
+ MetaspaceObj::Type type() const { return ConstMethodType; }
private:
// Since the size of the compressed line number table is unknown, the
// offsets of the other variable sized sections are computed backwards