comparison src/share/vm/oops/method.cpp @ 13584:2dfe246179c0

Merge
author dholmes
date Wed, 20 Sep 2017 23:55:35 -0400
parents 23d7878acfb7 1d0801b41ccd
children 503ddcb96bb0
comparison
equal deleted inserted replaced
153:b5e9fea64418 157:ad9465d7089c
35 #include "interpreter/bytecodes.hpp" 35 #include "interpreter/bytecodes.hpp"
36 #include "interpreter/interpreter.hpp" 36 #include "interpreter/interpreter.hpp"
37 #include "interpreter/oopMapCache.hpp" 37 #include "interpreter/oopMapCache.hpp"
38 #include "memory/heapInspection.hpp" 38 #include "memory/heapInspection.hpp"
39 #include "memory/metadataFactory.hpp" 39 #include "memory/metadataFactory.hpp"
40 #include "memory/metaspaceClosure.hpp"
40 #include "memory/metaspaceShared.hpp" 41 #include "memory/metaspaceShared.hpp"
41 #include "memory/oopFactory.hpp" 42 #include "memory/oopFactory.hpp"
42 #include "memory/resourceArea.hpp" 43 #include "memory/resourceArea.hpp"
43 #include "oops/constMethod.hpp" 44 #include "oops/constMethod.hpp"
44 #include "oops/method.hpp" 45 #include "oops/method.hpp"
77 byte_code_size, 78 byte_code_size,
78 sizes, 79 sizes,
79 method_type, 80 method_type,
80 CHECK_NULL); 81 CHECK_NULL);
81 int size = Method::size(access_flags.is_native()); 82 int size = Method::size(access_flags.is_native());
82 return new (loader_data, size, false, MetaspaceObj::MethodType, THREAD) Method(cm, access_flags); 83 return new (loader_data, size, MetaspaceObj::MethodType, THREAD) Method(cm, access_flags);
83 } 84 }
84 85
85 Method::Method(ConstMethod* xconst, AccessFlags access_flags) { 86 Method::Method(ConstMethod* xconst, AccessFlags access_flags) {
86 NoSafepointVerifier no_safepoint; 87 NoSafepointVerifier no_safepoint;
87 set_constMethod(xconst); 88 set_constMethod(xconst);
302 303
303 Symbol* Method::klass_name() const { 304 Symbol* Method::klass_name() const {
304 return method_holder()->name(); 305 return method_holder()->name();
305 } 306 }
306 307
308
309 void Method::metaspace_pointers_do(MetaspaceClosure* it) {
310 log_trace(cds)("Iter(Method): %p", this);
311
312 it->push(&_constMethod);
313 it->push(&_method_data);
314 it->push(&_method_counters);
315 }
307 316
308 // Attempt to return method oop to original state. Clear any pointers 317 // Attempt to return method oop to original state. Clear any pointers
309 // (to objects outside the shared spaces). We won't be able to predict 318 // (to objects outside the shared spaces). We won't be able to predict
310 // where they should point in a new JVM. Further initialize some 319 // where they should point in a new JVM. Further initialize some
311 // entries now in order allow them to be write protected later. 320 // entries now in order allow them to be write protected later.
1620 void Method::sort_methods(Array<Method*>* methods, bool idempotent, bool set_idnums) { 1629 void Method::sort_methods(Array<Method*>* methods, bool idempotent, bool set_idnums) {
1621 int length = methods->length(); 1630 int length = methods->length();
1622 if (length > 1) { 1631 if (length > 1) {
1623 { 1632 {
1624 NoSafepointVerifier nsv; 1633 NoSafepointVerifier nsv;
1625 QuickSort::sort<Method*>(methods->data(), length, method_comparator, idempotent); 1634 QuickSort::sort(methods->data(), length, method_comparator, idempotent);
1626 } 1635 }
1627 // Reset method ordering 1636 // Reset method ordering
1628 if (set_idnums) { 1637 if (set_idnums) {
1629 for (int i = 0; i < length; i++) { 1638 for (int i = 0; i < length; i++) {
1630 Method* m = methods->at(i); 1639 Method* m = methods->at(i);