--- a/hotspot/src/share/vm/classfile/stackMapFrame.cpp Fri Dec 18 14:30:13 2015 -0500
+++ b/hotspot/src/share/vm/classfile/stackMapFrame.cpp Sat Dec 19 02:32:27 2015 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -74,7 +74,7 @@
}
VerificationType StackMapFrame::set_locals_from_arg(
- const methodHandle m, VerificationType thisKlass, TRAPS) {
+ const methodHandle& m, VerificationType thisKlass, TRAPS) {
SignatureStream ss(m->signature());
int init_local_num = 0;
if (!m->is_static()) {
--- a/hotspot/src/share/vm/classfile/stackMapFrame.hpp Fri Dec 18 14:30:13 2015 -0500
+++ b/hotspot/src/share/vm/classfile/stackMapFrame.hpp Sat Dec 19 02:32:27 2015 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -152,7 +152,7 @@
// Set local variable type array based on m's signature.
VerificationType set_locals_from_arg(
- const methodHandle m, VerificationType thisKlass, TRAPS);
+ const methodHandle& m, VerificationType thisKlass, TRAPS);
// Search local variable type array and stack type array.
// Set every element with type of old_object to new_object.
--- a/hotspot/src/share/vm/classfile/verifier.cpp Fri Dec 18 14:30:13 2015 -0500
+++ b/hotspot/src/share/vm/classfile/verifier.cpp Sat Dec 19 02:32:27 2015 +0100
@@ -1745,7 +1745,7 @@
#undef bad_type_message
-char* ClassVerifier::generate_code_data(methodHandle m, u4 code_length, TRAPS) {
+char* ClassVerifier::generate_code_data(const methodHandle& m, u4 code_length, TRAPS) {
char* code_data = NEW_RESOURCE_ARRAY(char, code_length);
memset(code_data, 0, sizeof(char) * code_length);
RawBytecodeStream bcs(m);
@@ -1814,9 +1814,9 @@
}
void ClassVerifier::verify_local_variable_table(u4 code_length, char* code_data, TRAPS) {
- int localvariable_table_length = _method()->localvariable_table_length();
+ int localvariable_table_length = _method->localvariable_table_length();
if (localvariable_table_length > 0) {
- LocalVariableTableElement* table = _method()->localvariable_table_start();
+ LocalVariableTableElement* table = _method->localvariable_table_start();
for (int i = 0; i < localvariable_table_length; i++) {
u2 start_bci = table[i].start_bci;
u2 length = table[i].length;
--- a/hotspot/src/share/vm/classfile/verifier.hpp Fri Dec 18 14:30:13 2015 -0500
+++ b/hotspot/src/share/vm/classfile/verifier.hpp Sat Dec 19 02:32:27 2015 +0100
@@ -264,7 +264,7 @@
ErrorContext _error_context; // contains information about an error
void verify_method(const methodHandle& method, TRAPS);
- char* generate_code_data(methodHandle m, u4 code_length, TRAPS);
+ char* generate_code_data(const methodHandle& m, u4 code_length, TRAPS);
void verify_exception_handler_table(u4 code_length, char* code_data,
int& min, int& max, TRAPS);
void verify_local_variable_table(u4 code_length, char* code_data, TRAPS);
@@ -378,7 +378,7 @@
~ClassVerifier();
Thread* thread() { return _thread; }
- methodHandle method() { return _method; }
+ const methodHandle& method() { return _method; }
instanceKlassHandle current_class() const { return _klass; }
VerificationType current_type() const { return _this_type; }
--- a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp Fri Dec 18 14:30:13 2015 -0500
+++ b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp Sat Dec 19 02:32:27 2015 +0100
@@ -86,7 +86,7 @@
bool is_raw() const { return _is_raw; }
// Stream attributes
- methodHandle method() const { return _method; }
+ const methodHandle& method() const { return _method; }
int bci() const { return _bci; }
int next_bci() const { return _next_bci; }
--- a/hotspot/src/share/vm/runtime/handles.cpp Fri Dec 18 14:30:13 2015 -0500
+++ b/hotspot/src/share/vm/runtime/handles.cpp Sat Dec 19 02:32:27 2015 +0100
@@ -46,8 +46,57 @@
_handle = thread->handle_area()->allocate_handle(obj);
}
}
+#endif
-#endif
+// Copy constructors and destructors for metadata handles
+// These do too much to inline.
+#define DEF_METADATA_HANDLE_FN_NOINLINE(name, type) \
+name##Handle::name##Handle(const name##Handle &h) { \
+ _value = h._value; \
+ if (_value != NULL) { \
+ assert(_value->is_valid(), "obj is valid"); \
+ if (h._thread != NULL) { \
+ assert(h._thread == Thread::current(), "thread must be current");\
+ _thread = h._thread; \
+ } else { \
+ _thread = Thread::current(); \
+ } \
+ assert (_thread->is_in_stack((address)this), "not on stack?"); \
+ _thread->metadata_handles()->push((Metadata*)_value); \
+ } else { \
+ _thread = NULL; \
+ } \
+} \
+name##Handle& name##Handle::operator=(const name##Handle &s) { \
+ remove(); \
+ _value = s._value; \
+ if (_value != NULL) { \
+ assert(_value->is_valid(), "obj is valid"); \
+ if (s._thread != NULL) { \
+ assert(s._thread == Thread::current(), "thread must be current");\
+ _thread = s._thread; \
+ } else { \
+ _thread = Thread::current(); \
+ } \
+ assert (_thread->is_in_stack((address)this), "not on stack?"); \
+ _thread->metadata_handles()->push((Metadata*)_value); \
+ } else { \
+ _thread = NULL; \
+ } \
+ return *this; \
+} \
+inline void name##Handle::remove() { \
+ if (_value != NULL) { \
+ int i = _thread->metadata_handles()->find_from_end((Metadata*)_value); \
+ assert(i!=-1, "not in metadata_handles list"); \
+ _thread->metadata_handles()->remove_at(i); \
+ } \
+} \
+name##Handle::~name##Handle () { remove(); } \
+
+DEF_METADATA_HANDLE_FN_NOINLINE(method, Method)
+DEF_METADATA_HANDLE_FN_NOINLINE(constantPool, ConstantPool)
+
static uintx chunk_oops_do(OopClosure* f, Chunk* chunk, char* chunk_top) {
oop* bottom = (oop*) chunk->bottom();
--- a/hotspot/src/share/vm/runtime/handles.inline.hpp Fri Dec 18 14:30:13 2015 -0500
+++ b/hotspot/src/share/vm/runtime/handles.inline.hpp Sat Dec 19 02:32:27 2015 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -69,48 +69,6 @@
_thread->metadata_handles()->push((Metadata*)obj); \
} \
} \
-inline name##Handle::name##Handle(const name##Handle &h) { \
- _value = h._value; \
- if (_value != NULL) { \
- assert(_value->is_valid(), "obj is valid"); \
- if (h._thread != NULL) { \
- assert(h._thread == Thread::current(), "thread must be current");\
- _thread = h._thread; \
- } else { \
- _thread = Thread::current(); \
- } \
- assert (_thread->is_in_stack((address)this), "not on stack?"); \
- _thread->metadata_handles()->push((Metadata*)_value); \
- } else { \
- _thread = NULL; \
- } \
-} \
-inline name##Handle& name##Handle::operator=(const name##Handle &s) { \
- remove(); \
- _value = s._value; \
- if (_value != NULL) { \
- assert(_value->is_valid(), "obj is valid"); \
- if (s._thread != NULL) { \
- assert(s._thread == Thread::current(), "thread must be current");\
- _thread = s._thread; \
- } else { \
- _thread = Thread::current(); \
- } \
- assert (_thread->is_in_stack((address)this), "not on stack?"); \
- _thread->metadata_handles()->push((Metadata*)_value); \
- } else { \
- _thread = NULL; \
- } \
- return *this; \
-} \
-inline void name##Handle::remove() { \
- if (_value != NULL) { \
- int i = _thread->metadata_handles()->find_from_end((Metadata*)_value); \
- assert(i!=-1, "not in metadata_handles list"); \
- _thread->metadata_handles()->remove_at(i); \
- } \
-} \
-inline name##Handle::~name##Handle () { remove(); } \
DEF_METADATA_HANDLE_FN(method, Method)
DEF_METADATA_HANDLE_FN(constantPool, ConstantPool)