Mercurial > hg > truffle
comparison src/share/vm/opto/callGenerator.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 | 7a302948f5a4 |
children | e626685e9f6c |
comparison
equal
deleted
inserted
replaced
6724:36d1d483d5d6 | 6725:da91efe96a93 |
---|---|
23 */ | 23 */ |
24 | 24 |
25 #include "precompiled.hpp" | 25 #include "precompiled.hpp" |
26 #include "ci/bcEscapeAnalyzer.hpp" | 26 #include "ci/bcEscapeAnalyzer.hpp" |
27 #include "ci/ciCallSite.hpp" | 27 #include "ci/ciCallSite.hpp" |
28 #include "ci/ciCPCache.hpp" | 28 #include "ci/ciObjArray.hpp" |
29 #include "ci/ciMemberName.hpp" | 29 #include "ci/ciMemberName.hpp" |
30 #include "ci/ciMethodHandle.hpp" | 30 #include "ci/ciMethodHandle.hpp" |
31 #include "classfile/javaClasses.hpp" | 31 #include "classfile/javaClasses.hpp" |
32 #include "compiler/compileLog.hpp" | 32 #include "compiler/compileLog.hpp" |
33 #include "opto/addnode.hpp" | 33 #include "opto/addnode.hpp" |
165 int _vtable_index; | 165 int _vtable_index; |
166 public: | 166 public: |
167 VirtualCallGenerator(ciMethod* method, int vtable_index) | 167 VirtualCallGenerator(ciMethod* method, int vtable_index) |
168 : CallGenerator(method), _vtable_index(vtable_index) | 168 : CallGenerator(method), _vtable_index(vtable_index) |
169 { | 169 { |
170 assert(vtable_index == methodOopDesc::invalid_vtable_index || | 170 assert(vtable_index == Method::invalid_vtable_index || |
171 vtable_index >= 0, "either invalid or usable"); | 171 vtable_index >= 0, "either invalid or usable"); |
172 } | 172 } |
173 virtual bool is_virtual() const { return true; } | 173 virtual bool is_virtual() const { return true; } |
174 virtual JVMState* generate(JVMState* jvms); | 174 virtual JVMState* generate(JVMState* jvms); |
175 }; | 175 }; |
215 } | 215 } |
216 | 216 |
217 assert(!method()->is_static(), "virtual call must not be to static"); | 217 assert(!method()->is_static(), "virtual call must not be to static"); |
218 assert(!method()->is_final(), "virtual call should not be to final"); | 218 assert(!method()->is_final(), "virtual call should not be to final"); |
219 assert(!method()->is_private(), "virtual call should not be to private"); | 219 assert(!method()->is_private(), "virtual call should not be to private"); |
220 assert(_vtable_index == methodOopDesc::invalid_vtable_index || !UseInlineCaches, | 220 assert(_vtable_index == Method::invalid_vtable_index || !UseInlineCaches, |
221 "no vtable calls if +UseInlineCaches "); | 221 "no vtable calls if +UseInlineCaches "); |
222 address target = SharedRuntime::get_resolve_virtual_call_stub(); | 222 address target = SharedRuntime::get_resolve_virtual_call_stub(); |
223 // Normal inline cache used for call | 223 // Normal inline cache used for call |
224 CallDynamicJavaNode *call = new (kit.C, tf()->domain()->cnt()) CallDynamicJavaNode(tf(), target, method(), _vtable_index, kit.bci()); | 224 CallDynamicJavaNode *call = new (kit.C, tf()->domain()->cnt()) CallDynamicJavaNode(tf(), target, method(), _vtable_index, kit.bci()); |
225 kit.set_arguments_for_java_call(call); | 225 kit.set_arguments_for_java_call(call); |
601 Node* receiver = kit.argument(0); | 601 Node* receiver = kit.argument(0); |
602 if (receiver->Opcode() == Op_ConP) { | 602 if (receiver->Opcode() == Op_ConP) { |
603 const TypeOopPtr* oop_ptr = receiver->bottom_type()->is_oopptr(); | 603 const TypeOopPtr* oop_ptr = receiver->bottom_type()->is_oopptr(); |
604 ciMethod* target = oop_ptr->const_oop()->as_method_handle()->get_vmtarget(); | 604 ciMethod* target = oop_ptr->const_oop()->as_method_handle()->get_vmtarget(); |
605 guarantee(!target->is_method_handle_intrinsic(), "should not happen"); // XXX remove | 605 guarantee(!target->is_method_handle_intrinsic(), "should not happen"); // XXX remove |
606 const int vtable_index = methodOopDesc::invalid_vtable_index; | 606 const int vtable_index = Method::invalid_vtable_index; |
607 CallGenerator* cg = C->call_generator(target, vtable_index, false, jvms, true, PROB_ALWAYS); | 607 CallGenerator* cg = C->call_generator(target, vtable_index, false, jvms, true, PROB_ALWAYS); |
608 if (cg != NULL && cg->is_inline()) | 608 if (cg != NULL && cg->is_inline()) |
609 return cg; | 609 return cg; |
610 } else { | 610 } else { |
611 if (PrintInlining) CompileTask::print_inlining(callee, jvms->depth() - 1, jvms->bci(), "receiver not constant"); | 611 if (PrintInlining) CompileTask::print_inlining(callee, jvms->depth() - 1, jvms->bci(), "receiver not constant"); |
651 Node* cast_obj = gvn.transform(new (C, 2) CheckCastPPNode(kit.control(), arg, sig_type)); | 651 Node* cast_obj = gvn.transform(new (C, 2) CheckCastPPNode(kit.control(), arg, sig_type)); |
652 kit.set_argument(receiver_skip + i, cast_obj); | 652 kit.set_argument(receiver_skip + i, cast_obj); |
653 } | 653 } |
654 } | 654 } |
655 } | 655 } |
656 const int vtable_index = methodOopDesc::invalid_vtable_index; | 656 const int vtable_index = Method::invalid_vtable_index; |
657 const bool call_is_virtual = target->is_abstract(); // FIXME workaround | 657 const bool call_is_virtual = target->is_abstract(); // FIXME workaround |
658 CallGenerator* cg = C->call_generator(target, vtable_index, call_is_virtual, jvms, true, PROB_ALWAYS); | 658 CallGenerator* cg = C->call_generator(target, vtable_index, call_is_virtual, jvms, true, PROB_ALWAYS); |
659 if (cg != NULL && cg->is_inline()) | 659 if (cg != NULL && cg->is_inline()) |
660 return cg; | 660 return cg; |
661 } | 661 } |