src/share/vm/oops/constMethodKlass.cpp

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2003, 2011, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 78,88 **** CollectedHeap::permanent_obj_allocate(h_k, size, CHECK_NULL); assert(!cm->is_parsable(), "Not yet safely parsable"); No_Safepoint_Verifier no_safepoint; cm->set_interpreter_kind(Interpreter::invalid); cm->init_fingerprint(); ! cm->set_method(NULL); cm->set_stackmap_data(NULL); cm->set_exception_table(NULL); cm->set_code_size(byte_code_size); cm->set_constMethod_size(size); cm->set_inlined_tables_length(checked_exceptions_length, --- 78,88 ---- CollectedHeap::permanent_obj_allocate(h_k, size, CHECK_NULL); assert(!cm->is_parsable(), "Not yet safely parsable"); No_Safepoint_Verifier no_safepoint; cm->set_interpreter_kind(Interpreter::invalid); cm->init_fingerprint(); ! cm->set_constants(NULL); cm->set_stackmap_data(NULL); cm->set_exception_table(NULL); cm->set_code_size(byte_code_size); cm->set_constMethod_size(size); cm->set_inlined_tables_length(checked_exceptions_length,
*** 96,106 **** } void constMethodKlass::oop_follow_contents(oop obj) { assert (obj->is_constMethod(), "object must be constMethod"); constMethodOop cm = constMethodOop(obj); ! MarkSweep::mark_and_push(cm->adr_method()); MarkSweep::mark_and_push(cm->adr_stackmap_data()); MarkSweep::mark_and_push(cm->adr_exception_table()); // Performance tweak: We skip iterating over the klass pointer since we // know that Universe::constMethodKlassObj never moves. } --- 96,106 ---- } void constMethodKlass::oop_follow_contents(oop obj) { assert (obj->is_constMethod(), "object must be constMethod"); constMethodOop cm = constMethodOop(obj); ! MarkSweep::mark_and_push(cm->adr_constants()); MarkSweep::mark_and_push(cm->adr_stackmap_data()); MarkSweep::mark_and_push(cm->adr_exception_table()); // Performance tweak: We skip iterating over the klass pointer since we // know that Universe::constMethodKlassObj never moves. }
*** 108,129 **** #ifndef SERIALGC void constMethodKlass::oop_follow_contents(ParCompactionManager* cm, oop obj) { assert (obj->is_constMethod(), "object must be constMethod"); constMethodOop cm_oop = constMethodOop(obj); ! PSParallelCompact::mark_and_push(cm, cm_oop->adr_method()); PSParallelCompact::mark_and_push(cm, cm_oop->adr_stackmap_data()); PSParallelCompact::mark_and_push(cm, cm_oop->adr_exception_table()); // Performance tweak: We skip iterating over the klass pointer since we // know that Universe::constMethodKlassObj never moves. } #endif // SERIALGC int constMethodKlass::oop_oop_iterate(oop obj, OopClosure* blk) { assert (obj->is_constMethod(), "object must be constMethod"); constMethodOop cm = constMethodOop(obj); ! blk->do_oop(cm->adr_method()); blk->do_oop(cm->adr_stackmap_data()); blk->do_oop(cm->adr_exception_table()); // Get size before changing pointers. // Don't call size() or oop_size() since that is a virtual call. int size = cm->object_size(); --- 108,129 ---- #ifndef SERIALGC void constMethodKlass::oop_follow_contents(ParCompactionManager* cm, oop obj) { assert (obj->is_constMethod(), "object must be constMethod"); constMethodOop cm_oop = constMethodOop(obj); ! PSParallelCompact::mark_and_push(cm, cm_oop->adr_constants()); PSParallelCompact::mark_and_push(cm, cm_oop->adr_stackmap_data()); PSParallelCompact::mark_and_push(cm, cm_oop->adr_exception_table()); // Performance tweak: We skip iterating over the klass pointer since we // know that Universe::constMethodKlassObj never moves. } #endif // SERIALGC int constMethodKlass::oop_oop_iterate(oop obj, OopClosure* blk) { assert (obj->is_constMethod(), "object must be constMethod"); constMethodOop cm = constMethodOop(obj); ! blk->do_oop(cm->adr_constants()); blk->do_oop(cm->adr_stackmap_data()); blk->do_oop(cm->adr_exception_table()); // Get size before changing pointers. // Don't call size() or oop_size() since that is a virtual call. int size = cm->object_size();
*** 133,143 **** int constMethodKlass::oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr) { assert (obj->is_constMethod(), "object must be constMethod"); constMethodOop cm = constMethodOop(obj); oop* adr; ! adr = cm->adr_method(); if (mr.contains(adr)) blk->do_oop(adr); adr = cm->adr_stackmap_data(); if (mr.contains(adr)) blk->do_oop(adr); adr = cm->adr_exception_table(); if (mr.contains(adr)) blk->do_oop(adr); --- 133,143 ---- int constMethodKlass::oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr) { assert (obj->is_constMethod(), "object must be constMethod"); constMethodOop cm = constMethodOop(obj); oop* adr; ! adr = cm->adr_constants(); if (mr.contains(adr)) blk->do_oop(adr); adr = cm->adr_stackmap_data(); if (mr.contains(adr)) blk->do_oop(adr); adr = cm->adr_exception_table(); if (mr.contains(adr)) blk->do_oop(adr);
*** 151,161 **** int constMethodKlass::oop_adjust_pointers(oop obj) { assert(obj->is_constMethod(), "should be constMethod"); constMethodOop cm = constMethodOop(obj); ! MarkSweep::adjust_pointer(cm->adr_method()); MarkSweep::adjust_pointer(cm->adr_stackmap_data()); MarkSweep::adjust_pointer(cm->adr_exception_table()); // Get size before changing pointers. // Don't call size() or oop_size() since that is a virtual call. int size = cm->object_size(); --- 151,161 ---- int constMethodKlass::oop_adjust_pointers(oop obj) { assert(obj->is_constMethod(), "should be constMethod"); constMethodOop cm = constMethodOop(obj); ! MarkSweep::adjust_pointer(cm->adr_constants()); MarkSweep::adjust_pointer(cm->adr_stackmap_data()); MarkSweep::adjust_pointer(cm->adr_exception_table()); // Get size before changing pointers. // Don't call size() or oop_size() since that is a virtual call. int size = cm->object_size();
*** 186,197 **** void constMethodKlass::oop_print_on(oop obj, outputStream* st) { ResourceMark rm; assert(obj->is_constMethod(), "must be constMethod"); Klass::oop_print_on(obj, st); constMethodOop m = constMethodOop(obj); ! st->print(" - method: " INTPTR_FORMAT " ", (address)m->method()); ! m->method()->print_value_on(st); st->cr(); st->print(" - exceptions: " INTPTR_FORMAT "\n", (address)m->exception_table()); if (m->has_stackmap_table()) { st->print(" - stackmap data: "); m->stackmap_data()->print_value_on(st); st->cr(); --- 186,197 ---- void constMethodKlass::oop_print_on(oop obj, outputStream* st) { ResourceMark rm; assert(obj->is_constMethod(), "must be constMethod"); Klass::oop_print_on(obj, st); constMethodOop m = constMethodOop(obj); ! st->print(" - constants: " INTPTR_FORMAT " ", (address)m->constants()); ! m->constants()->print_value_on(st); st->cr(); st->print(" - exceptions: " INTPTR_FORMAT "\n", (address)m->exception_table()); if (m->has_stackmap_table()) { st->print(" - stackmap data: "); m->stackmap_data()->print_value_on(st); st->cr();
*** 221,232 **** guarantee(m->is_perm(), "should be in permspace"); // Verification can occur during oop construction before the method or // other fields have been initialized. if (!obj->partially_loaded()) { ! guarantee(m->method()->is_perm(), "should be in permspace"); ! guarantee(m->method()->is_method(), "should be method"); typeArrayOop stackmap_data = m->stackmap_data(); guarantee(stackmap_data == NULL || stackmap_data->is_perm(), "should be in permspace"); guarantee(m->exception_table()->is_perm(), "should be in permspace"); guarantee(m->exception_table()->is_typeArray(), "should be type array"); --- 221,232 ---- guarantee(m->is_perm(), "should be in permspace"); // Verification can occur during oop construction before the method or // other fields have been initialized. if (!obj->partially_loaded()) { ! guarantee(m->constants()->is_perm(), "should be in permspace"); ! guarantee(m->constants()->is_constantPool(), "should be constant pool"); typeArrayOop stackmap_data = m->stackmap_data(); guarantee(stackmap_data == NULL || stackmap_data->is_perm(), "should be in permspace"); guarantee(m->exception_table()->is_perm(), "should be in permspace"); guarantee(m->exception_table()->is_typeArray(), "should be type array");