comparison src/share/vm/c1x/c1x_Compiler.cpp @ 1410:b30a2cd5e3a2

Added methods to c1x_VMExits.cpp Some memos: - the result is not stored in a jobject, but in an oop! => (oop)get_as_jobject() - we get problems with locks hold by the user program when disabling background compilation => currently this makes an assert, we need a better solution
author Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
date Wed, 12 May 2010 16:29:41 +0200
parents 09e7826ecf01
children 9195b99c841b
comparison
equal deleted inserted replaced
1407:09e7826ecf01 1410:b30a2cd5e3a2
37 VM_ENTRY_MARK; 37 VM_ENTRY_MARK;
38 38
39 ResourceMark rm; 39 ResourceMark rm;
40 HandleMark hm; 40 HandleMark hm;
41 41
42 TRACE_C1X_1("compile_method"); 42 CompilerThread::current()->set_compiling(true);
43 43 oop rimethod = get_rimethod(target);
44 methodHandle method(Thread::current(), (methodOop)target->get_oop()); 44 VMExits::compileMethod(rimethod, entry_bci);
45 TRACE_C1X_1("name = %s", method->name_and_sig_as_C_string()); 45 CompilerThread::current()->set_compiling(false);
46
47 JavaValue result(T_VOID);
48 symbolHandle syKlass = oopFactory::new_symbol("com/sun/hotspot/c1x/VMExits", CHECK);
49
50
51 Handle nullh;
52 KlassHandle k = SystemDictionary::resolve_or_null(syKlass, nullh, nullh, CHECK);
53 if (k.is_null()) {
54 tty->print_cr("not found");
55 return;//fatal("Could not find class com.sun.hotspot.c1x.VMExits");
56 }
57 symbolHandle syName = oopFactory::new_symbol("compileMethod", CHECK);
58 symbolHandle sySig = oopFactory::new_symbol("(Lcom/sun/cri/ri/RiMethod;I)V", CHECK);
59 JavaCallArguments args;
60 args.push_oop(method());
61 args.push_int(entry_bci);
62 JavaCalls::call_static(&result, k, syName, sySig, &args, CHECK);
63 } 46 }
64 47
65 // Print compilation timers and statistics 48 // Print compilation timers and statistics
66 void C1XCompiler::print_timers() { 49 void C1XCompiler::print_timers() {
67 TRACE_C1X_1("print_timers"); 50 TRACE_C1X_1("print_timers");
68 } 51 }
52
53 oop C1XCompiler::get_rimethod(ciMethod *method) {
54 methodOop m = (methodOop)method->get_oop();
55 // TODO: implement caching
56 return VMExits::createRiMethod(m);
57 }