Mercurial > hg > truffle
diff src/cpu/zero/vm/cppInterpreter_zero.cpp @ 6725:da91efe96a93
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>
author | coleenp |
---|---|
date | Sat, 01 Sep 2012 13:25:18 -0400 |
parents | 1d7922586cf6 |
children | a3e2f723f2a5 |
line wrap: on
line diff
--- a/src/cpu/zero/vm/cppInterpreter_zero.cpp Fri Aug 31 16:39:35 2012 -0700 +++ b/src/cpu/zero/vm/cppInterpreter_zero.cpp Sat Sep 01 13:25:18 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -31,8 +31,8 @@ #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "oops/arrayOop.hpp" -#include "oops/methodDataOop.hpp" -#include "oops/methodOop.hpp" +#include "oops/methodData.hpp" +#include "oops/method.hpp" #include "oops/oop.inline.hpp" #include "prims/jvmtiExport.hpp" #include "prims/jvmtiThreadState.hpp" @@ -65,7 +65,7 @@ CALL_VM_NOCHECK_NOFIX(func) \ fixup_after_potential_safepoint() -int CppInterpreter::normal_entry(methodOop method, intptr_t UNUSED, TRAPS) { +int CppInterpreter::normal_entry(Method* method, intptr_t UNUSED, TRAPS) { JavaThread *thread = (JavaThread *) THREAD; // Allocate and initialize our frame. @@ -90,7 +90,7 @@ InterpreterFrame *frame = thread->top_zero_frame()->as_interpreter_frame(); interpreterState istate = frame->interpreter_state(); - methodOop method = istate->method(); + Method* method = istate->method(); intptr_t *result = NULL; int result_slots = 0; @@ -114,7 +114,7 @@ // Examine the message from the interpreter to decide what to do if (istate->msg() == BytecodeInterpreter::call_method) { - methodOop callee = istate->callee(); + Method* callee = istate->callee(); // Trim back the stack to put the parameters at the top stack->set_sp(istate->stack() + 1); @@ -215,7 +215,7 @@ stack->push(result[-i]); } -int CppInterpreter::native_entry(methodOop method, intptr_t UNUSED, TRAPS) { +int CppInterpreter::native_entry(Method* method, intptr_t UNUSED, TRAPS) { // Make sure method is native and not abstract assert(method->is_native() && !method->is_abstract(), "should be"); @@ -485,7 +485,7 @@ return 0; } -int CppInterpreter::accessor_entry(methodOop method, intptr_t UNUSED, TRAPS) { +int CppInterpreter::accessor_entry(Method* method, intptr_t UNUSED, TRAPS) { JavaThread *thread = (JavaThread *) THREAD; ZeroStack *stack = thread->zero_stack(); intptr_t *locals = stack->sp(); @@ -518,7 +518,7 @@ // Get the entry from the constant pool cache, and drop into // the slow path if it has not been resolved - constantPoolCacheOop cache = method->constants()->cache(); + ConstantPoolCache* cache = method->constants()->cache(); ConstantPoolCacheEntry* entry = cache->entry_at(index); if (!entry->is_resolved(Bytecodes::_getfield)) { return normal_entry(method, 0, THREAD); @@ -613,7 +613,7 @@ return 0; } -int CppInterpreter::empty_entry(methodOop method, intptr_t UNUSED, TRAPS) { +int CppInterpreter::empty_entry(Method* method, intptr_t UNUSED, TRAPS) { JavaThread *thread = (JavaThread *) THREAD; ZeroStack *stack = thread->zero_stack(); @@ -629,7 +629,7 @@ return 0; } -int CppInterpreter::method_handle_entry(methodOop method, +int CppInterpreter::method_handle_entry(Method* method, intptr_t UNUSED, TRAPS) { JavaThread *thread = (JavaThread *) THREAD; ZeroStack *stack = thread->zero_stack(); @@ -737,7 +737,7 @@ MethodHandles::EntryKind entry_kind = (MethodHandles::EntryKind) (((intptr_t) entry) & 0xffffffff); - methodOop method = NULL; + Method* method = NULL; switch (entry_kind) { case MethodHandles::_invokestatic_mh: direct_to_method = true; @@ -761,13 +761,13 @@ } if (entry_kind != MethodHandles::_invokespecial_mh) { intptr_t index = java_lang_invoke_DirectMethodHandle::vmindex(method_handle); - instanceKlass* rcvrKlass = - (instanceKlass *) receiver->klass()->klass_part(); + InstanceKlass* rcvrKlass = + (InstanceKlass *) receiver->klass(); if (entry_kind == MethodHandles::_invokevirtual_mh) { - method = (methodOop) rcvrKlass->start_of_vtable()[index]; + method = (Method*) rcvrKlass->start_of_vtable()[index]; } else { - oop iclass = java_lang_invoke_MethodHandle::vmtarget(method_handle); + oop iclass = java_lang_invoke_MethodHandle::next_target(method_handle); itableOffsetEntry* ki = (itableOffsetEntry *) rcvrKlass->start_of_itable(); int i, length = rcvrKlass->itable_length(); @@ -873,7 +873,7 @@ case MethodHandles::_adapter_retype_only: case MethodHandles::_adapter_retype_raw: src_rtype = result_type_of_handle( - java_lang_invoke_MethodHandle::vmtarget(method_handle)); + java_lang_invoke_MethodHandle::next_target(method_handle)); dst_rtype = result_type_of_handle(method_handle); break; @@ -883,12 +883,12 @@ java_lang_invoke_AdapterMethodHandle::vmargslot(method_handle); oop arg = VMSLOTS_OBJECT(arg_slot); if (arg != NULL) { - klassOop objKlassOop = arg->klass(); - klassOop klassOf = java_lang_Class::as_klassOop( + Klass* objKlassOop = arg->klass(); + Klass* klassOf = java_lang_Class::as_Klass( java_lang_invoke_AdapterMethodHandle::argument(method_handle)); if (objKlassOop != klassOf && - !objKlassOop->klass_part()->is_subtype_of(klassOf)) { + !objKlassOop->is_subtype_of(klassOf)) { ResourceMark rm(THREAD); const char* objName = Klass::cast(objKlassOop)->external_name(); const char* klassName = Klass::cast(klassOf)->external_name(); @@ -1089,14 +1089,14 @@ if (direct_to_method) { if (method == NULL) { method = - (methodOop) java_lang_invoke_MethodHandle::vmtarget(method_handle); + (Method*) java_lang_invoke_MethodHandle::vmtarget(method_handle); } address entry_point = method->from_interpreted_entry(); Interpreter::invoke_method(method, entry_point, THREAD); } else { process_method_handle( - java_lang_invoke_MethodHandle::vmtarget(method_handle), THREAD); + java_lang_invoke_MethodHandle::next_target(method_handle), THREAD); } // NB all oops now trashed @@ -1172,7 +1172,7 @@ BasicType CppInterpreter::result_type_of_handle(oop method_handle) { oop method_type = java_lang_invoke_MethodHandle::type(method_handle); oop return_type = java_lang_invoke_MethodType::rtype(method_type); - return java_lang_Class::as_BasicType(return_type, (klassOop *) NULL); + return java_lang_Class::as_BasicType(return_type, (Klass* *) NULL); } intptr_t* CppInterpreter::calculate_unwind_sp(ZeroStack* stack, @@ -1189,7 +1189,7 @@ THROW_MSG(name, message); IRT_END -InterpreterFrame *InterpreterFrame::build(const methodOop method, TRAPS) { +InterpreterFrame *InterpreterFrame::build(Method* const method, TRAPS) { JavaThread *thread = (JavaThread *) THREAD; ZeroStack *stack = thread->zero_stack(); @@ -1285,7 +1285,7 @@ return i; } -BasicType CppInterpreter::result_type_of(methodOop method) { +BasicType CppInterpreter::result_type_of(Method* method) { BasicType t; switch (method->result_index()) { case 0 : t = T_BOOLEAN; break; @@ -1440,7 +1440,7 @@ return (InterpreterFrame *) fp; } -int AbstractInterpreter::layout_activation(methodOop method, +int AbstractInterpreter::layout_activation(Method* method, int tempcount, int popframe_extra_args, int moncount, @@ -1496,7 +1496,7 @@ void BytecodeInterpreter::layout_interpreterState(interpreterState istate, frame* caller, frame* current, - methodOop method, + Method* method, intptr_t* locals, intptr_t* stack, intptr_t* stack_base, @@ -1539,7 +1539,7 @@ // Helper for (runtime) stack overflow checks -int AbstractInterpreter::size_top_interpreter_activation(methodOop method) { +int AbstractInterpreter::size_top_interpreter_activation(Method* method) { return 0; }