Mercurial > hg > graal-jvmci-8
comparison src/share/vm/graal/graalRuntime.cpp @ 7911:983f7bdb85ff
removed redundant graal_ prefix from Graal specific functions and variable in native code
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 01 Mar 2013 19:51:45 +1000 |
parents | a7a93887b4c4 |
children | c6c72de0537e |
comparison
equal
deleted
inserted
replaced
7910:748cb57f53cb | 7911:983f7bdb85ff |
---|---|
125 | 125 |
126 #ifdef ASSERT | 126 #ifdef ASSERT |
127 // Make sure that stubs that need oopmaps have them | 127 // Make sure that stubs that need oopmaps have them |
128 switch (id) { | 128 switch (id) { |
129 // These stubs don't need to have an oopmap | 129 // These stubs don't need to have an oopmap |
130 case graal_slow_subtype_check_id: | 130 case slow_subtype_check_id: |
131 #if defined(SPARC) || defined(PPC) | 131 #if defined(SPARC) || defined(PPC) |
132 case graal_handle_exception_nofpu_id: // Unused on sparc | 132 case handle_exception_nofpu_id: // Unused on sparc |
133 #endif | 133 #endif |
134 case graal_verify_oop_id: | 134 case verify_oop_id: |
135 case graal_unwind_exception_call_id: | 135 case unwind_exception_call_id: |
136 case graal_OSR_migration_end_id: | 136 case OSR_migration_end_id: |
137 case graal_arithmetic_frem_id: | 137 case arithmetic_frem_id: |
138 case graal_arithmetic_drem_id: | 138 case arithmetic_drem_id: |
139 case graal_set_deopt_info_id: | 139 case set_deopt_info_id: |
140 break; | 140 break; |
141 | 141 |
142 // All other stubs should have oopmaps | 142 // All other stubs should have oopmaps |
143 default: | 143 default: |
144 assert(oop_maps != NULL, "must have an oopmap"); | 144 assert(oop_maps != NULL, "must have an oopmap"); |
440 | 440 |
441 assert(continuation != NULL, "no handler found"); | 441 assert(continuation != NULL, "no handler found"); |
442 return continuation; | 442 return continuation; |
443 } | 443 } |
444 | 444 |
445 JRT_ENTRY(void, GraalRuntime::graal_create_null_exception(JavaThread* thread)) | 445 JRT_ENTRY(void, GraalRuntime::create_null_exception(JavaThread* thread)) |
446 thread->set_vm_result(Exceptions::new_exception(thread, vmSymbols::java_lang_NullPointerException(), NULL)()); | 446 thread->set_vm_result(Exceptions::new_exception(thread, vmSymbols::java_lang_NullPointerException(), NULL)()); |
447 JRT_END | 447 JRT_END |
448 | 448 |
449 JRT_ENTRY(void, GraalRuntime::graal_create_out_of_bounds_exception(JavaThread* thread, jint index)) | 449 JRT_ENTRY(void, GraalRuntime::create_out_of_bounds_exception(JavaThread* thread, jint index)) |
450 char message[jintAsStringSize]; | 450 char message[jintAsStringSize]; |
451 sprintf(message, "%d", index); | 451 sprintf(message, "%d", index); |
452 thread->set_vm_result(Exceptions::new_exception(thread, vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), message)()); | 452 thread->set_vm_result(Exceptions::new_exception(thread, vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), message)()); |
453 JRT_END | 453 JRT_END |
454 | 454 |
455 JRT_ENTRY_NO_ASYNC(void, GraalRuntime::graal_monitorenter(JavaThread* thread, oopDesc* obj, BasicLock* lock)) | 455 JRT_ENTRY_NO_ASYNC(void, GraalRuntime::monitorenter(JavaThread* thread, oopDesc* obj, BasicLock* lock)) |
456 if (TraceGraal >= 3) { | 456 if (TraceGraal >= 3) { |
457 char type[O_BUFLEN]; | 457 char type[O_BUFLEN]; |
458 obj->klass()->name()->as_C_string(type, O_BUFLEN); | 458 obj->klass()->name()->as_C_string(type, O_BUFLEN); |
459 markOop mark = obj->mark(); | 459 markOop mark = obj->mark(); |
460 tty->print_cr("%s: entered locking slow case with obj=" INTPTR_FORMAT ", type=%s, mark=" INTPTR_FORMAT ", lock=" INTPTR_FORMAT, thread->name(), obj, type, mark, lock); | 460 tty->print_cr("%s: entered locking slow case with obj=" INTPTR_FORMAT ", type=%s, mark=" INTPTR_FORMAT ", lock=" INTPTR_FORMAT, thread->name(), obj, type, mark, lock); |
482 tty->print_cr("%s: exiting locking slow with obj=" INTPTR_FORMAT, thread->name(), obj); | 482 tty->print_cr("%s: exiting locking slow with obj=" INTPTR_FORMAT, thread->name(), obj); |
483 } | 483 } |
484 JRT_END | 484 JRT_END |
485 | 485 |
486 | 486 |
487 JRT_LEAF(void, GraalRuntime::graal_monitorexit(JavaThread* thread, oopDesc* obj, BasicLock* lock)) | 487 JRT_LEAF(void, GraalRuntime::monitorexit(JavaThread* thread, oopDesc* obj, BasicLock* lock)) |
488 assert(thread == JavaThread::current(), "threads must correspond"); | 488 assert(thread == JavaThread::current(), "threads must correspond"); |
489 assert(thread->last_Java_sp(), "last_Java_sp must be set"); | 489 assert(thread->last_Java_sp(), "last_Java_sp must be set"); |
490 // monitorexit is non-blocking (leaf routine) => no exceptions can be thrown | 490 // monitorexit is non-blocking (leaf routine) => no exceptions can be thrown |
491 EXCEPTION_MARK; | 491 EXCEPTION_MARK; |
492 | 492 |
514 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); | 514 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); |
515 tty->flush(); | 515 tty->flush(); |
516 } | 516 } |
517 JRT_END | 517 JRT_END |
518 | 518 |
519 JRT_ENTRY(void, GraalRuntime::graal_log_object(JavaThread* thread, oop obj, jint flags)) | 519 JRT_ENTRY(void, GraalRuntime::log_object(JavaThread* thread, oop obj, jint flags)) |
520 bool string = mask_bits_are_true(flags, LOG_OBJECT_STRING); | 520 bool string = mask_bits_are_true(flags, LOG_OBJECT_STRING); |
521 bool address = mask_bits_are_true(flags, LOG_OBJECT_ADDRESS); | 521 bool address = mask_bits_are_true(flags, LOG_OBJECT_ADDRESS); |
522 bool newline = mask_bits_are_true(flags, LOG_OBJECT_NEWLINE); | 522 bool newline = mask_bits_are_true(flags, LOG_OBJECT_NEWLINE); |
523 if (!string) { | 523 if (!string) { |
524 if (!address && obj->is_oop_or_null(true)) { | 524 if (!address && obj->is_oop_or_null(true)) { |
536 if (newline) { | 536 if (newline) { |
537 tty->cr(); | 537 tty->cr(); |
538 } | 538 } |
539 JRT_END | 539 JRT_END |
540 | 540 |
541 JRT_ENTRY(void, GraalRuntime::graal_vm_error(JavaThread* thread, oop where, oop format, jlong value)) | 541 JRT_ENTRY(void, GraalRuntime::vm_error(JavaThread* thread, oop where, oop format, jlong value)) |
542 ResourceMark rm; | 542 ResourceMark rm; |
543 assert(where == NULL || java_lang_String::is_instance(where), "must be"); | 543 assert(where == NULL || java_lang_String::is_instance(where), "must be"); |
544 const char *error_msg = where == NULL ? "<internal Graal error>" : java_lang_String::as_utf8_string(where); | 544 const char *error_msg = where == NULL ? "<internal Graal error>" : java_lang_String::as_utf8_string(where); |
545 char *detail_msg = NULL; | 545 char *detail_msg = NULL; |
546 if (format != NULL) { | 546 if (format != NULL) { |
550 jio_snprintf(detail_msg, detail_msg_length, buf, value); | 550 jio_snprintf(detail_msg, detail_msg_length, buf, value); |
551 } | 551 } |
552 report_vm_error(__FILE__, __LINE__, error_msg, detail_msg); | 552 report_vm_error(__FILE__, __LINE__, error_msg, detail_msg); |
553 JRT_END | 553 JRT_END |
554 | 554 |
555 JRT_ENTRY(void, GraalRuntime::graal_log_printf(JavaThread* thread, oop format, jlong v1, jlong v2, jlong v3)) | 555 JRT_ENTRY(void, GraalRuntime::log_printf(JavaThread* thread, oop format, jlong v1, jlong v2, jlong v3)) |
556 ResourceMark rm; | 556 ResourceMark rm; |
557 assert(format != NULL && java_lang_String::is_instance(format), "must be"); | 557 assert(format != NULL && java_lang_String::is_instance(format), "must be"); |
558 char *buf = java_lang_String::as_utf8_string(format); | 558 char *buf = java_lang_String::as_utf8_string(format); |
559 tty->print(buf, v1, v2, v3); | 559 tty->print(buf, v1, v2, v3); |
560 JRT_END | 560 JRT_END |
561 | 561 |
562 JRT_ENTRY(void, GraalRuntime::graal_log_primitive(JavaThread* thread, jchar typeChar, jlong value, jboolean newline)) | 562 JRT_ENTRY(void, GraalRuntime::log_primitive(JavaThread* thread, jchar typeChar, jlong value, jboolean newline)) |
563 union { | 563 union { |
564 jlong l; | 564 jlong l; |
565 jdouble d; | 565 jdouble d; |
566 jfloat f; | 566 jfloat f; |
567 } uu; | 567 } uu; |
580 if (newline) { | 580 if (newline) { |
581 tty->cr(); | 581 tty->cr(); |
582 } | 582 } |
583 JRT_END | 583 JRT_END |
584 | 584 |
585 JRT_ENTRY(jint, GraalRuntime::graal_identity_hash_code(JavaThread* thread, oop obj)) | 585 JRT_ENTRY(jint, GraalRuntime::identity_hash_code(JavaThread* thread, oop obj)) |
586 return (jint) obj->identity_hash(); | 586 return (jint) obj->identity_hash(); |
587 JRT_END | 587 JRT_END |
588 | 588 |
589 JRT_ENTRY(jboolean, GraalRuntime::graal_thread_is_interrupted(JavaThread* thread, oop receiver, jboolean clear_interrupted)) | 589 JRT_ENTRY(jboolean, GraalRuntime::thread_is_interrupted(JavaThread* thread, oop receiver, jboolean clear_interrupted)) |
590 // Ensure that the C++ Thread and OSThread structures aren't freed before we operate | 590 // Ensure that the C++ Thread and OSThread structures aren't freed before we operate |
591 Handle receiverHandle(thread, receiver); | 591 Handle receiverHandle(thread, receiver); |
592 MutexLockerEx ml(thread->threadObj() == receiver ? NULL : Threads_lock); | 592 MutexLockerEx ml(thread->threadObj() == receiver ? NULL : Threads_lock); |
593 JavaThread* receiverThread = java_lang_Thread::thread(receiverHandle()); | 593 JavaThread* receiverThread = java_lang_Thread::thread(receiverHandle()); |
594 return (jint) Thread::is_interrupted(receiverThread, clear_interrupted != 0); | 594 return (jint) Thread::is_interrupted(receiverThread, clear_interrupted != 0); |