comparison src/share/vm/graal/graalRuntime.cpp @ 12435:43e004461248

Merge
author Christos Kotselidis <christos.kotselidis@oracle.com>
date Wed, 16 Oct 2013 01:12:47 +0200
parents 808348377021 370b5f07f9e2
children e27f3169460e
comparison
equal deleted inserted replaced
12434:90f3c090a002 12435:43e004461248
129 assert(rank >= 1, "rank must be nonzero"); 129 assert(rank >= 1, "rank must be nonzero");
130 oop obj = ArrayKlass::cast(klass)->multi_allocate(rank, dims, CHECK); 130 oop obj = ArrayKlass::cast(klass)->multi_allocate(rank, dims, CHECK);
131 thread->set_vm_result(obj); 131 thread->set_vm_result(obj);
132 JRT_END 132 JRT_END
133 133
134 JRT_ENTRY(void, GraalRuntime::dynamic_new_array(JavaThread* thread, oop element_mirror, jint length)) 134 JRT_ENTRY(void, GraalRuntime::dynamic_new_array(JavaThread* thread, oopDesc* element_mirror, jint length))
135 oop obj = Reflection::reflect_new_array(element_mirror, length, CHECK); 135 oop obj = Reflection::reflect_new_array(element_mirror, length, CHECK);
136 thread->set_vm_result(obj); 136 thread->set_vm_result(obj);
137 JRT_END 137 JRT_END
138 138
139 extern void vm_exit(int code); 139 extern void vm_exit(int code);
369 tty->print_cr("%s: exited locking slow case with obj=" INTPTR_FORMAT ", type=%s, mark=" INTPTR_FORMAT ", lock=" INTPTR_FORMAT, thread->name(), obj, type, obj->mark(), lock); 369 tty->print_cr("%s: exited locking slow case with obj=" INTPTR_FORMAT ", type=%s, mark=" INTPTR_FORMAT ", lock=" INTPTR_FORMAT, thread->name(), obj, type, obj->mark(), lock);
370 tty->flush(); 370 tty->flush();
371 } 371 }
372 JRT_END 372 JRT_END
373 373
374 JRT_ENTRY(void, GraalRuntime::log_object(JavaThread* thread, oop obj, jint flags)) 374 JRT_ENTRY(void, GraalRuntime::log_object(JavaThread* thread, oopDesc* obj, jint flags))
375 bool string = mask_bits_are_true(flags, LOG_OBJECT_STRING); 375 bool string = mask_bits_are_true(flags, LOG_OBJECT_STRING);
376 bool addr = mask_bits_are_true(flags, LOG_OBJECT_ADDRESS); 376 bool addr = mask_bits_are_true(flags, LOG_OBJECT_ADDRESS);
377 bool newline = mask_bits_are_true(flags, LOG_OBJECT_NEWLINE); 377 bool newline = mask_bits_are_true(flags, LOG_OBJECT_NEWLINE);
378 if (!string) { 378 if (!string) {
379 if (!addr && obj->is_oop_or_null(true)) { 379 if (!addr && obj->is_oop_or_null(true)) {
414 ret=false; 414 ret=false;
415 } 415 }
416 return (jint)ret; 416 return (jint)ret;
417 JRT_END 417 JRT_END
418 418
419 JRT_ENTRY(void, GraalRuntime::vm_error(JavaThread* thread, oop where, oop format, jlong value)) 419 JRT_ENTRY(void, GraalRuntime::vm_error(JavaThread* thread, oopDesc* where, oopDesc* format, jlong value))
420 ResourceMark rm; 420 ResourceMark rm;
421 assert(where == NULL || java_lang_String::is_instance(where), "must be"); 421 assert(where == NULL || java_lang_String::is_instance(where), "must be");
422 const char *error_msg = where == NULL ? "<internal Graal error>" : java_lang_String::as_utf8_string(where); 422 const char *error_msg = where == NULL ? "<internal Graal error>" : java_lang_String::as_utf8_string(where);
423 char *detail_msg = NULL; 423 char *detail_msg = NULL;
424 if (format != NULL) { 424 if (format != NULL) {
428 jio_snprintf(detail_msg, detail_msg_length, buf, value); 428 jio_snprintf(detail_msg, detail_msg_length, buf, value);
429 } 429 }
430 report_vm_error(__FILE__, __LINE__, error_msg, detail_msg); 430 report_vm_error(__FILE__, __LINE__, error_msg, detail_msg);
431 JRT_END 431 JRT_END
432 432
433 JRT_LEAF(oop, GraalRuntime::load_and_clear_exception(JavaThread* thread)) 433 JRT_LEAF(oopDesc*, GraalRuntime::load_and_clear_exception(JavaThread* thread))
434 oop exception = thread->exception_oop(); 434 oop exception = thread->exception_oop();
435 assert(exception != NULL, "npe"); 435 assert(exception != NULL, "npe");
436 thread->set_exception_oop(NULL); 436 thread->set_exception_oop(NULL);
437 thread->set_exception_pc(0); 437 thread->set_exception_pc(0);
438 return exception; 438 return exception;
439 JRT_END 439 JRT_END
440 440
441 JRT_LEAF(void, GraalRuntime::log_printf(JavaThread* thread, oop format, jlong v1, jlong v2, jlong v3)) 441 JRT_LEAF(void, GraalRuntime::log_printf(JavaThread* thread, oopDesc* format, jlong v1, jlong v2, jlong v3))
442 ResourceMark rm; 442 ResourceMark rm;
443 assert(format != NULL && java_lang_String::is_instance(format), "must be"); 443 assert(format != NULL && java_lang_String::is_instance(format), "must be");
444 char *buf = java_lang_String::as_utf8_string(format); 444 char *buf = java_lang_String::as_utf8_string(format);
445 tty->print(buf, v1, v2, v3); 445 tty->print(buf, v1, v2, v3);
446 JRT_END 446 JRT_END
506 if (newline) { 506 if (newline) {
507 tty->cr(); 507 tty->cr();
508 } 508 }
509 JRT_END 509 JRT_END
510 510
511 JRT_ENTRY(jint, GraalRuntime::identity_hash_code(JavaThread* thread, oop obj)) 511 JRT_ENTRY(jint, GraalRuntime::identity_hash_code(JavaThread* thread, oopDesc* obj))
512 return (jint) obj->identity_hash(); 512 return (jint) obj->identity_hash();
513 JRT_END 513 JRT_END
514 514
515 JRT_ENTRY(jboolean, GraalRuntime::thread_is_interrupted(JavaThread* thread, oop receiver, jboolean clear_interrupted)) 515 JRT_ENTRY(jboolean, GraalRuntime::thread_is_interrupted(JavaThread* thread, oopDesc* receiver, jboolean clear_interrupted))
516 // Ensure that the C++ Thread and OSThread structures aren't freed before we operate 516 // Ensure that the C++ Thread and OSThread structures aren't freed before we operate
517 Handle receiverHandle(thread, receiver); 517 Handle receiverHandle(thread, receiver);
518 MutexLockerEx ml(thread->threadObj() == receiver ? NULL : Threads_lock); 518 MutexLockerEx ml(thread->threadObj() == (void*)receiver ? NULL : Threads_lock);
519 JavaThread* receiverThread = java_lang_Thread::thread(receiverHandle()); 519 JavaThread* receiverThread = java_lang_Thread::thread(receiverHandle());
520 return (jint) Thread::is_interrupted(receiverThread, clear_interrupted != 0); 520 return (jint) Thread::is_interrupted(receiverThread, clear_interrupted != 0);
521 JRT_END 521 JRT_END
522 522
523 // JVM_InitializeGraalRuntime 523 // JVM_InitializeGraalRuntime