aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm/runtime
diff options
context:
space:
mode:
authorcoleenp <none@none>2012-09-01 13:25:18 -0400
committercoleenp <none@none>2012-09-01 13:25:18 -0400
commitc4f2a125e3006c1715c12ec6ec682389b24d7cac (patch)
tree00340ce50c7adf1b8db7e987946c2c9d747f37a3 /src/share/vm/runtime
parentab8cad1d47e8e46e6e633ee5eb4cb0cdb7a0e7bb (diff)
6964458: Reimplement class meta-data storage to use native memory
Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com> --HG-- rename : src/cpu/sparc/vm/dump_sparc.cpp => src/cpu/sparc/vm/metaspaceShared_sparc.cpp rename : src/cpu/x86/vm/dump_x86_32.cpp => src/cpu/x86/vm/metaspaceShared_x86_32.cpp rename : src/cpu/x86/vm/dump_x86_64.cpp => src/cpu/x86/vm/metaspaceShared_x86_64.cpp rename : src/cpu/zero/vm/dump_zero.cpp => src/cpu/zero/vm/metaspaceShared_zero.cpp rename : src/share/vm/oops/compiledICHolderOop.cpp => src/share/vm/oops/compiledICHolder.cpp rename : src/share/vm/oops/compiledICHolderOop.hpp => src/share/vm/oops/compiledICHolder.hpp rename : src/share/vm/oops/constMethodOop.cpp => src/share/vm/oops/constMethod.cpp rename : src/share/vm/oops/constMethodOop.hpp => src/share/vm/oops/constMethod.hpp rename : src/share/vm/oops/constantPoolOop.cpp => src/share/vm/oops/constantPool.cpp rename : src/share/vm/oops/constantPoolOop.hpp => src/share/vm/oops/constantPool.hpp rename : src/share/vm/oops/cpCacheOop.cpp => src/share/vm/oops/cpCache.cpp rename : src/share/vm/oops/cpCacheOop.hpp => src/share/vm/oops/cpCache.hpp rename : src/share/vm/oops/methodOop.cpp => src/share/vm/oops/method.cpp rename : src/share/vm/oops/methodOop.hpp => src/share/vm/oops/method.hpp rename : src/share/vm/oops/methodDataOop.cpp => src/share/vm/oops/methodData.cpp rename : src/share/vm/oops/methodDataOop.hpp => src/share/vm/oops/methodData.hpp
Diffstat (limited to 'src/share/vm/runtime')
-rw-r--r--src/share/vm/runtime/advancedThresholdPolicy.cpp45
-rw-r--r--src/share/vm/runtime/advancedThresholdPolicy.hpp24
-rw-r--r--src/share/vm/runtime/aprofiler.cpp72
-rw-r--r--src/share/vm/runtime/aprofiler.hpp11
-rw-r--r--src/share/vm/runtime/arguments.cpp123
-rw-r--r--src/share/vm/runtime/biasedLocking.cpp10
-rw-r--r--src/share/vm/runtime/compilationPolicy.cpp28
-rw-r--r--src/share/vm/runtime/compilationPolicy.hpp14
-rw-r--r--src/share/vm/runtime/deoptimization.cpp46
-rw-r--r--src/share/vm/runtime/deoptimization.hpp8
-rw-r--r--src/share/vm/runtime/dtraceJSDT.cpp6
-rw-r--r--src/share/vm/runtime/fieldDescriptor.cpp20
-rw-r--r--src/share/vm/runtime/fieldDescriptor.hpp20
-rw-r--r--src/share/vm/runtime/fprofiler.cpp76
-rw-r--r--src/share/vm/runtime/fprofiler.hpp8
-rw-r--r--src/share/vm/runtime/frame.cpp66
-rw-r--r--src/share/vm/runtime/frame.hpp17
-rw-r--r--src/share/vm/runtime/frame.inline.hpp6
-rw-r--r--src/share/vm/runtime/globals.hpp110
-rw-r--r--src/share/vm/runtime/handles.cpp11
-rw-r--r--src/share/vm/runtime/handles.hpp174
-rw-r--r--src/share/vm/runtime/handles.inline.hpp59
-rw-r--r--src/share/vm/runtime/init.cpp3
-rw-r--r--src/share/vm/runtime/java.cpp34
-rw-r--r--src/share/vm/runtime/javaCalls.cpp12
-rw-r--r--src/share/vm/runtime/javaCalls.hpp8
-rw-r--r--src/share/vm/runtime/jfieldIDWorkaround.hpp16
-rw-r--r--src/share/vm/runtime/jniHandles.cpp23
-rw-r--r--src/share/vm/runtime/jniHandles.hpp33
-rw-r--r--src/share/vm/runtime/memprofiler.cpp10
-rw-r--r--src/share/vm/runtime/mutexLocker.cpp2
-rw-r--r--src/share/vm/runtime/objectMonitor.cpp26
-rw-r--r--src/share/vm/runtime/os.cpp30
-rw-r--r--src/share/vm/runtime/perfData.cpp7
-rw-r--r--src/share/vm/runtime/perfData.hpp3
-rw-r--r--src/share/vm/runtime/reflection.cpp120
-rw-r--r--src/share/vm/runtime/reflection.hpp22
-rw-r--r--src/share/vm/runtime/reflectionUtils.cpp8
-rw-r--r--src/share/vm/runtime/reflectionUtils.hpp35
-rw-r--r--src/share/vm/runtime/relocator.cpp40
-rw-r--r--src/share/vm/runtime/relocator.hpp4
-rw-r--r--src/share/vm/runtime/rframe.hpp6
-rw-r--r--src/share/vm/runtime/sharedRuntime.cpp68
-rw-r--r--src/share/vm/runtime/sharedRuntime.hpp8
-rw-r--r--src/share/vm/runtime/signature.cpp6
-rw-r--r--src/share/vm/runtime/signature.hpp6
-rw-r--r--src/share/vm/runtime/simpleThresholdPolicy.cpp26
-rw-r--r--src/share/vm/runtime/simpleThresholdPolicy.hpp24
-rw-r--r--src/share/vm/runtime/simpleThresholdPolicy.inline.hpp6
-rw-r--r--src/share/vm/runtime/stackValue.cpp4
-rw-r--r--src/share/vm/runtime/stubRoutines.hpp4
-rw-r--r--src/share/vm/runtime/sweeper.cpp37
-rw-r--r--src/share/vm/runtime/sweeper.hpp4
-rw-r--r--src/share/vm/runtime/synchronizer.cpp26
-rw-r--r--src/share/vm/runtime/thread.cpp86
-rw-r--r--src/share/vm/runtime/thread.hpp39
-rw-r--r--src/share/vm/runtime/unhandledOops.cpp6
-rw-r--r--src/share/vm/runtime/vframe.cpp20
-rw-r--r--src/share/vm/runtime/vframe.hpp20
-rw-r--r--src/share/vm/runtime/vframeArray.cpp6
-rw-r--r--src/share/vm/runtime/vframeArray.hpp6
-rw-r--r--src/share/vm/runtime/vframe_hp.cpp19
-rw-r--r--src/share/vm/runtime/vframe_hp.hpp10
-rw-r--r--src/share/vm/runtime/virtualspace.cpp45
-rw-r--r--src/share/vm/runtime/virtualspace.hpp6
-rw-r--r--src/share/vm/runtime/vmStructs.cpp594
-rw-r--r--src/share/vm/runtime/vmStructs.hpp8
-rw-r--r--src/share/vm/runtime/vmThread.cpp2
-rw-r--r--src/share/vm/runtime/vm_operations.hpp5
69 files changed, 1238 insertions, 1249 deletions
diff --git a/src/share/vm/runtime/advancedThresholdPolicy.cpp b/src/share/vm/runtime/advancedThresholdPolicy.cpp
index 29453b8cb..9f4135f92 100644
--- a/src/share/vm/runtime/advancedThresholdPolicy.cpp
+++ b/src/share/vm/runtime/advancedThresholdPolicy.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2012, 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
@@ -73,7 +73,7 @@ void AdvancedThresholdPolicy::initialize() {
}
// update_rate() is called from select_task() while holding a compile queue lock.
-void AdvancedThresholdPolicy::update_rate(jlong t, methodOop m) {
+void AdvancedThresholdPolicy::update_rate(jlong t, Method* m) {
if (is_old(m)) {
// We don't remove old methods from the queue,
// so we can just zero the rate.
@@ -106,7 +106,7 @@ void AdvancedThresholdPolicy::update_rate(jlong t, methodOop m) {
// Check if this method has been stale from a given number of milliseconds.
// See select_task().
-bool AdvancedThresholdPolicy::is_stale(jlong t, jlong timeout, methodOop m) {
+bool AdvancedThresholdPolicy::is_stale(jlong t, jlong timeout, Method* m) {
jlong delta_s = t - SafepointSynchronize::end_of_last_safepoint();
jlong delta_t = t - m->prev_time();
if (delta_t > timeout && delta_s > timeout) {
@@ -120,16 +120,16 @@ bool AdvancedThresholdPolicy::is_stale(jlong t, jlong timeout, methodOop m) {
// We don't remove old methods from the compile queue even if they have
// very low activity. See select_task().
-bool AdvancedThresholdPolicy::is_old(methodOop method) {
+bool AdvancedThresholdPolicy::is_old(Method* method) {
return method->invocation_count() > 50000 || method->backedge_count() > 500000;
}
-double AdvancedThresholdPolicy::weight(methodOop method) {
+double AdvancedThresholdPolicy::weight(Method* method) {
return (method->rate() + 1) * ((method->invocation_count() + 1) * (method->backedge_count() + 1));
}
// Apply heuristics and return true if x should be compiled before y
-bool AdvancedThresholdPolicy::compare_methods(methodOop x, methodOop y) {
+bool AdvancedThresholdPolicy::compare_methods(Method* x, Method* y) {
if (x->highest_comp_level() > y->highest_comp_level()) {
// recompilation after deopt
return true;
@@ -143,8 +143,8 @@ bool AdvancedThresholdPolicy::compare_methods(methodOop x, methodOop y) {
}
// Is method profiled enough?
-bool AdvancedThresholdPolicy::is_method_profiled(methodOop method) {
- methodDataOop mdo = method->method_data();
+bool AdvancedThresholdPolicy::is_method_profiled(Method* method) {
+ MethodData* mdo = method->method_data();
if (mdo != NULL) {
int i = mdo->invocation_count_delta();
int b = mdo->backedge_count_delta();
@@ -156,19 +156,20 @@ bool AdvancedThresholdPolicy::is_method_profiled(methodOop method) {
// Called with the queue locked and with at least one element
CompileTask* AdvancedThresholdPolicy::select_task(CompileQueue* compile_queue) {
CompileTask *max_task = NULL;
- methodHandle max_method;
+ Method* max_method;
jlong t = os::javaTimeMillis();
// Iterate through the queue and find a method with a maximum rate.
for (CompileTask* task = compile_queue->first(); task != NULL;) {
CompileTask* next_task = task->next();
- methodHandle method = (methodOop)JNIHandles::resolve(task->method_handle());
- update_rate(t, method());
+ Method* method = task->method();
+ MethodData* mdo = method->method_data();
+ update_rate(t, method);
if (max_task == NULL) {
max_task = task;
max_method = method;
} else {
// If a method has been stale for some time, remove it from the queue.
- if (is_stale(t, TieredCompileTaskTimeout, method()) && !is_old(method())) {
+ if (is_stale(t, TieredCompileTaskTimeout, method) && !is_old(method)) {
if (PrintTieredEvents) {
print_event(REMOVE_FROM_QUEUE, method, method, task->osr_bci(), (CompLevel)task->comp_level());
}
@@ -180,7 +181,7 @@ CompileTask* AdvancedThresholdPolicy::select_task(CompileQueue* compile_queue) {
}
// Select a method with a higher rate
- if (compare_methods(method(), max_method())) {
+ if (compare_methods(method, max_method)) {
max_task = task;
max_method = method;
}
@@ -189,7 +190,7 @@ CompileTask* AdvancedThresholdPolicy::select_task(CompileQueue* compile_queue) {
}
if (max_task->comp_level() == CompLevel_full_profile && TieredStopAtLevel > CompLevel_full_profile
- && is_method_profiled(max_method())) {
+ && is_method_profiled(max_method)) {
max_task->set_comp_level(CompLevel_limited_profile);
if (PrintTieredEvents) {
print_event(UPDATE_IN_QUEUE, max_method, max_method, max_task->osr_bci(), (CompLevel)max_task->comp_level());
@@ -247,7 +248,7 @@ bool AdvancedThresholdPolicy::call_predicate(int i, int b, CompLevel cur_level)
// If a method is old enough and is still in the interpreter we would want to
// start profiling without waiting for the compiled method to arrive.
// We also take the load on compilers into the account.
-bool AdvancedThresholdPolicy::should_create_mdo(methodOop method, CompLevel cur_level) {
+bool AdvancedThresholdPolicy::should_create_mdo(Method* method, CompLevel cur_level) {
if (cur_level == CompLevel_none &&
CompileBroker::queue_size(CompLevel_full_optimization) <=
Tier3DelayOn * compiler_count(CompLevel_full_optimization)) {
@@ -274,7 +275,7 @@ bool AdvancedThresholdPolicy::should_not_inline(ciEnv* env, ciMethod* callee) {
void AdvancedThresholdPolicy::create_mdo(methodHandle mh, JavaThread* THREAD) {
if (mh->is_native() || mh->is_abstract() || mh->is_accessor()) return;
if (mh->method_data() == NULL) {
- methodOopDesc::build_interpreter_method_data(mh, CHECK_AND_CLEAR);
+ Method::build_interpreter_method_data(mh, CHECK_AND_CLEAR);
}
}
@@ -318,7 +319,7 @@ void AdvancedThresholdPolicy::create_mdo(methodHandle mh, JavaThread* THREAD) {
*/
// Common transition function. Given a predicate determines if a method should transition to another level.
-CompLevel AdvancedThresholdPolicy::common(Predicate p, methodOop method, CompLevel cur_level, bool disable_feedback) {
+CompLevel AdvancedThresholdPolicy::common(Predicate p, Method* method, CompLevel cur_level, bool disable_feedback) {
CompLevel next_level = cur_level;
int i = method->invocation_count();
int b = method->backedge_count();
@@ -352,7 +353,7 @@ CompLevel AdvancedThresholdPolicy::common(Predicate p, methodOop method, CompLev
// Special case: we got here because this method was fully profiled in the interpreter.
next_level = CompLevel_full_optimization;
} else {
- methodDataOop mdo = method->method_data();
+ MethodData* mdo = method->method_data();
if (mdo != NULL) {
if (mdo->would_profile()) {
if (disable_feedback || (CompileBroker::queue_size(CompLevel_full_optimization) <=
@@ -368,7 +369,7 @@ CompLevel AdvancedThresholdPolicy::common(Predicate p, methodOop method, CompLev
break;
case CompLevel_full_profile:
{
- methodDataOop mdo = method->method_data();
+ MethodData* mdo = method->method_data();
if (mdo != NULL) {
if (mdo->would_profile()) {
int mdo_i = mdo->invocation_count_delta();
@@ -388,7 +389,7 @@ CompLevel AdvancedThresholdPolicy::common(Predicate p, methodOop method, CompLev
}
// Determine if a method should be compiled with a normal entry point at a different level.
-CompLevel AdvancedThresholdPolicy::call_event(methodOop method, CompLevel cur_level) {
+CompLevel AdvancedThresholdPolicy::call_event(Method* method, CompLevel cur_level) {
CompLevel osr_level = MIN2((CompLevel) method->highest_osr_comp_level(),
common(&AdvancedThresholdPolicy::loop_predicate, method, cur_level, true));
CompLevel next_level = common(&AdvancedThresholdPolicy::call_predicate, method, cur_level);
@@ -397,7 +398,7 @@ CompLevel AdvancedThresholdPolicy::call_event(methodOop method, CompLevel cur_le
// equalized by raising the regular method level in order to avoid OSRs during each
// invocation of the method.
if (osr_level == CompLevel_full_optimization && cur_level == CompLevel_full_profile) {
- methodDataOop mdo = method->method_data();
+ MethodData* mdo = method->method_data();
guarantee(mdo != NULL, "MDO should not be NULL");
if (mdo->invocation_count() >= 1) {
next_level = CompLevel_full_optimization;
@@ -409,7 +410,7 @@ CompLevel AdvancedThresholdPolicy::call_event(methodOop method, CompLevel cur_le
}
// Determine if we should do an OSR compilation of a given method.
-CompLevel AdvancedThresholdPolicy::loop_event(methodOop method, CompLevel cur_level) {
+CompLevel AdvancedThresholdPolicy::loop_event(Method* method, CompLevel cur_level) {
CompLevel next_level = common(&AdvancedThresholdPolicy::loop_predicate, method, cur_level, true);
if (cur_level == CompLevel_none) {
// If there is a live OSR method that means that we deopted to the interpreter
diff --git a/src/share/vm/runtime/advancedThresholdPolicy.hpp b/src/share/vm/runtime/advancedThresholdPolicy.hpp
index 71268774c..90a1ca174 100644
--- a/src/share/vm/runtime/advancedThresholdPolicy.hpp
+++ b/src/share/vm/runtime/advancedThresholdPolicy.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2012, 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
@@ -99,7 +99,7 @@ class CompileQueue;
* The intuition is to equalize the time that is spend profiling each method.
* The same predicate is used to control the transition from level 3 to level 4 (C2). It should be
* noted though that the thresholds are relative. Moreover i and b for the 0->3 transition come
- * from methodOop and for 3->4 transition they come from MDO (since profiled invocations are
+ * from Method* and for 3->4 transition they come from MDO (since profiled invocations are
* counted separately).
*
* OSR transitions are controlled simply with b > TierXBackEdgeThreshold * s predicates.
@@ -168,38 +168,38 @@ class AdvancedThresholdPolicy : public SimpleThresholdPolicy {
bool call_predicate(int i, int b, CompLevel cur_level);
bool loop_predicate(int i, int b, CompLevel cur_level);
// Common transition function. Given a predicate determines if a method should transition to another level.
- CompLevel common(Predicate p, methodOop method, CompLevel cur_level, bool disable_feedback = false);
+ CompLevel common(Predicate p, Method* method, CompLevel cur_level, bool disable_feedback = false);
// Transition functions.
// call_event determines if a method should be compiled at a different
// level with a regular invocation entry.
- CompLevel call_event(methodOop method, CompLevel cur_level);
+ CompLevel call_event(Method* method, CompLevel cur_level);
// loop_event checks if a method should be OSR compiled at a different
// level.
- CompLevel loop_event(methodOop method, CompLevel cur_level);
+ CompLevel loop_event(Method* method, CompLevel cur_level);
// Has a method been long around?
// We don't remove old methods from the compile queue even if they have
// very low activity (see select_task()).
- inline bool is_old(methodOop method);
+ inline bool is_old(Method* method);
// Was a given method inactive for a given number of milliseconds.
// If it is, we would remove it from the queue (see select_task()).
- inline bool is_stale(jlong t, jlong timeout, methodOop m);
+ inline bool is_stale(jlong t, jlong timeout, Method* m);
// Compute the weight of the method for the compilation scheduling
- inline double weight(methodOop method);
+ inline double weight(Method* method);
// Apply heuristics and return true if x should be compiled before y
- inline bool compare_methods(methodOop x, methodOop y);
+ inline bool compare_methods(Method* x, Method* y);
// Compute event rate for a given method. The rate is the number of event (invocations + backedges)
// per millisecond.
- inline void update_rate(jlong t, methodOop m);
+ inline void update_rate(jlong t, Method* m);
// Compute threshold scaling coefficient
inline double threshold_scale(CompLevel level, int feedback_k);
// If a method is old enough and is still in the interpreter we would want to
// start profiling without waiting for the compiled method to arrive. This function
// determines whether we should do that.
- inline bool should_create_mdo(methodOop method, CompLevel cur_level);
+ inline bool should_create_mdo(Method* method, CompLevel cur_level);
// Create MDO if necessary.
void create_mdo(methodHandle mh, JavaThread* thread);
// Is method profiled enough?
- bool is_method_profiled(methodOop method);
+ bool is_method_profiled(Method* method);
protected:
void print_specific(EventType type, methodHandle mh, methodHandle imh, int bci, CompLevel level);
diff --git a/src/share/vm/runtime/aprofiler.cpp b/src/share/vm/runtime/aprofiler.cpp
index c3dbce368..6c4e9cc42 100644
--- a/src/share/vm/runtime/aprofiler.cpp
+++ b/src/share/vm/runtime/aprofiler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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,7 +25,6 @@
#include "precompiled.hpp"
#include "classfile/systemDictionary.hpp"
#include "gc_interface/collectedHeap.inline.hpp"
-#include "memory/permGen.hpp"
#include "memory/resourceArea.hpp"
#include "memory/space.hpp"
#include "oops/oop.inline.hpp"
@@ -34,35 +33,19 @@
bool AllocationProfiler::_active = false;
-GrowableArray<klassOop>* AllocationProfiler::_print_array = NULL;
+GrowableArray<Klass*>* AllocationProfiler::_print_array = NULL;
class AllocProfClosure : public ObjectClosure {
public:
void do_object(oop obj) {
- Klass* k = obj->blueprint();
+ Klass* k = obj->klass();
k->set_alloc_count(k->alloc_count() + 1);
k->set_alloc_size(k->alloc_size() + obj->size());
}
};
-#ifndef PRODUCT
-
-class AllocProfResetClosure : public ObjectClosure {
- public:
- void do_object(oop obj) {
- if (obj->is_klass()) {
- Klass* k = Klass::cast(klassOop(obj));
- k->set_alloc_count(0);
- k->set_alloc_size(0);
- }
- }
-};
-
-#endif
-
-
void AllocationProfiler::iterate_since_last_gc() {
if (is_active()) {
AllocProfClosure blk;
@@ -82,20 +65,20 @@ void AllocationProfiler::disengage() {
}
-void AllocationProfiler::add_class_to_array(klassOop k) {
+void AllocationProfiler::add_class_to_array(Klass* k) {
_print_array->append(k);
}
-void AllocationProfiler::add_classes_to_array(klassOop k) {
+void AllocationProfiler::add_classes_to_array(Klass* k) {
// Iterate over klass and all array klasses for klass
- k->klass_part()->with_array_klasses_do(&AllocationProfiler::add_class_to_array);
+ k->with_array_klasses_do(&AllocationProfiler::add_class_to_array);
}
-int AllocationProfiler::compare_classes(klassOop* k1, klassOop* k2) {
+int AllocationProfiler::compare_classes(Klass** k1, Klass** k2) {
// Sort by total allocation size
- return (*k2)->klass_part()->alloc_size() - (*k1)->klass_part()->alloc_size();
+ return (*k2)->alloc_size() - (*k1)->alloc_size();
}
@@ -113,14 +96,14 @@ void AllocationProfiler::sort_and_print_array(size_t cutoff) {
size_t total_alloc_size = 0;
int total_alloc_count = 0;
for (int index = 0; index < _print_array->length(); index++) {
- klassOop k = _print_array->at(index);
- size_t alloc_size = k->klass_part()->alloc_size();
+ Klass* k = _print_array->at(index);
+ size_t alloc_size = k->alloc_size();
if (alloc_size > cutoff) {
- int alloc_count = k->klass_part()->alloc_count();
+ int alloc_count = k->alloc_count();
#ifdef PRODUCT
- const char* name = k->klass_part()->external_name();
+ const char* name = k->external_name();
#else
- const char* name = k->klass_part()->internal_name();
+ const char* name = k->internal_name();
#endif
tty->print_cr("%20u %10u %8u %s",
alloc_size * BytesPerWord,
@@ -130,6 +113,8 @@ void AllocationProfiler::sort_and_print_array(size_t cutoff) {
total_alloc_size += alloc_size;
total_alloc_count += alloc_count;
}
+ k->set_alloc_count(0);
+ k->set_alloc_size(0);
}
tty->print_cr("%20u %10u %8u --total--",
total_alloc_size * BytesPerWord,
@@ -148,32 +133,11 @@ void AllocationProfiler::print(size_t cutoff) {
tty->cr();
// Print regular instance klasses and basic type array klasses
- _print_array = new GrowableArray<klassOop>(SystemDictionary::number_of_classes()*2);
+ _print_array = new GrowableArray<Klass*>(SystemDictionary::number_of_classes()*2);
SystemDictionary::classes_do(&add_classes_to_array);
Universe::basic_type_classes_do(&add_classes_to_array);
sort_and_print_array(cutoff);
- #ifndef PRODUCT
- tty->print_cr("Allocation profile for system classes (sizes in bytes, cutoff = %d bytes):", cutoff * BytesPerWord);
- tty->cr();
-
- // Print system klasses (methods, symbols, constant pools, etc.)
- _print_array = new GrowableArray<klassOop>(64);
- Universe::system_classes_do(&add_classes_to_array);
- sort_and_print_array(cutoff);
-
- tty->print_cr("Permanent generation dump (sizes in bytes, cutoff = %d bytes):", cutoff * BytesPerWord);
- tty->cr();
-
- AllocProfResetClosure resetblk;
- Universe::heap()->permanent_object_iterate(&resetblk);
- AllocProfClosure blk;
- Universe::heap()->permanent_object_iterate(&blk);
-
- _print_array = new GrowableArray<klassOop>(SystemDictionary::number_of_classes()*2);
- SystemDictionary::classes_do(&add_classes_to_array);
- Universe::basic_type_classes_do(&add_classes_to_array);
- Universe::system_classes_do(&add_classes_to_array);
- sort_and_print_array(cutoff);
- #endif
+ // This used to print metadata in the permgen but since there isn't a permgen
+ // anymore, it is not yet implemented.
}
diff --git a/src/share/vm/runtime/aprofiler.hpp b/src/share/vm/runtime/aprofiler.hpp
index 89af4734e..ba4dd7aa5 100644
--- a/src/share/vm/runtime/aprofiler.hpp
+++ b/src/share/vm/runtime/aprofiler.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -28,7 +28,6 @@
#include "memory/allocation.hpp"
#include "memory/universe.hpp"
#include "oops/klass.hpp"
-#include "oops/klassOop.hpp"
#include "utilities/top.hpp"
// A simple allocation profiler for Java. The profiler collects and prints
@@ -46,12 +45,12 @@ class AllocationProfiler: AllStatic {
friend class MarkSweep;
private:
static bool _active; // tells whether profiler is active
- static GrowableArray<klassOop>* _print_array; // temporary array for printing
+ static GrowableArray<Klass*>* _print_array; // temporary array for printing
// Utility printing functions
- static void add_class_to_array(klassOop k);
- static void add_classes_to_array(klassOop k);
- static int compare_classes(klassOop* k1, klassOop* k2);
+ static void add_class_to_array(Klass* k);
+ static void add_classes_to_array(Klass* k);
+ static int compare_classes(Klass** k1, Klass** k2);
static int average(size_t alloc_size, int alloc_count);
static void sort_and_print_array(size_t cutoff);
diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp
index 27085b3f8..f70bd16b1 100644
--- a/src/share/vm/runtime/arguments.cpp
+++ b/src/share/vm/runtime/arguments.cpp
@@ -245,6 +245,18 @@ static ObsoleteFlag obsolete_jvm_flags[] = {
JDK_Version::jdk_update(6,27), JDK_Version::jdk(8) },
{ "AllowTransitionalJSR292", JDK_Version::jdk(7), JDK_Version::jdk(8) },
{ "UseCompressedStrings", JDK_Version::jdk(7), JDK_Version::jdk(8) },
+ { "CMSPermGenPrecleaningEnabled", JDK_Version::jdk(8), JDK_Version::jdk(9) },
+ { "CMSTriggerPermRatio", JDK_Version::jdk(8), JDK_Version::jdk(9) },
+ { "CMSInitiatingPermOccupancyFraction", JDK_Version::jdk(8), JDK_Version::jdk(9) },
+ { "AdaptivePermSizeWeight", JDK_Version::jdk(8), JDK_Version::jdk(9) },
+ { "PermGenPadding", JDK_Version::jdk(8), JDK_Version::jdk(9) },
+ { "PermMarkSweepDeadRatio", JDK_Version::jdk(8), JDK_Version::jdk(9) },
+ { "PermSize", JDK_Version::jdk(8), JDK_Version::jdk(9) },
+ { "MaxPermSize", JDK_Version::jdk(8), JDK_Version::jdk(9) },
+ { "MinPermHeapExpansion", JDK_Version::jdk(8), JDK_Version::jdk(9) },
+ { "MaxPermHeapExpansion", JDK_Version::jdk(8), JDK_Version::jdk(9) },
+ { "CMSRevisitStackSize", JDK_Version::jdk(8), JDK_Version::jdk(9) },
+ { "PrintRevisitStats", JDK_Version::jdk(8), JDK_Version::jdk(9) },
#ifdef PRODUCT
{ "DesiredMethodLimit",
JDK_Version::jdk_update(7, 2), JDK_Version::jdk(8) },
@@ -1086,9 +1098,6 @@ void Arguments::set_parnew_gc_flags() {
}
}
if (UseParNewGC) {
- // CDS doesn't work with ParNew yet
- no_shared_spaces();
-
// By default YoungPLABSize and OldPLABSize are set to 4096 and 1024 respectively,
// these settings are default for Parallel Scavenger. For ParNew+Tenured configuration
// we set them to 1024 and 1024.
@@ -1332,10 +1341,10 @@ bool verify_object_alignment() {
inline uintx max_heap_for_compressed_oops() {
// Avoid sign flip.
- if (OopEncodingHeapMax < MaxPermSize + os::vm_page_size()) {
+ if (OopEncodingHeapMax < ClassMetaspaceSize + os::vm_page_size()) {
return 0;
}
- LP64_ONLY(return OopEncodingHeapMax - MaxPermSize - os::vm_page_size());
+ LP64_ONLY(return OopEncodingHeapMax - ClassMetaspaceSize - os::vm_page_size());
NOT_LP64(ShouldNotReachHere(); return 0);
}
@@ -1354,11 +1363,6 @@ bool Arguments::should_auto_select_low_pause_collector() {
}
void Arguments::set_ergonomics_flags() {
- // Parallel GC is not compatible with sharing. If one specifies
- // that they want sharing explicitly, do not set ergonomics flags.
- if (DumpSharedSpaces || RequireSharedSpaces) {
- return;
- }
if (os::is_server_class_machine()) {
// If no other collector is requested explicitly,
@@ -1368,13 +1372,19 @@ void Arguments::set_ergonomics_flags() {
!UseConcMarkSweepGC &&
!UseG1GC &&
!UseParNewGC &&
- !DumpSharedSpaces &&
FLAG_IS_DEFAULT(UseParallelGC)) {
if (should_auto_select_low_pause_collector()) {
FLAG_SET_ERGO(bool, UseConcMarkSweepGC, true);
} else {
FLAG_SET_ERGO(bool, UseParallelGC, true);
}
+ }
+ // Shared spaces work fine with other GCs but causes bytecode rewriting
+ // to be disabled, which hurts interpreter performance and decreases
+ // server performance. On server class machines, keep the default
+ // off unless it is asked for. Future work: either add bytecode rewriting
+ // at link time, or rewrite bytecodes in non-shared methods.
+ if (!DumpSharedSpaces && !RequireSharedSpaces) {
no_shared_spaces();
}
}
@@ -1402,8 +1412,22 @@ void Arguments::set_ergonomics_flags() {
if (UseCompressedOops && !FLAG_IS_DEFAULT(UseCompressedOops)) {
warning("Max heap size too large for Compressed Oops");
FLAG_SET_DEFAULT(UseCompressedOops, false);
+ FLAG_SET_DEFAULT(UseCompressedKlassPointers, false);
}
}
+ // UseCompressedOops must be on for UseCompressedKlassPointers to be on.
+ if (!UseCompressedOops) {
+ if (UseCompressedKlassPointers) {
+ warning("UseCompressedKlassPointers requires UseCompressedOops");
+ }
+ FLAG_SET_DEFAULT(UseCompressedKlassPointers, false);
+ } else {
+ // Turn on UseCompressedKlassPointers too
+ // The compiler is broken for this so turn it on when the compiler is fixed.
+ // if (FLAG_IS_DEFAULT(UseCompressedKlassPointers)) {
+ // FLAG_SET_ERGO(bool, UseCompressedKlassPointers, true);
+ // }
+ }
// Also checks that certain machines are slower with compressed oops
// in vm_version initialization code.
#endif // _LP64
@@ -1444,9 +1468,6 @@ void Arguments::set_parallel_gc_flags() {
if (FLAG_IS_DEFAULT(MarkSweepDeadRatio)) {
FLAG_SET_DEFAULT(MarkSweepDeadRatio, 1);
}
- if (FLAG_IS_DEFAULT(PermMarkSweepDeadRatio)) {
- FLAG_SET_DEFAULT(PermMarkSweepDeadRatio, 5);
- }
}
}
if (UseNUMA) {
@@ -1470,7 +1491,6 @@ void Arguments::set_g1_gc_flags() {
FLAG_SET_DEFAULT(ParallelGCThreads,
Abstract_VM_Version::parallel_worker_threads());
}
- no_shared_spaces();
if (FLAG_IS_DEFAULT(MarkStackSize)) {
FLAG_SET_DEFAULT(MarkStackSize, 128 * TASKQUEUE_SIZE);
@@ -1806,7 +1826,6 @@ bool Arguments::check_vm_args_consistency() {
status = status && verify_percentage(AdaptiveSizePolicyWeight,
"AdaptiveSizePolicyWeight");
- status = status && verify_percentage(AdaptivePermSizeWeight, "AdaptivePermSizeWeight");
status = status && verify_percentage(ThresholdTolerance, "ThresholdTolerance");
status = status && verify_percentage(MinHeapFreeRatio, "MinHeapFreeRatio");
status = status && verify_percentage(MaxHeapFreeRatio, "MaxHeapFreeRatio");
@@ -2385,13 +2404,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
// -Xshare:dump
} else if (match_option(option, "-Xshare:dump", &tail)) {
-#ifdef TIERED
- FLAG_SET_CMDLINE(bool, DumpSharedSpaces, true);
- set_mode_flags(_int); // Prevent compilation, which creates objects
-#elif defined(COMPILER2)
- vm_exit_during_initialization(
- "Dumping a shared archive is not supported on the Server JVM.", NULL);
-#elif defined(KERNEL)
+#if defined(KERNEL)
vm_exit_during_initialization(
"Dumping a shared archive is not supported on the Kernel JVM.", NULL);
#else
@@ -2491,15 +2504,6 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
// process space. The 64bit VM version of this function is a nop.
initHeapSize = os::allocatable_physical_memory(initHeapSize);
- // The perm gen is separate but contiguous with the
- // object heap (and is reserved with it) so subtract it
- // from the heap size.
- if (initHeapSize > MaxPermSize) {
- initHeapSize = initHeapSize - MaxPermSize;
- } else {
- warning("AggressiveHeap and MaxPermSize values may conflict");
- }
-
if (FLAG_IS_DEFAULT(MaxHeapSize)) {
FLAG_SET_CMDLINE(uintx, MaxHeapSize, initHeapSize);
FLAG_SET_CMDLINE(uintx, InitialHeapSize, initHeapSize);
@@ -2904,39 +2908,25 @@ void Arguments::set_shared_spaces_flags() {
const bool must_share = DumpSharedSpaces || RequireSharedSpaces;
const bool might_share = must_share || UseSharedSpaces;
- // The string table is part of the shared archive so the size must match.
- if (!FLAG_IS_DEFAULT(StringTableSize)) {
- // Disable sharing.
- if (must_share) {
- warning("disabling shared archive %s because of non-default "
- "StringTableSize", DumpSharedSpaces ? "creation" : "use");
- }
- if (might_share) {
- FLAG_SET_DEFAULT(DumpSharedSpaces, false);
- FLAG_SET_DEFAULT(RequireSharedSpaces, false);
- FLAG_SET_DEFAULT(UseSharedSpaces, false);
- }
- return;
- }
-
- // Check whether class data sharing settings conflict with GC, compressed oops
- // or page size, and fix them up. Explicit sharing options override other
- // settings.
- const bool cannot_share = UseConcMarkSweepGC || CMSIncrementalMode ||
- UseG1GC || UseParNewGC || UseParallelGC || UseParallelOldGC ||
- UseCompressedOops || UseLargePages && FLAG_IS_CMDLINE(UseLargePages);
+ // CompressedOops cannot be used with CDS. The offsets of oopmaps and
+ // static fields are incorrect in the archive. With some more clever
+ // initialization, this restriction can probably be lifted.
+ // ??? UseLargePages might be okay now
+ const bool cannot_share = UseCompressedOops ||
+ (UseLargePages && FLAG_IS_CMDLINE(UseLargePages));
if (cannot_share) {
if (must_share) {
- warning("selecting serial gc and disabling large pages %s"
+ warning("disabling large pages%s"
"because of %s", "" LP64_ONLY("and compressed oops "),
DumpSharedSpaces ? "-Xshare:dump" : "-Xshare:on");
- force_serial_gc();
FLAG_SET_CMDLINE(bool, UseLargePages, false);
LP64_ONLY(FLAG_SET_CMDLINE(bool, UseCompressedOops, false));
+ LP64_ONLY(FLAG_SET_CMDLINE(bool, UseCompressedKlassPointers, false));
} else {
+ // Prefer compressed oops and large pages to class data sharing
if (UseSharedSpaces && Verbose) {
- warning("turning off use of shared archive because of "
- "choice of garbage collector or large pages");
+ warning("turning off use of shared archive because of large pages%s",
+ "" LP64_ONLY(" and/or compressed oops"));
}
no_shared_spaces();
}
@@ -2945,6 +2935,18 @@ void Arguments::set_shared_spaces_flags() {
// there may not even be a shared archive to use.
FLAG_SET_DEFAULT(UseLargePages, false);
}
+
+ // Add 2M to any size for SharedReadOnlySize to get around the JPRT setting
+ if (DumpSharedSpaces && !FLAG_IS_DEFAULT(SharedReadOnlySize)) {
+ SharedReadOnlySize = 14*M;
+ }
+
+ if (DumpSharedSpaces) {
+ if (RequireSharedSpaces) {
+ warning("cannot dump shared archive while using shared archive");
+ }
+ UseSharedSpaces = false;
+ }
}
// Disable options not supported in this release, with a warning if they
@@ -3103,12 +3105,6 @@ jint Arguments::parse(const JavaVMInitArgs* args) {
}
ScavengeRootsInCode = 1;
}
- if (!JavaObjectsInPerm && ScavengeRootsInCode == 0) {
- if (!FLAG_IS_DEFAULT(ScavengeRootsInCode)) {
- warning("forcing ScavengeRootsInCode non-zero because JavaObjectsInPerm is false");
- }
- ScavengeRootsInCode = 1;
- }
if (PrintGCDetails) {
// Turn on -verbose:gc options as well
@@ -3200,6 +3196,7 @@ jint Arguments::parse(const JavaVMInitArgs* args) {
FLAG_SET_DEFAULT(ProfileInterpreter, false);
FLAG_SET_DEFAULT(UseBiasedLocking, false);
LP64_ONLY(FLAG_SET_DEFAULT(UseCompressedOops, false));
+ LP64_ONLY(FLAG_SET_DEFAULT(UseCompressedKlassPointers, false));
#endif // CC_INTERP
#ifdef COMPILER2
diff --git a/src/share/vm/runtime/biasedLocking.cpp b/src/share/vm/runtime/biasedLocking.cpp
index de739ecaf..469f46194 100644
--- a/src/share/vm/runtime/biasedLocking.cpp
+++ b/src/share/vm/runtime/biasedLocking.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, 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
@@ -38,7 +38,7 @@ BiasedLockingCounters BiasedLocking::_counters;
static GrowableArray<Handle>* _preserved_oop_stack = NULL;
static GrowableArray<markOop>* _preserved_mark_stack = NULL;
-static void enable_biased_locking(klassOop k) {
+static void enable_biased_locking(Klass* k) {
Klass::cast(k)->set_prototype_header(markOopDesc::biased_locking_prototype());
}
@@ -276,7 +276,7 @@ static HeuristicsResult update_heuristics(oop o, bool allow_rebias) {
// 2. Revoke the biases of all objects in the heap of this type
// and don't allow rebiasing of these objects. Disable
// allocation of objects of that type with the bias bit set.
- Klass* k = o->blueprint();
+ Klass* k = o->klass();
jlong cur_time = os::javaTimeMillis();
jlong last_bulk_revocation_time = k->last_biased_lock_bulk_revocation_time();
int revocation_count = k->biased_lock_revocation_count();
@@ -330,10 +330,10 @@ static BiasedLocking::Condition bulk_revoke_or_rebias_at_safepoint(oop o,
}
jlong cur_time = os::javaTimeMillis();
- o->blueprint()->set_last_biased_lock_bulk_revocation_time(cur_time);
+ o->klass()->set_last_biased_lock_bulk_revocation_time(cur_time);
- klassOop k_o = o->klass();
+ Klass* k_o = o->klass();
Klass* klass = Klass::cast(k_o);
if (bulk_rebias) {
diff --git a/src/share/vm/runtime/compilationPolicy.cpp b/src/share/vm/runtime/compilationPolicy.cpp
index dadfb1e48..8689c8c1b 100644
--- a/src/share/vm/runtime/compilationPolicy.cpp
+++ b/src/share/vm/runtime/compilationPolicy.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -28,8 +28,8 @@
#include "code/scopeDesc.hpp"
#include "compiler/compilerOracle.hpp"
#include "interpreter/interpreter.hpp"
-#include "oops/methodDataOop.hpp"
-#include "oops/methodOop.hpp"
+#include "oops/methodData.hpp"
+#include "oops/method.hpp"
#include "oops/oop.inline.hpp"
#include "prims/nativeLookup.hpp"
#include "runtime/advancedThresholdPolicy.hpp"
@@ -222,7 +222,7 @@ void NonTieredCompPolicy::reset_counter_for_back_branch_event(methodHandle m) {
//
class CounterDecay : public AllStatic {
static jlong _last_timestamp;
- static void do_method(methodOop m) {
+ static void do_method(Method* m) {
m->invocation_counter()->decay();
}
public:
@@ -245,9 +245,9 @@ void CounterDecay::decay() {
double classes_per_tick = nclasses * (CounterDecayMinIntervalLength * 1e-3 /
CounterHalfLifeTime);
for (int i = 0; i < classes_per_tick; i++) {
- klassOop k = SystemDictionary::try_get_next_class();
- if (k != NULL && k->klass_part()->oop_is_instance()) {
- instanceKlass::cast(k)->methods_do(do_method);
+ Klass* k = SystemDictionary::try_get_next_class();
+ if (k != NULL && k->oop_is_instance()) {
+ InstanceKlass::cast(k)->methods_do(do_method);
}
}
}
@@ -277,12 +277,12 @@ void NonTieredCompPolicy::reprofile(ScopeDesc* trap_scope, bool is_osr) {
// This method can be called by any component of the runtime to notify the policy
// that it's recommended to delay the complation of this method.
-void NonTieredCompPolicy::delay_compilation(methodOop method) {
+void NonTieredCompPolicy::delay_compilation(Method* method) {
method->invocation_counter()->decay();
method->backedge_counter()->decay();
}
-void NonTieredCompPolicy::disable_compilation(methodOop method) {
+void NonTieredCompPolicy::disable_compilation(Method* method) {
method->invocation_counter()->set_state(InvocationCounter::wait_for_nothing);
method->backedge_counter()->set_state(InvocationCounter::wait_for_nothing);
}
@@ -291,8 +291,8 @@ CompileTask* NonTieredCompPolicy::select_task(CompileQueue* compile_queue) {
return compile_queue->first();
}
-bool NonTieredCompPolicy::is_mature(methodOop method) {
- methodDataOop mdo = method->method_data();
+bool NonTieredCompPolicy::is_mature(Method* method) {
+ MethodData* mdo = method->method_data();
assert(mdo != NULL, "Should be");
uint current = mdo->mileage_of(method);
uint initial = mdo->creation_mileage();
@@ -371,7 +371,7 @@ void NonTieredCompPolicy::trace_frequency_counter_overflow(methodHandle m, int b
bc->print();
if (ProfileInterpreter) {
if (bci != InvocationEntryBci) {
- methodDataOop mdo = m->method_data();
+ MethodData* mdo = m->method_data();
if (mdo != NULL) {
int count = mdo->bci_to_data(branch_bci)->as_JumpData()->taken();
tty->print_cr("back branch count = %d", count);
@@ -627,7 +627,7 @@ const char* StackWalkCompPolicy::shouldNotInline(methodHandle m) {
// negative filter: should send NOT be inlined? returns NULL (--> inline) or rejection msg
if (m->is_abstract()) return (_msg = "abstract method");
// note: we allow ik->is_abstract()
- if (!instanceKlass::cast(m->method_holder())->is_initialized()) return (_msg = "method holder not initialized");
+ if (!InstanceKlass::cast(m->method_holder())->is_initialized()) return (_msg = "method holder not initialized");
if (m->is_native()) return (_msg = "native method");
nmethod* m_code = m->code();
if (m_code != NULL && m_code->code_size() > InlineSmallCode)
@@ -639,7 +639,7 @@ const char* StackWalkCompPolicy::shouldNotInline(methodHandle m) {
if ((m->code() == NULL) && m->was_never_executed()) return (_msg = "never executed");
if (!m->was_executed_more_than(MIN2(MinInliningThreshold, CompileThreshold >> 1))) return (_msg = "executed < MinInliningThreshold times");
}
- if (methodOopDesc::has_unloaded_classes_in_signature(m, JavaThread::current())) return (_msg = "unloaded signature classes");
+ if (Method::has_unloaded_classes_in_signature(m, JavaThread::current())) return (_msg = "unloaded signature classes");
return NULL;
}
diff --git a/src/share/vm/runtime/compilationPolicy.hpp b/src/share/vm/runtime/compilationPolicy.hpp
index a0912beaf..e53782aaa 100644
--- a/src/share/vm/runtime/compilationPolicy.hpp
+++ b/src/share/vm/runtime/compilationPolicy.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -71,15 +71,15 @@ public:
virtual void reprofile(ScopeDesc* trap_scope, bool is_osr) = 0;
// delay_compilation(method) can be called by any component of the runtime to notify the policy
// that it's recommended to delay the complation of this method.
- virtual void delay_compilation(methodOop method) = 0;
+ virtual void delay_compilation(Method* method) = 0;
// disable_compilation() is called whenever the runtime decides to disable compilation of the
// specified method.
- virtual void disable_compilation(methodOop method) = 0;
+ virtual void disable_compilation(Method* method) = 0;
// Select task is called by CompileBroker. The queue is guaranteed to have at least one
// element and is locked. The function should select one and return it.
virtual CompileTask* select_task(CompileQueue* compile_queue) = 0;
// Tell the runtime if we think a given method is adequately profiled.
- virtual bool is_mature(methodOop method) = 0;
+ virtual bool is_mature(Method* method) = 0;
// Do policy initialization
virtual void initialize() = 0;
virtual bool should_not_inline(ciEnv* env, ciMethod* method) { return false; }
@@ -100,9 +100,9 @@ public:
virtual int compiler_count(CompLevel comp_level);
virtual void do_safepoint_work();
virtual void reprofile(ScopeDesc* trap_scope, bool is_osr);
- virtual void delay_compilation(methodOop method);
- virtual void disable_compilation(methodOop method);
- virtual bool is_mature(methodOop method);
+ virtual void delay_compilation(Method* method);
+ virtual void disable_compilation(Method* method);
+ virtual bool is_mature(Method* method);
virtual void initialize();
virtual CompileTask* select_task(CompileQueue* compile_queue);
virtual nmethod* event(methodHandle method, methodHandle inlinee, int branch_bci, int bci, CompLevel comp_level, nmethod* nm, JavaThread* thread);
diff --git a/src/share/vm/runtime/deoptimization.cpp b/src/share/vm/runtime/deoptimization.cpp
index ac52edd47..4fdd9deda 100644
--- a/src/share/vm/runtime/deoptimization.cpp
+++ b/src/share/vm/runtime/deoptimization.cpp
@@ -34,7 +34,7 @@
#include "memory/allocation.inline.hpp"
#include "memory/oopFactory.hpp"
#include "memory/resourceArea.hpp"
-#include "oops/methodOop.hpp"
+#include "oops/method.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvmtiThreadState.hpp"
#include "runtime/biasedLocking.hpp"
@@ -748,11 +748,11 @@ bool Deoptimization::realloc_objects(JavaThread* thread, frame* fr, GrowableArra
assert(objects->at(i)->is_object(), "invalid debug information");
ObjectValue* sv = (ObjectValue*) objects->at(i);
- KlassHandle k(((ConstantOopReadValue*) sv->klass())->value()());
+ KlassHandle k(java_lang_Class::as_Klass(sv->klass()->as_ConstantOopReadValue()->value()()));
oop obj = NULL;
if (k->oop_is_instance()) {
- instanceKlass* ik = instanceKlass::cast(k());
+ InstanceKlass* ik = InstanceKlass::cast(k());
obj = ik->allocate_instance(CHECK_(false));
} else if (k->oop_is_typeArray()) {
typeArrayKlass* ak = typeArrayKlass::cast(k());
@@ -782,7 +782,7 @@ class FieldReassigner: public FieldClosure {
frame* _fr;
RegisterMap* _reg_map;
ObjectValue* _sv;
- instanceKlass* _ik;
+ InstanceKlass* _ik;
oop _obj;
int _i;
@@ -914,12 +914,12 @@ void Deoptimization::reassign_object_array_elements(frame* fr, RegisterMap* reg_
void Deoptimization::reassign_fields(frame* fr, RegisterMap* reg_map, GrowableArray<ScopeValue*>* objects) {
for (int i = 0; i < objects->length(); i++) {
ObjectValue* sv = (ObjectValue*) objects->at(i);
- KlassHandle k(((ConstantOopReadValue*) sv->klass())->value()());
+ KlassHandle k(java_lang_Class::as_Klass(sv->klass()->as_ConstantOopReadValue()->value()()));
Handle obj = sv->value();
assert(obj.not_null(), "reallocation was missed");
if (k->oop_is_instance()) {
- instanceKlass* ik = instanceKlass::cast(k());
+ InstanceKlass* ik = InstanceKlass::cast(k());
FieldReassigner reassign(fr, reg_map, sv, obj());
ik->do_nonstatic_fields(&reassign);
} else if (k->oop_is_typeArray()) {
@@ -965,11 +965,11 @@ void Deoptimization::print_objects(GrowableArray<ScopeValue*>* objects) {
for (int i = 0; i < objects->length(); i++) {
ObjectValue* sv = (ObjectValue*) objects->at(i);
- KlassHandle k(((ConstantOopReadValue*) sv->klass())->value()());
+ KlassHandle k(java_lang_Class::as_Klass(sv->klass()->as_ConstantOopReadValue()->value()()));
Handle obj = sv->value();
tty->print(" object <" INTPTR_FORMAT "> of type ", sv->value()());
- k->as_klassOop()->print_value();
+ k->print_value();
tty->print(" allocated (%d bytes)", obj->size() * HeapWordSize);
tty->cr();
@@ -1182,13 +1182,13 @@ JRT_END
void Deoptimization::load_class_by_index(constantPoolHandle constant_pool, int index, TRAPS) {
// in case of an unresolved klass entry, load the class.
if (constant_pool->tag_at(index).is_unresolved_klass()) {
- klassOop tk = constant_pool->klass_at(index, CHECK);
+ Klass* tk = constant_pool->klass_at(index, CHECK);
return;
}
if (!constant_pool->tag_at(index).is_symbol()) return;
- Handle class_loader (THREAD, instanceKlass::cast(constant_pool->pool_holder())->class_loader());
+ Handle class_loader (THREAD, InstanceKlass::cast(constant_pool->pool_holder())->class_loader());
Symbol* symbol = constant_pool->symbol_at(index);
// class name?
@@ -1268,8 +1268,8 @@ JRT_ENTRY(void, Deoptimization::uncommon_trap_inner(JavaThread* thread, jint tra
// Ensure that we can record deopt. history:
bool create_if_missing = ProfileTraps;
- methodDataHandle trap_mdo
- (THREAD, get_method_data(thread, trap_method, create_if_missing));
+ MethodData* trap_mdo =
+ get_method_data(thread, trap_method, create_if_missing);
// Print a bunch of diagnostics, if requested.
if (TraceDeoptimization || LogCompilation) {
@@ -1297,7 +1297,7 @@ JRT_ENTRY(void, Deoptimization::uncommon_trap_inner(JavaThread* thread, jint tra
if (xtty != NULL)
xtty->name(class_name);
}
- if (xtty != NULL && trap_mdo.not_null()) {
+ if (xtty != NULL && trap_mdo != NULL) {
// Dump the relevant MDO state.
// This is the deopt count for the current reason, any previous
// reasons or recompiles seen at this point.
@@ -1380,7 +1380,7 @@ JRT_ENTRY(void, Deoptimization::uncommon_trap_inner(JavaThread* thread, jint tra
// PerMethodRecompilationCutoff, the method is abandoned.
// This should only happen if the method is very large and has
// many "lukewarm" deoptimizations. The code which enforces this
- // limit is elsewhere (class nmethod, class methodOopDesc).
+ // limit is elsewhere (class nmethod, class Method).
//
// Note that the per-BCI 'is_recompiled' bit gives the compiler one chance
// to recompile at each bytecode independently of the per-BCI cutoff.
@@ -1449,15 +1449,15 @@ JRT_ENTRY(void, Deoptimization::uncommon_trap_inner(JavaThread* thread, jint tra
// Setting +ProfileTraps fixes the following, on all platforms:
// 4852688: ProfileInterpreter is off by default for ia64. The result is
// infinite heroic-opt-uncommon-trap/deopt/recompile cycles, since the
- // recompile relies on a methodDataOop to record heroic opt failures.
+ // recompile relies on a MethodData* to record heroic opt failures.
// Whether the interpreter is producing MDO data or not, we also need
// to use the MDO to detect hot deoptimization points and control
// aggressive optimization.
bool inc_recompile_count = false;
ProfileData* pdata = NULL;
- if (ProfileTraps && update_trap_state && trap_mdo.not_null()) {
- assert(trap_mdo() == get_method_data(thread, trap_method, false), "sanity");
+ if (ProfileTraps && update_trap_state && trap_mdo != NULL) {
+ assert(trap_mdo == get_method_data(thread, trap_method, false), "sanity");
uint this_trap_count = 0;
bool maybe_prior_trap = false;
bool maybe_prior_recompile = false;
@@ -1573,15 +1573,15 @@ JRT_ENTRY(void, Deoptimization::uncommon_trap_inner(JavaThread* thread, jint tra
}
JRT_END
-methodDataOop
+MethodData*
Deoptimization::get_method_data(JavaThread* thread, methodHandle m,
bool create_if_missing) {
Thread* THREAD = thread;
- methodDataOop mdo = m()->method_data();
+ MethodData* mdo = m()->method_data();
if (mdo == NULL && create_if_missing && !HAS_PENDING_EXCEPTION) {
// Build an MDO. Ignore errors like OutOfMemory;
// that simply means we won't have an MDO to update.
- methodOopDesc::build_interpreter_method_data(m, THREAD);
+ Method::build_interpreter_method_data(m, THREAD);
if (HAS_PENDING_EXCEPTION) {
assert((PENDING_EXCEPTION->is_a(SystemDictionary::OutOfMemoryError_klass())), "we expect only an OOM error here");
CLEAR_PENDING_EXCEPTION;
@@ -1592,7 +1592,7 @@ Deoptimization::get_method_data(JavaThread* thread, methodHandle m,
}
ProfileData*
-Deoptimization::query_update_method_data(methodDataHandle trap_mdo,
+Deoptimization::query_update_method_data(MethodData* trap_mdo,
int trap_bci,
Deoptimization::DeoptReason reason,
//outputs:
@@ -1652,7 +1652,7 @@ Deoptimization::query_update_method_data(methodDataHandle trap_mdo,
}
void
-Deoptimization::update_method_data_from_interpreter(methodDataHandle trap_mdo, int trap_bci, int reason) {
+Deoptimization::update_method_data_from_interpreter(MethodData* trap_mdo, int trap_bci, int reason) {
ResourceMark rm;
// Ignored outputs:
uint ignore_this_trap_count;
@@ -1940,7 +1940,7 @@ void Deoptimization::print_statistics() {
}
void
-Deoptimization::update_method_data_from_interpreter(methodDataHandle trap_mdo, int trap_bci, int reason) {
+Deoptimization::update_method_data_from_interpreter(MethodData* trap_mdo, int trap_bci, int reason) {
// no udpate
}
diff --git a/src/share/vm/runtime/deoptimization.hpp b/src/share/vm/runtime/deoptimization.hpp
index 23870b4e8..b70a478b3 100644
--- a/src/share/vm/runtime/deoptimization.hpp
+++ b/src/share/vm/runtime/deoptimization.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -332,9 +332,9 @@ class Deoptimization : AllStatic {
static void popframe_preserve_args(JavaThread* thread, int bytes_to_save, void* start_address);
private:
- static methodDataOop get_method_data(JavaThread* thread, methodHandle m, bool create_if_missing);
+ static MethodData* get_method_data(JavaThread* thread, methodHandle m, bool create_if_missing);
// Update the mdo's count and per-BCI reason bits, returning previous state:
- static ProfileData* query_update_method_data(methodDataHandle trap_mdo,
+ static ProfileData* query_update_method_data(MethodData* trap_mdo,
int trap_bci,
DeoptReason reason,
//outputs:
@@ -355,7 +355,7 @@ class Deoptimization : AllStatic {
// Note: Histogram array size is 1-2 Kb.
public:
- static void update_method_data_from_interpreter(methodDataHandle trap_mdo, int trap_bci, int reason);
+ static void update_method_data_from_interpreter(MethodData* trap_mdo, int trap_bci, int reason);
};
class DeoptimizationMarker : StackObj { // for profiling
diff --git a/src/share/vm/runtime/dtraceJSDT.cpp b/src/share/vm/runtime/dtraceJSDT.cpp
index 67b18ea27..1a5f4fe52 100644
--- a/src/share/vm/runtime/dtraceJSDT.cpp
+++ b/src/share/vm/runtime/dtraceJSDT.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -67,7 +67,7 @@ jlong DTraceJSDT::activate(
assert(probe->name != NULL, "valid probe name");
assert(probe->function != NULL, "valid probe function spec");
methodHandle h_method =
- methodHandle(THREAD, JNIHandles::resolve_jmethod_id(probe->method));
+ methodHandle(THREAD, Method::resolve_jmethod_id(probe->method));
nmethod* nm = AdapterHandlerLibrary::create_dtrace_nmethod(h_method);
if (nm == NULL) {
delete probes;
@@ -92,7 +92,7 @@ jlong DTraceJSDT::activate(
}
jboolean DTraceJSDT::is_probe_enabled(jmethodID method) {
- methodOop m = JNIHandles::resolve_jmethod_id(method);
+ Method* m = Method::resolve_jmethod_id(method);
return nativeInstruction_at(m->code()->trap_address())->is_dtrace_trap();
}
diff --git a/src/share/vm/runtime/fieldDescriptor.cpp b/src/share/vm/runtime/fieldDescriptor.cpp
index 3d5213f03..23011684d 100644
--- a/src/share/vm/runtime/fieldDescriptor.cpp
+++ b/src/share/vm/runtime/fieldDescriptor.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -27,6 +27,7 @@
#include "classfile/vmSymbols.hpp"
#include "memory/resourceArea.hpp"
#include "memory/universe.inline.hpp"
+#include "oops/annotations.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/fieldStreams.hpp"
#include "runtime/fieldDescriptor.hpp"
@@ -35,7 +36,7 @@
oop fieldDescriptor::loader() const {
- return instanceKlass::cast(_cp->pool_holder())->class_loader();
+ return InstanceKlass::cast(_cp->pool_holder())->class_loader();
}
Symbol* fieldDescriptor::generic_signature() const {
@@ -44,7 +45,7 @@ Symbol* fieldDescriptor::generic_signature() const {
}
int idx = 0;
- instanceKlass* ik = instanceKlass::cast(field_holder());
+ InstanceKlass* ik = InstanceKlass::cast(field_holder());
for (AllFieldStream fs(ik); !fs.done(); fs.next()) {
if (idx == _index) {
return fs.generic_signature();
@@ -56,12 +57,12 @@ Symbol* fieldDescriptor::generic_signature() const {
return NULL;
}
-typeArrayOop fieldDescriptor::annotations() const {
- instanceKlass* ik = instanceKlass::cast(field_holder());
- objArrayOop md = ik->fields_annotations();
+AnnotationArray* fieldDescriptor::annotations() const {
+ InstanceKlass* ik = InstanceKlass::cast(field_holder());
+ Array<AnnotationArray*>* md = ik->fields_annotations();
if (md == NULL)
return NULL;
- return typeArrayOop(md->obj_at(index()));
+ return md->at(index());
}
constantTag fieldDescriptor::initial_value_tag() const {
@@ -85,11 +86,10 @@ jdouble fieldDescriptor::double_initial_value() const {
}
oop fieldDescriptor::string_initial_value(TRAPS) const {
- return constants()->string_at(initial_value_index(), CHECK_0);
+ return constants()->uncached_string_at(initial_value_index(), CHECK_0);
}
-void fieldDescriptor::initialize(klassOop k, int index) {
- instanceKlass* ik = instanceKlass::cast(k);
+void fieldDescriptor::initialize(InstanceKlass* ik, int index) {
_cp = ik->constants();
FieldInfo* f = ik->field(index);
assert(!f->is_internal(), "regular Java fields only");
diff --git a/src/share/vm/runtime/fieldDescriptor.hpp b/src/share/vm/runtime/fieldDescriptor.hpp
index 12c2fd9eb..496b160cd 100644
--- a/src/share/vm/runtime/fieldDescriptor.hpp
+++ b/src/share/vm/runtime/fieldDescriptor.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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,9 +25,7 @@
#ifndef SHARE_VM_RUNTIME_FIELDDESCRIPTOR_HPP
#define SHARE_VM_RUNTIME_FIELDDESCRIPTOR_HPP
-#include "oops/constantPoolOop.hpp"
-#include "oops/klassOop.hpp"
-#include "oops/oop.inline.hpp"
+#include "oops/constantPool.hpp"
#include "oops/symbol.hpp"
#include "runtime/fieldType.hpp"
#include "utilities/accessFlags.hpp"
@@ -45,12 +43,12 @@ class fieldDescriptor VALUE_OBJ_CLASS_SPEC {
// update the access_flags for the field in the klass
void update_klass_field_access_flag() {
- instanceKlass* ik = instanceKlass::cast(field_holder());
+ InstanceKlass* ik = InstanceKlass::cast(field_holder());
ik->field(index())->set_access_flags(_access_flags.as_short());
}
FieldInfo* field() const {
- instanceKlass* ik = instanceKlass::cast(field_holder());
+ InstanceKlass* ik = InstanceKlass::cast(field_holder());
return ik->field(_index);
}
@@ -61,15 +59,15 @@ class fieldDescriptor VALUE_OBJ_CLASS_SPEC {
Symbol* signature() const {
return field()->signature(_cp);
}
- klassOop field_holder() const { return _cp->pool_holder(); }
- constantPoolOop constants() const { return _cp(); }
+ Klass* field_holder() const { return _cp->pool_holder(); }
+ ConstantPool* constants() const { return _cp(); }
AccessFlags access_flags() const { return _access_flags; }
oop loader() const;
- // Offset (in words) of field from start of instanceOop / klassOop
+ // Offset (in words) of field from start of instanceOop / Klass*
int offset() const { return field()->offset(); }
Symbol* generic_signature() const;
int index() const { return _index; }
- typeArrayOop annotations() const;
+ AnnotationArray* annotations() const;
// Initial field value
bool has_initial_value() const { return field()->initval_index() != 0; }
@@ -113,7 +111,7 @@ class fieldDescriptor VALUE_OBJ_CLASS_SPEC {
}
// Initialization
- void initialize(klassOop k, int index);
+ void initialize(InstanceKlass* ik, int index);
// Print
void print() { print_on(tty); }
diff --git a/src/share/vm/runtime/fprofiler.cpp b/src/share/vm/runtime/fprofiler.cpp
index 2f045c270..ce910b45f 100644
--- a/src/share/vm/runtime/fprofiler.cpp
+++ b/src/share/vm/runtime/fprofiler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -288,9 +288,9 @@ class ProfilerNode {
virtual bool is_runtime_stub() const{ return false; }
virtual void oops_do(OopClosure* f) = 0;
- virtual bool interpreted_match(methodOop m) const { return false; }
- virtual bool compiled_match(methodOop m ) const { return false; }
- virtual bool stub_match(methodOop m, const char* name) const { return false; }
+ virtual bool interpreted_match(Method* m) const { return false; }
+ virtual bool compiled_match(Method* m ) const { return false; }
+ virtual bool stub_match(Method* m, const char* name) const { return false; }
virtual bool adapter_match() const { return false; }
virtual bool runtimeStub_match(const CodeBlob* stub, const char* name) const { return false; }
virtual bool unknown_compiled_match(const CodeBlob* cb) const { return false; }
@@ -312,12 +312,12 @@ class ProfilerNode {
st->cr();
}
- virtual methodOop method() = 0;
+ virtual Method* method() = 0;
virtual void print_method_on(outputStream* st) {
int limit;
int i;
- methodOop m = method();
+ Method* m = method();
Symbol* k = m->klass_name();
// Print the class name with dots instead of slashes
limit = k->utf8_length();
@@ -342,7 +342,7 @@ class ProfilerNode {
Symbol* sig = m->signature();
sig->print_symbol_on(st);
} else if (MethodHandles::is_signature_polymorphic(m->intrinsic_id()))
- // compare with methodOopDesc::print_short_name
+ // compare with Method::print_short_name
MethodHandles::print_as_basic_type_signature_on(st, m->signature(), true);
}
@@ -356,7 +356,7 @@ class ProfilerNode {
}
// for hashing into the table
- static int hash(methodOop method) {
+ static int hash(Method* method) {
// The point here is to try to make something fairly unique
// out of the fields we can read without grabbing any locks
// since the method may be locked when we need the hash.
@@ -388,24 +388,26 @@ void ProfilerNode::operator delete(void* p){
class interpretedNode : public ProfilerNode {
private:
- methodOop _method;
+ Method* _method;
+ oop _class_loader; // needed to keep metadata for the method alive
public:
- interpretedNode(methodOop method, TickPosition where) : ProfilerNode() {
+ interpretedNode(Method* method, TickPosition where) : ProfilerNode() {
_method = method;
+ _class_loader = method->method_holder()->class_loader();
update(where);
}
bool is_interpreted() const { return true; }
- bool interpreted_match(methodOop m) const {
+ bool interpreted_match(Method* m) const {
return _method == m;
}
void oops_do(OopClosure* f) {
- f->do_oop((oop*)&_method);
+ f->do_oop(&_class_loader);
}
- methodOop method() { return _method; }
+ Method* method() { return _method; }
static void print_title(outputStream* st) {
st->fill_to(col1);
@@ -425,22 +427,24 @@ class interpretedNode : public ProfilerNode {
class compiledNode : public ProfilerNode {
private:
- methodOop _method;
+ Method* _method;
+ oop _class_loader; // needed to keep metadata for the method alive
public:
- compiledNode(methodOop method, TickPosition where) : ProfilerNode() {
+ compiledNode(Method* method, TickPosition where) : ProfilerNode() {
_method = method;
+ _class_loader = method->method_holder()->class_loader();
update(where);
}
bool is_compiled() const { return true; }
- bool compiled_match(methodOop m) const {
+ bool compiled_match(Method* m) const {
return _method == m;
}
- methodOop method() { return _method; }
+ Method* method() { return _method; }
void oops_do(OopClosure* f) {
- f->do_oop((oop*)&_method);
+ f->do_oop(&_class_loader);
}
static void print_title(outputStream* st) {
@@ -460,26 +464,28 @@ class compiledNode : public ProfilerNode {
class stubNode : public ProfilerNode {
private:
- methodOop _method;
+ Method* _method;
+ oop _class_loader; // needed to keep metadata for the method alive
const char* _symbol; // The name of the nearest VM symbol (for +ProfileVM). Points to a unique string
public:
- stubNode(methodOop method, const char* name, TickPosition where) : ProfilerNode() {
+ stubNode(Method* method, const char* name, TickPosition where) : ProfilerNode() {
_method = method;
+ _class_loader = method->method_holder()->class_loader();
_symbol = name;
update(where);
}
bool is_stub() const { return true; }
- bool stub_match(methodOop m, const char* name) const {
- return (_method == m) && (_symbol == name);
+ void oops_do(OopClosure* f) {
+ f->do_oop(&_class_loader);
}
- void oops_do(OopClosure* f) {
- f->do_oop((oop*)&_method);
+ bool stub_match(Method* m, const char* name) const {
+ return (_method == m) && (_symbol == name);
}
- methodOop method() { return _method; }
+ Method* method() { return _method; }
static void print_title(outputStream* st) {
st->fill_to(col1);
@@ -512,7 +518,7 @@ class adapterNode : public ProfilerNode {
bool adapter_match() const { return true; }
- methodOop method() { return NULL; }
+ Method* method() { return NULL; }
void oops_do(OopClosure* f) {
;
@@ -545,7 +551,7 @@ class runtimeStubNode : public ProfilerNode {
(_symbol == name);
}
- methodOop method() { return NULL; }
+ Method* method() { return NULL; }
static void print_title(outputStream* st) {
st->fill_to(col1);
@@ -593,7 +599,7 @@ class unknown_compiledNode : public ProfilerNode {
return !strcmp(((SingletonBlob*)cb)->name(), _name);
}
- methodOop method() { return NULL; }
+ Method* method() { return NULL; }
void oops_do(OopClosure* f) {
;
@@ -627,7 +633,7 @@ class vmNode : public ProfilerNode {
bool vm_match(const char* name) const { return strcmp(name, _name) == 0; }
- methodOop method() { return NULL; }
+ Method* method() { return NULL; }
static int hash(const char* name){
// Compute a simple hash
@@ -661,7 +667,7 @@ class vmNode : public ProfilerNode {
}
};
-void ThreadProfiler::interpreted_update(methodOop method, TickPosition where) {
+void ThreadProfiler::interpreted_update(Method* method, TickPosition where) {
int index = entry(ProfilerNode::hash(method));
if (!table[index]) {
table[index] = new (this) interpretedNode(method, where);
@@ -678,7 +684,7 @@ void ThreadProfiler::interpreted_update(methodOop method, TickPosition where) {
}
}
-void ThreadProfiler::compiled_update(methodOop method, TickPosition where) {
+void ThreadProfiler::compiled_update(Method* method, TickPosition where) {
int index = entry(ProfilerNode::hash(method));
if (!table[index]) {
table[index] = new (this) compiledNode(method, where);
@@ -695,7 +701,7 @@ void ThreadProfiler::compiled_update(methodOop method, TickPosition where) {
}
}
-void ThreadProfiler::stub_update(methodOop method, const char* name, TickPosition where) {
+void ThreadProfiler::stub_update(Method* method, const char* name, TickPosition where) {
int index = entry(ProfilerNode::hash(method));
if (!table[index]) {
table[index] = new (this) stubNode(method, name, where);
@@ -957,7 +963,7 @@ void ThreadProfiler::record_interpreted_tick(JavaThread* thread, frame fr, TickP
// The frame has been fully validated so we can trust the method and bci
- methodOop method = *fr.interpreter_frame_method_addr();
+ Method* method = *fr.interpreter_frame_method_addr();
interpreted_update(method, where);
@@ -984,8 +990,8 @@ void ThreadProfiler::record_compiled_tick(JavaThread* thread, frame fr, TickPosi
cb = fr.cb();
localwhere = tp_native;
}
- methodOop method = (cb->is_nmethod()) ? ((nmethod *)cb)->method() :
- (methodOop)NULL;
+ Method* method = (cb->is_nmethod()) ? ((nmethod *)cb)->method() :
+ (Method*)NULL;
if (method == NULL) {
if (cb->is_runtime_stub())
diff --git a/src/share/vm/runtime/fprofiler.hpp b/src/share/vm/runtime/fprofiler.hpp
index 25c2f2a10..5cab0a265 100644
--- a/src/share/vm/runtime/fprofiler.hpp
+++ b/src/share/vm/runtime/fprofiler.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -154,9 +154,9 @@ private:
private:
void record_interpreted_tick(JavaThread* thread, frame fr, TickPosition where, int* ticks);
void record_compiled_tick (JavaThread* thread, frame fr, TickPosition where);
- void interpreted_update(methodOop method, TickPosition where);
- void compiled_update (methodOop method, TickPosition where);
- void stub_update (methodOop method, const char* name, TickPosition where);
+ void interpreted_update(Method* method, TickPosition where);
+ void compiled_update (Method* method, TickPosition where);
+ void stub_update (Method* method, const char* name, TickPosition where);
void adapter_update (TickPosition where);
void runtime_stub_update(const CodeBlob* stub, const char* name, TickPosition where);
diff --git a/src/share/vm/runtime/frame.cpp b/src/share/vm/runtime/frame.cpp
index 5afdd866a..f9acadd45 100644
--- a/src/share/vm/runtime/frame.cpp
+++ b/src/share/vm/runtime/frame.cpp
@@ -29,8 +29,8 @@
#include "memory/resourceArea.hpp"
#include "memory/universe.inline.hpp"
#include "oops/markOop.hpp"
-#include "oops/methodDataOop.hpp"
-#include "oops/methodOop.hpp"
+#include "oops/methodData.hpp"
+#include "oops/method.hpp"
#include "oops/oop.inline.hpp"
#include "oops/oop.inline2.hpp"
#include "prims/methodHandles.hpp"
@@ -383,15 +383,15 @@ void frame::interpreter_frame_set_locals(intptr_t* locs) {
*interpreter_frame_locals_addr() = locs;
}
-methodOop frame::interpreter_frame_method() const {
+Method* frame::interpreter_frame_method() const {
assert(is_interpreted_frame(), "interpreted frame expected");
- methodOop m = *interpreter_frame_method_addr();
- assert(m->is_perm(), "bad methodOop in interpreter frame");
- assert(m->is_method(), "not a methodOop");
+ Method* m = *interpreter_frame_method_addr();
+ assert(m->is_metadata(), "bad Method* in interpreter frame");
+ assert(m->is_method(), "not a Method*");
return m;
}
-void frame::interpreter_frame_set_method(methodOop method) {
+void frame::interpreter_frame_set_method(Method* method) {
assert(is_interpreted_frame(), "interpreted frame expected");
*interpreter_frame_method_addr() = method;
}
@@ -410,7 +410,7 @@ void frame::interpreter_frame_set_bcx(intptr_t bcx) {
if (!is_now_bci) {
// The bcx was just converted from bci to bcp.
// Convert the mdx in parallel.
- methodDataOop mdo = interpreter_frame_method()->method_data();
+ MethodData* mdo = interpreter_frame_method()->method_data();
assert(mdo != NULL, "");
int mdi = mdx - 1; // We distinguish valid mdi from zero by adding one.
address mdp = mdo->di_to_dp(mdi);
@@ -420,7 +420,7 @@ void frame::interpreter_frame_set_bcx(intptr_t bcx) {
if (is_now_bci) {
// The bcx was just converted from bcp to bci.
// Convert the mdx in parallel.
- methodDataOop mdo = interpreter_frame_method()->method_data();
+ MethodData* mdo = interpreter_frame_method()->method_data();
assert(mdo != NULL, "");
int mdi = mdo->dp_to_di((address)mdx);
interpreter_frame_set_mdx((intptr_t)mdi + 1); // distinguish valid from 0.
@@ -691,7 +691,7 @@ static void print_C_frame(outputStream* st, char* buf, int buflen, address pc) {
void frame::print_on_error(outputStream* st, char* buf, int buflen, bool verbose) const {
if (_cb != NULL) {
if (Interpreter::contains(pc())) {
- methodOop m = this->interpreter_frame_method();
+ Method* m = this->interpreter_frame_method();
if (m != NULL) {
m->name_and_sig_as_C_string(buf, buflen);
st->print("j %s", buf);
@@ -709,7 +709,7 @@ void frame::print_on_error(outputStream* st, char* buf, int buflen, bool verbose
} else if (_cb->is_buffer_blob()) {
st->print("v ~BufferBlob::%s", ((BufferBlob *)_cb)->name());
} else if (_cb->is_nmethod()) {
- methodOop m = ((nmethod *)_cb)->method();
+ Method* m = ((nmethod *)_cb)->method();
if (m != NULL) {
m->name_and_sig_as_C_string(buf, buflen);
st->print("J %s", buf);
@@ -736,8 +736,8 @@ void frame::print_on_error(outputStream* st, char* buf, int buflen, bool verbose
/*
The interpreter_frame_expression_stack_at method in the case of SPARC needs the
max_stack value of the method in order to compute the expression stack address.
- It uses the methodOop in order to get the max_stack value but during GC this
- methodOop value saved on the frame is changed by reverse_and_push and hence cannot
+ It uses the Method* in order to get the max_stack value but during GC this
+ Method* value saved on the frame is changed by reverse_and_push and hence cannot
be used. So we save the max_stack value in the FrameClosure object and pass it
down to the interpreter_frame_expression_stack_at method
*/
@@ -886,9 +886,12 @@ void frame::oops_interpreted_do(OopClosure* f, const RegisterMap* map, bool quer
methodHandle m (thread, interpreter_frame_method());
jint bci = interpreter_frame_bci();
- assert(Universe::heap()->is_in(m()), "must be valid oop");
+ assert(!Universe::heap()->is_in(m()),
+ "must be valid oop");
assert(m->is_method(), "checking frame value");
- assert((m->is_native() && bci == 0) || (!m->is_native() && bci >= 0 && bci < m->code_size()), "invalid bci value");
+ assert((m->is_native() && bci == 0) ||
+ (!m->is_native() && bci >= 0 && bci < m->code_size()),
+ "invalid bci value");
// Handle the monitor elements in the activation
for (
@@ -903,23 +906,10 @@ void frame::oops_interpreted_do(OopClosure* f, const RegisterMap* map, bool quer
}
// process fixed part
- f->do_oop((oop*)interpreter_frame_method_addr());
- f->do_oop((oop*)interpreter_frame_cache_addr());
-
- // Hmm what about the mdp?
-#ifdef CC_INTERP
- // Interpreter frame in the midst of a call have a methodOop within the
- // object.
- interpreterState istate = get_interpreterState();
- if (istate->msg() == BytecodeInterpreter::call_method) {
- f->do_oop((oop*)&istate->_result._to_call._callee);
- }
-
-#endif /* CC_INTERP */
-
#if !defined(PPC) || defined(ZERO)
if (m->is_native()) {
#ifdef CC_INTERP
+ interpreterState istate = get_interpreterState();
f->do_oop((oop*)&istate->_oop_temp);
#else
f->do_oop((oop*)( fp() + interpreter_frame_oop_temp_offset ));
@@ -1148,9 +1138,19 @@ void frame::nmethods_do(CodeBlobClosure* cf) {
}
+// call f() on the interpreted Method*s in the stack.
+// Have to walk the entire code cache for the compiled frames Yuck.
+void frame::metadata_do(void f(Metadata*)) {
+ if (_cb != NULL && Interpreter::contains(pc())) {
+ Method* m = this->interpreter_frame_method();
+ assert(m != NULL, "huh?");
+ f(m);
+ }
+}
+
void frame::gc_prologue() {
if (is_interpreted_frame()) {
- // set bcx to bci to become methodOop position independent during GC
+ // set bcx to bci to become Method* position independent during GC
interpreter_frame_set_bcx(interpreter_frame_bci());
}
}
@@ -1225,7 +1225,7 @@ void frame::zap_dead_locals(JavaThread* thread, const RegisterMap* map) {
void frame::zap_dead_interpreted_locals(JavaThread *thread, const RegisterMap* map) {
// get current interpreter 'pc'
assert(is_interpreted_frame(), "Not an interpreted frame");
- methodOop m = interpreter_frame_method();
+ Method* m = interpreter_frame_method();
int bci = interpreter_frame_bci();
int max_locals = m->is_native() ? m->size_of_parameters() : m->max_locals();
@@ -1269,7 +1269,7 @@ void frame::zap_dead_deoptimized_locals(JavaThread*, const RegisterMap*) {
void frame::verify(const RegisterMap* map) {
// for now make sure receiver type is correct
if (is_interpreted_frame()) {
- methodOop method = interpreter_frame_method();
+ Method* method = interpreter_frame_method();
guarantee(method->is_method(), "method is wrong in frame::verify");
if (!method->is_static()) {
// fetch the receiver
@@ -1334,7 +1334,7 @@ void frame::describe(FrameValues& values, int frame_no) {
}
if (is_interpreted_frame()) {
- methodOop m = interpreter_frame_method();
+ Method* m = interpreter_frame_method();
int bci = interpreter_frame_bci();
// Label the method and current bci
diff --git a/src/share/vm/runtime/frame.hpp b/src/share/vm/runtime/frame.hpp
index 9ebda0f99..8f6d759d6 100644
--- a/src/share/vm/runtime/frame.hpp
+++ b/src/share/vm/runtime/frame.hpp
@@ -26,7 +26,7 @@
#define SHARE_VM_RUNTIME_FRAME_HPP
#include "asm/assembler.hpp"
-#include "oops/methodOop.hpp"
+#include "oops/method.hpp"
#include "runtime/basicLock.hpp"
#include "runtime/monitorChunk.hpp"
#include "runtime/registerMap.hpp"
@@ -197,7 +197,7 @@ class frame VALUE_OBJ_CLASS_SPEC {
oop* obj_at_addr(int offset) const { return (oop*) addr_at(offset); }
- oop* adjusted_obj_at_addr(methodOop method, int index) { return obj_at_addr(adjust_offset(method, index)); }
+ oop* adjusted_obj_at_addr(Method* method, int index) { return obj_at_addr(adjust_offset(method, index)); }
private:
jint* int_at_addr(int offset) const { return (jint*) addr_at(offset); }
@@ -343,10 +343,10 @@ class frame VALUE_OBJ_CLASS_SPEC {
public:
// Method & constant pool cache
- methodOop interpreter_frame_method() const;
- void interpreter_frame_set_method(methodOop method);
- methodOop* interpreter_frame_method_addr() const;
- constantPoolCacheOop* interpreter_frame_cache_addr() const;
+ Method* interpreter_frame_method() const;
+ void interpreter_frame_set_method(Method* method);
+ Method** interpreter_frame_method_addr() const;
+ ConstantPoolCache** interpreter_frame_cache_addr() const;
#ifdef PPC
oop* interpreter_frame_mirror_addr() const;
#endif
@@ -422,12 +422,15 @@ class frame VALUE_OBJ_CLASS_SPEC {
void oops_do_internal(OopClosure* f, CodeBlobClosure* cf, RegisterMap* map, bool use_interpreter_oop_map_cache);
void oops_entry_do(OopClosure* f, const RegisterMap* map);
void oops_code_blob_do(OopClosure* f, CodeBlobClosure* cf, const RegisterMap* map);
- int adjust_offset(methodOop method, int index); // helper for above fn
+ int adjust_offset(Method* method, int index); // helper for above fn
public:
// Memory management
void oops_do(OopClosure* f, CodeBlobClosure* cf, RegisterMap* map) { oops_do_internal(f, cf, map, true); }
void nmethods_do(CodeBlobClosure* cf);
+ // RedefineClasses support for finding live interpreted methods on the stack
+ void metadata_do(void f(Metadata*));
+
void gc_prologue();
void gc_epilogue();
void pd_gc_epilog();
diff --git a/src/share/vm/runtime/frame.inline.hpp b/src/share/vm/runtime/frame.inline.hpp
index b80b042dc..7c1890438 100644
--- a/src/share/vm/runtime/frame.inline.hpp
+++ b/src/share/vm/runtime/frame.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -28,7 +28,7 @@
#include "interpreter/bytecodeInterpreter.hpp"
#include "interpreter/bytecodeInterpreter.inline.hpp"
#include "interpreter/interpreter.hpp"
-#include "oops/methodOop.hpp"
+#include "oops/method.hpp"
#include "runtime/frame.hpp"
#include "runtime/signature.hpp"
#ifdef TARGET_ARCH_x86
@@ -58,7 +58,7 @@
// This file holds platform-independent bodies of inline functions for frames.
// Note: The bcx usually contains the bcp; however during GC it contains the bci
-// (changed by gc_prologue() and gc_epilogue()) to be methodOop position
+// (changed by gc_prologue() and gc_epilogue()) to be Method* position
// independent. These accessors make sure the correct value is returned
// by testing the range of the bcx value. bcp's are guaranteed to be above
// max_method_code_size, since methods are always allocated in OldSpace and
diff --git a/src/share/vm/runtime/globals.hpp b/src/share/vm/runtime/globals.hpp
index 777af0359..93a62805f 100644
--- a/src/share/vm/runtime/globals.hpp
+++ b/src/share/vm/runtime/globals.hpp
@@ -175,8 +175,7 @@ define_pd_global(intx, InitialCodeCacheSize, 160*K);
define_pd_global(intx, ReservedCodeCacheSize, 32*M);
define_pd_global(intx, CodeCacheExpansionSize, 32*K);
define_pd_global(intx, CodeCacheMinBlockLength, 1);
-define_pd_global(uintx,PermSize, ScaleForWordSize(4*M));
-define_pd_global(uintx,MaxPermSize, ScaleForWordSize(64*M));
+define_pd_global(uintx,MetaspaceSize, ScaleForWordSize(4*M));
define_pd_global(bool, NeverActAsServerClassMachine, true);
define_pd_global(uint64_t,MaxRAM, 1ULL*G);
#define CI_COMPILER_COUNT 0
@@ -439,7 +438,11 @@ class CommandLineFlags {
#define RUNTIME_FLAGS(develop, develop_pd, product, product_pd, diagnostic, experimental, notproduct, manageable, product_rw, lp64_product) \
\
lp64_product(bool, UseCompressedOops, false, \
- "Use 32-bit object references in 64-bit VM. " \
+ "Use 32-bit object references in 64-bit VM " \
+ "lp64_product means flag is always constant in 32 bit VM") \
+ \
+ lp64_product(bool, UseCompressedKlassPointers, false, \
+ "Use 32-bit klass pointers in 64-bit VM " \
"lp64_product means flag is always constant in 32 bit VM") \
\
notproduct(bool, CheckCompressedOops, true, \
@@ -1188,11 +1191,6 @@ class CommandLineFlags {
"Decay time (in milliseconds) to re-enable bulk rebiasing of a " \
"type after previous bulk rebias") \
\
- develop(bool, JavaObjectsInPerm, false, \
- "controls whether Classes and interned Strings are allocated" \
- "in perm. This purely intended to allow debugging issues" \
- "in production.") \
- \
/* tracing */ \
\
notproduct(bool, TraceRuntimeCalls, false, \
@@ -1677,9 +1675,6 @@ class CommandLineFlags {
product(uintx, CMSConcMarkMultiple, 32, \
"Size (in cards) of CMS concurrent MT marking task") \
\
- product(uintx, CMSRevisitStackSize, 1*M, \
- "Size of CMS KlassKlass revisit stack") \
- \
product(bool, CMSAbortSemantics, false, \
"Whether abort-on-overflow semantics is implemented") \
\
@@ -1697,10 +1692,6 @@ class CommandLineFlags {
product(bool, CMSConcurrentMTEnabled, true, \
"Whether multi-threaded concurrent work enabled (if ParNewGC)") \
\
- product(bool, CMSPermGenPrecleaningEnabled, true, \
- "Whether concurrent precleaning enabled in perm gen" \
- " (effective only when CMSPrecleaningEnabled is true)") \
- \
product(bool, CMSPrecleaningEnabled, true, \
"Whether concurrent precleaning enabled") \
\
@@ -1816,11 +1807,6 @@ class CommandLineFlags {
"Percentage of MinHeapFreeRatio in CMS generation that is " \
"allocated before a CMS collection cycle commences") \
\
- product(intx, CMSTriggerPermRatio, 80, \
- "Percentage of MinHeapFreeRatio in the CMS perm generation that " \
- "is allocated before a CMS collection cycle commences, that " \
- "also collects the perm generation") \
- \
product(uintx, CMSBootstrapOccupancy, 50, \
"Percentage CMS generation occupancy at which to " \
"initiate CMS collection for bootstrapping collection stats") \
@@ -1836,11 +1822,6 @@ class CommandLineFlags {
"not just one of the generations (e.g., G1). A value of 0 " \
"denotes 'do constant GC cycles'.") \
\
- product(intx, CMSInitiatingPermOccupancyFraction, -1, \
- "Percentage CMS perm generation occupancy to start a " \
- "CMScollection cycle. A negative value means that " \
- "CMSTriggerPermRatio is used") \
- \
product(bool, UseCMSInitiatingOccupancyOnly, false, \
"Only use occupancy as a crierion for starting a CMS collection") \
\
@@ -1900,6 +1881,29 @@ class CommandLineFlags {
"Number of ObjArray elements to push onto the marking stack" \
"before pushing a continuation entry") \
\
+ develop(bool, MetadataAllocationFailALot, false, \
+ "Fail metadata allocations at intervals controlled by " \
+ "MetadataAllocationFailALotInterval") \
+ \
+ develop(uintx, MetadataAllocationFailALotInterval, 1000, \
+ "metadata allocation failure alot interval") \
+ \
+ develop(bool, MetaDataDeallocateALot, false, \
+ "Deallocation bunches of metadata at intervals controlled by " \
+ "MetaDataAllocateALotInterval") \
+ \
+ develop(uintx, MetaDataDeallocateALotInterval, 100, \
+ "Metadata deallocation alot interval") \
+ \
+ develop(bool, TraceMetadataChunkAllocation, false, \
+ "Trace humongous metadata allocations") \
+ \
+ product(bool, TraceMetadataHumongousAllocation, false, \
+ "Trace humongous metadata allocations") \
+ \
+ develop(bool, TraceMetavirtualspaceAllocation, false, \
+ "Trace humongous metadata allocations") \
+ \
notproduct(bool, ExecuteInternalVMTests, false, \
"Enable execution of internal VM tests.") \
\
@@ -1920,9 +1924,6 @@ class CommandLineFlags {
product(bool, TLABStats, true, \
"Print various TLAB related information") \
\
- product(bool, PrintRevisitStats, false, \
- "Print revisit (klass and MDO) stack related information") \
- \
EMBEDDED_ONLY(product(bool, LowMemoryProtection, true, \
"Enable LowMemoryProtection")) \
\
@@ -2023,12 +2024,6 @@ class CommandLineFlags {
product(uintx, SurvivorPadding, 3, \
"How much buffer to keep for survivor overflow") \
\
- product(uintx, AdaptivePermSizeWeight, 20, \
- "Weight for perm gen exponential resizing, between 0 and 100") \
- \
- product(uintx, PermGenPadding, 3, \
- "How much buffer to keep for perm gen sizing") \
- \
product(uintx, ThresholdTolerance, 10, \
"Allowed collection cost difference between generations") \
\
@@ -2216,6 +2211,12 @@ class CommandLineFlags {
product_rw(bool, TraceLoaderConstraints, false, \
"Trace loader constraints") \
\
+ develop(bool, TraceClassLoaderData, false, \
+ "Trace class loader loader_data lifetime") \
+ \
+ product(uintx, InitialBootClassLoaderMetaspaceSize, 3*M, \
+ "Initial size of the boot class loader data metaspace") \
+ \
product(bool, TraceGen0Time, false, \
"Trace accumulated time for Gen 0 collection") \
\
@@ -2986,11 +2987,15 @@ class CommandLineFlags {
"Additional size added to desired new generation size per " \
"non-daemon thread (in bytes)") \
\
- product_pd(uintx, PermSize, \
- "Initial size of permanent generation (in bytes)") \
+ product_pd(uintx, MetaspaceSize, \
+ "Initial size of Metaspaces (in bytes)") \
\
- product_pd(uintx, MaxPermSize, \
- "Maximum size of permanent generation (in bytes)") \
+ product(uintx, MaxMetaspaceSize, max_uintx, \
+ "Maximum size of Metaspaces (in bytes)") \
+ \
+ product(uintx, ClassMetaspaceSize, NOT_LP64(1*M) LP64_ONLY(512*M), \
+ "Maximum size of InstanceKlass area in Metaspace used for " \
+ "UseCompressedKlassPointers") \
\
product(uintx, MinHeapFreeRatio, 40, \
"Min percentage of heap free after GC to avoid expansion") \
@@ -3004,10 +3009,10 @@ class CommandLineFlags {
product(uintx, MinHeapDeltaBytes, ScaleForWordSize(128*K), \
"Min change in heap space due to GC (in bytes)") \
\
- product(uintx, MinPermHeapExpansion, ScaleForWordSize(256*K), \
+ product(uintx, MinMetaspaceExpansion, ScaleForWordSize(256*K), \
"Min expansion of permanent heap (in bytes)") \
\
- product(uintx, MaxPermHeapExpansion, ScaleForWordSize(4*M), \
+ product(uintx, MaxMetaspaceExpansion, ScaleForWordSize(4*M), \
"Max expansion of permanent heap without full GC (in bytes)") \
\
product(intx, QueuedAllocationWarningCount, 0, \
@@ -3038,10 +3043,6 @@ class CommandLineFlags {
"either completely full or completely empty. Par compact also" \
"has a smaller default value; see arguments.cpp.") \
\
- product(uintx, PermMarkSweepDeadRatio, 20, \
- "Percentage (0-100) of the perm gen allowed as dead wood." \
- "See MarkSweepDeadRatio for collector-specific comments.") \
- \
product(intx, MarkSweepAlwaysCompactCount, 4, \
"How often should we fully compact the heap (ignoring the dead " \
"space parameters)") \
@@ -3523,29 +3524,20 @@ class CommandLineFlags {
product(bool, PrintSharedSpaces, false, \
"Print usage of shared spaces") \
\
- product(uintx, SharedDummyBlockSize, 512*M, \
- "Size of dummy block used to shift heap addresses (in bytes)") \
- \
- product(uintx, SharedReadWriteSize, NOT_LP64(12*M) LP64_ONLY(13*M), \
+ product(uintx, SharedReadWriteSize, NOT_LP64(12*M) LP64_ONLY(16*M), \
"Size of read-write space in permanent generation (in bytes)") \
\
- product(uintx, SharedReadOnlySize, 10*M, \
+ product(uintx, SharedReadOnlySize, NOT_LP64(12*M) LP64_ONLY(16*M), \
"Size of read-only space in permanent generation (in bytes)") \
\
- product(uintx, SharedMiscDataSize, NOT_LP64(4*M) LP64_ONLY(5*M) NOT_PRODUCT(+1*M), \
+ product(uintx, SharedMiscDataSize, NOT_LP64(2*M) LP64_ONLY(4*M), \
"Size of the shared data area adjacent to the heap (in bytes)") \
\
- product(uintx, SharedMiscCodeSize, 4*M, \
+ product(uintx, SharedMiscCodeSize, 120*K, \
"Size of the shared code area adjacent to the heap (in bytes)") \
\
- diagnostic(bool, SharedOptimizeColdStart, true, \
- "At dump time, order shared objects to achieve better " \
- "cold startup time.") \
- \
- develop(intx, SharedOptimizeColdStartPolicy, 2, \
- "Reordering policy for SharedOptimizeColdStart " \
- "0=favor classload-time locality, 1=balanced, " \
- "2=favor runtime locality") \
+ product(uintx, SharedDummyBlockSize, 0, \
+ "Size of dummy block used to shift heap addresses (in bytes)") \
\
diagnostic(bool, SharedSkipVerify, false, \
"Skip assert() and verify() which page-in unwanted shared " \
diff --git a/src/share/vm/runtime/handles.cpp b/src/share/vm/runtime/handles.cpp
index 1ddbacc44..0ba6c984e 100644
--- a/src/share/vm/runtime/handles.cpp
+++ b/src/share/vm/runtime/handles.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -24,6 +24,7 @@
#include "precompiled.hpp"
#include "memory/allocation.inline.hpp"
+#include "oops/constantPool.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/handles.inline.hpp"
#ifdef TARGET_OS_FAMILY_linux
@@ -70,8 +71,10 @@ static uintx chunk_oops_do(OopClosure* f, Chunk* chunk, char* chunk_top) {
// during GC phase 3, a handle may be a forward pointer that
// is not yet valid, so loosen the assertion
while (bottom < top) {
-// assert((*bottom)->is_oop(), "handle should point to oop");
- assert(Universe::heap()->is_in(*bottom), "handle should be valid heap address");
+ // This test can be moved up but for now check every oop.
+
+ assert((*bottom)->is_oop(), "handle should point to oop");
+
f->do_oop(bottom++);
}
return handles_visited;
@@ -148,6 +151,8 @@ HandleMark::~HandleMark() {
// Note: _nof_handlemarks is only set in debug mode
warning("%d: Allocated in HandleMark : %d", _nof_handlemarks, handles);
}
+
+ tty->print_cr("Handles %d", handles);
}
#endif
diff --git a/src/share/vm/runtime/handles.hpp b/src/share/vm/runtime/handles.hpp
index e2b2d4971..4a2e9ff82 100644
--- a/src/share/vm/runtime/handles.hpp
+++ b/src/share/vm/runtime/handles.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -26,8 +26,6 @@
#define SHARE_VM_RUNTIME_HANDLES_HPP
#include "oops/klass.hpp"
-#include "oops/klassOop.hpp"
-#include "utilities/top.hpp"
//------------------------------------------------------------------------------------------------------------------------
// In order to preserve oops during garbage collection, they should be
@@ -56,17 +54,8 @@
// there is a corresponding handle called xxxHandle, e.g.
//
// oop Handle
-// methodOop methodHandle
+// Method* methodHandle
// instanceOop instanceHandle
-//
-// For klassOops, it is often useful to model the Klass hierarchy in order
-// to get access to the klass_part without casting. For each xxxKlass there
-// is a corresponding handle called xxxKlassHandle, e.g.
-//
-// klassOop Klass KlassHandle
-// klassOop methodKlass methodKlassHandle
-// klassOop instanceKlass instanceKlassHandle
-//
//------------------------------------------------------------------------------------------------------------------------
// Base class for all handles. Provides overloading of frequently
@@ -84,12 +73,7 @@ class Handle VALUE_OBJ_CLASS_SPEC {
// Constructors
Handle() { _handle = NULL; }
Handle(oop obj);
-#ifndef ASSERT
Handle(Thread* thread, oop obj);
-#else
- // Don't inline body with assert for current thread
- Handle(Thread* thread, oop obj);
-#endif // ASSERT
// General access
oop operator () () const { return obj(); }
@@ -115,53 +99,8 @@ class Handle VALUE_OBJ_CLASS_SPEC {
static oop raw_resolve(oop *handle) { return handle == NULL ? (oop)NULL : *handle; }
};
-
-//------------------------------------------------------------------------------------------------------------------------
-// Base class for Handles containing klassOops. Provides overloading of frequently
-// used operators for ease of use and typed access to the Klass part.
-class KlassHandle: public Handle {
- protected:
- klassOop obj() const { return (klassOop)Handle::obj(); }
- klassOop non_null_obj() const { return (klassOop)Handle::non_null_obj(); }
- Klass* as_klass() const { return non_null_obj()->klass_part(); }
-
- public:
- // Constructors
- KlassHandle () : Handle() {}
- KlassHandle (oop obj) : Handle(obj) {
- assert(SharedSkipVerify || is_null() || obj->is_klass(), "not a klassOop");
- }
- KlassHandle (Klass* kl) : Handle(kl ? kl->as_klassOop() : (klassOop)NULL) {
- assert(SharedSkipVerify || is_null() || obj()->is_klass(), "not a klassOop");
- }
-
- // Faster versions passing Thread
- KlassHandle (Thread* thread, oop obj) : Handle(thread, obj) {
- assert(SharedSkipVerify || is_null() || obj->is_klass(), "not a klassOop");
- }
- KlassHandle (Thread *thread, Klass* kl)
- : Handle(thread, kl ? kl->as_klassOop() : (klassOop)NULL) {
- assert(is_null() || obj()->is_klass(), "not a klassOop");
- }
-
- // Direct interface, use very sparingly.
- // Used by SystemDictionaryHandles to create handles on existing WKKs.
- // The obj of such a klass handle may be null, because the handle is formed
- // during system bootstrapping.
- KlassHandle(klassOop *handle, bool dummy) : Handle((oop*)handle, dummy) {
- assert(SharedSkipVerify || is_null() || obj() == NULL || obj()->is_klass(), "not a klassOop");
- }
-
- // General access
- klassOop operator () () const { return obj(); }
- Klass* operator -> () const { return as_klass(); }
-};
-
-
-//------------------------------------------------------------------------------------------------------------------------
// Specific Handles for different oop types
#define DEF_HANDLE(type, is_a) \
- class type##Handle; \
class type##Handle: public Handle { \
protected: \
type##Oop obj() const { return (type##Oop)Handle::obj(); } \
@@ -178,9 +117,6 @@ class KlassHandle: public Handle {
assert(SharedSkipVerify || is_null() || ((oop)obj)->is_a(), "illegal type"); \
} \
\
- /* Special constructor, use sparingly */ \
- type##Handle (type##Oop *handle, bool dummy) : Handle((oop*)handle, dummy) {} \
- \
/* Operators for ease of use */ \
type##Oop operator () () const { return obj(); } \
type##Oop operator -> () const { return non_null_obj(); } \
@@ -188,52 +124,94 @@ class KlassHandle: public Handle {
DEF_HANDLE(instance , is_instance )
-DEF_HANDLE(method , is_method )
-DEF_HANDLE(constMethod , is_constMethod )
-DEF_HANDLE(methodData , is_methodData )
DEF_HANDLE(array , is_array )
-DEF_HANDLE(constantPool , is_constantPool )
-DEF_HANDLE(constantPoolCache, is_constantPoolCache)
DEF_HANDLE(objArray , is_objArray )
DEF_HANDLE(typeArray , is_typeArray )
//------------------------------------------------------------------------------------------------------------------------
-// Specific KlassHandles for different Klass types
-#define DEF_KLASS_HANDLE(type, is_a) \
- class type##Handle : public KlassHandle { \
+// Metadata Handles. Unlike oop Handles these are needed to prevent metadata
+// from being reclaimed by RedefineClasses.
+
+// Specific Handles for different oop types
+#define DEF_METADATA_HANDLE(name, type) \
+ class name##Handle; \
+ class name##Handle { \
+ type* _value; \
+ Thread* _thread; \
+ protected: \
+ type* obj() const { return _value; } \
+ type* non_null_obj() const { assert(_value != NULL, "resolving NULL _value"); return _value; } \
+ \
public: \
/* Constructors */ \
- type##Handle () : KlassHandle() {} \
- type##Handle (klassOop obj) : KlassHandle(obj) { \
- assert(SharedSkipVerify || is_null() || obj->klass_part()->is_a(), \
- "illegal type"); \
- } \
- type##Handle (Thread* thread, klassOop obj) : KlassHandle(thread, obj) { \
- assert(SharedSkipVerify || is_null() || obj->klass_part()->is_a(), \
- "illegal type"); \
- } \
+ name##Handle () : _value(NULL), _thread(NULL) {} \
+ name##Handle (type* obj); \
+ name##Handle (Thread* thread, type* obj); \
+ \
+ name##Handle (const name##Handle &h); \
+ name##Handle& operator=(const name##Handle &s); \
\
- /* Access to klass part */ \
- type* operator -> () const { return (type*)obj()->klass_part(); } \
+ /* Destructor */ \
+ ~name##Handle (); \
+ void remove(); \
\
- static type##Handle cast(KlassHandle h) { return type##Handle(h()); } \
+ /* Operators for ease of use */ \
+ type* operator () () const { return obj(); } \
+ type* operator -> () const { return non_null_obj(); } \
+ \
+ bool operator == (type* o) const { return obj() == o; } \
+ bool operator == (const name##Handle& h) const { return obj() == h.obj(); } \
\
+ /* Null checks */ \
+ bool is_null() const { return _value == NULL; } \
+ bool not_null() const { return _value != NULL; } \
};
-DEF_KLASS_HANDLE(instanceKlass , oop_is_instance_slow )
-DEF_KLASS_HANDLE(methodKlass , oop_is_method )
-DEF_KLASS_HANDLE(constMethodKlass , oop_is_constMethod )
-DEF_KLASS_HANDLE(klassKlass , oop_is_klass )
-DEF_KLASS_HANDLE(arrayKlassKlass , oop_is_arrayKlass )
-DEF_KLASS_HANDLE(objArrayKlassKlass , oop_is_objArrayKlass )
-DEF_KLASS_HANDLE(typeArrayKlassKlass , oop_is_typeArrayKlass)
-DEF_KLASS_HANDLE(arrayKlass , oop_is_array )
-DEF_KLASS_HANDLE(typeArrayKlass , oop_is_typeArray_slow)
-DEF_KLASS_HANDLE(objArrayKlass , oop_is_objArray_slow )
-DEF_KLASS_HANDLE(constantPoolKlass , oop_is_constantPool )
-DEF_KLASS_HANDLE(constantPoolCacheKlass, oop_is_constantPool )
+DEF_METADATA_HANDLE(method, Method)
+DEF_METADATA_HANDLE(constantPool, ConstantPool)
+
+// Writing this class explicitly, since DEF_METADATA_HANDLE(klass) doesn't
+// provide the necessary Klass* <-> Klass* conversions. This Klass
+// could be removed when we don't have the Klass* typedef anymore.
+class KlassHandle {
+ Klass* _value;
+ protected:
+ Klass* obj() const { return _value; }
+ Klass* non_null_obj() const { assert(_value != NULL, "resolving NULL _value"); return _value; }
+
+ public:
+ KlassHandle() : _value(NULL) {}
+ KlassHandle(const Klass* obj) : _value(const_cast<Klass *>(obj)) {};
+ KlassHandle(Thread* thread, const Klass* obj) : _value(const_cast<Klass *>(obj)) {};
+
+ Klass* operator () () const { return obj(); }
+ Klass* operator -> () const { return non_null_obj(); }
+
+ bool operator == (Klass* o) const { return obj() == o; }
+ bool operator == (const KlassHandle& h) const { return obj() == h.obj(); }
+
+ bool is_null() const { return _value == NULL; }
+ bool not_null() const { return _value != NULL; }
+};
+
+class instanceKlassHandle : public KlassHandle {
+ public:
+ /* Constructors */
+ instanceKlassHandle () : KlassHandle() {}
+ instanceKlassHandle (const Klass* k) : KlassHandle(k) {
+ assert(SharedSkipVerify || k == NULL || k->oop_is_instance(),
+ "illegal type");
+ }
+ instanceKlassHandle (Thread* thread, const Klass* k) : KlassHandle(thread, k) {
+ assert(SharedSkipVerify || k == NULL || k->oop_is_instance(),
+ "illegal type");
+ }
+ /* Access to klass part */
+ InstanceKlass* operator () () const { return (InstanceKlass*)obj(); }
+ InstanceKlass* operator -> () const { return (InstanceKlass*)obj(); }
+};
//------------------------------------------------------------------------------------------------------------------------
diff --git a/src/share/vm/runtime/handles.inline.hpp b/src/share/vm/runtime/handles.inline.hpp
index 806d66fca..96dd94cc5 100644
--- a/src/share/vm/runtime/handles.inline.hpp
+++ b/src/share/vm/runtime/handles.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
@@ -62,6 +62,63 @@ inline Handle::Handle(Thread* thread, oop obj) {
}
#endif // ASSERT
+// Constructors for metadata handles
+#define DEF_METADATA_HANDLE_FN(name, type) \
+inline name##Handle::name##Handle(type* obj) : _value(obj), _thread(NULL) { \
+ if (obj != NULL) { \
+ assert(((Metadata*)obj)->is_valid(), "obj is valid"); \
+ _thread = Thread::current(); \
+ assert (_thread->is_in_stack((address)this), "not on stack?"); \
+ _thread->metadata_handles()->push((Metadata*)obj); \
+ } \
+} \
+inline name##Handle::name##Handle(Thread* thread, type* obj) : _value(obj), _thread(thread) { \
+ if (obj != NULL) { \
+ assert(((Metadata*)obj)->is_valid(), "obj is valid"); \
+ assert(_thread == Thread::current(), "thread must be current"); \
+ assert (_thread->is_in_stack((address)this), "not on stack?"); \
+ _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(); \
+ } \
+ _thread->metadata_handles()->push((Metadata*)_value); \
+ } \
+} \
+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(); \
+ } \
+ _thread->metadata_handles()->push((Metadata*)_value); \
+ } \
+ 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)
inline HandleMark::HandleMark() {
initialize(Thread::current());
diff --git a/src/share/vm/runtime/init.cpp b/src/share/vm/runtime/init.cpp
index d46de5c65..b7e6f4a66 100644
--- a/src/share/vm/runtime/init.cpp
+++ b/src/share/vm/runtime/init.cpp
@@ -94,12 +94,13 @@ jint init_globals() {
management_init();
bytecodes_init();
classLoader_init();
+ Metaspace::global_initialize(); // must be before codeCache
codeCache_init();
VM_Version_init();
os_init_globals();
stubRoutines_init1();
jint status = universe_init(); // dependent on codeCache_init and
- // stubRoutines_init1
+ // stubRoutines_init1 and metaspace_init.
if (status != JNI_OK)
return status;
diff --git a/src/share/vm/runtime/java.cpp b/src/share/vm/runtime/java.cpp
index ed888adb4..8b3aab39a 100644
--- a/src/share/vm/runtime/java.cpp
+++ b/src/share/vm/runtime/java.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -33,12 +33,11 @@
#include "memory/genCollectedHeap.hpp"
#include "memory/oopFactory.hpp"
#include "memory/universe.hpp"
-#include "oops/constantPoolOop.hpp"
+#include "oops/constantPool.hpp"
#include "oops/generateOopMap.hpp"
#include "oops/instanceKlass.hpp"
-#include "oops/instanceKlassKlass.hpp"
#include "oops/instanceOop.hpp"
-#include "oops/methodOop.hpp"
+#include "oops/method.hpp"
#include "oops/objArrayOop.hpp"
#include "oops/oop.inline.hpp"
#include "oops/symbol.hpp"
@@ -115,19 +114,23 @@ HS_DTRACE_PROBE_DECL(hotspot, vm__shutdown);
// Statistics printing (method invocation histogram)
-GrowableArray<methodOop>* collected_invoked_methods;
+GrowableArray<Method*>* collected_invoked_methods;
-void collect_invoked_methods(methodOop m) {
+void collect_invoked_methods(Method* m) {
if (m->invocation_count() + m->compiled_invocation_count() >= 1 ) {
collected_invoked_methods->push(m);
}
}
-GrowableArray<methodOop>* collected_profiled_methods;
+GrowableArray<Method*>* collected_profiled_methods;
-void collect_profiled_methods(methodOop m) {
- methodHandle mh(Thread::current(), m);
+void collect_profiled_methods(Method* m) {
+ Thread* thread = Thread::current();
+ // This HandleMark prevents a huge amount of handles from being added
+ // to the metadata_handles() array on the thread.
+ HandleMark hm(thread);
+ methodHandle mh(thread, m);
if ((m->method_data() != NULL) &&
(PrintMethodData || CompilerOracle::should_print(mh))) {
collected_profiled_methods->push(m);
@@ -135,7 +138,7 @@ void collect_profiled_methods(methodOop m) {
}
-int compare_methods(methodOop* a, methodOop* b) {
+int compare_methods(Method** a, Method** b) {
// %%% there can be 32-bit overflow here
return ((*b)->invocation_count() + (*b)->compiled_invocation_count())
- ((*a)->invocation_count() + (*a)->compiled_invocation_count());
@@ -145,7 +148,7 @@ int compare_methods(methodOop* a, methodOop* b) {
void print_method_invocation_histogram() {
ResourceMark rm;
HandleMark hm;
- collected_invoked_methods = new GrowableArray<methodOop>(1024);
+ collected_invoked_methods = new GrowableArray<Method*>(1024);
SystemDictionary::methods_do(collect_invoked_methods);
collected_invoked_methods->sort(&compare_methods);
//
@@ -156,7 +159,7 @@ void print_method_invocation_histogram() {
unsigned total = 0, int_total = 0, comp_total = 0, static_total = 0, final_total = 0,
synch_total = 0, nativ_total = 0, acces_total = 0;
for (int index = 0; index < collected_invoked_methods->length(); index++) {
- methodOop m = collected_invoked_methods->at(index);
+ Method* m = collected_invoked_methods->at(index);
int c = m->invocation_count() + m->compiled_invocation_count();
if (c >= MethodHistogramCutoff) m->print_invocation_count();
int_total += m->invocation_count();
@@ -185,14 +188,14 @@ void print_method_invocation_histogram() {
void print_method_profiling_data() {
ResourceMark rm;
HandleMark hm;
- collected_profiled_methods = new GrowableArray<methodOop>(1024);
+ collected_profiled_methods = new GrowableArray<Method*>(1024);
SystemDictionary::methods_do(collect_profiled_methods);
collected_profiled_methods->sort(&compare_methods);
int count = collected_profiled_methods->length();
if (count > 0) {
for (int index = 0; index < count; index++) {
- methodOop m = collected_profiled_methods->at(index);
+ Method* m = collected_profiled_methods->at(index);
ttyLocker ttyl;
tty->print_cr("------------------------------------------------------------------------");
//m->print_name(tty);
@@ -485,6 +488,9 @@ void before_exit(JavaThread * thread) {
if (PrintGCDetails) {
Universe::print();
AdaptiveSizePolicyOutput(0);
+ if (Verbose) {
+ ClassLoaderDataGraph::dump_on(gclog_or_tty);
+ }
}
diff --git a/src/share/vm/runtime/javaCalls.cpp b/src/share/vm/runtime/javaCalls.cpp
index edbba9817..0eb14c462 100644
--- a/src/share/vm/runtime/javaCalls.cpp
+++ b/src/share/vm/runtime/javaCalls.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -89,7 +89,6 @@ JavaCallWrapper::JavaCallWrapper(methodHandle callee_method, Handle receiver, Ja
_receiver = receiver();
#ifdef CHECK_UNHANDLED_OOPS
- THREAD->allow_unhandled_oop(&_callee_method);
THREAD->allow_unhandled_oop(&_receiver);
#endif // CHECK_UNHANDLED_OOPS
@@ -154,7 +153,6 @@ JavaCallWrapper::~JavaCallWrapper() {
void JavaCallWrapper::oops_do(OopClosure* f) {
- f->do_oop((oop*)&_callee_method);
f->do_oop((oop*)&_receiver);
handles()->oops_do(f);
}
@@ -191,7 +189,7 @@ void JavaCalls::call_default_constructor(JavaThread* thread, methodHandle method
assert(method->name() == vmSymbols::object_initializer_name(), "Should only be called for default constructor");
assert(method->signature() == vmSymbols::void_method_signature(), "Should only be called for default constructor");
- instanceKlass* ik = instanceKlass::cast(method->method_holder());
+ InstanceKlass* ik = InstanceKlass::cast(method->method_holder());
if (ik->is_initialized() && ik->has_vanilla_constructor()) {
// safe to skip constructor call
} else {
@@ -206,7 +204,7 @@ void JavaCalls::call_default_constructor(JavaThread* thread, methodHandle method
void JavaCalls::call_virtual(JavaValue* result, KlassHandle spec_klass, Symbol* name, Symbol* signature, JavaCallArguments* args, TRAPS) {
CallInfo callinfo;
Handle receiver = args->receiver();
- KlassHandle recvrKlass(THREAD, receiver.is_null() ? (klassOop)NULL : receiver->klass());
+ KlassHandle recvrKlass(THREAD, receiver.is_null() ? (Klass*)NULL : receiver->klass());
LinkResolver::resolve_virtual_call(
callinfo, receiver, recvrKlass, spec_klass, name, signature,
KlassHandle(), false, true, CHECK);
@@ -346,11 +344,11 @@ void JavaCalls::call_helper(JavaValue* result, methodHandle* m, JavaCallArgument
#ifdef ASSERT
- { klassOop holder = method->method_holder();
+ { Klass* holder = method->method_holder();
// A klass might not be initialized since JavaCall's might be used during the executing of
// the <clinit>. For example, a Thread.start might start executing on an object that is
// not fully initialized! (bad Java programming style)
- assert(instanceKlass::cast(holder)->is_linked(), "rewritting must have taken place");
+ assert(InstanceKlass::cast(holder)->is_linked(), "rewritting must have taken place");
}
#endif
diff --git a/src/share/vm/runtime/javaCalls.hpp b/src/share/vm/runtime/javaCalls.hpp
index d4f85956f..3b288f0d2 100644
--- a/src/share/vm/runtime/javaCalls.hpp
+++ b/src/share/vm/runtime/javaCalls.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -26,7 +26,7 @@
#define SHARE_VM_RUNTIME_JAVACALLS_HPP
#include "memory/allocation.hpp"
-#include "oops/methodOop.hpp"
+#include "oops/method.hpp"
#include "runtime/handles.hpp"
#include "runtime/javaFrameAnchor.hpp"
#include "runtime/vmThread.hpp"
@@ -67,7 +67,7 @@ class JavaCallWrapper: StackObj {
private:
JavaThread* _thread; // the thread to which this call belongs
JNIHandleBlock* _handles; // the saved handle block
- methodOop _callee_method; // to be able to collect arguments if entry frame is top frame
+ Method* _callee_method; // to be able to collect arguments if entry frame is top frame
oop _receiver; // the receiver of the call (if a non-static call)
JavaFrameAnchor _anchor; // last thread anchor state that we must restore
@@ -87,7 +87,7 @@ class JavaCallWrapper: StackObj {
JavaValue* result() const { return _result; }
// GC support
- methodOop callee_method() { return _callee_method; }
+ Method* callee_method() { return _callee_method; }
oop receiver() { return _receiver; }
void oops_do(OopClosure* f);
diff --git a/src/share/vm/runtime/jfieldIDWorkaround.hpp b/src/share/vm/runtime/jfieldIDWorkaround.hpp
index 4b6f1aca7..a1831ab8f 100644
--- a/src/share/vm/runtime/jfieldIDWorkaround.hpp
+++ b/src/share/vm/runtime/jfieldIDWorkaround.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -91,14 +91,14 @@ class jfieldIDWorkaround: AllStatic {
}
return (intptr_t)result;
}
- static intptr_t encode_klass_hash(klassOop k, intptr_t offset);
- static bool klass_hash_ok(klassOop k, jfieldID id);
- static void verify_instance_jfieldID(klassOop k, jfieldID id);
+ static intptr_t encode_klass_hash(Klass* k, intptr_t offset);
+ static bool klass_hash_ok(Klass* k, jfieldID id);
+ static void verify_instance_jfieldID(Klass* k, jfieldID id);
public:
- static bool is_valid_jfieldID(klassOop k, jfieldID id);
+ static bool is_valid_jfieldID(Klass* k, jfieldID id);
- static bool is_instance_jfieldID(klassOop k, jfieldID id) {
+ static bool is_instance_jfieldID(Klass* k, jfieldID id) {
uintptr_t as_uint = (uintptr_t) id;
return ((as_uint & instance_mask_in_place) != 0);
}
@@ -107,7 +107,7 @@ class jfieldIDWorkaround: AllStatic {
return ((as_uint & instance_mask_in_place) == 0);
}
- static jfieldID to_instance_jfieldID(klassOop k, int offset) {
+ static jfieldID to_instance_jfieldID(Klass* k, int offset) {
intptr_t as_uint = ((offset & large_offset_mask) << offset_shift) | instance_mask_in_place;
if (VerifyJNIFields) {
as_uint |= encode_klass_hash(k, offset);
@@ -124,7 +124,7 @@ class jfieldIDWorkaround: AllStatic {
return result;
}
- static intptr_t from_instance_jfieldID(klassOop k, jfieldID id) {
+ static intptr_t from_instance_jfieldID(Klass* k, jfieldID id) {
#ifndef ASSERT
// always verify in debug mode; switchable in anything else
if (VerifyJNIFields)
diff --git a/src/share/vm/runtime/jniHandles.cpp b/src/share/vm/runtime/jniHandles.cpp
index 3cbcaca43..4c618b049 100644
--- a/src/share/vm/runtime/jniHandles.cpp
+++ b/src/share/vm/runtime/jniHandles.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
@@ -111,19 +111,6 @@ jobject JNIHandles::make_weak_global(Handle obj) {
return res;
}
-jmethodID JNIHandles::make_jmethod_id(methodHandle mh) {
- return (jmethodID) make_weak_global(mh);
-}
-
-
-
-void JNIHandles::change_method_associated_with_jmethod_id(jmethodID jmid, methodHandle mh) {
- MutexLocker ml(JNIGlobalHandle_lock); // Is this necessary?
- Handle obj = (Handle)mh;
- oop* jobj = (oop*)jmid;
- *jobj = obj();
-}
-
void JNIHandles::destroy_global(jobject handle) {
if (handle != NULL) {
@@ -140,10 +127,6 @@ void JNIHandles::destroy_weak_global(jobject handle) {
}
}
-void JNIHandles::destroy_jmethod_id(jmethodID mid) {
- destroy_weak_global((jobject)mid);
-}
-
void JNIHandles::oops_do(OopClosure* f) {
f->do_oop(&_deleted_handle);
@@ -162,8 +145,8 @@ void JNIHandles::initialize() {
EXCEPTION_MARK;
// We will never reach the CATCH below since Exceptions::_throw will cause
// the VM to exit if an exception is thrown during initialization
- klassOop k = SystemDictionary::Object_klass();
- _deleted_handle = instanceKlass::cast(k)->allocate_permanent_instance(CATCH);
+ Klass* k = SystemDictionary::Object_klass();
+ _deleted_handle = InstanceKlass::cast(k)->allocate_instance(CATCH);
}
diff --git a/src/share/vm/runtime/jniHandles.hpp b/src/share/vm/runtime/jniHandles.hpp
index 71bb1dd89..1b6b6b81f 100644
--- a/src/share/vm/runtime/jniHandles.hpp
+++ b/src/share/vm/runtime/jniHandles.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
@@ -62,23 +62,6 @@ class JNIHandles : AllStatic {
static jobject make_weak_global(Handle obj);
static void destroy_weak_global(jobject handle);
- // jmethodID handling (as Weak global handles).
- // Because the useful life-span of a jmethodID cannot be determined, once created they are
- // never reclaimed. The methods to which they refer, however, can be GC'ed away if the class
- // is unloaded or if the method is made obsolete or deleted -- in these cases, the jmethodID
- // refers to NULL (as is the case for any weak reference).
- static jmethodID make_jmethod_id(methodHandle mh);
- static void destroy_jmethod_id(jmethodID mid);
- // Use resolve_jmethod_id() in situations where the caller is expected
- // to provide a valid jmethodID; the only sanity checks are in asserts;
- // result guaranteed not to be NULL.
- inline static methodOop resolve_jmethod_id(jmethodID mid);
- // Use checked_resolve_jmethod_id() in situations where the caller
- // should provide a valid jmethodID, but might not. NULL is returned
- // when the jmethodID does not refer to a valid method.
- inline static methodOop checked_resolve_jmethod_id(jmethodID mid);
- static void change_method_associated_with_jmethod_id(jmethodID jmid, methodHandle mh);
-
// Sentinel marking deleted handles in block. Note that we cannot store NULL as
// the sentinel, since clearing weak global JNI refs are done by storing NULL in
// the handle. The handle may not be reused before destroy_weak_global is called.
@@ -207,20 +190,6 @@ inline oop JNIHandles::resolve_non_null(jobject handle) {
return result;
};
-inline methodOop JNIHandles::resolve_jmethod_id(jmethodID mid) {
- return (methodOop) resolve_non_null((jobject)mid);
-};
-
-inline methodOop JNIHandles::checked_resolve_jmethod_id(jmethodID mid) {
- oop o = resolve_external_guard((jobject) mid);
- if (o == NULL || !o->is_method()) {
- return (methodOop) NULL;
- }
-
- return (methodOop) o;
-};
-
-
inline void JNIHandles::destroy_local(jobject handle) {
if (handle != NULL) {
*((oop*)handle) = deleted_handle(); // Mark the handle as deleted, allocate will reuse it
diff --git a/src/share/vm/runtime/memprofiler.cpp b/src/share/vm/runtime/memprofiler.cpp
index ab53d9218..339358b4f 100644
--- a/src/share/vm/runtime/memprofiler.cpp
+++ b/src/share/vm/runtime/memprofiler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
@@ -28,7 +28,6 @@
#include "gc_interface/collectedHeap.inline.hpp"
#include "interpreter/oopMapCache.hpp"
#include "memory/generation.hpp"
-#include "memory/permGen.hpp"
#include "memory/resourceArea.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/jniHandles.hpp"
@@ -129,15 +128,12 @@ void MemProfiler::do_trace() {
}
// Print trace line in log
- fprintf(_log_fp, "%6.1f,%5d,%5d," UINTX_FORMAT_W(6) "," UINTX_FORMAT_W(6) ","
- UINTX_FORMAT_W(6) "," UINTX_FORMAT_W(6) ",",
+ fprintf(_log_fp, "%6.1f,%5d,%5d," UINTX_FORMAT_W(6) "," UINTX_FORMAT_W(6) ",",
os::elapsedTime(),
Threads::number_of_threads(),
SystemDictionary::number_of_classes(),
Universe::heap()->used() / K,
- Universe::heap()->capacity() / K,
- Universe::heap()->permanent_used() / HWperKB,
- Universe::heap()->permanent_capacity() / HWperKB);
+ Universe::heap()->capacity() / K);
fprintf(_log_fp, UINTX_FORMAT_W(6) ",", CodeCache::capacity() / K);
diff --git a/src/share/vm/runtime/mutexLocker.cpp b/src/share/vm/runtime/mutexLocker.cpp
index f1911eaba..b1d92def2 100644
--- a/src/share/vm/runtime/mutexLocker.cpp
+++ b/src/share/vm/runtime/mutexLocker.cpp
@@ -225,7 +225,7 @@ void mutex_init() {
def(ExpandHeap_lock , Mutex , leaf, true ); // Used during compilation by VM thread
def(JNIHandleBlockFreeList_lock , Mutex , leaf, true ); // handles are used by VM thread
def(SignatureHandlerLibrary_lock , Mutex , leaf, false);
- def(SymbolTable_lock , Mutex , leaf, true );
+ def(SymbolTable_lock , Mutex , leaf+2, true );
def(StringTable_lock , Mutex , leaf, true );
def(ProfilePrint_lock , Mutex , leaf, false); // serial profile printing
def(ExceptionCache_lock , Mutex , leaf, false); // serial profile printing
diff --git a/src/share/vm/runtime/objectMonitor.cpp b/src/share/vm/runtime/objectMonitor.cpp
index cee84037e..e02feeeae 100644
--- a/src/share/vm/runtime/objectMonitor.cpp
+++ b/src/share/vm/runtime/objectMonitor.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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,11 +69,11 @@
// TODO-FIXME: probes should not fire when caller is _blocked. assert() accordingly.
-#define DTRACE_MONITOR_PROBE_COMMON(klassOop, thread) \
+#define DTRACE_MONITOR_PROBE_COMMON(obj, thread) \
char* bytes = NULL; \
int len = 0; \
jlong jtid = SharedRuntime::get_java_tid(thread); \
- Symbol* klassname = ((oop)(klassOop))->klass()->klass_part()->name(); \
+ Symbol* klassname = ((oop)obj)->klass()->name(); \
if (klassname != NULL) { \
bytes = (char*)klassname->bytes(); \
len = klassname->utf8_length(); \
@@ -92,19 +92,19 @@ HS_DTRACE_PROBE_DECL4(hotspot, monitor__contended__entered,
HS_DTRACE_PROBE_DECL4(hotspot, monitor__contended__exit,
jlong, uintptr_t, char*, int);
-#define DTRACE_MONITOR_WAIT_PROBE(monitor, klassOop, thread, millis) \
+#define DTRACE_MONITOR_WAIT_PROBE(monitor, obj, thread, millis) \
{ \
if (DTraceMonitorProbes) { \
- DTRACE_MONITOR_PROBE_COMMON(klassOop, thread); \
+ DTRACE_MONITOR_PROBE_COMMON(obj, thread); \
HS_DTRACE_PROBE5(hotspot, monitor__wait, jtid, \
(monitor), bytes, len, (millis)); \
} \
}
-#define DTRACE_MONITOR_PROBE(probe, monitor, klassOop, thread) \
+#define DTRACE_MONITOR_PROBE(probe, monitor, obj, thread) \
{ \
if (DTraceMonitorProbes) { \
- DTRACE_MONITOR_PROBE_COMMON(klassOop, thread); \
+ DTRACE_MONITOR_PROBE_COMMON(obj, thread); \
HS_DTRACE_PROBE4(hotspot, monitor__##probe, jtid, \
(uintptr_t)(monitor), bytes, len); \
} \
@@ -112,10 +112,10 @@ HS_DTRACE_PROBE_DECL4(hotspot, monitor__contended__exit,
#else /* USDT2 */
-#define DTRACE_MONITOR_WAIT_PROBE(monitor, klassOop, thread, millis) \
+#define DTRACE_MONITOR_WAIT_PROBE(monitor, obj, thread, millis) \
{ \
if (DTraceMonitorProbes) { \
- DTRACE_MONITOR_PROBE_COMMON(klassOop, thread); \
+ DTRACE_MONITOR_PROBE_COMMON(obj, thread); \
HOTSPOT_MONITOR_WAIT(jtid, \
(monitor), bytes, len, (millis)); \
} \
@@ -127,10 +127,10 @@ HS_DTRACE_PROBE_DECL4(hotspot, monitor__contended__exit,
#define HOTSPOT_MONITOR_notify HOTSPOT_MONITOR_NOTIFY
#define HOTSPOT_MONITOR_notifyAll HOTSPOT_MONITOR_NOTIFYALL
-#define DTRACE_MONITOR_PROBE(probe, monitor, klassOop, thread) \
+#define DTRACE_MONITOR_PROBE(probe, monitor, obj, thread) \
{ \
if (DTraceMonitorProbes) { \
- DTRACE_MONITOR_PROBE_COMMON(klassOop, thread); \
+ DTRACE_MONITOR_PROBE_COMMON(obj, thread); \
HOTSPOT_MONITOR_##probe(jtid, \
(uintptr_t)(monitor), bytes, len); \
} \
@@ -139,8 +139,8 @@ HS_DTRACE_PROBE_DECL4(hotspot, monitor__contended__exit,
#endif /* USDT2 */
#else // ndef DTRACE_ENABLED
-#define DTRACE_MONITOR_WAIT_PROBE(klassOop, thread, millis, mon) {;}
-#define DTRACE_MONITOR_PROBE(probe, klassOop, thread, mon) {;}
+#define DTRACE_MONITOR_WAIT_PROBE(obj, thread, millis, mon) {;}
+#define DTRACE_MONITOR_PROBE(probe, obj, thread, mon) {;}
#endif // ndef DTRACE_ENABLED
diff --git a/src/share/vm/runtime/os.cpp b/src/share/vm/runtime/os.cpp
index 6733e8edb..6689cd4dc 100644
--- a/src/share/vm/runtime/os.cpp
+++ b/src/share/vm/runtime/os.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -271,7 +271,7 @@ static void signal_thread_entry(JavaThread* thread, TRAPS) {
default: {
// Dispatch the signal to java
HandleMark hm(THREAD);
- klassOop k = SystemDictionary::resolve_or_null(vmSymbols::sun_misc_Signal(), THREAD);
+ Klass* k = SystemDictionary::resolve_or_null(vmSymbols::sun_misc_Signal(), THREAD);
KlassHandle klass (THREAD, k);
if (klass.not_null()) {
JavaValue result(T_VOID);
@@ -294,7 +294,7 @@ static void signal_thread_entry(JavaThread* thread, TRAPS) {
char klass_name[256];
char tmp_sig_name[16];
const char* sig_name = "UNKNOWN";
- instanceKlass::cast(PENDING_EXCEPTION->klass())->
+ InstanceKlass::cast(PENDING_EXCEPTION->klass())->
name()->as_klass_external_name(klass_name, 256);
if (os::exception_name(sig, tmp_sig_name, 16) != NULL)
sig_name = tmp_sig_name;
@@ -314,7 +314,7 @@ void os::signal_init() {
if (!ReduceSignalUsage) {
// Setup JavaThread for processing signals
EXCEPTION_MARK;
- klassOop k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_Thread(), true, CHECK);
+ Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_Thread(), true, CHECK);
instanceKlassHandle klass (THREAD, k);
instanceHandle thread_oop = klass->allocate_instance_handle(CHECK);
@@ -893,17 +893,6 @@ void os::print_location(outputStream* st, intptr_t x, bool verbose) {
if (print) {
st->print_cr(INTPTR_FORMAT " is an oop", addr);
oop(p)->print_on(st);
- if (p != (HeapWord*)x && oop(p)->is_constMethod() &&
- constMethodOop(p)->contains(addr)) {
- Thread *thread = Thread::current();
- HandleMark hm(thread);
- methodHandle mh (thread, constMethodOop(p)->method());
- if (!mh->is_native()) {
- st->print_cr("bci_from(%p) = %d; print_codes():",
- addr, mh->bci_from(address(x)));
- mh->print_codes_on(st);
- }
- }
return;
}
} else {
@@ -958,6 +947,17 @@ void os::print_location(outputStream* st, intptr_t x, bool verbose) {
}
}
+
+#ifndef PRODUCT
+ // Check if in metaspace.
+ if (ClassLoaderDataGraph::contains((address)addr)) {
+ // Use addr->print() from the debugger instead (not here)
+ st->print_cr(INTPTR_FORMAT
+ " is pointing into metadata", addr);
+ return;
+ }
+#endif
+
// Try an OS specific find
if (os::find(addr, st)) {
return;
diff --git a/src/share/vm/runtime/perfData.cpp b/src/share/vm/runtime/perfData.cpp
index 3d4bf2da8..10e62cb29 100644
--- a/src/share/vm/runtime/perfData.cpp
+++ b/src/share/vm/runtime/perfData.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
@@ -213,7 +213,10 @@ PerfLongVariant::PerfLongVariant(CounterNS ns, const char* namep, Units u,
void PerfLongVariant::sample() {
- assert(_sample_helper != NULL || _sampled != NULL, "unexpected state");
+ // JJJ - This should not happen. Maybe the first sample is taken
+ // while the _sample_helper is being null'ed out.
+ // assert(_sample_helper != NULL || _sampled != NULL, "unexpected state");
+ if (_sample_helper == NULL) return;
if (_sample_helper != NULL) {
*(jlong*)_valuep = _sample_helper->take_sample();
diff --git a/src/share/vm/runtime/perfData.hpp b/src/share/vm/runtime/perfData.hpp
index 2552fe8ba..07dc9c956 100644
--- a/src/share/vm/runtime/perfData.hpp
+++ b/src/share/vm/runtime/perfData.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
@@ -425,6 +425,7 @@ class PerfLongVariant : public PerfLong {
inline void inc() { (*(jlong*)_valuep)++; }
inline void inc(jlong val) { (*(jlong*)_valuep) += val; }
inline void add(jlong val) { (*(jlong*)_valuep) += val; }
+ void clear_sample_helper() { _sample_helper = NULL; }
};
/*
diff --git a/src/share/vm/runtime/reflection.cpp b/src/share/vm/runtime/reflection.cpp
index cd009ed90..2c5d26ed9 100644
--- a/src/share/vm/runtime/reflection.cpp
+++ b/src/share/vm/runtime/reflection.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -46,24 +46,24 @@
#define JAVA_1_5_VERSION 49
-static void trace_class_resolution(klassOop to_class) {
+static void trace_class_resolution(Klass* to_class) {
ResourceMark rm;
int line_number = -1;
const char * source_file = NULL;
- klassOop caller = NULL;
+ Klass* caller = NULL;
JavaThread* jthread = JavaThread::current();
if (jthread->has_last_Java_frame()) {
vframeStream vfst(jthread);
// skip over any frames belonging to java.lang.Class
while (!vfst.at_end() &&
- instanceKlass::cast(vfst.method()->method_holder())->name() == vmSymbols::java_lang_Class()) {
+ InstanceKlass::cast(vfst.method()->method_holder())->name() == vmSymbols::java_lang_Class()) {
vfst.next();
}
if (!vfst.at_end()) {
// this frame is a likely suspect
caller = vfst.method()->method_holder();
line_number = vfst.method()->line_number_from_bci(vfst.bci());
- Symbol* s = instanceKlass::cast(vfst.method()->method_holder())->source_file_name();
+ Symbol* s = InstanceKlass::cast(vfst.method()->method_holder())->source_file_name();
if (s != NULL) {
source_file = s->as_C_string();
}
@@ -254,7 +254,7 @@ void Reflection::array_set(jvalue* value, arrayOop a, int index, BasicType value
if (value_type == T_OBJECT) {
oop obj = (oop) value->l;
if (obj != NULL) {
- klassOop element_klass = objArrayKlass::cast(a->klass())->element_klass();
+ Klass* element_klass = objArrayKlass::cast(a->klass())->element_klass();
if (!obj->is_a(element_klass)) {
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "array element type mismatch");
}
@@ -301,7 +301,7 @@ void Reflection::array_set(jvalue* value, arrayOop a, int index, BasicType value
}
-klassOop Reflection::basic_type_mirror_to_arrayklass(oop basic_type_mirror, TRAPS) {
+Klass* Reflection::basic_type_mirror_to_arrayklass(oop basic_type_mirror, TRAPS) {
assert(java_lang_Class::is_primitive(basic_type_mirror), "just checking");
BasicType type = java_lang_Class::primitive_type(basic_type_mirror);
if (type == T_VOID) {
@@ -312,7 +312,7 @@ klassOop Reflection::basic_type_mirror_to_arrayklass(oop basic_type_mirror, TRAP
}
-oop Reflection:: basic_type_arrayklass_to_mirror(klassOop basic_type_arrayklass, TRAPS) {
+oop Reflection:: basic_type_arrayklass_to_mirror(Klass* basic_type_arrayklass, TRAPS) {
BasicType type = typeArrayKlass::cast(basic_type_arrayklass)->element_type();
return Universe::java_mirror(type);
}
@@ -326,10 +326,10 @@ arrayOop Reflection::reflect_new_array(oop element_mirror, jint length, TRAPS) {
THROW_0(vmSymbols::java_lang_NegativeArraySizeException());
}
if (java_lang_Class::is_primitive(element_mirror)) {
- klassOop tak = basic_type_mirror_to_arrayklass(element_mirror, CHECK_NULL);
+ Klass* tak = basic_type_mirror_to_arrayklass(element_mirror, CHECK_NULL);
return typeArrayKlass::cast(tak)->allocate(length, THREAD);
} else {
- klassOop k = java_lang_Class::as_klassOop(element_mirror);
+ Klass* k = java_lang_Class::as_Klass(element_mirror);
if (Klass::cast(k)->oop_is_array() && arrayKlass::cast(k)->dimension() >= MAX_DIM) {
THROW_0(vmSymbols::java_lang_IllegalArgumentException());
}
@@ -360,12 +360,12 @@ arrayOop Reflection::reflect_new_multi_array(oop element_mirror, typeArrayOop di
dimensions[i] = d;
}
- klassOop klass;
+ Klass* klass;
int dim = len;
if (java_lang_Class::is_primitive(element_mirror)) {
klass = basic_type_mirror_to_arrayklass(element_mirror, CHECK_NULL);
} else {
- klass = java_lang_Class::as_klassOop(element_mirror);
+ klass = java_lang_Class::as_Klass(element_mirror);
if (Klass::cast(klass)->oop_is_array()) {
int k_dim = arrayKlass::cast(klass)->dimension();
if (k_dim + len > MAX_DIM) {
@@ -386,7 +386,7 @@ oop Reflection::array_component_type(oop mirror, TRAPS) {
return NULL;
}
- klassOop klass = java_lang_Class::as_klassOop(mirror);
+ Klass* klass = java_lang_Class::as_Klass(mirror);
if (!Klass::cast(klass)->oop_is_array()) {
return NULL;
}
@@ -401,7 +401,7 @@ oop Reflection::array_component_type(oop mirror, TRAPS) {
result2 = Klass::cast(objArrayKlass::cast(klass)->element_klass())->java_mirror();
}
} else {
- klassOop lower_dim = arrayKlass::cast(klass)->lower_dimension();
+ Klass* lower_dim = arrayKlass::cast(klass)->lower_dimension();
assert(Klass::cast(lower_dim)->oop_is_array(), "just checking");
result2 = Klass::cast(lower_dim)->java_mirror();
}
@@ -411,7 +411,7 @@ oop Reflection::array_component_type(oop mirror, TRAPS) {
}
-bool Reflection::reflect_check_access(klassOop field_class, AccessFlags acc, klassOop target_class, bool is_method_invoke, TRAPS) {
+bool Reflection::reflect_check_access(Klass* field_class, AccessFlags acc, Klass* target_class, bool is_method_invoke, TRAPS) {
// field_class : declaring class
// acc : declared field access
// target_class : for protected
@@ -424,7 +424,7 @@ bool Reflection::reflect_check_access(klassOop field_class, AccessFlags acc, kla
// that case (same as classic).
ResourceMark rm(THREAD);
assert(THREAD->is_Java_thread(), "sanity check");
- klassOop client_class = ((JavaThread *)THREAD)->security_get_caller_class(is_method_invoke ? 0 : 1);
+ Klass* client_class = ((JavaThread *)THREAD)->security_get_caller_class(is_method_invoke ? 0 : 1);
if (client_class != field_class) {
if (!verify_class_access(client_class, field_class, false)
@@ -454,13 +454,13 @@ bool Reflection::reflect_check_access(klassOop field_class, AccessFlags acc, kla
}
-bool Reflection::verify_class_access(klassOop current_class, klassOop new_class, bool classloader_only) {
+bool Reflection::verify_class_access(Klass* current_class, Klass* new_class, bool classloader_only) {
// Verify that current_class can access new_class. If the classloader_only
// flag is set, we automatically allow any accesses in which current_class
// doesn't have a classloader.
if ((current_class == NULL) ||
(current_class == new_class) ||
- (instanceKlass::cast(new_class)->is_public()) ||
+ (InstanceKlass::cast(new_class)->is_public()) ||
is_same_class_package(current_class, new_class)) {
return true;
}
@@ -475,13 +475,13 @@ bool Reflection::verify_class_access(klassOop current_class, klassOop new_class,
return can_relax_access_check_for(current_class, new_class, classloader_only);
}
-static bool under_host_klass(instanceKlass* ik, klassOop host_klass) {
+static bool under_host_klass(InstanceKlass* ik, Klass* host_klass) {
DEBUG_ONLY(int inf_loop_check = 1000 * 1000 * 1000);
for (;;) {
- klassOop hc = (klassOop) ik->host_klass();
+ Klass* hc = (Klass*) ik->host_klass();
if (hc == NULL) return false;
if (hc == host_klass) return true;
- ik = instanceKlass::cast(hc);
+ ik = InstanceKlass::cast(hc);
// There's no way to make a host class loop short of patching memory.
// Therefore there cannot be a loop here unles there's another bug.
@@ -491,9 +491,9 @@ static bool under_host_klass(instanceKlass* ik, klassOop host_klass) {
}
bool Reflection::can_relax_access_check_for(
- klassOop accessor, klassOop accessee, bool classloader_only) {
- instanceKlass* accessor_ik = instanceKlass::cast(accessor);
- instanceKlass* accessee_ik = instanceKlass::cast(accessee);
+ Klass* accessor, Klass* accessee, bool classloader_only) {
+ InstanceKlass* accessor_ik = InstanceKlass::cast(accessor);
+ InstanceKlass* accessee_ik = InstanceKlass::cast(accessee);
// If either is on the other's host_klass chain, access is OK,
// because one is inside the other.
@@ -513,9 +513,9 @@ bool Reflection::can_relax_access_check_for(
}
}
-bool Reflection::verify_field_access(klassOop current_class,
- klassOop resolved_class,
- klassOop field_class,
+bool Reflection::verify_field_access(Klass* current_class,
+ Klass* resolved_class,
+ Klass* field_class,
AccessFlags access,
bool classloader_only,
bool protected_restriction) {
@@ -569,12 +569,12 @@ bool Reflection::verify_field_access(klassOop current_class,
}
-bool Reflection::is_same_class_package(klassOop class1, klassOop class2) {
- return instanceKlass::cast(class1)->is_same_class_package(class2);
+bool Reflection::is_same_class_package(Klass* class1, Klass* class2) {
+ return InstanceKlass::cast(class1)->is_same_class_package(class2);
}
-bool Reflection::is_same_package_member(klassOop class1, klassOop class2, TRAPS) {
- return instanceKlass::cast(class1)->is_same_package_member(class2, THREAD);
+bool Reflection::is_same_package_member(Klass* class1, Klass* class2, TRAPS) {
+ return InstanceKlass::cast(class1)->is_same_package_member(class2, THREAD);
}
@@ -592,9 +592,9 @@ void Reflection::check_for_inner_class(instanceKlassHandle outer, instanceKlassH
int ooff = iter.outer_class_info_index();
if (inner_is_member && ioff != 0 && ooff != 0) {
- klassOop o = cp->klass_at(ooff, CHECK);
+ Klass* o = cp->klass_at(ooff, CHECK);
if (o == outer()) {
- klassOop i = cp->klass_at(ioff, CHECK);
+ Klass* i = cp->klass_at(ioff, CHECK);
if (i == inner()) {
return;
}
@@ -602,7 +602,7 @@ void Reflection::check_for_inner_class(instanceKlassHandle outer, instanceKlassH
}
if (!inner_is_member && ioff != 0 && ooff == 0 &&
cp->klass_name_at_matches(inner, ioff)) {
- klassOop i = cp->klass_at(ioff, CHECK);
+ Klass* i = cp->klass_at(ioff, CHECK);
if (i == inner()) {
return;
}
@@ -630,9 +630,9 @@ oop get_mirror_from_signature(methodHandle method, SignatureStream* ss, TRAPS) {
case T_OBJECT:
case T_ARRAY:
Symbol* name = ss->as_symbol(CHECK_NULL);
- oop loader = instanceKlass::cast(method->method_holder())->class_loader();
- oop protection_domain = instanceKlass::cast(method->method_holder())->protection_domain();
- klassOop k = SystemDictionary::resolve_or_fail(
+ oop loader = InstanceKlass::cast(method->method_holder())->class_loader();
+ oop protection_domain = InstanceKlass::cast(method->method_holder())->protection_domain();
+ Klass* k = SystemDictionary::resolve_or_fail(
name,
Handle(THREAD, loader),
Handle(THREAD, protection_domain),
@@ -680,9 +680,9 @@ Handle Reflection::new_type(Symbol* signature, KlassHandle k, TRAPS) {
return Handle(THREAD, Universe::java_mirror(type));
}
- oop loader = instanceKlass::cast(k())->class_loader();
+ oop loader = InstanceKlass::cast(k())->class_loader();
oop protection_domain = Klass::cast(k())->protection_domain();
- klassOop result = SystemDictionary::resolve_or_fail(signature,
+ Klass* result = SystemDictionary::resolve_or_fail(signature,
Handle(THREAD, loader),
Handle(THREAD, protection_domain),
true, CHECK_(Handle()));
@@ -748,13 +748,16 @@ oop Reflection::new_method(methodHandle method, bool intern_name, bool for_const
java_lang_reflect_Method::set_signature(mh(), sig());
}
if (java_lang_reflect_Method::has_annotations_field()) {
- java_lang_reflect_Method::set_annotations(mh(), method->annotations());
+ typeArrayOop an_oop = Annotations::make_java_array(method->annotations(), CHECK_NULL);
+ java_lang_reflect_Method::set_annotations(mh(), an_oop);
}
if (java_lang_reflect_Method::has_parameter_annotations_field()) {
- java_lang_reflect_Method::set_parameter_annotations(mh(), method->parameter_annotations());
+ typeArrayOop an_oop = Annotations::make_java_array(method->parameter_annotations(), CHECK_NULL);
+ java_lang_reflect_Method::set_parameter_annotations(mh(), an_oop);
}
if (java_lang_reflect_Method::has_annotation_default_field()) {
- java_lang_reflect_Method::set_annotation_default(mh(), method->annotation_default());
+ typeArrayOop an_oop = Annotations::make_java_array(method->annotation_default(), CHECK_NULL);
+ java_lang_reflect_Method::set_annotation_default(mh(), an_oop);
}
return mh();
}
@@ -791,10 +794,12 @@ oop Reflection::new_constructor(methodHandle method, TRAPS) {
java_lang_reflect_Constructor::set_signature(ch(), sig());
}
if (java_lang_reflect_Constructor::has_annotations_field()) {
- java_lang_reflect_Constructor::set_annotations(ch(), method->annotations());
+ typeArrayOop an_oop = Annotations::make_java_array(method->annotations(), CHECK_NULL);
+ java_lang_reflect_Constructor::set_annotations(ch(), an_oop);
}
if (java_lang_reflect_Constructor::has_parameter_annotations_field()) {
- java_lang_reflect_Constructor::set_parameter_annotations(ch(), method->parameter_annotations());
+ typeArrayOop an_oop = Annotations::make_java_array(method->parameter_annotations(), CHECK_NULL);
+ java_lang_reflect_Constructor::set_parameter_annotations(ch(), an_oop);
}
return ch();
}
@@ -811,7 +816,7 @@ oop Reflection::new_field(fieldDescriptor* fd, bool intern_name, TRAPS) {
name = java_lang_String::create_from_symbol(field_name, CHECK_NULL);
}
Symbol* signature = fd->signature();
- KlassHandle holder (THREAD, fd->field_holder());
+ instanceKlassHandle holder (THREAD, fd->field_holder());
Handle type = new_type(signature, holder, CHECK_NULL);
Handle rh = java_lang_reflect_Field::create(CHECK_NULL);
@@ -829,7 +834,8 @@ oop Reflection::new_field(fieldDescriptor* fd, bool intern_name, TRAPS) {
java_lang_reflect_Field::set_signature(rh(), sig());
}
if (java_lang_reflect_Field::has_annotations_field()) {
- java_lang_reflect_Field::set_annotations(rh(), fd->annotations());
+ typeArrayOop an_oop = Annotations::make_java_array(fd->annotations(), CHECK_NULL);
+ java_lang_reflect_Field::set_annotations(rh(), an_oop);
}
return rh();
}
@@ -882,7 +888,7 @@ oop Reflection::invoke(instanceKlassHandle klass, methodHandle reflected_method,
method = reflected_method;
} else {
// resolve based on the receiver
- if (instanceKlass::cast(reflected_method->method_holder())->is_interface()) {
+ if (InstanceKlass::cast(reflected_method->method_holder())->is_interface()) {
// resolve interface call
if (ReflectionWrapResolutionErrors) {
// new default: 6531596
@@ -905,10 +911,10 @@ oop Reflection::invoke(instanceKlassHandle klass, methodHandle reflected_method,
// if the method can be overridden, we resolve using the vtable index.
int index = reflected_method->vtable_index();
method = reflected_method;
- if (index != methodOopDesc::nonvirtual_vtable_index) {
+ if (index != Method::nonvirtual_vtable_index) {
// target_klass might be an arrayKlassOop but all vtables start at
// the same place. The cast is to avoid virtual call and assertion.
- instanceKlass* inst = (instanceKlass*)target_klass()->klass_part();
+ InstanceKlass* inst = (InstanceKlass*)target_klass();
method = methodHandle(THREAD, inst->method_at_vtable(index));
}
if (!method.is_null()) {
@@ -919,7 +925,7 @@ oop Reflection::invoke(instanceKlassHandle klass, methodHandle reflected_method,
ResourceMark rm(THREAD);
Handle h_origexception = Exceptions::new_exception(THREAD,
vmSymbols::java_lang_AbstractMethodError(),
- methodOopDesc::name_and_sig_as_C_string(Klass::cast(target_klass()),
+ Method::name_and_sig_as_C_string(Klass::cast(target_klass()),
method->name(),
method->signature()));
JavaCallArguments args(h_origexception);
@@ -929,7 +935,7 @@ oop Reflection::invoke(instanceKlassHandle klass, methodHandle reflected_method,
} else {
ResourceMark rm(THREAD);
THROW_MSG_0(vmSymbols::java_lang_AbstractMethodError(),
- methodOopDesc::name_and_sig_as_C_string(Klass::cast(target_klass()),
+ Method::name_and_sig_as_C_string(Klass::cast(target_klass()),
method->name(),
method->signature()));
}
@@ -944,7 +950,7 @@ oop Reflection::invoke(instanceKlassHandle klass, methodHandle reflected_method,
if (method.is_null()) {
ResourceMark rm(THREAD);
THROW_MSG_0(vmSymbols::java_lang_NoSuchMethodError(),
- methodOopDesc::name_and_sig_as_C_string(Klass::cast(klass()),
+ Method::name_and_sig_as_C_string(Klass::cast(klass()),
reflected_method->name(),
reflected_method->signature()));
}
@@ -1003,7 +1009,7 @@ oop Reflection::invoke(instanceKlassHandle klass, methodHandle reflected_method,
}
} else {
if (arg != NULL) {
- klassOop k = java_lang_Class::as_klassOop(type_mirror);
+ Klass* k = java_lang_Class::as_Klass(type_mirror);
if (!arg->is_a(k)) {
THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "argument type mismatch");
}
@@ -1079,8 +1085,8 @@ oop Reflection::invoke_method(oop method_mirror, Handle receiver, objArrayHandle
rtype = T_OBJECT;
}
- instanceKlassHandle klass(THREAD, java_lang_Class::as_klassOop(mirror));
- methodOop m = klass->method_with_idnum(slot);
+ instanceKlassHandle klass(THREAD, java_lang_Class::as_Klass(mirror));
+ Method* m = klass->method_with_idnum(slot);
if (m == NULL) {
THROW_MSG_0(vmSymbols::java_lang_InternalError(), "invoke");
}
@@ -1096,8 +1102,8 @@ oop Reflection::invoke_constructor(oop constructor_mirror, objArrayHandle args,
bool override = java_lang_reflect_Constructor::override(constructor_mirror) != 0;
objArrayHandle ptypes(THREAD, objArrayOop(java_lang_reflect_Constructor::parameter_types(constructor_mirror)));
- instanceKlassHandle klass(THREAD, java_lang_Class::as_klassOop(mirror));
- methodOop m = klass->method_with_idnum(slot);
+ instanceKlassHandle klass(THREAD, java_lang_Class::as_Klass(mirror));
+ Method* m = klass->method_with_idnum(slot);
if (m == NULL) {
THROW_MSG_0(vmSymbols::java_lang_InternalError(), "invoke");
}
diff --git a/src/share/vm/runtime/reflection.hpp b/src/share/vm/runtime/reflection.hpp
index cf5425394..dbc57ef3c 100644
--- a/src/share/vm/runtime/reflection.hpp
+++ b/src/share/vm/runtime/reflection.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -45,11 +45,11 @@ class FieldStream;
class Reflection: public AllStatic {
private:
// Access checking
- static bool reflect_check_access(klassOop field_class, AccessFlags acc, klassOop target_class, bool is_method_invoke, TRAPS);
+ static bool reflect_check_access(Klass* field_class, AccessFlags acc, Klass* target_class, bool is_method_invoke, TRAPS);
// Conversion
- static klassOop basic_type_mirror_to_arrayklass(oop basic_type_mirror, TRAPS);
- static oop basic_type_arrayklass_to_mirror(klassOop basic_type_arrayklass, TRAPS);
+ static Klass* basic_type_mirror_to_arrayklass(oop basic_type_mirror, TRAPS);
+ static oop basic_type_arrayklass_to_mirror(Klass* basic_type_arrayklass, TRAPS);
static objArrayHandle get_parameter_types(methodHandle method, int parameter_count, oop* return_type, TRAPS);
static objArrayHandle get_exception_types(methodHandle method, TRAPS);
@@ -86,19 +86,19 @@ class Reflection: public AllStatic {
static arrayOop reflect_new_multi_array(oop element_mirror, typeArrayOop dimensions, TRAPS);
// Verification
- static bool verify_class_access(klassOop current_class, klassOop new_class, bool classloader_only);
+ static bool verify_class_access(Klass* current_class, Klass* new_class, bool classloader_only);
- static bool verify_field_access(klassOop current_class,
- klassOop resolved_class,
- klassOop field_class,
+ static bool verify_field_access(Klass* current_class,
+ Klass* resolved_class,
+ Klass* field_class,
AccessFlags access,
bool classloader_only,
bool protected_restriction = false);
- static bool is_same_class_package(klassOop class1, klassOop class2);
- static bool is_same_package_member(klassOop class1, klassOop class2, TRAPS);
+ static bool is_same_class_package(Klass* class1, Klass* class2);
+ static bool is_same_package_member(Klass* class1, Klass* class2, TRAPS);
static bool can_relax_access_check_for(
- klassOop accessor, klassOop accesee, bool classloader_only);
+ Klass* accessor, Klass* accesee, bool classloader_only);
// inner class reflection
// raise an ICCE unless the required relationship can be proven to hold
diff --git a/src/share/vm/runtime/reflectionUtils.cpp b/src/share/vm/runtime/reflectionUtils.cpp
index e8a986ab3..9fcf966b9 100644
--- a/src/share/vm/runtime/reflectionUtils.cpp
+++ b/src/share/vm/runtime/reflectionUtils.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
@@ -30,7 +30,7 @@
KlassStream::KlassStream(instanceKlassHandle klass, bool local_only, bool classes_only) {
_klass = klass;
if (classes_only) {
- _interfaces = Universe::the_empty_system_obj_array();
+ _interfaces = Universe::the_empty_klass_array();
} else {
_interfaces = klass->transitive_interfaces();
}
@@ -47,7 +47,7 @@ bool KlassStream::eos() {
_klass = _klass->super();
} else {
if (_interface_index > 0) {
- _klass = klassOop(_interfaces->obj_at(--_interface_index));
+ _klass = _interfaces->at(--_interface_index);
} else {
return true;
}
@@ -70,7 +70,7 @@ void FilteredFieldsMap::initialize() {
if (JDK_Version::is_gte_jdk16x_version()) {
// The following class fields do not exist in
// previous version of jdk.
- offset = sun_reflect_ConstantPool::cp_oop_offset();
+ offset = sun_reflect_ConstantPool::oop_offset();
_filtered_fields->append(new FilteredField(SystemDictionary::reflect_ConstantPool_klass(), offset));
offset = sun_reflect_UnsafeStaticFieldAccessorImpl::base_offset();
_filtered_fields->append(new FilteredField(SystemDictionary::reflect_UnsafeStaticFieldAccessorImpl_klass(), offset));
diff --git a/src/share/vm/runtime/reflectionUtils.hpp b/src/share/vm/runtime/reflectionUtils.hpp
index 5d4ba5018..7641fa769 100644
--- a/src/share/vm/runtime/reflectionUtils.hpp
+++ b/src/share/vm/runtime/reflectionUtils.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
@@ -39,14 +39,14 @@
// interfaces last).
//
// for (KlassStream st(k, false, false); !st.eos(); st.next()) {
-// klassOop k = st.klass();
+// Klass* k = st.klass();
// ...
// }
class KlassStream VALUE_OBJ_CLASS_SPEC {
protected:
instanceKlassHandle _klass; // current klass/interface iterated over
- objArrayHandle _interfaces; // transitive interfaces for initial class
+ Array<Klass*>* _interfaces; // transitive interfaces for initial class
int _interface_index; // current interface being processed
bool _local_only; // process initial class/interface only
bool _classes_only; // process classes only (no interfaces)
@@ -75,14 +75,14 @@ class KlassStream VALUE_OBJ_CLASS_SPEC {
// Usage:
//
// for (MethodStream st(k, false, false); !st.eos(); st.next()) {
-// methodOop m = st.method();
+// Method* m = st.method();
// ...
// }
class MethodStream : public KlassStream {
private:
int length() const { return methods()->length(); }
- objArrayOop methods() const { return _klass->methods(); }
+ Array<Method*>* methods() const { return _klass->methods(); }
public:
MethodStream(instanceKlassHandle klass, bool local_only, bool classes_only)
: KlassStream(klass, local_only, classes_only) {
@@ -91,7 +91,7 @@ class MethodStream : public KlassStream {
}
void next() { _index--; }
- methodOop method() const { return methodOop(methods()->obj_at(index())); }
+ Method* method() const { return methods()->at(index()); }
};
@@ -138,16 +138,15 @@ class FieldStream : public KlassStream {
class FilteredField {
private:
- klassOop _klass;
+ Klass* _klass;
int _field_offset;
public:
- FilteredField(klassOop klass, int field_offset) {
+ FilteredField(Klass* klass, int field_offset) {
_klass = klass;
_field_offset = field_offset;
}
- klassOop klass() { return _klass; }
- oop* klass_addr() { return (oop*) &_klass; }
+ Klass* klass() { return _klass; }
int field_offset() { return _field_offset; }
};
@@ -156,7 +155,7 @@ class FilteredFieldsMap : AllStatic {
static GrowableArray<FilteredField *> *_filtered_fields;
public:
static void initialize();
- static bool is_filtered_field(klassOop klass, int field_offset) {
+ static bool is_filtered_field(Klass* klass, int field_offset) {
for (int i=0; i < _filtered_fields->length(); i++) {
if (klass == _filtered_fields->at(i)->klass() &&
field_offset == _filtered_fields->at(i)->field_offset()) {
@@ -165,21 +164,21 @@ class FilteredFieldsMap : AllStatic {
}
return false;
}
- static int filtered_fields_count(klassOop klass, bool local_only) {
+ static int filtered_fields_count(Klass* klass, bool local_only) {
int nflds = 0;
for (int i=0; i < _filtered_fields->length(); i++) {
if (local_only && klass == _filtered_fields->at(i)->klass()) {
nflds++;
- } else if (klass->klass_part()->is_subtype_of(_filtered_fields->at(i)->klass())) {
+ } else if (klass->is_subtype_of(_filtered_fields->at(i)->klass())) {
nflds++;
}
}
return nflds;
}
- // GC support.
- static void klasses_oops_do(OopClosure* f) {
+ // Enhance Class Redefinition Support
+ static void classes_do(KlassClosure* f) {
for (int i = 0; i < _filtered_fields->length(); i++) {
- f->do_oop((oop*)_filtered_fields->at(i)->klass_addr());
+ f->do_klass(_filtered_fields->at(i)->klass());
}
}
};
@@ -204,13 +203,13 @@ class FilteredFieldStream : public FieldStream {
public:
FilteredFieldStream(instanceKlassHandle klass, bool local_only, bool classes_only)
: FieldStream(klass, local_only, classes_only) {
- _filtered_fields_count = FilteredFieldsMap::filtered_fields_count((klassOop)klass(), local_only);
+ _filtered_fields_count = FilteredFieldsMap::filtered_fields_count((Klass*)klass(), local_only);
}
int field_count();
void next() {
_index -= 1;
if (has_filtered_field()) {
- while (_index >=0 && FilteredFieldsMap::is_filtered_field((klassOop)_klass(), offset())) {
+ while (_index >=0 && FilteredFieldsMap::is_filtered_field((Klass*)_klass(), offset())) {
_index -= 1;
}
}
diff --git a/src/share/vm/runtime/relocator.cpp b/src/share/vm/runtime/relocator.cpp
index 9759b5e5f..450bcf28a 100644
--- a/src/share/vm/runtime/relocator.cpp
+++ b/src/share/vm/runtime/relocator.cpp
@@ -25,6 +25,7 @@
#include "precompiled.hpp"
#include "classfile/stackMapTableFormat.hpp"
#include "interpreter/bytecodes.hpp"
+#include "memory/metadataFactory.hpp"
#include "memory/oopFactory.hpp"
#include "memory/universe.inline.hpp"
#include "oops/oop.inline.hpp"
@@ -155,11 +156,16 @@ methodHandle Relocator::insert_space_at(int bci, int size, u_char inst_buffer[],
if (!handle_code_changes()) return methodHandle();
// Construct the new method
- methodHandle new_method = methodOopDesc::clone_with_new_data(method(),
+ methodHandle new_method = Method::clone_with_new_data(method(),
code_array(), code_length(),
compressed_line_number_table(),
compressed_line_number_table_size(),
CHECK_(methodHandle()));
+
+ // Deallocate the old Method* from metadata
+ ClassLoaderData* loader_data = method()->method_holder()->class_loader_data();
+ loader_data->add_to_deallocate_list(method()());
+
set_method(new_method);
if (TraceRelocator) {
@@ -443,16 +449,14 @@ void Relocator::adjust_local_var_table(int bci, int delta) {
// Create a new array, copying the src array but adding a hole at
// the specified location
-static typeArrayOop insert_hole_at(
- size_t where, int hole_sz, typeArrayOop src) {
+static Array<u1>* insert_hole_at(ClassLoaderData* loader_data,
+ size_t where, int hole_sz, Array<u1>* src) {
Thread* THREAD = Thread::current();
- Handle src_hnd(THREAD, src);
- typeArrayOop dst =
- oopFactory::new_permanent_byteArray(src->length() + hole_sz, CHECK_NULL);
- src = (typeArrayOop)src_hnd();
+ Array<u1>* dst =
+ MetadataFactory::new_array<u1>(loader_data, src->length() + hole_sz, 0, CHECK_NULL);
- address src_addr = (address)src->byte_at_addr(0);
- address dst_addr = (address)dst->byte_at_addr(0);
+ address src_addr = (address)src->adr_at(0);
+ address dst_addr = (address)dst->adr_at(0);
memcpy(dst_addr, src_addr, where);
memcpy(dst_addr + where + hole_sz,
@@ -464,10 +468,10 @@ static typeArrayOop insert_hole_at(
// map frames.
void Relocator::adjust_stack_map_table(int bci, int delta) {
if (method()->has_stackmap_table()) {
- typeArrayOop data = method()->stackmap_data();
+ Array<u1>* data = method()->stackmap_data();
// The data in the array is a classfile representation of the stackmap table
stack_map_table* sm_table =
- stack_map_table::at((address)data->byte_at_addr(0));
+ stack_map_table::at((address)data->adr_at(0));
int count = sm_table->number_of_entries();
stack_map_frame* frame = sm_table->entries();
@@ -497,14 +501,18 @@ void Relocator::adjust_stack_map_table(int bci, int delta) {
// We can safely ignore the reverse situation as a small delta
// can still be used in an extended version of the frame.
- size_t frame_offset = (address)frame - (address)data->byte_at_addr(0);
+ size_t frame_offset = (address)frame - (address)data->adr_at(0);
- data = insert_hole_at(frame_offset + 1, 2, data);
- if (data == NULL) {
+ ClassLoaderData* loader_data = method()->method_holder()->class_loader_data();
+ Array<u1>* new_data = insert_hole_at(loader_data, frame_offset + 1, 2, data);
+ if (new_data == NULL) {
return; // out-of-memory?
}
+ // Deallocate old data
+ MetadataFactory::free_array<u1>(loader_data, data);
+ data = new_data;
- address frame_addr = (address)(data->byte_at_addr(0) + frame_offset);
+ address frame_addr = (address)(data->adr_at(0) + frame_offset);
frame = stack_map_frame::at(frame_addr);
@@ -573,7 +581,7 @@ bool Relocator::expand_code_array(int delta) {
if (code_array() != NULL) {
memcpy(new_code_array, code_array(), code_length());
} else {
- // Initial copy. Copy directly from methodOop
+ // Initial copy. Copy directly from Method*
memcpy(new_code_array, method()->code_base(), code_length());
}
diff --git a/src/share/vm/runtime/relocator.hpp b/src/share/vm/runtime/relocator.hpp
index c34866f74..bbc0600f7 100644
--- a/src/share/vm/runtime/relocator.hpp
+++ b/src/share/vm/runtime/relocator.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -26,7 +26,7 @@
#define SHARE_VM_RUNTIME_RELOCATOR_HPP
#include "interpreter/bytecodes.hpp"
-#include "oops/methodOop.hpp"
+#include "oops/method.hpp"
#ifdef TARGET_ARCH_x86
# include "bytes_x86.hpp"
#endif
diff --git a/src/share/vm/runtime/rframe.hpp b/src/share/vm/runtime/rframe.hpp
index 4437a4f07..e70093b94 100644
--- a/src/share/vm/runtime/rframe.hpp
+++ b/src/share/vm/runtime/rframe.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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,9 +69,9 @@ class RFrame : public ResourceObj {
RFrame* parent() const; // rframe containing lexical scope (if any)
virtual void print() = 0;
- static int computeSends(methodOop m);
+ static int computeSends(Method* m);
static int computeSends(nmethod* nm);
- static int computeCumulSends(methodOop m);
+ static int computeCumulSends(Method* m);
static int computeCumulSends(nmethod* nm);
};
diff --git a/src/share/vm/runtime/sharedRuntime.cpp b/src/share/vm/runtime/sharedRuntime.cpp
index 3be009ccc..d730251b7 100644
--- a/src/share/vm/runtime/sharedRuntime.cpp
+++ b/src/share/vm/runtime/sharedRuntime.cpp
@@ -590,13 +590,13 @@ void SharedRuntime::throw_and_post_jvmti_exception(JavaThread *thread, Symbol* n
// to modify the compilers to generate calls to this function.
//
JRT_LEAF(int, SharedRuntime::rc_trace_method_entry(
- JavaThread* thread, methodOopDesc* method))
+ JavaThread* thread, Method* method))
assert(RC_TRACE_IN_RANGE(0x00001000, 0x00002000), "wrong call");
if (method->is_obsolete()) {
// We are calling an obsolete method, but this is not necessarily
// an error. Our method could have been redefined just after we
- // fetched the methodOop from the constant pool.
+ // fetched the Method* from the constant pool.
// RC_TRACE macro has an embedded ResourceMark
RC_TRACE_WITH_THREAD(0x00001000, thread,
@@ -725,8 +725,8 @@ JRT_END
JRT_ENTRY(void, SharedRuntime::throw_StackOverflowError(JavaThread* thread))
// We avoid using the normal exception construction in this case because
// it performs an upcall to Java, and we're already out of stack space.
- klassOop k = SystemDictionary::StackOverflowError_klass();
- oop exception_oop = instanceKlass::cast(k)->allocate_instance(CHECK);
+ Klass* k = SystemDictionary::StackOverflowError_klass();
+ oop exception_oop = InstanceKlass::cast(k)->allocate_instance(CHECK);
Handle exception (thread, exception_oop);
if (StackTraceInThrowable) {
java_lang_Throwable::fill_in_stack_trace(exception);
@@ -909,8 +909,8 @@ JRT_END
JRT_ENTRY_NO_ASYNC(void, SharedRuntime::register_finalizer(JavaThread* thread, oopDesc* obj))
assert(obj->is_oop(), "must be a valid oop");
- assert(obj->klass()->klass_part()->has_finalizer(), "shouldn't be here otherwise");
- instanceKlass::register_finalizer(instanceOop(obj), CHECK);
+ assert(obj->klass()->has_finalizer(), "shouldn't be here otherwise");
+ InstanceKlass::register_finalizer(instanceOop(obj), CHECK);
JRT_END
@@ -935,7 +935,7 @@ int SharedRuntime::dtrace_object_alloc(oopDesc* o) {
int SharedRuntime::dtrace_object_alloc_base(Thread* thread, oopDesc* o) {
assert(DTraceAllocProbes, "wrong call");
- Klass* klass = o->blueprint();
+ Klass* klass = o->klass();
int size = o->size();
Symbol* name = klass->name();
#ifndef USDT2
@@ -950,7 +950,7 @@ int SharedRuntime::dtrace_object_alloc_base(Thread* thread, oopDesc* o) {
}
JRT_LEAF(int, SharedRuntime::dtrace_method_entry(
- JavaThread* thread, methodOopDesc* method))
+ JavaThread* thread, Method* method))
assert(DTraceMethodProbes, "wrong call");
Symbol* kname = method->klass_name();
Symbol* name = method->name();
@@ -971,7 +971,7 @@ JRT_LEAF(int, SharedRuntime::dtrace_method_entry(
JRT_END
JRT_LEAF(int, SharedRuntime::dtrace_method_exit(
- JavaThread* thread, methodOopDesc* method))
+ JavaThread* thread, Method* method))
assert(DTraceMethodProbes, "wrong call");
Symbol* kname = method->klass_name();
Symbol* name = method->name();
@@ -1059,7 +1059,7 @@ Handle SharedRuntime::find_callee_info_helper(JavaThread* thread,
if (bc != Bytecodes::_invokestatic && bc != Bytecodes::_invokedynamic) {
assert(receiver.not_null(), "should have thrown exception");
KlassHandle receiver_klass(THREAD, receiver->klass());
- klassOop rk = constants->klass_ref_at(bytecode_index, CHECK_(nullHandle));
+ Klass* rk = constants->klass_ref_at(bytecode_index, CHECK_(nullHandle));
// klass is already loaded
KlassHandle static_receiver_klass(THREAD, rk);
// Method handle invokes might have been optimized to a direct call
@@ -1071,11 +1071,11 @@ Handle SharedRuntime::find_callee_info_helper(JavaThread* thread,
callee->is_compiled_lambda_form(),
"actual receiver must be subclass of static receiver klass");
if (receiver_klass->oop_is_instance()) {
- if (instanceKlass::cast(receiver_klass())->is_not_initialized()) {
+ if (InstanceKlass::cast(receiver_klass())->is_not_initialized()) {
tty->print_cr("ERROR: Klass not yet initialized!!");
- receiver_klass.print();
+ receiver_klass()->print();
}
- assert(!instanceKlass::cast(receiver_klass())->is_not_initialized(), "receiver_klass must be initialized");
+ assert(!InstanceKlass::cast(receiver_klass())->is_not_initialized(), "receiver_klass must be initialized");
}
}
#endif
@@ -1233,7 +1233,7 @@ methodHandle SharedRuntime::resolve_sub_helper(JavaThread *thread,
{
MutexLocker ml_patch(CompiledIC_lock);
- // Now that we are ready to patch if the methodOop was redefined then
+ // Now that we are ready to patch if the Method* was redefined then
// don't update call site and let the caller retry.
if (!callee_method->is_old()) {
@@ -1245,7 +1245,9 @@ methodHandle SharedRuntime::resolve_sub_helper(JavaThread *thread,
}
#endif
if (is_virtual) {
- CompiledIC* inline_cache = CompiledIC_before(caller_frame.pc());
+ nmethod* nm = callee_nm;
+ if (nm == NULL) CodeCache::find_blob(caller_frame.pc());
+ CompiledIC* inline_cache = CompiledIC_before(caller_nm, caller_frame.pc());
if (inline_cache->is_clean()) {
inline_cache->set_to_monomorphic(virtual_call_info);
}
@@ -1274,8 +1276,8 @@ JRT_BLOCK_ENTRY(address, SharedRuntime::handle_wrong_method_ic_miss(JavaThread*
methodHandle callee_method;
JRT_BLOCK
callee_method = SharedRuntime::handle_ic_miss_helper(thread, CHECK_NULL);
- // Return methodOop through TLS
- thread->set_vm_result(callee_method());
+ // Return Method* through TLS
+ thread->set_vm_result_2(callee_method());
JRT_BLOCK_END
// return compiled code entry point after potential safepoints
assert(callee_method->verified_code_entry() != NULL, " Jump to zero!");
@@ -1307,9 +1309,9 @@ JRT_BLOCK_ENTRY(address, SharedRuntime::handle_wrong_method(JavaThread* thread))
if (caller_frame.is_interpreted_frame() ||
caller_frame.is_entry_frame()) {
- methodOop callee = thread->callee_target();
+ Method* callee = thread->callee_target();
guarantee(callee != NULL && callee->is_method(), "bad handshake");
- thread->set_vm_result(callee);
+ thread->set_vm_result_2(callee);
thread->set_callee_target(NULL);
return callee->get_c2i_entry();
}
@@ -1319,7 +1321,7 @@ JRT_BLOCK_ENTRY(address, SharedRuntime::handle_wrong_method(JavaThread* thread))
JRT_BLOCK
// Force resolving of caller (if we called from compiled frame)
callee_method = SharedRuntime::reresolve_call_site(thread, CHECK_NULL);
- thread->set_vm_result(callee_method());
+ thread->set_vm_result_2(callee_method());
JRT_BLOCK_END
// return compiled code entry point after potential safepoints
assert(callee_method->verified_code_entry() != NULL, " Jump to zero!");
@@ -1332,7 +1334,7 @@ JRT_BLOCK_ENTRY(address, SharedRuntime::resolve_static_call_C(JavaThread *thread
methodHandle callee_method;
JRT_BLOCK
callee_method = SharedRuntime::resolve_helper(thread, false, false, CHECK_NULL);
- thread->set_vm_result(callee_method());
+ thread->set_vm_result_2(callee_method());
JRT_BLOCK_END
// return compiled code entry point after potential safepoints
assert(callee_method->verified_code_entry() != NULL, " Jump to zero!");
@@ -1345,7 +1347,7 @@ JRT_BLOCK_ENTRY(address, SharedRuntime::resolve_virtual_call_C(JavaThread *threa
methodHandle callee_method;
JRT_BLOCK
callee_method = SharedRuntime::resolve_helper(thread, true, false, CHECK_NULL);
- thread->set_vm_result(callee_method());
+ thread->set_vm_result_2(callee_method());
JRT_BLOCK_END
// return compiled code entry point after potential safepoints
assert(callee_method->verified_code_entry() != NULL, " Jump to zero!");
@@ -1359,7 +1361,7 @@ JRT_BLOCK_ENTRY(address, SharedRuntime::resolve_opt_virtual_call_C(JavaThread *t
methodHandle callee_method;
JRT_BLOCK
callee_method = SharedRuntime::resolve_helper(thread, true, true, CHECK_NULL);
- thread->set_vm_result(callee_method());
+ thread->set_vm_result_2(callee_method());
JRT_BLOCK_END
// return compiled code entry point after potential safepoints
assert(callee_method->verified_code_entry() != NULL, " Jump to zero!");
@@ -1442,7 +1444,7 @@ methodHandle SharedRuntime::handle_ic_miss_helper(JavaThread *thread, TRAPS) {
CodeBlob* cb = caller_frame.cb();
if (cb->is_nmethod() && ((nmethod*)cb)->is_in_use()) {
// Not a non-entrant nmethod, so find inline_cache
- CompiledIC* inline_cache = CompiledIC_before(caller_frame.pc());
+ CompiledIC* inline_cache = CompiledIC_before(((nmethod*)cb), caller_frame.pc());
bool should_be_mono = false;
if (inline_cache->is_optimized()) {
if (TraceCallFixup) {
@@ -1452,9 +1454,9 @@ methodHandle SharedRuntime::handle_ic_miss_helper(JavaThread *thread, TRAPS) {
tty->print_cr(" code: " INTPTR_FORMAT, callee_method->code());
}
should_be_mono = true;
- } else {
- compiledICHolderOop ic_oop = (compiledICHolderOop) inline_cache->cached_oop();
- if ( ic_oop != NULL && ic_oop->is_compiledICHolder()) {
+ } else if (inline_cache->is_icholder_call()) {
+ CompiledICHolder* ic_oop = inline_cache->cached_icholder();
+ if ( ic_oop != NULL) {
if (receiver()->klass() == ic_oop->holder_klass()) {
// This isn't a real miss. We must have seen that compiled code
@@ -1591,7 +1593,7 @@ methodHandle SharedRuntime::reresolve_call_site(JavaThread *thread, TRAPS) {
ssc->set_to_clean();
} else {
// compiled, dispatched call (which used to call an interpreted method)
- CompiledIC* inline_cache = CompiledIC_at(call_addr);
+ CompiledIC* inline_cache = CompiledIC_at(caller_nm, call_addr);
inline_cache->set_to_clean();
}
}
@@ -1622,8 +1624,8 @@ methodHandle SharedRuntime::reresolve_call_site(JavaThread *thread, TRAPS) {
// where we went int -> i2c -> c2i and so the caller could in fact be
// interpreted. If the caller is compiled we attempt to patch the caller
// so he no longer calls into the interpreter.
-IRT_LEAF(void, SharedRuntime::fixup_callers_callsite(methodOopDesc* method, address caller_pc))
- methodOop moop(method);
+IRT_LEAF(void, SharedRuntime::fixup_callers_callsite(Method* method, address caller_pc))
+ Method* moop(method);
address entry_point = moop->from_compiled_entry();
@@ -1634,7 +1636,7 @@ IRT_LEAF(void, SharedRuntime::fixup_callers_callsite(methodOopDesc* method, addr
// Also it is possible that we lost a race in that from_compiled_entry
// is now back to the i2c in that case we don't need to patch and if
// we did we'd leap into space because the callsite needs to use
- // "to interpreter" stub in order to load up the methodOop. Don't
+ // "to interpreter" stub in order to load up the Method*. Don't
// ask me how I know this...
CodeBlob* cb = CodeCache::find_blob(caller_pc);
@@ -1907,7 +1909,7 @@ class MethodArityHistogram {
static int _max_size; // max. arg size seen
static void add_method_to_histogram(nmethod* nm) {
- methodOop m = nm->method();
+ Method* m = nm->method();
ArgumentCount args(m->signature());
int arity = args.size() + (m->is_static() ? 0 : 1);
int argsize = m->size_of_parameters();
@@ -2800,7 +2802,7 @@ JRT_LEAF(intptr_t*, SharedRuntime::OSR_migration_begin( JavaThread *thread) )
// QQQ we could place number of active monitors in the array so that compiled code
// could double check it.
- methodOop moop = fr.interpreter_frame_method();
+ Method* moop = fr.interpreter_frame_method();
int max_locals = moop->max_locals();
// Allocate temp buffer, 1 word per local & 2 per active monitor
int buf_size_words = max_locals + active_monitor_count*2;
diff --git a/src/share/vm/runtime/sharedRuntime.hpp b/src/share/vm/runtime/sharedRuntime.hpp
index 83e1dbf98..014ec503c 100644
--- a/src/share/vm/runtime/sharedRuntime.hpp
+++ b/src/share/vm/runtime/sharedRuntime.hpp
@@ -234,7 +234,7 @@ class SharedRuntime: AllStatic {
static void throw_and_post_jvmti_exception(JavaThread *thread, Symbol* name, const char *message = NULL);
// RedefineClasses() tracing support for obsolete method entry
- static int rc_trace_method_entry(JavaThread* thread, methodOopDesc* m);
+ static int rc_trace_method_entry(JavaThread* thread, Method* m);
// To be used as the entry point for unresolved native methods.
static address native_method_throw_unsatisfied_link_error_entry();
@@ -253,8 +253,8 @@ class SharedRuntime: AllStatic {
// dtrace notifications
static int dtrace_object_alloc(oopDesc* o);
static int dtrace_object_alloc_base(Thread* thread, oopDesc* o);
- static int dtrace_method_entry(JavaThread* thread, methodOopDesc* m);
- static int dtrace_method_exit(JavaThread* thread, methodOopDesc* m);
+ static int dtrace_method_entry(JavaThread* thread, Method* m);
+ static int dtrace_method_exit(JavaThread* thread, Method* m);
// Utility method for retrieving the Java thread id, returns 0 if the
// thread is not a well formed Java thread.
@@ -452,7 +452,7 @@ class SharedRuntime: AllStatic {
// A compiled caller has just called the interpreter, but compiled code
// exists. Patch the caller so he no longer calls into the interpreter.
- static void fixup_callers_callsite(methodOopDesc* moop, address ret_pc);
+ static void fixup_callers_callsite(Method* moop, address ret_pc);
// Slow-path Locking and Unlocking
static void complete_monitor_locking_C(oopDesc* obj, BasicLock* lock, JavaThread* thread);
diff --git a/src/share/vm/runtime/signature.cpp b/src/share/vm/runtime/signature.cpp
index cb4af9038..4599928b8 100644
--- a/src/share/vm/runtime/signature.cpp
+++ b/src/share/vm/runtime/signature.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -336,7 +336,7 @@ Symbol* SignatureStream::as_symbol(TRAPS) {
return name;
}
-klassOop SignatureStream::as_klass(Handle class_loader, Handle protection_domain,
+Klass* SignatureStream::as_klass(Handle class_loader, Handle protection_domain,
FailureMode failure_mode, TRAPS) {
if (!is_object()) return NULL;
Symbol* name = as_symbol(CHECK_NULL);
@@ -352,7 +352,7 @@ oop SignatureStream::as_java_mirror(Handle class_loader, Handle protection_domai
FailureMode failure_mode, TRAPS) {
if (!is_object())
return Universe::java_mirror(type());
- klassOop klass = as_klass(class_loader, protection_domain, failure_mode, CHECK_NULL);
+ Klass* klass = as_klass(class_loader, protection_domain, failure_mode, CHECK_NULL);
if (klass == NULL) return NULL;
return Klass::cast(klass)->java_mirror();
}
diff --git a/src/share/vm/runtime/signature.hpp b/src/share/vm/runtime/signature.hpp
index 6d211f007..33c8c8232 100644
--- a/src/share/vm/runtime/signature.hpp
+++ b/src/share/vm/runtime/signature.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -26,7 +26,7 @@
#define SHARE_VM_RUNTIME_SIGNATURE_HPP
#include "memory/allocation.hpp"
-#include "oops/methodOop.hpp"
+#include "oops/method.hpp"
#include "utilities/top.hpp"
// SignatureIterators iterate over a Java signature (or parts of it).
@@ -394,7 +394,7 @@ class SignatureStream : public StackObj {
BasicType type() const { return _type; }
Symbol* as_symbol(TRAPS);
enum FailureMode { ReturnNull, CNFException, NCDFError };
- klassOop as_klass(Handle class_loader, Handle protection_domain, FailureMode failure_mode, TRAPS);
+ Klass* as_klass(Handle class_loader, Handle protection_domain, FailureMode failure_mode, TRAPS);
oop as_java_mirror(Handle class_loader, Handle protection_domain, FailureMode failure_mode, TRAPS);
const jbyte* raw_bytes() { return _signature->bytes() + _begin; }
int raw_length() { return _end - _begin; }
diff --git a/src/share/vm/runtime/simpleThresholdPolicy.cpp b/src/share/vm/runtime/simpleThresholdPolicy.cpp
index 0ebc560a5..ecf3d01df 100644
--- a/src/share/vm/runtime/simpleThresholdPolicy.cpp
+++ b/src/share/vm/runtime/simpleThresholdPolicy.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2012, 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
@@ -34,10 +34,10 @@
void SimpleThresholdPolicy::print_counters(const char* prefix, methodHandle mh) {
int invocation_count = mh->invocation_count();
int backedge_count = mh->backedge_count();
- methodDataHandle mdh = mh->method_data();
+ MethodData* mdh = mh->method_data();
int mdo_invocations = 0, mdo_backedges = 0;
int mdo_invocations_start = 0, mdo_backedges_start = 0;
- if (mdh() != NULL) {
+ if (mdh != NULL) {
mdo_invocations = mdh->invocation_count();
mdo_backedges = mdh->backedge_count();
mdo_invocations_start = mdh->invocation_count_start();
@@ -147,10 +147,10 @@ void SimpleThresholdPolicy::set_carry_if_necessary(InvocationCounter *counter) {
}
// Set carry flags on the counters if necessary
-void SimpleThresholdPolicy::handle_counter_overflow(methodOop method) {
+void SimpleThresholdPolicy::handle_counter_overflow(Method* method) {
set_carry_if_necessary(method->invocation_counter());
set_carry_if_necessary(method->backedge_counter());
- methodDataOop mdo = method->method_data();
+ MethodData* mdo = method->method_data();
if (mdo != NULL) {
set_carry_if_necessary(mdo->invocation_counter());
set_carry_if_necessary(mdo->backedge_counter());
@@ -168,7 +168,7 @@ void SimpleThresholdPolicy::reprofile(ScopeDesc* trap_scope, bool is_osr) {
methodHandle mh(sd->method());
print_event(REPROFILE, mh, mh, InvocationEntryBci, CompLevel_none);
}
- methodDataOop mdo = sd->method()->method_data();
+ MethodData* mdo = sd->method()->method_data();
if (mdo != NULL) {
mdo->reset_start_counters();
}
@@ -272,9 +272,9 @@ bool SimpleThresholdPolicy::call_predicate(int i, int b, CompLevel cur_level) {
}
// Determine is a method is mature.
-bool SimpleThresholdPolicy::is_mature(methodOop method) {
+bool SimpleThresholdPolicy::is_mature(Method* method) {
if (is_trivial(method)) return true;
- methodDataOop mdo = method->method_data();
+ MethodData* mdo = method->method_data();
if (mdo != NULL) {
int i = mdo->invocation_count();
int b = mdo->backedge_count();
@@ -286,7 +286,7 @@ bool SimpleThresholdPolicy::is_mature(methodOop method) {
}
// Common transition function. Given a predicate determines if a method should transition to another level.
-CompLevel SimpleThresholdPolicy::common(Predicate p, methodOop method, CompLevel cur_level) {
+CompLevel SimpleThresholdPolicy::common(Predicate p, Method* method, CompLevel cur_level) {
CompLevel next_level = cur_level;
int i = method->invocation_count();
int b = method->backedge_count();
@@ -306,7 +306,7 @@ CompLevel SimpleThresholdPolicy::common(Predicate p, methodOop method, CompLevel
case CompLevel_limited_profile:
case CompLevel_full_profile:
{
- methodDataOop mdo = method->method_data();
+ MethodData* mdo = method->method_data();
if (mdo != NULL) {
if (mdo->would_profile()) {
int mdo_i = mdo->invocation_count_delta();
@@ -326,7 +326,7 @@ CompLevel SimpleThresholdPolicy::common(Predicate p, methodOop method, CompLevel
}
// Determine if a method should be compiled with a normal entry point at a different level.
-CompLevel SimpleThresholdPolicy::call_event(methodOop method, CompLevel cur_level) {
+CompLevel SimpleThresholdPolicy::call_event(Method* method, CompLevel cur_level) {
CompLevel osr_level = MIN2((CompLevel) method->highest_osr_comp_level(),
common(&SimpleThresholdPolicy::loop_predicate, method, cur_level));
CompLevel next_level = common(&SimpleThresholdPolicy::call_predicate, method, cur_level);
@@ -335,7 +335,7 @@ CompLevel SimpleThresholdPolicy::call_event(methodOop method, CompLevel cur_lev
// equalized by raising the regular method level in order to avoid OSRs during each
// invocation of the method.
if (osr_level == CompLevel_full_optimization && cur_level == CompLevel_full_profile) {
- methodDataOop mdo = method->method_data();
+ MethodData* mdo = method->method_data();
guarantee(mdo != NULL, "MDO should not be NULL");
if (mdo->invocation_count() >= 1) {
next_level = CompLevel_full_optimization;
@@ -348,7 +348,7 @@ CompLevel SimpleThresholdPolicy::call_event(methodOop method, CompLevel cur_lev
}
// Determine if we should do an OSR compilation of a given method.
-CompLevel SimpleThresholdPolicy::loop_event(methodOop method, CompLevel cur_level) {
+CompLevel SimpleThresholdPolicy::loop_event(Method* method, CompLevel cur_level) {
CompLevel next_level = common(&SimpleThresholdPolicy::loop_predicate, method, cur_level);
if (cur_level == CompLevel_none) {
// If there is a live OSR method that means that we deopted to the interpreter
diff --git a/src/share/vm/runtime/simpleThresholdPolicy.hpp b/src/share/vm/runtime/simpleThresholdPolicy.hpp
index e22819808..49a9d8934 100644
--- a/src/share/vm/runtime/simpleThresholdPolicy.hpp
+++ b/src/share/vm/runtime/simpleThresholdPolicy.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2012, 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
@@ -26,7 +26,7 @@
#define SHARE_VM_RUNTIME_SIMPLETHRESHOLDPOLICY_HPP
#include "code/nmethod.hpp"
-#include "oops/methodDataOop.hpp"
+#include "oops/methodData.hpp"
#include "runtime/compilationPolicy.hpp"
#include "utilities/globalDefinitions.hpp"
@@ -38,8 +38,8 @@ class SimpleThresholdPolicy : public CompilationPolicy {
// Check if the counter is big enough and set carry (effectively infinity).
inline void set_carry_if_necessary(InvocationCounter *counter);
- // Set carry flags in the counters (in methodOop and MDO).
- inline void handle_counter_overflow(methodOop method);
+ // Set carry flags in the counters (in Method* and MDO).
+ inline void handle_counter_overflow(Method* method);
// Call and loop predicates determine whether a transition to a higher compilation
// level should be performed (pointers to predicate functions are passed to common_TF().
// Predicates also take compiler load into account.
@@ -47,14 +47,14 @@ class SimpleThresholdPolicy : public CompilationPolicy {
bool call_predicate(int i, int b, CompLevel cur_level);
bool loop_predicate(int i, int b, CompLevel cur_level);
// Common transition function. Given a predicate determines if a method should transition to another level.
- CompLevel common(Predicate p, methodOop method, CompLevel cur_level);
+ CompLevel common(Predicate p, Method* method, CompLevel cur_level);
// Transition functions.
// call_event determines if a method should be compiled at a different
// level with a regular invocation entry.
- CompLevel call_event(methodOop method, CompLevel cur_level);
+ CompLevel call_event(Method* method, CompLevel cur_level);
// loop_event checks if a method should be OSR compiled at a different
// level.
- CompLevel loop_event(methodOop method, CompLevel cur_level);
+ CompLevel loop_event(Method* method, CompLevel cur_level);
void print_counters(const char* prefix, methodHandle mh);
protected:
int c1_count() const { return _c1_count; }
@@ -72,7 +72,7 @@ protected:
virtual void submit_compile(methodHandle mh, int bci, CompLevel level, JavaThread* thread);
// Simple methods are as good being compiled with C1 as C2.
// This function tells if it's such a function.
- inline bool is_trivial(methodOop method);
+ inline bool is_trivial(Method* method);
// Predicate helpers are used by .*_predicate() methods as well as others.
// They check the given counter values, multiplied by the scale against the thresholds.
@@ -80,7 +80,7 @@ protected:
template<CompLevel level> static inline bool loop_predicate_helper(int i, int b, double scale);
// Get a compilation level for a given method.
- static CompLevel comp_level(methodOop method) {
+ static CompLevel comp_level(Method* method) {
nmethod *nm = method->code();
if (nm != NULL && nm->is_in_use()) {
return (CompLevel)nm->comp_level();
@@ -100,15 +100,15 @@ public:
}
virtual CompLevel initial_compile_level() { return MIN2((CompLevel)TieredStopAtLevel, CompLevel_initial_compile); }
virtual void do_safepoint_work() { }
- virtual void delay_compilation(methodOop method) { }
- virtual void disable_compilation(methodOop method) { }
+ virtual void delay_compilation(Method* method) { }
+ virtual void disable_compilation(Method* method) { }
virtual void reprofile(ScopeDesc* trap_scope, bool is_osr);
virtual nmethod* event(methodHandle method, methodHandle inlinee,
int branch_bci, int bci, CompLevel comp_level, nmethod* nm, JavaThread* thread);
// Select task is called by CompileBroker. We should return a task or NULL.
virtual CompileTask* select_task(CompileQueue* compile_queue);
// Tell the runtime if we think a given method is adequately profiled.
- virtual bool is_mature(methodOop method);
+ virtual bool is_mature(Method* method);
// Initialize: set compiler thread count
virtual void initialize();
virtual bool should_not_inline(ciEnv* env, ciMethod* callee) {
diff --git a/src/share/vm/runtime/simpleThresholdPolicy.inline.hpp b/src/share/vm/runtime/simpleThresholdPolicy.inline.hpp
index 8abc9ace1..4917f766f 100644
--- a/src/share/vm/runtime/simpleThresholdPolicy.inline.hpp
+++ b/src/share/vm/runtime/simpleThresholdPolicy.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
@@ -53,10 +53,10 @@ bool SimpleThresholdPolicy::loop_predicate_helper(int i, int b, double scale) {
// Simple methods are as good being compiled with C1 as C2.
// Determine if a given method is such a case.
-bool SimpleThresholdPolicy::is_trivial(methodOop method) {
+bool SimpleThresholdPolicy::is_trivial(Method* method) {
if (method->is_accessor()) return true;
if (method->code() != NULL) {
- methodDataOop mdo = method->method_data();
+ MethodData* mdo = method->method_data();
if (mdo != NULL && mdo->num_loops() == 0 &&
(method->code_size() < 5 || (mdo->num_blocks() < 4) && (method->code_size() < 15))) {
return !mdo->would_profile();
diff --git a/src/share/vm/runtime/stackValue.cpp b/src/share/vm/runtime/stackValue.cpp
index c761e1461..ce274103d 100644
--- a/src/share/vm/runtime/stackValue.cpp
+++ b/src/share/vm/runtime/stackValue.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -145,7 +145,7 @@ StackValue* StackValue::create_stack_value(const frame* fr, const RegisterMap* r
return new StackValue(value.p);
} else if (sv->is_constant_oop()) {
// constant oop
- return new StackValue(((ConstantOopReadValue *)sv)->value());
+ return new StackValue(sv->as_ConstantOopReadValue()->value());
#ifdef _LP64
} else if (sv->is_constant_double()) {
// Constant double in a single stack slot
diff --git a/src/share/vm/runtime/stubRoutines.hpp b/src/share/vm/runtime/stubRoutines.hpp
index eca252698..0e583aea0 100644
--- a/src/share/vm/runtime/stubRoutines.hpp
+++ b/src/share/vm/runtime/stubRoutines.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -240,7 +240,7 @@ class StubRoutines: AllStatic {
address link,
intptr_t* result,
BasicType result_type,
- methodOopDesc* method,
+ Method* method,
address entry_point,
intptr_t* parameters,
int size_of_parameters,
diff --git a/src/share/vm/runtime/sweeper.cpp b/src/share/vm/runtime/sweeper.cpp
index 2dea6d7ba..7c516dfe9 100644
--- a/src/share/vm/runtime/sweeper.cpp
+++ b/src/share/vm/runtime/sweeper.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -24,10 +24,12 @@
#include "precompiled.hpp"
#include "code/codeCache.hpp"
+#include "code/compiledIC.hpp"
+#include "code/icBuffer.hpp"
#include "code/nmethod.hpp"
#include "compiler/compileBroker.hpp"
#include "memory/resourceArea.hpp"
-#include "oops/methodOop.hpp"
+#include "oops/method.hpp"
#include "runtime/atomic.hpp"
#include "runtime/compilationPolicy.hpp"
#include "runtime/mutexLocker.hpp"
@@ -324,13 +326,32 @@ class NMethodMarker: public StackObj {
public:
NMethodMarker(nmethod* nm) {
_thread = CompilerThread::current();
+ if (!nm->is_zombie() && !nm->is_unloaded()) {
+ // Only expose live nmethods for scanning
_thread->set_scanned_nmethod(nm);
}
+ }
~NMethodMarker() {
_thread->set_scanned_nmethod(NULL);
}
};
+void NMethodSweeper::release_nmethod(nmethod *nm) {
+ // Clean up any CompiledICHolders
+ {
+ ResourceMark rm;
+ MutexLocker ml_patch(CompiledIC_lock);
+ RelocIterator iter(nm);
+ while (iter.next()) {
+ if (iter.type() == relocInfo::virtual_call_type) {
+ CompiledIC::cleanup_call_site(iter.virtual_call_reloc());
+ }
+ }
+ }
+
+ MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
+ nm->flush();
+}
void NMethodSweeper::process_nmethod(nmethod *nm) {
assert(!CodeCache_lock->owned_by_self(), "just checking");
@@ -365,8 +386,7 @@ void NMethodSweeper::process_nmethod(nmethod *nm) {
if (PrintMethodFlushing && Verbose) {
tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (marked for reclamation) being flushed", nm->compile_id(), nm);
}
- MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
- nm->flush();
+ release_nmethod(nm);
} else {
if (PrintMethodFlushing && Verbose) {
tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (zombie) being marked for reclamation", nm->compile_id(), nm);
@@ -400,10 +420,9 @@ void NMethodSweeper::process_nmethod(nmethod *nm) {
if (PrintMethodFlushing && Verbose)
tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (unloaded) being made zombie", nm->compile_id(), nm);
if (nm->is_osr_method()) {
- // No inline caches will ever point to osr methods, so we can just remove it
- MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
SWEEP(nm);
- nm->flush();
+ // No inline caches will ever point to osr methods, so we can just remove it
+ release_nmethod(nm);
} else {
nm->make_zombie();
_rescan = true;
@@ -434,8 +453,8 @@ void NMethodSweeper::process_nmethod(nmethod *nm) {
// saving the old code in a list in the CodeCache. Then
// execution resumes. If a method so marked is not called by the second sweeper
// stack traversal after the current one, the nmethod will be marked non-entrant and
-// got rid of by normal sweeping. If the method is called, the methodOop's
-// _code field is restored and the methodOop/nmethod
+// got rid of by normal sweeping. If the method is called, the Method*'s
+// _code field is restored and the Method*/nmethod
// go back to their normal state.
void NMethodSweeper::handle_full_code_cache(bool is_full) {
// Only the first one to notice can advise us to start early cleaning
diff --git a/src/share/vm/runtime/sweeper.hpp b/src/share/vm/runtime/sweeper.hpp
index f9ccb5353..f6e9bc309 100644
--- a/src/share/vm/runtime/sweeper.hpp
+++ b/src/share/vm/runtime/sweeper.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -52,6 +52,8 @@ class NMethodSweeper : public AllStatic {
static void process_nmethod(nmethod *nm);
+ static void release_nmethod(nmethod* nm);
+
static void log_sweep(const char* msg, const char* format = NULL, ...);
public:
diff --git a/src/share/vm/runtime/synchronizer.cpp b/src/share/vm/runtime/synchronizer.cpp
index f2c3da08c..021998d02 100644
--- a/src/share/vm/runtime/synchronizer.cpp
+++ b/src/share/vm/runtime/synchronizer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
@@ -77,11 +77,11 @@
// Only bother with this argument setup if dtrace is available
// TODO-FIXME: probes should not fire when caller is _blocked. assert() accordingly.
-#define DTRACE_MONITOR_PROBE_COMMON(klassOop, thread) \
+#define DTRACE_MONITOR_PROBE_COMMON(obj, thread) \
char* bytes = NULL; \
int len = 0; \
jlong jtid = SharedRuntime::get_java_tid(thread); \
- Symbol* klassname = ((oop)(klassOop))->klass()->klass_part()->name(); \
+ Symbol* klassname = ((oop)(obj))->klass()->name(); \
if (klassname != NULL) { \
bytes = (char*)klassname->bytes(); \
len = klassname->utf8_length(); \
@@ -93,19 +93,19 @@ HS_DTRACE_PROBE_DECL5(hotspot, monitor__wait,
HS_DTRACE_PROBE_DECL4(hotspot, monitor__waited,
jlong, uintptr_t, char*, int);
-#define DTRACE_MONITOR_WAIT_PROBE(monitor, klassOop, thread, millis) \
+#define DTRACE_MONITOR_WAIT_PROBE(monitor, obj, thread, millis) \
{ \
if (DTraceMonitorProbes) { \
- DTRACE_MONITOR_PROBE_COMMON(klassOop, thread); \
+ DTRACE_MONITOR_PROBE_COMMON(obj, thread); \
HS_DTRACE_PROBE5(hotspot, monitor__wait, jtid, \
(monitor), bytes, len, (millis)); \
} \
}
-#define DTRACE_MONITOR_PROBE(probe, monitor, klassOop, thread) \
+#define DTRACE_MONITOR_PROBE(probe, monitor, obj, thread) \
{ \
if (DTraceMonitorProbes) { \
- DTRACE_MONITOR_PROBE_COMMON(klassOop, thread); \
+ DTRACE_MONITOR_PROBE_COMMON(obj, thread); \
HS_DTRACE_PROBE4(hotspot, monitor__##probe, jtid, \
(uintptr_t)(monitor), bytes, len); \
} \
@@ -113,10 +113,10 @@ HS_DTRACE_PROBE_DECL4(hotspot, monitor__waited,
#else /* USDT2 */
-#define DTRACE_MONITOR_WAIT_PROBE(monitor, klassOop, thread, millis) \
+#define DTRACE_MONITOR_WAIT_PROBE(monitor, obj, thread, millis) \
{ \
if (DTraceMonitorProbes) { \
- DTRACE_MONITOR_PROBE_COMMON(klassOop, thread); \
+ DTRACE_MONITOR_PROBE_COMMON(obj, thread); \
HOTSPOT_MONITOR_WAIT(jtid, \
(uintptr_t)(monitor), bytes, len, (millis)); \
} \
@@ -124,10 +124,10 @@ HS_DTRACE_PROBE_DECL4(hotspot, monitor__waited,
#define HOTSPOT_MONITOR_PROBE_waited HOTSPOT_MONITOR_PROBE_WAITED
-#define DTRACE_MONITOR_PROBE(probe, monitor, klassOop, thread) \
+#define DTRACE_MONITOR_PROBE(probe, monitor, obj, thread) \
{ \
if (DTraceMonitorProbes) { \
- DTRACE_MONITOR_PROBE_COMMON(klassOop, thread); \
+ DTRACE_MONITOR_PROBE_COMMON(obj, thread); \
HOTSPOT_MONITOR_PROBE_##probe(jtid, /* probe = waited */ \
(uintptr_t)(monitor), bytes, len); \
} \
@@ -136,8 +136,8 @@ HS_DTRACE_PROBE_DECL4(hotspot, monitor__waited,
#endif /* USDT2 */
#else // ndef DTRACE_ENABLED
-#define DTRACE_MONITOR_WAIT_PROBE(klassOop, thread, millis, mon) {;}
-#define DTRACE_MONITOR_PROBE(probe, klassOop, thread, mon) {;}
+#define DTRACE_MONITOR_WAIT_PROBE(obj, thread, millis, mon) {;}
+#define DTRACE_MONITOR_PROBE(probe, obj, thread, mon) {;}
#endif // ndef DTRACE_ENABLED
diff --git a/src/share/vm/runtime/thread.cpp b/src/share/vm/runtime/thread.cpp
index 76d0c8de1..5eceab041 100644
--- a/src/share/vm/runtime/thread.cpp
+++ b/src/share/vm/runtime/thread.cpp
@@ -34,6 +34,7 @@
#include "interpreter/oopMapCache.hpp"
#include "jvmtifiles/jvmtiEnv.hpp"
#include "memory/gcLocker.inline.hpp"
+#include "memory/metaspaceShared.hpp"
#include "memory/oopFactory.hpp"
#include "memory/universe.inline.hpp"
#include "oops/instanceKlass.hpp"
@@ -219,6 +220,7 @@ Thread::Thread() {
set_osthread(NULL);
set_resource_area(new (mtThread)ResourceArea());
set_handle_area(new (mtThread) HandleArea(NULL));
+ set_metadata_handles(new (ResourceObj::C_HEAP, mtClass) GrowableArray<Metadata*>(300, true));
set_active_handles(NULL);
set_free_handle_block(NULL);
set_last_handle_mark(NULL);
@@ -346,6 +348,7 @@ Thread::~Thread() {
ParkEvent::Release (_MuxEvent) ; _MuxEvent = NULL ;
delete handle_area();
+ delete metadata_handles();
// osthread() can be NULL, if creation of thread failed.
if (osthread() != NULL) os::free_thread(osthread());
@@ -817,6 +820,14 @@ void Thread::nmethods_do(CodeBlobClosure* cf) {
// no nmethods in a generic thread...
}
+void Thread::metadata_do(void f(Metadata*)) {
+ if (metadata_handles() != NULL) {
+ for (int i = 0; i< metadata_handles()->length(); i++) {
+ f(metadata_handles()->at(i));
+ }
+ }
+}
+
void Thread::print_on(outputStream* st) const {
// get_priority assumes osthread initialized
if (osthread() != NULL) {
@@ -916,6 +927,8 @@ void Thread::check_for_valid_safepoint_state(bool potential_vm_operation) {
bool Thread::is_in_stack(address adr) const {
assert(Thread::current() == this, "is_in_stack can only be called from current thread");
address end = os::current_stack_pointer();
+ // Allow non Java threads to call this without stack_base
+ if (_stack_base == NULL) return true;
if (stack_base() >= adr && adr >= end) return true;
return false;
@@ -937,14 +950,14 @@ bool Thread::set_as_starting_thread() {
}
static void initialize_class(Symbol* class_name, TRAPS) {
- klassOop klass = SystemDictionary::resolve_or_fail(class_name, true, CHECK);
- instanceKlass::cast(klass)->initialize(CHECK);
+ Klass* klass = SystemDictionary::resolve_or_fail(class_name, true, CHECK);
+ InstanceKlass::cast(klass)->initialize(CHECK);
}
// Creates the initial ThreadGroup
static Handle create_initial_thread_group(TRAPS) {
- klassOop k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_ThreadGroup(), true, CHECK_NH);
+ Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_ThreadGroup(), true, CHECK_NH);
instanceKlassHandle klass (THREAD, k);
Handle system_instance = klass->allocate_instance_handle(CHECK_NH);
@@ -977,7 +990,7 @@ static Handle create_initial_thread_group(TRAPS) {
// Creates the initial Thread
static oop create_initial_thread(Handle thread_group, JavaThread* thread, TRAPS) {
- klassOop k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_Thread(), true, CHECK_NULL);
+ Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_Thread(), true, CHECK_NULL);
instanceKlassHandle klass (THREAD, k);
instanceHandle thread_oop = klass->allocate_instance_handle(CHECK_NULL);
@@ -999,7 +1012,7 @@ static oop create_initial_thread(Handle thread_group, JavaThread* thread, TRAPS)
}
static void call_initializeSystemClass(TRAPS) {
- klassOop k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), true, CHECK);
+ Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), true, CHECK);
instanceKlassHandle klass (THREAD, k);
JavaValue result(T_VOID);
@@ -1011,11 +1024,11 @@ char java_runtime_name[128] = "";
// extract the JRE name from sun.misc.Version.java_runtime_name
static const char* get_java_runtime_name(TRAPS) {
- klassOop k = SystemDictionary::find(vmSymbols::sun_misc_Version(),
+ Klass* k = SystemDictionary::find(vmSymbols::sun_misc_Version(),
Handle(), Handle(), CHECK_AND_CLEAR_NULL);
fieldDescriptor fd;
bool found = k != NULL &&
- instanceKlass::cast(k)->find_local_field(vmSymbols::java_runtime_name_name(),
+ InstanceKlass::cast(k)->find_local_field(vmSymbols::java_runtime_name_name(),
vmSymbols::string_signature(), &fd);
if (found) {
oop name_oop = k->java_mirror()->obj_field(fd.offset());
@@ -1033,7 +1046,7 @@ static const char* get_java_runtime_name(TRAPS) {
// General purpose hook into Java code, run once when the VM is initialized.
// The Java library method itself may be changed independently from the VM.
static void call_postVMInitHook(TRAPS) {
- klassOop k = SystemDictionary::PostVMInitHook_klass();
+ Klass* k = SystemDictionary::PostVMInitHook_klass();
instanceKlassHandle klass (THREAD, k);
if (klass.not_null()) {
JavaValue result(T_VOID);
@@ -1049,7 +1062,7 @@ static void reset_vm_info_property(TRAPS) {
const char *vm_info = VM_Version::vm_info_string();
// java.lang.System class
- klassOop k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), true, CHECK);
+ Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), true, CHECK);
instanceKlassHandle klass (THREAD, k);
// setProperty arguments
@@ -1074,7 +1087,7 @@ void JavaThread::allocate_threadObj(Handle thread_group, char* thread_name, bool
assert(thread_group.not_null(), "thread group should be specified");
assert(threadObj() == NULL, "should only create Java thread object once");
- klassOop k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_Thread(), true, CHECK);
+ Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_Thread(), true, CHECK);
instanceKlassHandle klass (THREAD, k);
instanceHandle thread_oop = klass->allocate_instance_handle(CHECK);
@@ -1982,7 +1995,7 @@ void JavaThread::check_and_handle_async_exceptions(bool check_unsafe_error) {
frame f = last_frame();
tty->print(" (pc: " INTPTR_FORMAT " sp: " INTPTR_FORMAT " )", f.pc(), f.sp());
}
- tty->print_cr(" of type: %s", instanceKlass::cast(_pending_async_exception->klass())->external_name());
+ tty->print_cr(" of type: %s", InstanceKlass::cast(_pending_async_exception->klass())->external_name());
}
_pending_async_exception = NULL;
clear_has_async_exception();
@@ -2103,10 +2116,10 @@ void JavaThread::send_thread_stop(oop java_throwable) {
if (TraceExceptions) {
ResourceMark rm;
- tty->print_cr("Pending Async. exception installed of type: %s", instanceKlass::cast(_pending_async_exception->klass())->external_name());
+ tty->print_cr("Pending Async. exception installed of type: %s", InstanceKlass::cast(_pending_async_exception->klass())->external_name());
}
// for AbortVMOnException flag
- NOT_PRODUCT(Exceptions::debug_check_abort(instanceKlass::cast(_pending_async_exception->klass())->external_name()));
+ NOT_PRODUCT(Exceptions::debug_check_abort(InstanceKlass::cast(_pending_async_exception->klass())->external_name()));
}
}
@@ -2656,7 +2669,6 @@ void JavaThread::oops_do(OopClosure* f, CodeBlobClosure* cf) {
// around using this function
f->do_oop((oop*) &_threadObj);
f->do_oop((oop*) &_vm_result);
- f->do_oop((oop*) &_vm_result_2);
f->do_oop((oop*) &_exception_oop);
f->do_oop((oop*) &_pending_async_exception);
@@ -2679,6 +2691,22 @@ void JavaThread::nmethods_do(CodeBlobClosure* cf) {
}
}
+void JavaThread::metadata_do(void f(Metadata*)) {
+ Thread::metadata_do(f);
+ if (has_last_Java_frame()) {
+ // Traverse the execution stack to call f() on the methods in the stack
+ for(StackFrameStream fst(this); !fst.is_done(); fst.next()) {
+ fst.current()->metadata_do(f);
+ }
+ } else if (is_Compiler_thread()) {
+ // need to walk ciMetadata in current compile tasks to keep alive.
+ CompilerThread* ct = (CompilerThread*)this;
+ if (ct->env() != NULL) {
+ ct->env()->metadata_do(f);
+ }
+ }
+}
+
// Printing
const char* _get_thread_state_name(JavaThreadState _thread_state) {
switch (_thread_state) {
@@ -2869,7 +2897,7 @@ void JavaThread::prepare(jobject jni_thread, ThreadPriority prio) {
Handle thread_oop(Thread::current(),
JNIHandles::resolve_non_null(jni_thread));
- assert(instanceKlass::cast(thread_oop->klass())->is_linked(),
+ assert(InstanceKlass::cast(thread_oop->klass())->is_linked(),
"must be initialized");
set_threadObj(thread_oop());
java_lang_Thread::set_thread(thread_oop(), this);
@@ -3070,7 +3098,7 @@ javaVFrame* JavaThread::last_java_vframe(RegisterMap *reg_map) {
}
-klassOop JavaThread::security_get_caller_class(int depth) {
+Klass* JavaThread::security_get_caller_class(int depth) {
vframeStream vfst(this);
vfst.security_get_caller_frame(depth);
if (!vfst.at_end()) {
@@ -3123,6 +3151,9 @@ int Threads::_number_of_threads = 0;
int Threads::_number_of_non_daemon_threads = 0;
int Threads::_return_code = 0;
size_t JavaThread::_stack_size_at_create = 0;
+#ifdef ASSERT
+bool Threads::_vm_complete = false;
+#endif
// All JavaThreads
#define ALL_JAVA_THREADS(X) for (JavaThread* X = _thread_list; X; X = X->next())
@@ -3320,9 +3351,8 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
// At this point, the Universe is initialized, but we have not executed
// any byte code. Now is a good time (the only time) to dump out the
// internal state of the JVM for sharing.
-
if (DumpSharedSpaces) {
- Universe::heap()->preload_and_dump(CHECK_0);
+ MetaspaceShared::preload_and_dump(CHECK_0);
ShouldNotReachHere();
}
@@ -3351,10 +3381,10 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
// Forcibly initialize java/util/HashMap and mutate the private
// static final "frontCacheEnabled" field before we start creating instances
#ifdef ASSERT
- klassOop tmp_k = SystemDictionary::find(vmSymbols::java_util_HashMap(), Handle(), Handle(), CHECK_0);
+ Klass* tmp_k = SystemDictionary::find(vmSymbols::java_util_HashMap(), Handle(), Handle(), CHECK_0);
assert(tmp_k == NULL, "java/util/HashMap should not be loaded yet");
#endif
- klassOop k_o = SystemDictionary::resolve_or_null(vmSymbols::java_util_HashMap(), Handle(), Handle(), CHECK_0);
+ Klass* k_o = SystemDictionary::resolve_or_null(vmSymbols::java_util_HashMap(), Handle(), Handle(), CHECK_0);
KlassHandle k = KlassHandle(THREAD, k_o);
guarantee(k.not_null(), "Must find java/util/HashMap");
instanceKlassHandle ik = instanceKlassHandle(THREAD, k());
@@ -3369,7 +3399,7 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
if (UseStringCache) {
// Forcibly initialize java/lang/StringValue and mutate the private
// static final "stringCacheEnabled" field before we start creating instances
- klassOop k_o = SystemDictionary::resolve_or_null(vmSymbols::java_lang_StringValue(), Handle(), Handle(), CHECK_0);
+ Klass* k_o = SystemDictionary::resolve_or_null(vmSymbols::java_lang_StringValue(), Handle(), Handle(), CHECK_0);
// Possible that StringValue isn't present: if so, silently don't break
if (k_o != NULL) {
KlassHandle k = KlassHandle(THREAD, k_o);
@@ -3574,6 +3604,9 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
os::init_3();
create_vm_timer.end();
+#ifdef ASSERT
+ _vm_complete = true;
+#endif
return JNI_OK;
}
@@ -3781,7 +3814,7 @@ void JavaThread::invoke_shutdown_hooks() {
}
EXCEPTION_MARK;
- klassOop k =
+ Klass* k =
SystemDictionary::resolve_or_null(vmSymbols::java_lang_Shutdown(),
THREAD);
if (k != NULL) {
@@ -3840,6 +3873,9 @@ void JavaThread::invoke_shutdown_hooks() {
bool Threads::destroy_vm() {
JavaThread* thread = JavaThread::current();
+#ifdef ASSERT
+ _vm_complete = false;
+#endif
// Wait until we are the last non-daemon thread to execute
{ MutexLocker nu(Threads_lock);
while (Threads::number_of_non_daemon_threads() > 1 )
@@ -4100,6 +4136,12 @@ void Threads::nmethods_do(CodeBlobClosure* cf) {
VMThread::vm_thread()->nmethods_do(cf);
}
+void Threads::metadata_do(void f(Metadata*)) {
+ ALL_JAVA_THREADS(p) {
+ p->metadata_do(f);
+ }
+}
+
void Threads::gc_epilogue() {
ALL_JAVA_THREADS(p) {
p->gc_epilogue();
diff --git a/src/share/vm/runtime/thread.hpp b/src/share/vm/runtime/thread.hpp
index a375f264f..434afd9b2 100644
--- a/src/share/vm/runtime/thread.hpp
+++ b/src/share/vm/runtime/thread.hpp
@@ -417,6 +417,9 @@ class Thread: public ThreadShadow {
HandleArea* handle_area() const { return _handle_area; }
void set_handle_area(HandleArea* area) { _handle_area = area; }
+ GrowableArray<Metadata*>* metadata_handles() const { return _metadata_handles; }
+ void set_metadata_handles(GrowableArray<Metadata*>* handles){ _metadata_handles = handles; }
+
// Thread-Local Allocation Buffer (TLAB) support
ThreadLocalAllocBuffer& tlab() { return _tlab; }
void initialize_tlab() {
@@ -500,6 +503,9 @@ public:
// Sweeper support
void nmethods_do(CodeBlobClosure* cf);
+ // jvmtiRedefineClasses support
+ void metadata_do(void f(Metadata*));
+
// Used by fast lock support
virtual bool is_lock_owned(address adr) const;
@@ -520,6 +526,7 @@ public:
// Thread local handle area for allocation of handles within the VM
HandleArea* _handle_area;
+ GrowableArray<Metadata*>* _metadata_handles;
// Support for stack overflow handling, get_thread, etc.
address _stack_base;
@@ -790,18 +797,18 @@ class JavaThread: public Thread {
GrowableArray<jvmtiDeferredLocalVariableSet*>* _deferred_locals_updates;
// Handshake value for fixing 6243940. We need a place for the i2c
- // adapter to store the callee methodOop. This value is NEVER live
+ // adapter to store the callee Method*. This value is NEVER live
// across a gc point so it does NOT have to be gc'd
// The handshake is open ended since we can't be certain that it will
// be NULLed. This is because we rarely ever see the race and end up
// in handle_wrong_method which is the backend of the handshake. See
// code in i2c adapters and handle_wrong_method.
- methodOop _callee_target;
+ Method* _callee_target;
- // Oop results of VM runtime calls
- oop _vm_result; // Used to pass back an oop result into Java code, GC-preserved
- oop _vm_result_2; // Used to pass back an oop result into Java code, GC-preserved
+ // Used to pass back results to the interpreter or generated code running Java code.
+ oop _vm_result; // oop result is GC-preserved
+ Metadata* _vm_result_2; // non-oop result
// See ReduceInitialCardMarks: this holds the precise space interval of
// the most recent slow path allocation for which compiled code has
@@ -1218,15 +1225,15 @@ class JavaThread: public Thread {
void set_deopt_nmethod(nmethod* nm) { _deopt_nmethod = nm; }
nmethod* deopt_nmethod() { return _deopt_nmethod; }
- methodOop callee_target() const { return _callee_target; }
- void set_callee_target (methodOop x) { _callee_target = x; }
+ Method* callee_target() const { return _callee_target; }
+ void set_callee_target (Method* x) { _callee_target = x; }
// Oop results of vm runtime calls
oop vm_result() const { return _vm_result; }
void set_vm_result (oop x) { _vm_result = x; }
- oop vm_result_2() const { return _vm_result_2; }
- void set_vm_result_2 (oop x) { _vm_result_2 = x; }
+ Metadata* vm_result_2() const { return _vm_result_2; }
+ void set_vm_result_2 (Metadata* x) { _vm_result_2 = x; }
MemRegion deferred_card_mark() const { return _deferred_card_mark; }
void set_deferred_card_mark(MemRegion mr) { _deferred_card_mark = mr; }
@@ -1389,6 +1396,9 @@ class JavaThread: public Thread {
// Sweeper operations
void nmethods_do(CodeBlobClosure* cf);
+ // RedefineClasses Support
+ void metadata_do(void f(Metadata*));
+
// Memory management operations
void gc_epilogue();
void gc_prologue();
@@ -1419,7 +1429,7 @@ public:
// Returns method at 'depth' java or native frames down the stack
// Used for security checks
- klassOop security_get_caller_class(int depth);
+ Klass* security_get_caller_class(int depth);
// Print stack trace in external format
void print_stack_on(outputStream* st);
@@ -1836,6 +1846,9 @@ class Threads: AllStatic {
static int _number_of_threads;
static int _number_of_non_daemon_threads;
static int _return_code;
+#ifdef ASSERT
+ static bool _vm_complete;
+#endif
public:
// Thread management
@@ -1883,8 +1896,14 @@ class Threads: AllStatic {
// Sweeper
static void nmethods_do(CodeBlobClosure* cf);
+ // RedefineClasses support
+ static void metadata_do(void f(Metadata*));
+
static void gc_epilogue();
static void gc_prologue();
+#ifdef ASSERT
+ static bool is_vm_complete() { return _vm_complete; }
+#endif
// Verification
static void verify();
diff --git a/src/share/vm/runtime/unhandledOops.cpp b/src/share/vm/runtime/unhandledOops.cpp
index 3216da1f2..4cc584e8b 100644
--- a/src/share/vm/runtime/unhandledOops.cpp
+++ b/src/share/vm/runtime/unhandledOops.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, 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
@@ -84,7 +84,7 @@ bool match_oop_entry(void *op, UnhandledOopEntry e) {
void UnhandledOops::allow_unhandled_oop(oop* op) {
assert (CheckUnhandledOops, "should only be called with checking option");
- int i = _oop_list->find_at_end(op, match_oop_entry);
+ int i = _oop_list->find_from_end(op, match_oop_entry);
assert(i!=-1, "safe for gc oop not in unhandled_oop_list");
UnhandledOopEntry entry = _oop_list->at(i);
@@ -106,7 +106,7 @@ void UnhandledOops::unregister_unhandled_oop(oop* op) {
tty->print_cr("u "INTPTR_FORMAT, op);
}
- int i = _oop_list->find_at_end(op, match_oop_entry);
+ int i = _oop_list->find_from_end(op, match_oop_entry);
assert(i!=-1, "oop not in unhandled_oop_list");
_oop_list->remove_at(i);
}
diff --git a/src/share/vm/runtime/vframe.cpp b/src/share/vm/runtime/vframe.cpp
index 09e324f3d..b1c2db818 100644
--- a/src/share/vm/runtime/vframe.cpp
+++ b/src/share/vm/runtime/vframe.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -146,8 +146,8 @@ static void print_locked_object_class_name(outputStream* st, Handle obj, const c
if (obj.not_null()) {
st->print("\t- %s <" INTPTR_FORMAT "> ", lock_state, (address)obj());
if (obj->klass() == SystemDictionary::Class_klass()) {
- klassOop target_klass = java_lang_Class::as_klassOop(obj());
- st->print_cr("(a java.lang.Class for %s)", instanceKlass::cast(target_klass)->external_name());
+ Klass* target_klass = java_lang_Class::as_Klass(obj());
+ st->print_cr("(a java.lang.Class for %s)", InstanceKlass::cast(target_klass)->external_name());
} else {
Klass* k = Klass::cast(obj->klass());
st->print_cr("(a %s)", k->external_name());
@@ -161,7 +161,7 @@ void javaVFrame::print_lock_info_on(outputStream* st, int frame_count) {
// If this is the first frame, and java.lang.Object.wait(...) then print out the receiver.
if (frame_count == 0) {
if (method()->name() == vmSymbols::wait_name() &&
- instanceKlass::cast(method()->method_holder())->name() == vmSymbols::java_lang_Object()) {
+ InstanceKlass::cast(method()->method_holder())->name() == vmSymbols::java_lang_Object()) {
StackValueCollection* locs = locals();
if (!locs->is_empty()) {
StackValue* sv = locs->at(0);
@@ -186,7 +186,7 @@ void javaVFrame::print_lock_info_on(outputStream* st, int frame_count) {
MonitorInfo* monitor = mons->at(index);
if (monitor->eliminated() && is_compiled_frame()) { // Eliminated in compiled code
if (monitor->owner_is_scalar_replaced()) {
- Klass* k = Klass::cast(monitor->owner_klass());
+ Klass* k = java_lang_Class::as_Klass(monitor->owner_klass());
st->print("\t- eliminated <owner is scalar replaced> (a %s)", k->external_name());
} else {
oop obj = monitor->owner();
@@ -249,7 +249,7 @@ int interpretedVFrame::bci() const {
return method()->bci_from(bcp());
}
-methodOop interpretedVFrame::method() const {
+Method* interpretedVFrame::method() const {
return fr().interpreter_frame_method();
}
@@ -527,7 +527,7 @@ void javaVFrame::print() {
MonitorInfo* monitor = list->at(index);
tty->print("\t obj\t");
if (monitor->owner_is_scalar_replaced()) {
- Klass* k = Klass::cast(monitor->owner_klass());
+ Klass* k = java_lang_Class::as_Klass(monitor->owner_klass());
tty->print("( is scalar replaced %s)", k->external_name());
} else if (monitor->owner() == NULL) {
tty->print("( null )");
@@ -546,14 +546,14 @@ void javaVFrame::print() {
void javaVFrame::print_value() const {
- methodOop m = method();
- klassOop k = m->method_holder();
+ Method* m = method();
+ Klass* k = m->method_holder();
tty->print_cr("frame( sp=" INTPTR_FORMAT ", unextended_sp=" INTPTR_FORMAT ", fp=" INTPTR_FORMAT ", pc=" INTPTR_FORMAT ")",
_fr.sp(), _fr.unextended_sp(), _fr.fp(), _fr.pc());
tty->print("%s.%s", Klass::cast(k)->internal_name(), m->name()->as_C_string());
if (!m->is_native()) {
- Symbol* source_name = instanceKlass::cast(k)->source_file_name();
+ Symbol* source_name = InstanceKlass::cast(k)->source_file_name();
int line_number = m->line_number_from_bci(bci());
if (source_name != NULL && (line_number != -1)) {
tty->print("(%s:%d)", source_name->as_C_string(), line_number);
diff --git a/src/share/vm/runtime/vframe.hpp b/src/share/vm/runtime/vframe.hpp
index badfea52b..b6bf34fc9 100644
--- a/src/share/vm/runtime/vframe.hpp
+++ b/src/share/vm/runtime/vframe.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -106,7 +106,7 @@ class vframe: public ResourceObj {
class javaVFrame: public vframe {
public:
// JVM state
- virtual methodOop method() const = 0;
+ virtual Method* method() const = 0;
virtual int bci() const = 0;
virtual StackValueCollection* locals() const = 0;
virtual StackValueCollection* expressions() const = 0;
@@ -158,7 +158,7 @@ class javaVFrame: public vframe {
class interpretedVFrame: public javaVFrame {
public:
// JVM state
- methodOop method() const;
+ Method* method() const;
int bci() const;
StackValueCollection* locals() const;
StackValueCollection* expressions() const;
@@ -243,7 +243,7 @@ class MonitorInfo : public ResourceObj {
private:
oop _owner; // the object owning the monitor
BasicLock* _lock;
- oop _owner_klass; // klass if owner was scalar replaced
+ oop _owner_klass; // klass (mirror) if owner was scalar replaced
bool _eliminated;
bool _owner_is_scalar_replaced;
public:
@@ -266,9 +266,9 @@ class MonitorInfo : public ResourceObj {
assert(!_owner_is_scalar_replaced, "should not be called for scalar replaced object");
return _owner;
}
- klassOop owner_klass() const {
+ oop owner_klass() const {
assert(_owner_is_scalar_replaced, "should not be called for not scalar replaced object");
- return (klassOop)_owner_klass;
+ return _owner_klass;
}
BasicLock* lock() const { return _lock; }
bool eliminated() const { return _eliminated; }
@@ -286,7 +286,7 @@ class vframeStreamCommon : StackObj {
int _sender_decode_offset;
// Cached information
- methodOop _method;
+ Method* _method;
int _bci;
// Should VM activations be ignored or not
@@ -311,7 +311,7 @@ class vframeStreamCommon : StackObj {
}
// Accessors
- methodOop method() const { return _method; }
+ Method* method() const { return _method; }
int bci() const { return _bci; }
intptr_t* frame_id() const { return _frame.id(); }
address frame_pc() const { return _frame.pc(); }
@@ -414,7 +414,7 @@ inline void vframeStreamCommon::fill_from_compiled_frame(int decode_offset) {
// Decode first part of scopeDesc
DebugInfoReadStream buffer(nm(), decode_offset);
_sender_decode_offset = buffer.read_int();
- _method = methodOop(buffer.read_oop());
+ _method = buffer.read_method();
_bci = buffer.read_bci();
assert(_method->is_method(), "checking type of decoded method");
@@ -509,7 +509,7 @@ inline bool vframeStreamCommon::fill_from_frame() {
inline void vframeStreamCommon::fill_from_interpreter_frame() {
- methodOop method = _frame.interpreter_frame_method();
+ Method* method = _frame.interpreter_frame_method();
intptr_t bcx = _frame.interpreter_frame_bcx();
int bci = method->validate_bci_from_bcx(bcx);
// 6379830 AsyncGetCallTrace sometimes feeds us wild frames.
diff --git a/src/share/vm/runtime/vframeArray.cpp b/src/share/vm/runtime/vframeArray.cpp
index a5faf37c3..2c9aa0f3a 100644
--- a/src/share/vm/runtime/vframeArray.cpp
+++ b/src/share/vm/runtime/vframeArray.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -29,7 +29,7 @@
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
#include "memory/universe.inline.hpp"
-#include "oops/methodDataOop.hpp"
+#include "oops/methodData.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvmtiThreadState.hpp"
#include "runtime/handles.inline.hpp"
@@ -299,7 +299,7 @@ void vframeArrayElement::unpack_on_stack(int caller_actual_parameters,
}
iframe()->interpreter_frame_set_bcx((intptr_t)bcp); // cannot use bcp because frame is not initialized yet
if (ProfileInterpreter) {
- methodDataOop mdo = method()->method_data();
+ MethodData* mdo = method()->method_data();
if (mdo != NULL) {
int bci = iframe()->interpreter_frame_bci();
if (use_next_mdp) ++bci;
diff --git a/src/share/vm/runtime/vframeArray.hpp b/src/share/vm/runtime/vframeArray.hpp
index 2eeeb39e6..b505c3571 100644
--- a/src/share/vm/runtime/vframeArray.hpp
+++ b/src/share/vm/runtime/vframeArray.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -54,7 +54,7 @@ class vframeArrayElement : public _ValueObj {
frame _frame; // the interpreter frame we will unpack into
int _bci; // raw bci for this vframe
bool _reexecute; // whether sould we reexecute this bytecode
- methodOop _method; // the method for this vframe
+ Method* _method; // the method for this vframe
MonitorChunk* _monitors; // active monitors for this vframe
StackValueCollection* _locals;
StackValueCollection* _expressions;
@@ -68,7 +68,7 @@ class vframeArrayElement : public _ValueObj {
int raw_bci(void) const { return _bci; }
bool should_reexecute(void) const { return _reexecute; }
- methodOop method(void) const { return _method; }
+ Method* method(void) const { return _method; }
MonitorChunk* monitors(void) const { return _monitors; }
diff --git a/src/share/vm/runtime/vframe_hp.cpp b/src/share/vm/runtime/vframe_hp.cpp
index 4f63575d9..a98f4a356 100644
--- a/src/share/vm/runtime/vframe_hp.cpp
+++ b/src/share/vm/runtime/vframe_hp.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -196,7 +196,7 @@ GrowableArray<MonitorInfo*>* compiledVFrame::monitors() const {
// Natives has no scope
if (scope() == NULL) {
nmethod* nm = code();
- methodOop method = nm->method();
+ Method* method = nm->method();
assert(method->is_native(), "");
if (!method->is_synchronized()) {
return new GrowableArray<MonitorInfo*>(0);
@@ -226,8 +226,9 @@ GrowableArray<MonitorInfo*>* compiledVFrame::monitors() const {
// Put klass for scalar replaced object.
ScopeValue* kv = ((ObjectValue *)ov)->klass();
assert(kv->is_constant_oop(), "klass should be oop constant for scalar replaced object");
- KlassHandle k(((ConstantOopReadValue*)kv)->value()());
- result->push(new MonitorInfo(k->as_klassOop(), resolve_monitor_lock(mv->basic_lock()),
+ Handle k(((ConstantOopReadValue*)kv)->value()());
+ assert(java_lang_Class::is_instance(k()), "must be");
+ result->push(new MonitorInfo(k(), resolve_monitor_lock(mv->basic_lock()),
mv->eliminated(), true));
} else {
result->push(new MonitorInfo(owner_sv->get_obj()(), resolve_monitor_lock(mv->basic_lock()),
@@ -267,14 +268,14 @@ nmethod* compiledVFrame::code() const {
}
-methodOop compiledVFrame::method() const {
+Method* compiledVFrame::method() const {
if (scope() == NULL) {
// native nmethods have no scope the method is implied
nmethod* nm = code();
assert(nm->is_native_method(), "must be native");
return nm->method();
}
- return scope()->method()();
+ return scope()->method();
}
@@ -318,7 +319,7 @@ vframe* compiledVFrame::sender() const {
}
}
-jvmtiDeferredLocalVariableSet::jvmtiDeferredLocalVariableSet(methodOop method, int bci, intptr_t* id) {
+jvmtiDeferredLocalVariableSet::jvmtiDeferredLocalVariableSet(Method* method, int bci, intptr_t* id) {
_method = method;
_bci = bci;
_id = id;
@@ -353,8 +354,8 @@ void jvmtiDeferredLocalVariableSet::set_local_at(int idx, BasicType type, jvalue
}
void jvmtiDeferredLocalVariableSet::oops_do(OopClosure* f) {
-
- f->do_oop((oop*) &_method);
+ // The Method* is on the stack so a live activation keeps it alive
+ // either by mirror in interpreter or code in compiled code.
for ( int i = 0; i < locals()->length(); i++ ) {
if ( locals()->at(i)->type() == T_OBJECT) {
f->do_oop(locals()->at(i)->oop_addr());
diff --git a/src/share/vm/runtime/vframe_hp.hpp b/src/share/vm/runtime/vframe_hp.hpp
index 4edb53bc8..21ec69efb 100644
--- a/src/share/vm/runtime/vframe_hp.hpp
+++ b/src/share/vm/runtime/vframe_hp.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -30,7 +30,7 @@
class compiledVFrame: public javaVFrame {
public:
// JVM state
- methodOop method() const;
+ Method* method() const;
int bci() const;
bool should_reexecute() const;
StackValueCollection* locals() const;
@@ -92,14 +92,14 @@ class jvmtiDeferredLocalVariable;
class jvmtiDeferredLocalVariableSet : public CHeapObj<mtCompiler> {
private:
- methodOop _method; // must be GC'd
+ Method* _method;
int _bci;
intptr_t* _id;
GrowableArray<jvmtiDeferredLocalVariable*>* _locals;
public:
// JVM state
- methodOop method() const { return _method; }
+ Method* method() const { return _method; }
int bci() const { return _bci; }
intptr_t* id() const { return _id; }
GrowableArray<jvmtiDeferredLocalVariable*>* locals() const { return _locals; }
@@ -111,7 +111,7 @@ private:
void oops_do(OopClosure* f);
// constructor
- jvmtiDeferredLocalVariableSet(methodOop method, int bci, intptr_t* id);
+ jvmtiDeferredLocalVariableSet(Method* method, int bci, intptr_t* id);
// destructor
~jvmtiDeferredLocalVariableSet();
diff --git a/src/share/vm/runtime/virtualspace.cpp b/src/share/vm/runtime/virtualspace.cpp
index 38f434dce..18c147a6a 100644
--- a/src/share/vm/runtime/virtualspace.cpp
+++ b/src/share/vm/runtime/virtualspace.cpp
@@ -155,38 +155,27 @@ static bool failed_to_reserve_as_requested(char* base, char* requested_address,
return true;
}
-ReservedSpace::ReservedSpace(const size_t prefix_size,
- const size_t prefix_align,
- const size_t suffix_size,
+ReservedSpace::ReservedSpace(const size_t suffix_size,
const size_t suffix_align,
char* requested_address,
const size_t noaccess_prefix)
{
- assert(prefix_size != 0, "sanity");
- assert(prefix_align != 0, "sanity");
assert(suffix_size != 0, "sanity");
assert(suffix_align != 0, "sanity");
- assert((prefix_size & (prefix_align - 1)) == 0,
- "prefix_size not divisible by prefix_align");
assert((suffix_size & (suffix_align - 1)) == 0,
"suffix_size not divisible by suffix_align");
- assert((suffix_align & (prefix_align - 1)) == 0,
- "suffix_align not divisible by prefix_align");
// Assert that if noaccess_prefix is used, it is the same as prefix_align.
- assert(noaccess_prefix == 0 ||
- noaccess_prefix == prefix_align, "noaccess prefix wrong");
-
- // Add in noaccess_prefix to prefix_size;
- const size_t adjusted_prefix_size = prefix_size + noaccess_prefix;
+ // Add in noaccess_prefix to prefix
+ const size_t adjusted_prefix_size = noaccess_prefix;
const size_t size = adjusted_prefix_size + suffix_size;
// On systems where the entire region has to be reserved and committed up
// front, the compound alignment normally done by this method is unnecessary.
const bool try_reserve_special = UseLargePages &&
- prefix_align == os::large_page_size();
+ suffix_align == os::large_page_size();
if (!os::can_commit_large_page_memory() && try_reserve_special) {
- initialize(size, prefix_align, true, requested_address, noaccess_prefix,
+ initialize(size, suffix_align, true, requested_address, noaccess_prefix,
false);
return;
}
@@ -209,12 +198,11 @@ ReservedSpace::ReservedSpace(const size_t prefix_size,
addr = NULL;
}
} else {
- addr = os::reserve_memory(size, NULL, prefix_align);
+ addr = os::reserve_memory(size, NULL, suffix_align);
}
if (addr == NULL) return;
- // Check whether the result has the needed alignment (unlikely unless
- // prefix_align < suffix_align).
+ // Check whether the result has the needed alignment
const size_t ofs = (size_t(addr) + adjusted_prefix_size) & (suffix_align - 1);
if (ofs != 0) {
// Wrong alignment. Release, allocate more space and do manual alignment.
@@ -229,12 +217,12 @@ ReservedSpace::ReservedSpace(const size_t prefix_size,
}
const size_t extra = MAX2(ofs, suffix_align - ofs);
- addr = reserve_and_align(size + extra, adjusted_prefix_size, prefix_align,
+ addr = reserve_and_align(size + extra, adjusted_prefix_size, suffix_align,
suffix_size, suffix_align);
if (addr == NULL) {
// Try an even larger region. If this fails, address space is exhausted.
addr = reserve_and_align(size + suffix_align, adjusted_prefix_size,
- prefix_align, suffix_size, suffix_align);
+ suffix_align, suffix_size, suffix_align);
}
if (requested_address != 0 &&
@@ -249,7 +237,7 @@ ReservedSpace::ReservedSpace(const size_t prefix_size,
_base = addr;
_size = size;
- _alignment = prefix_align;
+ _alignment = suffix_align;
_noaccess_prefix = noaccess_prefix;
}
@@ -499,21 +487,18 @@ ReservedHeapSpace::ReservedHeapSpace(size_t size, size_t alignment,
protect_noaccess_prefix(size);
}
-ReservedHeapSpace::ReservedHeapSpace(const size_t prefix_size,
- const size_t prefix_align,
- const size_t suffix_size,
- const size_t suffix_align,
+ReservedHeapSpace::ReservedHeapSpace(const size_t heap_space_size,
+ const size_t alignment,
char* requested_address) :
- ReservedSpace(prefix_size, prefix_align, suffix_size, suffix_align,
+ ReservedSpace(heap_space_size, alignment,
requested_address,
(UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
Universe::narrow_oop_use_implicit_null_checks()) ?
- lcm(os::vm_page_size(), prefix_align) : 0) {
+ lcm(os::vm_page_size(), alignment) : 0) {
if (base() > 0) {
MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
}
-
- protect_noaccess_prefix(prefix_size+suffix_size);
+ protect_noaccess_prefix(heap_space_size);
}
// Reserve space for code segment. Same as Java heap only we mark this as
diff --git a/src/share/vm/runtime/virtualspace.hpp b/src/share/vm/runtime/virtualspace.hpp
index 79723bae7..934efb88a 100644
--- a/src/share/vm/runtime/virtualspace.hpp
+++ b/src/share/vm/runtime/virtualspace.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -79,8 +79,7 @@ class ReservedSpace VALUE_OBJ_CLASS_SPEC {
ReservedSpace(size_t size, size_t alignment, bool large,
char* requested_address = NULL,
const size_t noaccess_prefix = 0);
- ReservedSpace(const size_t prefix_size, const size_t prefix_align,
- const size_t suffix_size, const size_t suffix_align,
+ ReservedSpace(const size_t suffix_size, const size_t suffix_align,
char* requested_address,
const size_t noaccess_prefix = 0);
ReservedSpace(size_t size, size_t alignment, bool large, bool executable);
@@ -130,7 +129,6 @@ public:
ReservedHeapSpace(size_t size, size_t forced_base_alignment,
bool large, char* requested_address);
ReservedHeapSpace(const size_t prefix_size, const size_t prefix_align,
- const size_t suffix_size, const size_t suffix_align,
char* requested_address);
};
diff --git a/src/share/vm/runtime/vmStructs.cpp b/src/share/vm/runtime/vmStructs.cpp
index bc916d9f2..c527087a2 100644
--- a/src/share/vm/runtime/vmStructs.cpp
+++ b/src/share/vm/runtime/vmStructs.cpp
@@ -51,48 +51,37 @@
#include "interpreter/bytecodeInterpreter.hpp"
#include "interpreter/bytecodes.hpp"
#include "interpreter/interpreter.hpp"
+#include "memory/allocation.hpp"
#include "memory/cardTableRS.hpp"
-#include "memory/compactPermGen.hpp"
#include "memory/defNewGeneration.hpp"
#include "memory/freeBlockDictionary.hpp"
#include "memory/genCollectedHeap.hpp"
#include "memory/generation.hpp"
#include "memory/generationSpec.hpp"
#include "memory/heap.hpp"
-#include "memory/permGen.hpp"
#include "memory/space.hpp"
#include "memory/tenuredGeneration.hpp"
#include "memory/universe.hpp"
#include "memory/watermark.hpp"
#include "oops/arrayKlass.hpp"
-#include "oops/arrayKlassKlass.hpp"
#include "oops/arrayOop.hpp"
-#include "oops/compiledICHolderKlass.hpp"
-#include "oops/compiledICHolderOop.hpp"
-#include "oops/constMethodKlass.hpp"
-#include "oops/constMethodOop.hpp"
-#include "oops/constantPoolKlass.hpp"
-#include "oops/constantPoolOop.hpp"
-#include "oops/cpCacheKlass.hpp"
-#include "oops/cpCacheOop.hpp"
+#include "oops/compiledICHolder.hpp"
+#include "oops/constMethod.hpp"
+#include "oops/constantPool.hpp"
+#include "oops/cpCache.hpp"
+#include "oops/instanceClassLoaderKlass.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/instanceMirrorKlass.hpp"
-#include "oops/instanceKlassKlass.hpp"
#include "oops/instanceOop.hpp"
#include "oops/klass.hpp"
-#include "oops/klassOop.hpp"
#include "oops/markOop.hpp"
-#include "oops/methodDataKlass.hpp"
-#include "oops/methodDataOop.hpp"
-#include "oops/methodKlass.hpp"
-#include "oops/methodOop.hpp"
+#include "oops/methodData.hpp"
+#include "oops/method.hpp"
#include "oops/objArrayKlass.hpp"
-#include "oops/objArrayKlassKlass.hpp"
#include "oops/objArrayOop.hpp"
#include "oops/oop.inline.hpp"
#include "oops/symbol.hpp"
#include "oops/typeArrayKlass.hpp"
-#include "oops/typeArrayKlassKlass.hpp"
#include "oops/typeArrayOop.hpp"
#include "prims/jvmtiAgentThread.hpp"
#include "runtime/arguments.hpp"
@@ -107,6 +96,7 @@
#include "runtime/stubRoutines.hpp"
#include "runtime/virtualspace.hpp"
#include "runtime/vmStructs.hpp"
+#include "utilities/array.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/hashtable.hpp"
#ifdef TARGET_ARCH_x86
@@ -167,7 +157,6 @@
# include "vmStructs_bsd_zero.hpp"
#endif
#ifndef SERIALGC
-#include "gc_implementation/concurrentMarkSweep/cmsPermGen.hpp"
#include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp"
#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
@@ -178,7 +167,6 @@
#include "gc_implementation/parallelScavenge/asPSYoungGen.hpp"
#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
#include "gc_implementation/parallelScavenge/psOldGen.hpp"
-#include "gc_implementation/parallelScavenge/psPermGen.hpp"
#include "gc_implementation/parallelScavenge/psVirtualspace.hpp"
#include "gc_implementation/parallelScavenge/psYoungGen.hpp"
#include "gc_implementation/parallelScavenge/vmStructs_parallelgc.hpp"
@@ -248,9 +236,9 @@ typedef Hashtable<intptr_t, mtInternal> IntptrHashtable;
typedef Hashtable<Symbol*, mtSymbol> SymbolHashtable;
typedef HashtableEntry<Symbol*, mtClass> SymbolHashtableEntry;
typedef Hashtable<oop, mtSymbol> StringHashtable;
-typedef TwoOopHashtable<klassOop, mtClass> klassOopTwoOopHashtable;
-typedef Hashtable<klassOop, mtClass> klassOopHashtable;
-typedef HashtableEntry<klassOop, mtClass> klassHashtableEntry;
+typedef TwoOopHashtable<Klass*, mtClass> KlassTwoOopHashtable;
+typedef Hashtable<Klass*, mtClass> KlassHashtable;
+typedef HashtableEntry<Klass*, mtClass> KlassHashtableEntry;
typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
//--------------------------------------------------------------------------------
@@ -273,131 +261,126 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
last_entry) \
\
/******************************************************************/ \
- /* OopDesc and Klass hierarchies (NOTE: methodDataOop incomplete) */ \
+ /* OopDesc and Klass hierarchies (NOTE: MethodData* incomplete) */ \
/******************************************************************/ \
\
volatile_nonstatic_field(oopDesc, _mark, markOop) \
- volatile_nonstatic_field(oopDesc, _metadata._klass, wideKlassOop) \
+ volatile_nonstatic_field(oopDesc, _metadata._klass, Klass*) \
volatile_nonstatic_field(oopDesc, _metadata._compressed_klass, narrowOop) \
static_field(oopDesc, _bs, BarrierSet*) \
nonstatic_field(arrayKlass, _dimension, int) \
- volatile_nonstatic_field(arrayKlass, _higher_dimension, klassOop) \
- volatile_nonstatic_field(arrayKlass, _lower_dimension, klassOop) \
+ volatile_nonstatic_field(arrayKlass, _higher_dimension, Klass*) \
+ volatile_nonstatic_field(arrayKlass, _lower_dimension, Klass*) \
nonstatic_field(arrayKlass, _vtable_len, int) \
nonstatic_field(arrayKlass, _alloc_size, juint) \
nonstatic_field(arrayKlass, _component_mirror, oop) \
- nonstatic_field(compiledICHolderKlass, _alloc_size, juint) \
- nonstatic_field(compiledICHolderOopDesc, _holder_method, methodOop) \
- nonstatic_field(compiledICHolderOopDesc, _holder_klass, klassOop) \
- nonstatic_field(constantPoolOopDesc, _tags, typeArrayOop) \
- nonstatic_field(constantPoolOopDesc, _cache, constantPoolCacheOop) \
- nonstatic_field(constantPoolOopDesc, _pool_holder, klassOop) \
- nonstatic_field(constantPoolOopDesc, _operands, typeArrayOop) \
- nonstatic_field(constantPoolOopDesc, _length, int) \
- nonstatic_field(constantPoolCacheOopDesc, _length, int) \
- nonstatic_field(constantPoolCacheOopDesc, _constant_pool, constantPoolOop) \
- nonstatic_field(instanceKlass, _array_klasses, klassOop) \
- nonstatic_field(instanceKlass, _methods, objArrayOop) \
- nonstatic_field(instanceKlass, _method_ordering, typeArrayOop) \
- nonstatic_field(instanceKlass, _local_interfaces, objArrayOop) \
- nonstatic_field(instanceKlass, _transitive_interfaces, objArrayOop) \
- nonstatic_field(instanceKlass, _fields, typeArrayOop) \
- nonstatic_field(instanceKlass, _java_fields_count, u2) \
- nonstatic_field(instanceKlass, _constants, constantPoolOop) \
- nonstatic_field(instanceKlass, _class_loader, oop) \
- nonstatic_field(instanceKlass, _protection_domain, oop) \
- nonstatic_field(instanceKlass, _signers, objArrayOop) \
- nonstatic_field(instanceKlass, _source_file_name, Symbol*) \
- nonstatic_field(instanceKlass, _source_debug_extension, char*) \
- nonstatic_field(instanceKlass, _inner_classes, typeArrayOop) \
- nonstatic_field(instanceKlass, _nonstatic_field_size, int) \
- nonstatic_field(instanceKlass, _static_field_size, int) \
- nonstatic_field(instanceKlass, _static_oop_field_count, u2) \
- nonstatic_field(instanceKlass, _nonstatic_oop_map_size, int) \
- nonstatic_field(instanceKlass, _is_marked_dependent, bool) \
- nonstatic_field(instanceKlass, _minor_version, u2) \
- nonstatic_field(instanceKlass, _major_version, u2) \
- nonstatic_field(instanceKlass, _init_state, u1) \
- nonstatic_field(instanceKlass, _init_thread, Thread*) \
- nonstatic_field(instanceKlass, _vtable_len, int) \
- nonstatic_field(instanceKlass, _itable_len, int) \
- nonstatic_field(instanceKlass, _reference_type, u1) \
- volatile_nonstatic_field(instanceKlass, _oop_map_cache, OopMapCache*) \
- nonstatic_field(instanceKlass, _jni_ids, JNIid*) \
- nonstatic_field(instanceKlass, _osr_nmethods_head, nmethod*) \
- nonstatic_field(instanceKlass, _breakpoints, BreakpointInfo*) \
- nonstatic_field(instanceKlass, _generic_signature, Symbol*) \
- nonstatic_field(instanceKlass, _methods_jmethod_ids, jmethodID*) \
- nonstatic_field(instanceKlass, _methods_cached_itable_indices, int*) \
- volatile_nonstatic_field(instanceKlass, _idnum_allocated_count, u2) \
- nonstatic_field(instanceKlass, _class_annotations, typeArrayOop) \
- nonstatic_field(instanceKlass, _fields_annotations, objArrayOop) \
- nonstatic_field(instanceKlass, _methods_annotations, objArrayOop) \
- nonstatic_field(instanceKlass, _methods_parameter_annotations, objArrayOop) \
- nonstatic_field(instanceKlass, _methods_default_annotations, objArrayOop) \
- nonstatic_field(instanceKlass, _dependencies, nmethodBucket*) \
+ nonstatic_field(CompiledICHolder, _holder_method, Method*) \
+ nonstatic_field(CompiledICHolder, _holder_klass, Klass*) \
+ nonstatic_field(ConstantPool, _tags, Array<u1>*) \
+ nonstatic_field(ConstantPool, _cache, ConstantPoolCache*) \
+ nonstatic_field(ConstantPool, _pool_holder, Klass*) \
+ nonstatic_field(ConstantPool, _operands, Array<u2>*) \
+ nonstatic_field(ConstantPool, _length, int) \
+ nonstatic_field(ConstantPool, _resolved_references, jobject) \
+ nonstatic_field(ConstantPool, _reference_map, Array<u2>*) \
+ nonstatic_field(ConstantPoolCache, _length, int) \
+ nonstatic_field(ConstantPoolCache, _constant_pool, ConstantPool*) \
+ nonstatic_field(InstanceKlass, _array_klasses, Klass*) \
+ nonstatic_field(InstanceKlass, _methods, Array<Method*>*) \
+ nonstatic_field(InstanceKlass, _local_interfaces, Array<Klass*>*) \
+ nonstatic_field(InstanceKlass, _transitive_interfaces, Array<Klass*>*) \
+ nonstatic_field(InstanceKlass, _fields, Array<u2>*) \
+ nonstatic_field(InstanceKlass, _java_fields_count, u2) \
+ nonstatic_field(InstanceKlass, _constants, ConstantPool*) \
+ nonstatic_field(InstanceKlass, _class_loader_data, ClassLoaderData*) \
+ nonstatic_field(InstanceKlass, _protection_domain, oop) \
+ nonstatic_field(InstanceKlass, _signers, objArrayOop) \
+ nonstatic_field(InstanceKlass, _source_file_name, Symbol*) \
+ nonstatic_field(InstanceKlass, _source_debug_extension, char*) \
+ nonstatic_field(InstanceKlass, _inner_classes, Array<jushort>*) \
+ nonstatic_field(InstanceKlass, _nonstatic_field_size, int) \
+ nonstatic_field(InstanceKlass, _static_field_size, int) \
+ nonstatic_field(InstanceKlass, _static_oop_field_count, u2) \
+ nonstatic_field(InstanceKlass, _nonstatic_oop_map_size, int) \
+ nonstatic_field(InstanceKlass, _is_marked_dependent, bool) \
+ nonstatic_field(InstanceKlass, _minor_version, u2) \
+ nonstatic_field(InstanceKlass, _major_version, u2) \
+ nonstatic_field(InstanceKlass, _init_state, u1) \
+ nonstatic_field(InstanceKlass, _init_thread, Thread*) \
+ nonstatic_field(InstanceKlass, _vtable_len, int) \
+ nonstatic_field(InstanceKlass, _itable_len, int) \
+ nonstatic_field(InstanceKlass, _reference_type, u1) \
+ volatile_nonstatic_field(InstanceKlass, _oop_map_cache, OopMapCache*) \
+ nonstatic_field(InstanceKlass, _jni_ids, JNIid*) \
+ nonstatic_field(InstanceKlass, _osr_nmethods_head, nmethod*) \
+ nonstatic_field(InstanceKlass, _breakpoints, BreakpointInfo*) \
+ nonstatic_field(InstanceKlass, _generic_signature, Symbol*) \
+ nonstatic_field(InstanceKlass, _methods_jmethod_ids, jmethodID*) \
+ nonstatic_field(InstanceKlass, _methods_cached_itable_indices, int*) \
+ volatile_nonstatic_field(InstanceKlass, _idnum_allocated_count, u2) \
+ nonstatic_field(InstanceKlass, _annotations, Annotations*) \
+ nonstatic_field(InstanceKlass, _dependencies, nmethodBucket*) \
nonstatic_field(nmethodBucket, _nmethod, nmethod*) \
nonstatic_field(nmethodBucket, _count, int) \
nonstatic_field(nmethodBucket, _next, nmethodBucket*) \
+ nonstatic_field(InstanceKlass, _method_ordering, Array<int>*) \
nonstatic_field(Klass, _super_check_offset, juint) \
- nonstatic_field(Klass, _secondary_super_cache, klassOop) \
- nonstatic_field(Klass, _secondary_supers, objArrayOop) \
- nonstatic_field(Klass, _primary_supers[0], klassOop) \
+ nonstatic_field(Klass, _secondary_super_cache, Klass*) \
+ nonstatic_field(Klass, _secondary_supers, Array<Klass*>*) \
+ nonstatic_field(Klass, _primary_supers[0], Klass*) \
nonstatic_field(Klass, _java_mirror, oop) \
nonstatic_field(Klass, _modifier_flags, jint) \
- nonstatic_field(Klass, _super, klassOop) \
+ nonstatic_field(Klass, _super, Klass*) \
nonstatic_field(Klass, _layout_helper, jint) \
nonstatic_field(Klass, _name, Symbol*) \
nonstatic_field(Klass, _access_flags, AccessFlags) \
- nonstatic_field(Klass, _subklass, klassOop) \
- nonstatic_field(Klass, _next_sibling, klassOop) \
+ nonstatic_field(Klass, _subklass, Klass*) \
+ nonstatic_field(Klass, _next_sibling, Klass*) \
nonproduct_nonstatic_field(Klass, _verify_count, int) \
nonstatic_field(Klass, _alloc_count, juint) \
- nonstatic_field(klassKlass, _alloc_size, juint) \
- nonstatic_field(methodKlass, _alloc_size, juint) \
- nonstatic_field(methodDataOopDesc, _size, int) \
- nonstatic_field(methodDataOopDesc, _method, methodOop) \
- nonstatic_field(methodDataOopDesc, _data_size, int) \
- nonstatic_field(methodDataOopDesc, _data[0], intptr_t) \
- nonstatic_field(methodDataOopDesc, _nof_decompiles, uint) \
- nonstatic_field(methodDataOopDesc, _nof_overflow_recompiles, uint) \
- nonstatic_field(methodDataOopDesc, _nof_overflow_traps, uint) \
- nonstatic_field(methodDataOopDesc, _eflags, intx) \
- nonstatic_field(methodDataOopDesc, _arg_local, intx) \
- nonstatic_field(methodDataOopDesc, _arg_stack, intx) \
- nonstatic_field(methodDataOopDesc, _arg_returned, intx) \
- nonstatic_field(methodOopDesc, _constMethod, constMethodOop) \
- nonstatic_field(methodOopDesc, _method_data, methodDataOop) \
- nonstatic_field(methodOopDesc, _interpreter_invocation_count, int) \
- nonstatic_field(methodOopDesc, _access_flags, AccessFlags) \
- nonstatic_field(methodOopDesc, _vtable_index, int) \
- nonstatic_field(methodOopDesc, _method_size, u2) \
- nonstatic_field(methodOopDesc, _max_stack, u2) \
- nonstatic_field(methodOopDesc, _max_locals, u2) \
- nonstatic_field(methodOopDesc, _size_of_parameters, u2) \
- nonstatic_field(methodOopDesc, _interpreter_throwout_count, u2) \
- nonstatic_field(methodOopDesc, _number_of_breakpoints, u2) \
- nonstatic_field(methodOopDesc, _invocation_counter, InvocationCounter) \
- nonstatic_field(methodOopDesc, _backedge_counter, InvocationCounter) \
- nonproduct_nonstatic_field(methodOopDesc, _compiled_invocation_count, int) \
- volatile_nonstatic_field(methodOopDesc, _code, nmethod*) \
- nonstatic_field(methodOopDesc, _i2i_entry, address) \
- nonstatic_field(methodOopDesc, _adapter, AdapterHandlerEntry*) \
- volatile_nonstatic_field(methodOopDesc, _from_compiled_entry, address) \
- volatile_nonstatic_field(methodOopDesc, _from_interpreted_entry, address) \
- volatile_nonstatic_field(constMethodOopDesc, _fingerprint, uint64_t) \
- nonstatic_field(constMethodOopDesc, _constants, constantPoolOop) \
- nonstatic_field(constMethodOopDesc, _stackmap_data, typeArrayOop) \
- nonstatic_field(constMethodOopDesc, _constMethod_size, int) \
- nonstatic_field(constMethodOopDesc, _interpreter_kind, jbyte) \
- nonstatic_field(constMethodOopDesc, _flags, jbyte) \
- nonstatic_field(constMethodOopDesc, _code_size, u2) \
- nonstatic_field(constMethodOopDesc, _name_index, u2) \
- nonstatic_field(constMethodOopDesc, _signature_index, u2) \
- nonstatic_field(constMethodOopDesc, _method_idnum, u2) \
- nonstatic_field(constMethodOopDesc, _generic_signature_index, u2) \
- nonstatic_field(objArrayKlass, _element_klass, klassOop) \
- nonstatic_field(objArrayKlass, _bottom_klass, klassOop) \
+ nonstatic_field(MethodData, _size, int) \
+ nonstatic_field(MethodData, _method, Method*) \
+ nonstatic_field(MethodData, _data_size, int) \
+ nonstatic_field(MethodData, _data[0], intptr_t) \
+ nonstatic_field(MethodData, _nof_decompiles, uint) \
+ nonstatic_field(MethodData, _nof_overflow_recompiles, uint) \
+ nonstatic_field(MethodData, _nof_overflow_traps, uint) \
+ nonstatic_field(MethodData, _eflags, intx) \
+ nonstatic_field(MethodData, _arg_local, intx) \
+ nonstatic_field(MethodData, _arg_stack, intx) \
+ nonstatic_field(MethodData, _arg_returned, intx) \
+ nonstatic_field(Method, _constMethod, ConstMethod*) \
+ nonstatic_field(Method, _method_data, MethodData*) \
+ nonstatic_field(Method, _interpreter_invocation_count, int) \
+ nonstatic_field(Method, _access_flags, AccessFlags) \
+ nonstatic_field(Method, _vtable_index, int) \
+ nonstatic_field(Method, _method_size, u2) \
+ nonstatic_field(Method, _max_stack, u2) \
+ nonstatic_field(Method, _max_locals, u2) \
+ nonstatic_field(Method, _size_of_parameters, u2) \
+ nonstatic_field(Method, _interpreter_throwout_count, u2) \
+ nonstatic_field(Method, _number_of_breakpoints, u2) \
+ nonstatic_field(Method, _invocation_counter, InvocationCounter) \
+ nonstatic_field(Method, _backedge_counter, InvocationCounter) \
+ nonproduct_nonstatic_field(Method, _compiled_invocation_count, int) \
+ volatile_nonstatic_field(Method, _code, nmethod*) \
+ nonstatic_field(Method, _i2i_entry, address) \
+ nonstatic_field(Method, _adapter, AdapterHandlerEntry*) \
+ volatile_nonstatic_field(Method, _from_compiled_entry, address) \
+ volatile_nonstatic_field(Method, _from_interpreted_entry, address) \
+ volatile_nonstatic_field(ConstMethod, _fingerprint, uint64_t) \
+ nonstatic_field(ConstMethod, _constants, ConstantPool*) \
+ nonstatic_field(ConstMethod, _stackmap_data, Array<u1>*) \
+ nonstatic_field(ConstMethod, _constMethod_size, int) \
+ nonstatic_field(ConstMethod, _interpreter_kind, jbyte) \
+ nonstatic_field(ConstMethod, _flags, jbyte) \
+ nonstatic_field(ConstMethod, _code_size, u2) \
+ nonstatic_field(ConstMethod, _name_index, u2) \
+ nonstatic_field(ConstMethod, _signature_index, u2) \
+ nonstatic_field(ConstMethod, _method_idnum, u2) \
+ nonstatic_field(ConstMethod, _generic_signature_index, u2) \
+ nonstatic_field(objArrayKlass, _element_klass, Klass*) \
+ nonstatic_field(objArrayKlass, _bottom_klass, Klass*) \
volatile_nonstatic_field(Symbol, _refcount, int) \
nonstatic_field(Symbol, _identity_hash, int) \
nonstatic_field(Symbol, _length, unsigned short) \
@@ -409,7 +392,7 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
/***********************/ \
\
volatile_nonstatic_field(ConstantPoolCacheEntry, _indices, intx) \
- volatile_nonstatic_field(ConstantPoolCacheEntry, _f1, oop) \
+ nonstatic_field(ConstantPoolCacheEntry, _f1, volatile Metadata*) \
volatile_nonstatic_field(ConstantPoolCacheEntry, _f2, intx) \
volatile_nonstatic_field(ConstantPoolCacheEntry, _flags, intx) \
\
@@ -437,40 +420,24 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
/* JNI IDs */ \
/***********/ \
\
- nonstatic_field(JNIid, _holder, klassOop) \
+ nonstatic_field(JNIid, _holder, Klass*) \
nonstatic_field(JNIid, _next, JNIid*) \
nonstatic_field(JNIid, _offset, int) \
/************/ \
/* Universe */ \
/************/ \
\
- static_field(Universe, _boolArrayKlassObj, klassOop) \
- static_field(Universe, _byteArrayKlassObj, klassOop) \
- static_field(Universe, _charArrayKlassObj, klassOop) \
- static_field(Universe, _intArrayKlassObj, klassOop) \
- static_field(Universe, _shortArrayKlassObj, klassOop) \
- static_field(Universe, _longArrayKlassObj, klassOop) \
- static_field(Universe, _singleArrayKlassObj, klassOop) \
- static_field(Universe, _doubleArrayKlassObj, klassOop) \
- static_field(Universe, _methodKlassObj, klassOop) \
- static_field(Universe, _constMethodKlassObj, klassOop) \
- static_field(Universe, _methodDataKlassObj, klassOop) \
- static_field(Universe, _klassKlassObj, klassOop) \
- static_field(Universe, _arrayKlassKlassObj, klassOop) \
- static_field(Universe, _objArrayKlassKlassObj, klassOop) \
- static_field(Universe, _typeArrayKlassKlassObj, klassOop) \
- static_field(Universe, _instanceKlassKlassObj, klassOop) \
- static_field(Universe, _constantPoolKlassObj, klassOop) \
- static_field(Universe, _constantPoolCacheKlassObj, klassOop) \
- static_field(Universe, _compiledICHolderKlassObj, klassOop) \
- static_field(Universe, _systemObjArrayKlassObj, klassOop) \
+ static_field(Universe, _boolArrayKlassObj, Klass*) \
+ static_field(Universe, _byteArrayKlassObj, Klass*) \
+ static_field(Universe, _charArrayKlassObj, Klass*) \
+ static_field(Universe, _intArrayKlassObj, Klass*) \
+ static_field(Universe, _shortArrayKlassObj, Klass*) \
+ static_field(Universe, _longArrayKlassObj, Klass*) \
+ static_field(Universe, _singleArrayKlassObj, Klass*) \
+ static_field(Universe, _doubleArrayKlassObj, Klass*) \
static_field(Universe, _mirrors[0], oop) \
static_field(Universe, _main_thread_group, oop) \
static_field(Universe, _system_thread_group, oop) \
- static_field(Universe, _the_empty_byte_array, typeArrayOop) \
- static_field(Universe, _the_empty_short_array, typeArrayOop) \
- static_field(Universe, _the_empty_int_array, typeArrayOop) \
- static_field(Universe, _the_empty_system_obj_array, objArrayOop) \
static_field(Universe, _the_empty_class_klass_array, objArrayOop) \
static_field(Universe, _out_of_memory_error_java_heap, oop) \
static_field(Universe, _out_of_memory_error_perm_gen, oop) \
@@ -528,7 +495,6 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
nonstatic_field(CardTableRS, _ct_bs, CardTableModRefBSForCTRS*) \
\
nonstatic_field(CollectedHeap, _reserved, MemRegion) \
- nonstatic_field(SharedHeap, _perm_gen, PermGen*) \
nonstatic_field(CollectedHeap, _barrier_set, BarrierSet*) \
nonstatic_field(CollectedHeap, _defer_initial_card_mark, bool) \
nonstatic_field(CollectedHeap, _is_gc_active, bool) \
@@ -536,7 +502,6 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
nonstatic_field(CompactibleSpace, _first_dead, HeapWord*) \
nonstatic_field(CompactibleSpace, _end_of_live, HeapWord*) \
\
- nonstatic_field(CompactingPermGen, _gen, OneContigSpaceCardGeneration*) \
\
nonstatic_field(ContiguousSpace, _top, HeapWord*) \
nonstatic_field(ContiguousSpace, _concurrent_iteration_safe_limit, HeapWord*) \
@@ -579,30 +544,7 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
nonstatic_field(OneContigSpaceCardGeneration, _the_space, ContiguousSpace*) \
nonstatic_field(OneContigSpaceCardGeneration, _last_gc, WaterMark) \
\
- nonstatic_field(CompactingPermGenGen, _ro_vs, VirtualSpace) \
- nonstatic_field(CompactingPermGenGen, _rw_vs, VirtualSpace) \
- nonstatic_field(CompactingPermGenGen, _md_vs, VirtualSpace) \
- nonstatic_field(CompactingPermGenGen, _mc_vs, VirtualSpace) \
- nonstatic_field(CompactingPermGenGen, _ro_space, OffsetTableContigSpace*) \
- nonstatic_field(CompactingPermGenGen, _rw_space, OffsetTableContigSpace*) \
- static_field(CompactingPermGenGen, unshared_bottom, HeapWord*) \
- static_field(CompactingPermGenGen, unshared_end, HeapWord*) \
- static_field(CompactingPermGenGen, shared_bottom, HeapWord*) \
- static_field(CompactingPermGenGen, readonly_bottom, HeapWord*) \
- static_field(CompactingPermGenGen, readonly_end, HeapWord*) \
- static_field(CompactingPermGenGen, readwrite_bottom, HeapWord*) \
- static_field(CompactingPermGenGen, readwrite_end, HeapWord*) \
- static_field(CompactingPermGenGen, miscdata_bottom, HeapWord*) \
- static_field(CompactingPermGenGen, miscdata_end, HeapWord*) \
- static_field(CompactingPermGenGen, misccode_bottom, HeapWord*) \
- static_field(CompactingPermGenGen, misccode_end, HeapWord*) \
- static_field(CompactingPermGenGen, shared_end, HeapWord*) \
- \
- nonstatic_field(PermGen, _capacity_expansion_limit, size_t) \
- \
- nonstatic_field(PermanentGenerationSpec, _name, PermGen::Name) \
- nonstatic_field(PermanentGenerationSpec, _init_size, size_t) \
- nonstatic_field(PermanentGenerationSpec, _max_size, size_t) \
+ \
\
nonstatic_field(Space, _bottom, HeapWord*) \
nonstatic_field(Space, _end, HeapWord*) \
@@ -677,40 +619,40 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
static_field(SystemDictionary, _shared_dictionary, Dictionary*) \
static_field(SystemDictionary, _system_loader_lock_obj, oop) \
static_field(SystemDictionary, _loader_constraints, LoaderConstraintTable*) \
- static_field(SystemDictionary, WK_KLASS(Object_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(String_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(Class_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(Cloneable_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(ClassLoader_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(Serializable_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(System_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(Throwable_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(ThreadDeath_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(Error_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(Exception_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(RuntimeException_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(ClassNotFoundException_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(NoClassDefFoundError_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(LinkageError_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(ClassCastException_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(ArrayStoreException_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(VirtualMachineError_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(OutOfMemoryError_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(StackOverflowError_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(ProtectionDomain_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(AccessControlContext_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(Reference_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(SoftReference_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(WeakReference_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(FinalReference_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(PhantomReference_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(Finalizer_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(Thread_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(ThreadGroup_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(Properties_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(StringBuffer_klass), klassOop) \
- static_field(SystemDictionary, WK_KLASS(MethodHandle_klass), klassOop) \
- static_field(SystemDictionary, _box_klasses[0], klassOop) \
+ static_field(SystemDictionary, WK_KLASS(Object_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(String_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(Class_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(Cloneable_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(ClassLoader_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(Serializable_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(System_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(Throwable_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(ThreadDeath_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(Error_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(Exception_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(RuntimeException_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(ClassNotFoundException_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(NoClassDefFoundError_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(LinkageError_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(ClassCastException_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(ArrayStoreException_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(VirtualMachineError_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(OutOfMemoryError_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(StackOverflowError_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(ProtectionDomain_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(AccessControlContext_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(Reference_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(SoftReference_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(WeakReference_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(FinalReference_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(PhantomReference_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(Finalizer_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(Thread_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(ThreadGroup_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(Properties_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(StringBuffer_klass), Klass*) \
+ static_field(SystemDictionary, WK_KLASS(MethodHandle_klass), Klass*) \
+ static_field(SystemDictionary, _box_klasses[0], Klass*) \
static_field(SystemDictionary, _java_system_loader, oop) \
\
/*************/ \
@@ -748,12 +690,12 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
/* DictionaryEntry */ \
/*******************/ \
\
- nonstatic_field(DictionaryEntry, _loader, oop) \
+ nonstatic_field(DictionaryEntry, _loader_data, ClassLoaderData*) \
nonstatic_field(DictionaryEntry, _pd_set, ProtectionDomainEntry*) \
\
/********************/ \
\
- nonstatic_field(PlaceholderEntry, _loader, oop) \
+ nonstatic_field(PlaceholderEntry, _loader_data, ClassLoaderData*) \
\
/**************************/ \
/* ProctectionDomainEntry */ \
@@ -769,7 +711,13 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
nonstatic_field(LoaderConstraintEntry, _name, Symbol*) \
nonstatic_field(LoaderConstraintEntry, _num_loaders, int) \
nonstatic_field(LoaderConstraintEntry, _max_loaders, int) \
- nonstatic_field(LoaderConstraintEntry, _loaders, oop*) \
+ nonstatic_field(LoaderConstraintEntry, _loaders, ClassLoaderData**) \
+ \
+ nonstatic_field(ClassLoaderData, _class_loader, oop) \
+ nonstatic_field(ClassLoaderData, _next, ClassLoaderData*) \
+ \
+ static_field(ClassLoaderDataGraph, _head, ClassLoaderData*) \
+ nonstatic_field(ClassLoaderDataGraph, _unloading, ClassLoaderData*) \
\
/*******************/ \
/* GrowableArrays */ \
@@ -853,7 +801,7 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
/* NMethods (NOTE: incomplete, but only a little) */ \
/**************************************************/ \
\
- nonstatic_field(nmethod, _method, methodOop) \
+ nonstatic_field(nmethod, _method, Method*) \
nonstatic_field(nmethod, _entry_bci, int) \
nonstatic_field(nmethod, _osr_link, nmethod*) \
nonstatic_field(nmethod, _scavenge_root_link, nmethod*) \
@@ -866,6 +814,7 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
nonstatic_field(nmethod, _stub_offset, int) \
nonstatic_field(nmethod, _consts_offset, int) \
nonstatic_field(nmethod, _oops_offset, int) \
+ nonstatic_field(nmethod, _metadata_offset, int) \
nonstatic_field(nmethod, _scopes_data_offset, int) \
nonstatic_field(nmethod, _scopes_pcs_offset, int) \
nonstatic_field(nmethod, _dependencies_offset, int) \
@@ -918,7 +867,7 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
nonstatic_field(JavaThread, _threadObj, oop) \
nonstatic_field(JavaThread, _anchor, JavaFrameAnchor) \
nonstatic_field(JavaThread, _vm_result, oop) \
- nonstatic_field(JavaThread, _vm_result_2, oop) \
+ nonstatic_field(JavaThread, _vm_result_2, Metadata*) \
nonstatic_field(JavaThread, _pending_async_exception, oop) \
volatile_nonstatic_field(JavaThread, _exception_oop, oop) \
volatile_nonstatic_field(JavaThread, _exception_pc, address) \
@@ -1008,11 +957,13 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
nonstatic_field(ciEnv, _task, CompileTask*) \
nonstatic_field(ciEnv, _arena, Arena*) \
\
+ nonstatic_field(ciBaseObject, _ident, uint) \
+ \
nonstatic_field(ciObject, _handle, jobject) \
nonstatic_field(ciObject, _klass, ciKlass*) \
- nonstatic_field(ciObject, _ident, uint) \
\
- nonstatic_field(ciSymbol, _ident, uint) \
+ nonstatic_field(ciMetadata, _metadata, Metadata*) \
+ \
nonstatic_field(ciSymbol, _symbol, Symbol*) \
\
nonstatic_field(ciType, _basic_type, BasicType) \
@@ -1024,7 +975,7 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
nonstatic_field(ciObjArrayKlass, _element_klass, ciKlass*) \
nonstatic_field(ciObjArrayKlass, _base_element_klass, ciKlass*) \
\
- nonstatic_field(ciInstanceKlass, _init_state, instanceKlass::ClassState) \
+ nonstatic_field(ciInstanceKlass, _init_state, InstanceKlass::ClassState) \
nonstatic_field(ciInstanceKlass, _is_shared, bool) \
\
nonstatic_field(ciMethod, _interpreter_invocation_count, int) \
@@ -1040,7 +991,7 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
nonstatic_field(ciMethodData, _arg_stack, intx) \
nonstatic_field(ciMethodData, _arg_returned, intx) \
nonstatic_field(ciMethodData, _current_mileage, int) \
- nonstatic_field(ciMethodData, _orig, methodDataOopDesc) \
+ nonstatic_field(ciMethodData, _orig, MethodData) \
\
nonstatic_field(ciField, _holder, ciInstanceKlass*) \
nonstatic_field(ciField, _name, ciSymbol*) \
@@ -1049,7 +1000,7 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
nonstatic_field(ciField, _is_constant, bool) \
nonstatic_field(ciField, _constant_value, ciConstant) \
\
- nonstatic_field(ciObjectFactory, _ci_objects, GrowableArray<ciObject*>*) \
+ nonstatic_field(ciObjectFactory, _ci_metadata, GrowableArray<ciMetadata*>*) \
nonstatic_field(ciObjectFactory, _symbols, GrowableArray<ciSymbol*>*) \
nonstatic_field(ciObjectFactory, _unloaded_methods, GrowableArray<ciMethod*>*) \
\
@@ -1234,6 +1185,17 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
static_field(Arguments, _num_jvm_args, int) \
static_field(Arguments, _java_command, char*) \
\
+ /************/ \
+ /* Array<T> */ \
+ /************/ \
+ \
+ nonstatic_field(Array<int>, _length, int) \
+ unchecked_nonstatic_field(Array<int>, _data, sizeof(int)) \
+ unchecked_nonstatic_field(Array<u1>, _data, sizeof(u1)) \
+ unchecked_nonstatic_field(Array<u2>, _data, sizeof(u2)) \
+ unchecked_nonstatic_field(Array<Method*>, _data, sizeof(Method*)) \
+ unchecked_nonstatic_field(Array<Klass*>, _data, sizeof(Klass*)) \
+ \
/*********************************/ \
/* java_lang_Class fields */ \
/*********************************/ \
@@ -1248,7 +1210,7 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
/* Miscellaneous fields */ \
/************************/ \
\
- nonstatic_field(CompileTask, _method, jobject) \
+ nonstatic_field(CompileTask, _method, Method*) \
nonstatic_field(CompileTask, _osr_bci, int) \
nonstatic_field(CompileTask, _comp_level, int) \
nonstatic_field(CompileTask, _compile_id, uint) \
@@ -1262,7 +1224,7 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
\
nonstatic_field(vframeArrayElement, _frame, frame) \
nonstatic_field(vframeArrayElement, _bci, int) \
- nonstatic_field(vframeArrayElement, _method, methodOop) \
+ nonstatic_field(vframeArrayElement, _method, Method*) \
\
nonstatic_field(AccessFlags, _flags, jint) \
nonstatic_field(elapsedTimer, _counter, jlong) \
@@ -1360,14 +1322,15 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
declare_unsigned_integer_type(unsigned long) \
/* The compiler thinks this is a different type than */ \
/* unsigned short on Win32 */ \
- declare_unsigned_integer_type(u2) \
declare_unsigned_integer_type(u1) \
+ declare_unsigned_integer_type(u2) \
declare_unsigned_integer_type(unsigned) \
\
/*****************************/ \
/* C primitive pointer types */ \
/*****************************/ \
\
+ declare_toplevel_type(void*) \
declare_toplevel_type(int*) \
declare_toplevel_type(char*) \
declare_toplevel_type(char**) \
@@ -1389,44 +1352,40 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
declare_unsigned_integer_type(uint32_t) \
declare_unsigned_integer_type(uint64_t) \
\
- /*******************************************************************************/ \
- /* OopDesc and Klass hierarchies (NOTE: missing methodDataOop-related classes) */ \
- /*******************************************************************************/ \
+ /******************************************/ \
+ /* OopDesc hierarchy (NOTE: some missing) */ \
+ /******************************************/ \
\
declare_toplevel_type(oopDesc) \
- declare_toplevel_type(Klass_vtbl) \
- declare_type(Klass, Klass_vtbl) \
+ declare_type(arrayOopDesc, oopDesc) \
+ declare_type(objArrayOopDesc, arrayOopDesc) \
+ declare_type(instanceOopDesc, oopDesc) \
+ declare_type(markOopDesc, oopDesc) \
+ \
+ /**************************************************/ \
+ /* MetadataOopDesc hierarchy (NOTE: some missing) */ \
+ /**************************************************/ \
+ \
+ declare_toplevel_type(CompiledICHolder) \
+ declare_toplevel_type(MetaspaceObj) \
+ declare_type(Metadata, MetaspaceObj) \
+ declare_type(Klass, Metadata) \
declare_type(arrayKlass, Klass) \
- declare_type(arrayKlassKlass, klassKlass) \
- declare_type(arrayOopDesc, oopDesc) \
- declare_type(compiledICHolderKlass, Klass) \
- declare_type(compiledICHolderOopDesc, oopDesc) \
- declare_type(constantPoolKlass, Klass) \
- declare_type(constantPoolOopDesc, oopDesc) \
- declare_type(constantPoolCacheKlass, Klass) \
- declare_type(constantPoolCacheOopDesc, oopDesc) \
- declare_type(instanceKlass, Klass) \
- declare_type(instanceKlassKlass, klassKlass) \
- declare_type(instanceOopDesc, oopDesc) \
- declare_type(instanceMirrorKlass, instanceKlass) \
- declare_type(instanceRefKlass, instanceKlass) \
- declare_type(klassKlass, Klass) \
- declare_type(klassOopDesc, oopDesc) \
- declare_type(markOopDesc, oopDesc) \
- declare_type(methodDataKlass, Klass) \
- declare_type(methodDataOopDesc, oopDesc) \
- declare_type(methodKlass, Klass) \
- declare_type(constMethodKlass, Klass) \
- declare_type(methodOopDesc, oopDesc) \
declare_type(objArrayKlass, arrayKlass) \
- declare_type(objArrayKlassKlass, arrayKlassKlass) \
- declare_type(objArrayOopDesc, arrayOopDesc) \
- declare_type(constMethodOopDesc, oopDesc) \
declare_type(typeArrayKlass, arrayKlass) \
- declare_type(typeArrayKlassKlass, arrayKlassKlass) \
- declare_type(typeArrayOopDesc, arrayOopDesc) \
+ declare_type(InstanceKlass, Klass) \
+ declare_type(instanceClassLoaderKlass, InstanceKlass) \
+ declare_type(instanceMirrorKlass, InstanceKlass) \
+ declare_type(instanceRefKlass, InstanceKlass) \
+ declare_type(ConstantPool, Metadata) \
+ declare_type(ConstantPoolCache, MetaspaceObj) \
+ declare_type(MethodData, Metadata) \
+ declare_type(Method, Metadata) \
+ declare_type(ConstMethod, MetaspaceObj) \
+ \
declare_toplevel_type(Symbol) \
declare_toplevel_type(Symbol*) \
+ declare_toplevel_type(volatile Metadata*) \
\
declare_toplevel_type(nmethodBucket) \
\
@@ -1434,17 +1393,10 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
/* Oops */ \
/********/ \
\
- declare_oop_type(constantPoolOop) \
- declare_oop_type(constantPoolCacheOop) \
- declare_oop_type(klassOop) \
declare_oop_type(markOop) \
- declare_oop_type(methodOop) \
- declare_oop_type(methodDataOop) \
declare_oop_type(objArrayOop) \
declare_oop_type(oop) \
declare_oop_type(narrowOop) \
- declare_oop_type(wideKlassOop) \
- declare_oop_type(constMethodOop) \
declare_oop_type(typeArrayOop) \
\
/*************************************/ \
@@ -1455,6 +1407,9 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
declare_toplevel_type(LocalVariableTableElement) \
declare_toplevel_type(ExceptionTableElement) \
\
+ declare_toplevel_type(ClassLoaderData) \
+ declare_toplevel_type(ClassLoaderDataGraph) \
+ \
/******************************************/ \
/* Generation and space hierarchies */ \
/* (needed for run-time type information) */ \
@@ -1468,7 +1423,6 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
declare_type(CardGeneration, Generation) \
declare_type(OneContigSpaceCardGeneration, CardGeneration) \
declare_type(TenuredGeneration, OneContigSpaceCardGeneration) \
- declare_type(CompactingPermGenGen, OneContigSpaceCardGeneration) \
declare_toplevel_type(Space) \
declare_toplevel_type(BitMap) \
declare_type(CompactibleSpace, Space) \
@@ -1476,9 +1430,6 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
declare_type(EdenSpace, ContiguousSpace) \
declare_type(OffsetTableContigSpace, ContiguousSpace) \
declare_type(TenuredSpace, OffsetTableContigSpace) \
- declare_type(ContigPermSpace, OffsetTableContigSpace) \
- declare_toplevel_type(PermGen) \
- declare_type(CompactingPermGen, PermGen) \
declare_toplevel_type(BarrierSet) \
declare_type(ModRefBarrierSet, BarrierSet) \
declare_type(CardTableModRefBS, ModRefBarrierSet) \
@@ -1498,7 +1449,6 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
declare_toplevel_type(GenerationSpec) \
declare_toplevel_type(HeapWord) \
declare_toplevel_type(MemRegion) \
- declare_toplevel_type(PermanentGenerationSpec) \
declare_toplevel_type(ThreadLocalAllocBuffer) \
declare_toplevel_type(VirtualSpace) \
declare_toplevel_type(WaterMark) \
@@ -1524,7 +1474,6 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
declare_toplevel_type(MemRegion*) \
declare_toplevel_type(OffsetTableContigSpace*) \
declare_toplevel_type(OneContigSpaceCardGeneration*) \
- declare_toplevel_type(PermGen*) \
declare_toplevel_type(Space*) \
declare_toplevel_type(ThreadLocalAllocBuffer*) \
\
@@ -1545,15 +1494,15 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
declare_type(IntptrHashtable, BasicHashtable<mtInternal>) \
declare_type(SymbolTable, SymbolHashtable) \
declare_type(StringTable, StringHashtable) \
- declare_type(LoaderConstraintTable, klassOopHashtable) \
- declare_type(klassOopTwoOopHashtable, klassOopHashtable) \
- declare_type(Dictionary, klassOopTwoOopHashtable) \
+ declare_type(LoaderConstraintTable, KlassHashtable) \
+ declare_type(KlassTwoOopHashtable, KlassHashtable) \
+ declare_type(Dictionary, KlassTwoOopHashtable) \
declare_type(PlaceholderTable, SymbolTwoOopHashtable) \
declare_toplevel_type(BasicHashtableEntry<mtInternal>) \
declare_type(IntptrHashtableEntry, BasicHashtableEntry<mtInternal>) \
- declare_type(DictionaryEntry, klassHashtableEntry) \
+ declare_type(DictionaryEntry, KlassHashtableEntry) \
declare_type(PlaceholderEntry, SymbolHashtableEntry) \
- declare_type(LoaderConstraintEntry, klassHashtableEntry) \
+ declare_type(LoaderConstraintEntry, KlassHashtableEntry) \
declare_toplevel_type(HashtableBucket<mtInternal>) \
declare_toplevel_type(SystemDictionary) \
declare_toplevel_type(vmSymbols) \
@@ -2007,24 +1956,19 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
declare_toplevel_type(ciObjectFactory) \
declare_toplevel_type(ciConstant) \
declare_toplevel_type(ciField) \
- declare_toplevel_type(void*) \
- declare_toplevel_type(ciObject) \
- declare_type(ciMethod, ciObject) \
- declare_type(ciMethodData, ciObject) \
- declare_type(ciType, ciObject) \
- declare_type(ciInstance, ciObject) \
declare_toplevel_type(ciSymbol) \
+ declare_toplevel_type(ciBaseObject) \
+ declare_type(ciObject, ciBaseObject) \
+ declare_type(ciInstance, ciObject) \
+ declare_type(ciMetadata, ciBaseObject) \
+ declare_type(ciMethod, ciMetadata) \
+ declare_type(ciMethodData, ciMetadata) \
+ declare_type(ciType, ciMetadata) \
declare_type(ciKlass, ciType) \
declare_type(ciInstanceKlass, ciKlass) \
declare_type(ciArrayKlass, ciKlass) \
declare_type(ciTypeArrayKlass, ciArrayKlass) \
declare_type(ciObjArrayKlass, ciArrayKlass) \
- declare_type(ciMethodKlass, ciKlass) \
- declare_type(ciKlassKlass, ciKlass) \
- declare_type(ciInstanceKlassKlass, ciKlassKlass) \
- declare_type(ciArrayKlassKlass, ciKlassKlass) \
- declare_type(ciTypeArrayKlassKlass, ciArrayKlassKlass) \
- declare_type(ciObjArrayKlassKlass, ciArrayKlassKlass) \
\
/********************/ \
/* -XX flags */ \
@@ -2060,14 +2004,20 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
\
declare_integer_type(Bytecodes::Code) \
declare_integer_type(Generation::Name) \
- declare_integer_type(instanceKlass::ClassState) \
+ declare_integer_type(InstanceKlass::ClassState) \
declare_integer_type(JavaThreadState) \
declare_integer_type(Location::Type) \
declare_integer_type(Location::Where) \
- declare_integer_type(PermGen::Name) \
declare_integer_type(FlagValueOrigin) \
COMPILER2_PRESENT(declare_integer_type(OptoReg::Name)) \
\
+ declare_toplevel_type(CHeapObj<mtInternal>) \
+ declare_type(Array<int>, MetaspaceObj) \
+ declare_type(Array<u1>, MetaspaceObj) \
+ declare_type(Array<u2>, MetaspaceObj) \
+ declare_type(Array<Klass*>, MetaspaceObj) \
+ declare_type(Array<Method*>, MetaspaceObj) \
+ \
declare_integer_type(AccessFlags) /* FIXME: wrong type (not integer) */\
declare_toplevel_type(address) /* FIXME: should this be an integer type? */\
declare_integer_type(BasicType) /* FIXME: wrong type (not integer) */\
@@ -2108,7 +2058,8 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
declare_toplevel_type(Thread*) \
declare_toplevel_type(Universe) \
declare_toplevel_type(vframeArray) \
- declare_toplevel_type(vframeArrayElement)
+ declare_toplevel_type(vframeArrayElement) \
+ declare_toplevel_type(Annotations*)
/* NOTE that we do not use the last_entry() macro here; it is used */
@@ -2149,6 +2100,7 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
\
declare_constant(oopSize) \
declare_constant(LogBytesPerWord) \
+ declare_constant(BytesPerWord) \
declare_constant(BytesPerLong) \
\
/********************************************/ \
@@ -2197,10 +2149,6 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
declare_constant(HeapWordSize) \
declare_constant(LogHeapWordSize) \
\
- /* constants from PermGen::Name enum */ \
- \
- declare_constant(PermGen::MarkSweepCompact) \
- declare_constant(PermGen::MarkSweep) \
\
/************************/ \
/* PerfMemory - jvmstat */ \
@@ -2288,16 +2236,16 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
declare_constant(Klass::_lh_array_tag_obj_value) \
\
/********************************/ \
- /* constMethodOopDesc anon-enum */ \
+ /* ConstMethod anon-enum */ \
/********************************/ \
\
- declare_constant(constMethodOopDesc::_has_linenumber_table) \
- declare_constant(constMethodOopDesc::_has_checked_exceptions) \
- declare_constant(constMethodOopDesc::_has_localvariable_table) \
- declare_constant(constMethodOopDesc::_has_exception_table) \
+ declare_constant(ConstMethod::_has_linenumber_table) \
+ declare_constant(ConstMethod::_has_checked_exceptions) \
+ declare_constant(ConstMethod::_has_localvariable_table) \
+ declare_constant(ConstMethod::_has_exception_table) \
\
/*************************************/ \
- /* instanceKlass enum */ \
+ /* InstanceKlass enum */ \
/*************************************/ \
\
\
@@ -2314,26 +2262,25 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
declare_constant(FieldInfo::field_slots) \
\
/************************************************/ \
- /* instanceKlass InnerClassAttributeOffset enum */ \
+ /* InstanceKlass InnerClassAttributeOffset enum */ \
/************************************************/ \
\
- declare_constant(instanceKlass::inner_class_inner_class_info_offset) \
- declare_constant(instanceKlass::inner_class_outer_class_info_offset) \
- declare_constant(instanceKlass::inner_class_inner_name_offset) \
- declare_constant(instanceKlass::inner_class_access_flags_offset) \
- declare_constant(instanceKlass::inner_class_next_offset) \
+ declare_constant(InstanceKlass::inner_class_inner_class_info_offset) \
+ declare_constant(InstanceKlass::inner_class_outer_class_info_offset) \
+ declare_constant(InstanceKlass::inner_class_inner_name_offset) \
+ declare_constant(InstanceKlass::inner_class_access_flags_offset) \
+ declare_constant(InstanceKlass::inner_class_next_offset) \
\
/*********************************/ \
- /* instanceKlass ClassState enum */ \
+ /* InstanceKlass ClassState enum */ \
/*********************************/ \
\
- declare_constant(instanceKlass::unparsable_by_gc) \
- declare_constant(instanceKlass::allocated) \
- declare_constant(instanceKlass::loaded) \
- declare_constant(instanceKlass::linked) \
- declare_constant(instanceKlass::being_initialized) \
- declare_constant(instanceKlass::fully_initialized) \
- declare_constant(instanceKlass::initialization_error) \
+ declare_constant(InstanceKlass::allocated) \
+ declare_constant(InstanceKlass::loaded) \
+ declare_constant(InstanceKlass::linked) \
+ declare_constant(InstanceKlass::being_initialized) \
+ declare_constant(InstanceKlass::fully_initialized) \
+ declare_constant(InstanceKlass::initialization_error) \
\
/*********************************/ \
/* Symbol* - symbol max length */ \
@@ -2342,12 +2289,12 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
declare_constant(Symbol::max_symbol_length) \
\
/*************************************************/ \
- /* constantPoolOop layout enum for InvokeDynamic */ \
+ /* ConstantPool* layout enum for InvokeDynamic */ \
/*************************************************/ \
\
- declare_constant(constantPoolOopDesc::_indy_bsm_offset) \
- declare_constant(constantPoolOopDesc::_indy_argc_offset) \
- declare_constant(constantPoolOopDesc::_indy_argv_offset) \
+ declare_constant(ConstantPool::_indy_bsm_offset) \
+ declare_constant(ConstantPool::_indy_argc_offset) \
+ declare_constant(ConstantPool::_indy_argv_offset) \
\
/********************************/ \
/* ConstantPoolCacheEntry enums */ \
@@ -3167,8 +3114,13 @@ static int recursiveFindType(VMTypeEntry* origtypes, const char* typeName, bool
}
delete s;
}
+ const char* start = NULL;
if (strstr(typeName, "GrowableArray<") == typeName) {
- const char * start = typeName + strlen("GrowableArray<");
+ start = typeName + strlen("GrowableArray<");
+ } else if (strstr(typeName, "Array<") == typeName) {
+ start = typeName + strlen("Array<");
+ }
+ if (start != NULL) {
const char * end = strrchr(typeName, '>');
int len = end - start + 1;
char * s = new char[len];
diff --git a/src/share/vm/runtime/vmStructs.hpp b/src/share/vm/runtime/vmStructs.hpp
index 355746eb4..725399e2c 100644
--- a/src/share/vm/runtime/vmStructs.hpp
+++ b/src/share/vm/runtime/vmStructs.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -78,10 +78,10 @@ typedef struct {
} VMStructEntry;
typedef struct {
- const char* typeName; // Type name (example: "methodOopDesc")
+ const char* typeName; // Type name (example: "Method")
const char* superclassName; // Superclass name, or null if none (example: "oopDesc")
- int32_t isOopType; // Does this type represent an oop typedef? (i.e., "methodOop" or
- // "klassOop", but NOT "methodOopDesc")
+ int32_t isOopType; // Does this type represent an oop typedef? (i.e., "Method*" or
+ // "Klass*", but NOT "Method")
int32_t isIntegerType; // Does this type represent an integer type (of arbitrary size)?
int32_t isUnsigned; // If so, is it unsigned?
uint64_t size; // Size, in bytes, of the type
diff --git a/src/share/vm/runtime/vmThread.cpp b/src/share/vm/runtime/vmThread.cpp
index 9e421488b..470d6b1c4 100644
--- a/src/share/vm/runtime/vmThread.cpp
+++ b/src/share/vm/runtime/vmThread.cpp
@@ -26,7 +26,7 @@
#include "compiler/compileBroker.hpp"
#include "gc_interface/collectedHeap.hpp"
#include "memory/resourceArea.hpp"
-#include "oops/methodOop.hpp"
+#include "oops/method.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/interfaceSupport.hpp"
#include "runtime/mutexLocker.hpp"
diff --git a/src/share/vm/runtime/vm_operations.hpp b/src/share/vm/runtime/vm_operations.hpp
index ccbad94b7..949fa2d34 100644
--- a/src/share/vm/runtime/vm_operations.hpp
+++ b/src/share/vm/runtime/vm_operations.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -56,13 +56,12 @@
template(PrintJNI) \
template(HeapDumper) \
template(DeoptimizeTheWorld) \
+ template(CollectForMetadataAllocation) \
template(GC_HeapInspection) \
template(GenCollectFull) \
template(GenCollectFullConcurrent) \
template(GenCollectForAllocation) \
- template(GenCollectForPermanentAllocation) \
template(ParallelGCFailedAllocation) \
- template(ParallelGCFailedPermanentAllocation) \
template(ParallelGCSystemGC) \
template(CGC_Operation) \
template(CMS_Initial_Mark) \