comparison src/share/vm/graal/graalRuntime.cpp @ 12423:370b5f07f9e2

The runtime entries need to use oopDesc* rather than oop in their signature
author Gilles Duboscq <duboscq@ssw.jku.at>
date Tue, 15 Oct 2013 14:46:25 +0200
parents 2dfccd93510a
children 43e004461248
comparison
equal deleted inserted replaced
12422:d837abecd503 12423:370b5f07f9e2
106 assert(rank >= 1, "rank must be nonzero"); 106 assert(rank >= 1, "rank must be nonzero");
107 oop obj = ArrayKlass::cast(klass)->multi_allocate(rank, dims, CHECK); 107 oop obj = ArrayKlass::cast(klass)->multi_allocate(rank, dims, CHECK);
108 thread->set_vm_result(obj); 108 thread->set_vm_result(obj);
109 JRT_END 109 JRT_END
110 110
111 JRT_ENTRY(void, GraalRuntime::dynamic_new_array(JavaThread* thread, oop element_mirror, jint length)) 111 JRT_ENTRY(void, GraalRuntime::dynamic_new_array(JavaThread* thread, oopDesc* element_mirror, jint length))
112 oop obj = Reflection::reflect_new_array(element_mirror, length, CHECK); 112 oop obj = Reflection::reflect_new_array(element_mirror, length, CHECK);
113 thread->set_vm_result(obj); 113 thread->set_vm_result(obj);
114 JRT_END 114 JRT_END
115 115
116 extern void vm_exit(int code); 116 extern void vm_exit(int code);
346 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); 346 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);
347 tty->flush(); 347 tty->flush();
348 } 348 }
349 JRT_END 349 JRT_END
350 350
351 JRT_ENTRY(void, GraalRuntime::log_object(JavaThread* thread, oop obj, jint flags)) 351 JRT_ENTRY(void, GraalRuntime::log_object(JavaThread* thread, oopDesc* obj, jint flags))
352 bool string = mask_bits_are_true(flags, LOG_OBJECT_STRING); 352 bool string = mask_bits_are_true(flags, LOG_OBJECT_STRING);
353 bool addr = mask_bits_are_true(flags, LOG_OBJECT_ADDRESS); 353 bool addr = mask_bits_are_true(flags, LOG_OBJECT_ADDRESS);
354 bool newline = mask_bits_are_true(flags, LOG_OBJECT_NEWLINE); 354 bool newline = mask_bits_are_true(flags, LOG_OBJECT_NEWLINE);
355 if (!string) { 355 if (!string) {
356 if (!addr && obj->is_oop_or_null(true)) { 356 if (!addr && obj->is_oop_or_null(true)) {
391 ret=false; 391 ret=false;
392 } 392 }
393 return (jint)ret; 393 return (jint)ret;
394 JRT_END 394 JRT_END
395 395
396 JRT_ENTRY(void, GraalRuntime::vm_error(JavaThread* thread, oop where, oop format, jlong value)) 396 JRT_ENTRY(void, GraalRuntime::vm_error(JavaThread* thread, oopDesc* where, oopDesc* format, jlong value))
397 ResourceMark rm; 397 ResourceMark rm;
398 assert(where == NULL || java_lang_String::is_instance(where), "must be"); 398 assert(where == NULL || java_lang_String::is_instance(where), "must be");
399 const char *error_msg = where == NULL ? "<internal Graal error>" : java_lang_String::as_utf8_string(where); 399 const char *error_msg = where == NULL ? "<internal Graal error>" : java_lang_String::as_utf8_string(where);
400 char *detail_msg = NULL; 400 char *detail_msg = NULL;
401 if (format != NULL) { 401 if (format != NULL) {
405 jio_snprintf(detail_msg, detail_msg_length, buf, value); 405 jio_snprintf(detail_msg, detail_msg_length, buf, value);
406 } 406 }
407 report_vm_error(__FILE__, __LINE__, error_msg, detail_msg); 407 report_vm_error(__FILE__, __LINE__, error_msg, detail_msg);
408 JRT_END 408 JRT_END
409 409
410 JRT_LEAF(oop, GraalRuntime::load_and_clear_exception(JavaThread* thread)) 410 JRT_LEAF(oopDesc*, GraalRuntime::load_and_clear_exception(JavaThread* thread))
411 oop exception = thread->exception_oop(); 411 oop exception = thread->exception_oop();
412 assert(exception != NULL, "npe"); 412 assert(exception != NULL, "npe");
413 thread->set_exception_oop(NULL); 413 thread->set_exception_oop(NULL);
414 thread->set_exception_pc(0); 414 thread->set_exception_pc(0);
415 return exception; 415 return exception;
416 JRT_END 416 JRT_END
417 417
418 JRT_LEAF(void, GraalRuntime::log_printf(JavaThread* thread, oop format, jlong v1, jlong v2, jlong v3)) 418 JRT_LEAF(void, GraalRuntime::log_printf(JavaThread* thread, oopDesc* format, jlong v1, jlong v2, jlong v3))
419 ResourceMark rm; 419 ResourceMark rm;
420 assert(format != NULL && java_lang_String::is_instance(format), "must be"); 420 assert(format != NULL && java_lang_String::is_instance(format), "must be");
421 char *buf = java_lang_String::as_utf8_string(format); 421 char *buf = java_lang_String::as_utf8_string(format);
422 tty->print(buf, v1, v2, v3); 422 tty->print(buf, v1, v2, v3);
423 JRT_END 423 JRT_END
483 if (newline) { 483 if (newline) {
484 tty->cr(); 484 tty->cr();
485 } 485 }
486 JRT_END 486 JRT_END
487 487
488 JRT_ENTRY(jint, GraalRuntime::identity_hash_code(JavaThread* thread, oop obj)) 488 JRT_ENTRY(jint, GraalRuntime::identity_hash_code(JavaThread* thread, oopDesc* obj))
489 return (jint) obj->identity_hash(); 489 return (jint) obj->identity_hash();
490 JRT_END 490 JRT_END
491 491
492 JRT_ENTRY(jboolean, GraalRuntime::thread_is_interrupted(JavaThread* thread, oop receiver, jboolean clear_interrupted)) 492 JRT_ENTRY(jboolean, GraalRuntime::thread_is_interrupted(JavaThread* thread, oopDesc* receiver, jboolean clear_interrupted))
493 // Ensure that the C++ Thread and OSThread structures aren't freed before we operate 493 // Ensure that the C++ Thread and OSThread structures aren't freed before we operate
494 Handle receiverHandle(thread, receiver); 494 Handle receiverHandle(thread, receiver);
495 MutexLockerEx ml(thread->threadObj() == receiver ? NULL : Threads_lock); 495 MutexLockerEx ml(thread->threadObj() == (void*)receiver ? NULL : Threads_lock);
496 JavaThread* receiverThread = java_lang_Thread::thread(receiverHandle()); 496 JavaThread* receiverThread = java_lang_Thread::thread(receiverHandle());
497 return (jint) Thread::is_interrupted(receiverThread, clear_interrupted != 0); 497 return (jint) Thread::is_interrupted(receiverThread, clear_interrupted != 0);
498 JRT_END 498 JRT_END
499 499
500 // JVM_InitializeGraalRuntime 500 // JVM_InitializeGraalRuntime