comparison src/share/vm/c1x/c1x_VMEntries.cpp @ 2492:4e5515d09314

Fixed merge issues. - Accessing static fields from the java.lang.Class object instead of the klassOop (1-line-change) - Fixed issue with RiField object caching (the caching was only taking the offset as a field ID, but need to take offset+is_static)
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Fri, 22 Apr 2011 19:00:07 +0200
parents e3c42b8de67e
children ad9b14650e15
comparison
equal deleted inserted replaced
2491:0654ee04b214 2492:4e5515d09314
293 index = C1XCompiler::to_cp_index_u2(index); 293 index = C1XCompiler::to_cp_index_u2(index);
294 constantPoolOop cp = VmIds::get<constantPoolOop>(vmId); 294 constantPoolOop cp = VmIds::get<constantPoolOop>(vmId);
295 295
296 ciInstanceKlass* loading_klass = (ciInstanceKlass *) CURRENT_ENV->get_object(cp->pool_holder()); 296 ciInstanceKlass* loading_klass = (ciInstanceKlass *) CURRENT_ENV->get_object(cp->pool_holder());
297 ciField *field = CURRENT_ENV->get_field_by_index(loading_klass, index); 297 ciField *field = CURRENT_ENV->get_field_by_index(loading_klass, index);
298
298 Bytecodes::Code code = (Bytecodes::Code)(((int) byteCode) & 0xFF); 299 Bytecodes::Code code = (Bytecodes::Code)(((int) byteCode) & 0xFF);
299 Handle field_handle = C1XCompiler::get_RiField(field, loading_klass, cp->pool_holder(), code, THREAD); 300 Handle field_handle = C1XCompiler::get_RiField(field, loading_klass, cp->pool_holder(), code, THREAD);
300 bool is_constant = field->is_constant(); 301 bool is_constant = field->is_constant();
301 if (is_constant && field->is_static()) { 302 if (is_constant && field->is_static()) {
302 ciConstant constant = field->constant_value(); 303 ciConstant constant = field->constant_value();
367 Symbol* signature_symbol = VmIds::toSymbol(signature); 368 Symbol* signature_symbol = VmIds::toSymbol(signature);
368 methodOop method = klass->klass_part()->lookup_method(name_symbol, signature_symbol); 369 methodOop method = klass->klass_part()->lookup_method(name_symbol, signature_symbol);
369 if (method == NULL) { 370 if (method == NULL) {
370 if (TraceC1X >= 3) { 371 if (TraceC1X >= 3) {
371 ResourceMark rm; 372 ResourceMark rm;
372 tty->print_cr("Could not resolve method %s %s on klass %d", name_symbol->as_C_string(), signature_symbol->as_C_string(), klass->klass_part()->name()->as_C_string()); 373 tty->print_cr("Could not resolve method %s %s on klass %s", name_symbol->as_C_string(), signature_symbol->as_C_string(), klass->klass_part()->name()->as_C_string());
373 } 374 }
374 return NULL; 375 return NULL;
375 } 376 }
376 return JNIHandles::make_local(THREAD, VMExits::createRiMethodResolved(VmIds::add<methodOop>(method), Handle(JNIHandles::resolve(name)), THREAD)); 377 return JNIHandles::make_local(THREAD, VMExits::createRiMethodResolved(VmIds::add<methodOop>(method), Handle(JNIHandles::resolve(name)), THREAD));
377 } 378 }
615 616
616 // public void recordBailout(String reason); 617 // public void recordBailout(String reason);
617 JNIEXPORT void JNICALL Java_com_sun_hotspot_c1x_VMEntries_recordBailout(JNIEnv *jniEnv, jobject message) { 618 JNIEXPORT void JNICALL Java_com_sun_hotspot_c1x_VMEntries_recordBailout(JNIEnv *jniEnv, jobject message) {
618 if (C1XBailoutIsFatal) { 619 if (C1XBailoutIsFatal) {
619 Handle msg = JNIHandles::resolve(message); 620 Handle msg = JNIHandles::resolve(message);
620 if (msg.is_null()) { 621 if (!msg.is_null()) {
621 java_lang_String::print(msg, tty); 622 java_lang_String::print(msg, tty);
622 } 623 }
623 fatal("Bailout in C1X"); 624 fatal("Bailout in C1X");
624 } 625 }
625 } 626 }