Mercurial > hg > graal-compiler
comparison src/share/vm/prims/jvm.cpp @ 4970:33df1aeaebbf
Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Mon, 27 Feb 2012 13:10:13 +0100 |
parents | aa3d708d67c4 |
children | f7c4174b33ba |
comparison
equal
deleted
inserted
replaced
4703:2cfb7fb2dce7 | 4970:33df1aeaebbf |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
2714 if (java_throwable == NULL) { | 2714 if (java_throwable == NULL) { |
2715 THROW(vmSymbols::java_lang_NullPointerException()); | 2715 THROW(vmSymbols::java_lang_NullPointerException()); |
2716 } | 2716 } |
2717 oop java_thread = JNIHandles::resolve_non_null(jthread); | 2717 oop java_thread = JNIHandles::resolve_non_null(jthread); |
2718 JavaThread* receiver = java_lang_Thread::thread(java_thread); | 2718 JavaThread* receiver = java_lang_Thread::thread(java_thread); |
2719 Events::log("JVM_StopThread thread JavaThread " INTPTR_FORMAT " as oop " INTPTR_FORMAT " [exception " INTPTR_FORMAT "]", receiver, (address)java_thread, throwable); | 2719 Events::log_exception(JavaThread::current(), |
2720 "JVM_StopThread thread JavaThread " INTPTR_FORMAT " as oop " INTPTR_FORMAT " [exception " INTPTR_FORMAT "]", | |
2721 receiver, (address)java_thread, throwable); | |
2720 // First check if thread is alive | 2722 // First check if thread is alive |
2721 if (receiver != NULL) { | 2723 if (receiver != NULL) { |
2722 // Check if exception is getting thrown at self (use oop equality, since the | 2724 // Check if exception is getting thrown at self (use oop equality, since the |
2723 // target object might exit) | 2725 // target object might exit) |
2724 if (java_thread == thread->threadObj()) { | 2726 if (java_thread == thread->threadObj()) { |
3513 | 3515 |
3514 | 3516 |
3515 JVM_LEAF(jint, JVM_Recv(jint fd, char *buf, jint nBytes, jint flags)) | 3517 JVM_LEAF(jint, JVM_Recv(jint fd, char *buf, jint nBytes, jint flags)) |
3516 JVMWrapper2("JVM_Recv (0x%x)", fd); | 3518 JVMWrapper2("JVM_Recv (0x%x)", fd); |
3517 //%note jvm_r6 | 3519 //%note jvm_r6 |
3518 return os::recv(fd, buf, nBytes, flags); | 3520 return os::recv(fd, buf, (size_t)nBytes, (uint)flags); |
3519 JVM_END | 3521 JVM_END |
3520 | 3522 |
3521 | 3523 |
3522 JVM_LEAF(jint, JVM_Send(jint fd, char *buf, jint nBytes, jint flags)) | 3524 JVM_LEAF(jint, JVM_Send(jint fd, char *buf, jint nBytes, jint flags)) |
3523 JVMWrapper2("JVM_Send (0x%x)", fd); | 3525 JVMWrapper2("JVM_Send (0x%x)", fd); |
3524 //%note jvm_r6 | 3526 //%note jvm_r6 |
3525 return os::send(fd, buf, nBytes, flags); | 3527 return os::send(fd, buf, (size_t)nBytes, (uint)flags); |
3526 JVM_END | 3528 JVM_END |
3527 | 3529 |
3528 | 3530 |
3529 JVM_LEAF(jint, JVM_Timeout(int fd, long timeout)) | 3531 JVM_LEAF(jint, JVM_Timeout(int fd, long timeout)) |
3530 JVMWrapper2("JVM_Timeout (0x%x)", fd); | 3532 JVMWrapper2("JVM_Timeout (0x%x)", fd); |
3541 | 3543 |
3542 | 3544 |
3543 JVM_LEAF(jint, JVM_Connect(jint fd, struct sockaddr *him, jint len)) | 3545 JVM_LEAF(jint, JVM_Connect(jint fd, struct sockaddr *him, jint len)) |
3544 JVMWrapper2("JVM_Connect (0x%x)", fd); | 3546 JVMWrapper2("JVM_Connect (0x%x)", fd); |
3545 //%note jvm_r6 | 3547 //%note jvm_r6 |
3546 return os::connect(fd, him, len); | 3548 return os::connect(fd, him, (socklen_t)len); |
3547 JVM_END | 3549 JVM_END |
3548 | 3550 |
3549 | 3551 |
3550 JVM_LEAF(jint, JVM_Bind(jint fd, struct sockaddr *him, jint len)) | 3552 JVM_LEAF(jint, JVM_Bind(jint fd, struct sockaddr *him, jint len)) |
3551 JVMWrapper2("JVM_Bind (0x%x)", fd); | 3553 JVMWrapper2("JVM_Bind (0x%x)", fd); |
3552 //%note jvm_r6 | 3554 //%note jvm_r6 |
3553 return os::bind(fd, him, len); | 3555 return os::bind(fd, him, (socklen_t)len); |
3554 JVM_END | 3556 JVM_END |
3555 | 3557 |
3556 | 3558 |
3557 JVM_LEAF(jint, JVM_Accept(jint fd, struct sockaddr *him, jint *len)) | 3559 JVM_LEAF(jint, JVM_Accept(jint fd, struct sockaddr *him, jint *len)) |
3558 JVMWrapper2("JVM_Accept (0x%x)", fd); | 3560 JVMWrapper2("JVM_Accept (0x%x)", fd); |
3559 //%note jvm_r6 | 3561 //%note jvm_r6 |
3560 return os::accept(fd, him, (int *)len); | 3562 socklen_t socklen = (socklen_t)(*len); |
3563 jint result = os::accept(fd, him, &socklen); | |
3564 *len = (jint)socklen; | |
3565 return result; | |
3561 JVM_END | 3566 JVM_END |
3562 | 3567 |
3563 | 3568 |
3564 JVM_LEAF(jint, JVM_RecvFrom(jint fd, char *buf, int nBytes, int flags, struct sockaddr *from, int *fromlen)) | 3569 JVM_LEAF(jint, JVM_RecvFrom(jint fd, char *buf, int nBytes, int flags, struct sockaddr *from, int *fromlen)) |
3565 JVMWrapper2("JVM_RecvFrom (0x%x)", fd); | 3570 JVMWrapper2("JVM_RecvFrom (0x%x)", fd); |
3566 //%note jvm_r6 | 3571 //%note jvm_r6 |
3567 return os::recvfrom(fd, buf, nBytes, flags, from, fromlen); | 3572 socklen_t socklen = (socklen_t)(*fromlen); |
3573 jint result = os::recvfrom(fd, buf, (size_t)nBytes, (uint)flags, from, &socklen); | |
3574 *fromlen = (int)socklen; | |
3575 return result; | |
3568 JVM_END | 3576 JVM_END |
3569 | 3577 |
3570 | 3578 |
3571 JVM_LEAF(jint, JVM_GetSockName(jint fd, struct sockaddr *him, int *len)) | 3579 JVM_LEAF(jint, JVM_GetSockName(jint fd, struct sockaddr *him, int *len)) |
3572 JVMWrapper2("JVM_GetSockName (0x%x)", fd); | 3580 JVMWrapper2("JVM_GetSockName (0x%x)", fd); |
3573 //%note jvm_r6 | 3581 //%note jvm_r6 |
3574 return os::get_sock_name(fd, him, len); | 3582 socklen_t socklen = (socklen_t)(*len); |
3583 jint result = os::get_sock_name(fd, him, &socklen); | |
3584 *len = (int)socklen; | |
3585 return result; | |
3575 JVM_END | 3586 JVM_END |
3576 | 3587 |
3577 | 3588 |
3578 JVM_LEAF(jint, JVM_SendTo(jint fd, char *buf, int len, int flags, struct sockaddr *to, int tolen)) | 3589 JVM_LEAF(jint, JVM_SendTo(jint fd, char *buf, int len, int flags, struct sockaddr *to, int tolen)) |
3579 JVMWrapper2("JVM_SendTo (0x%x)", fd); | 3590 JVMWrapper2("JVM_SendTo (0x%x)", fd); |
3580 //%note jvm_r6 | 3591 //%note jvm_r6 |
3581 return os::sendto(fd, buf, len, flags, to, tolen); | 3592 return os::sendto(fd, buf, (size_t)len, (uint)flags, to, (socklen_t)tolen); |
3582 JVM_END | 3593 JVM_END |
3583 | 3594 |
3584 | 3595 |
3585 JVM_LEAF(jint, JVM_SocketAvailable(jint fd, jint *pbytes)) | 3596 JVM_LEAF(jint, JVM_SocketAvailable(jint fd, jint *pbytes)) |
3586 JVMWrapper2("JVM_SocketAvailable (0x%x)", fd); | 3597 JVMWrapper2("JVM_SocketAvailable (0x%x)", fd); |
3590 | 3601 |
3591 | 3602 |
3592 JVM_LEAF(jint, JVM_GetSockOpt(jint fd, int level, int optname, char *optval, int *optlen)) | 3603 JVM_LEAF(jint, JVM_GetSockOpt(jint fd, int level, int optname, char *optval, int *optlen)) |
3593 JVMWrapper2("JVM_GetSockOpt (0x%x)", fd); | 3604 JVMWrapper2("JVM_GetSockOpt (0x%x)", fd); |
3594 //%note jvm_r6 | 3605 //%note jvm_r6 |
3595 return os::get_sock_opt(fd, level, optname, optval, optlen); | 3606 socklen_t socklen = (socklen_t)(*optlen); |
3607 jint result = os::get_sock_opt(fd, level, optname, optval, &socklen); | |
3608 *optlen = (int)socklen; | |
3609 return result; | |
3596 JVM_END | 3610 JVM_END |
3597 | 3611 |
3598 | 3612 |
3599 JVM_LEAF(jint, JVM_SetSockOpt(jint fd, int level, int optname, const char *optval, int optlen)) | 3613 JVM_LEAF(jint, JVM_SetSockOpt(jint fd, int level, int optname, const char *optval, int optlen)) |
3600 JVMWrapper2("JVM_GetSockOpt (0x%x)", fd); | 3614 JVMWrapper2("JVM_GetSockOpt (0x%x)", fd); |
3601 //%note jvm_r6 | 3615 //%note jvm_r6 |
3602 return os::set_sock_opt(fd, level, optname, optval, optlen); | 3616 return os::set_sock_opt(fd, level, optname, optval, (socklen_t)optlen); |
3603 JVM_END | 3617 JVM_END |
3618 | |
3604 | 3619 |
3605 JVM_LEAF(int, JVM_GetHostName(char* name, int namelen)) | 3620 JVM_LEAF(int, JVM_GetHostName(char* name, int namelen)) |
3606 JVMWrapper("JVM_GetHostName"); | 3621 JVMWrapper("JVM_GetHostName"); |
3607 return os::get_host_name(name, namelen); | 3622 return os::get_host_name(name, namelen); |
3608 JVM_END | 3623 JVM_END |
3624 | |
3609 | 3625 |
3610 // Library support /////////////////////////////////////////////////////////////////////////// | 3626 // Library support /////////////////////////////////////////////////////////////////////////// |
3611 | 3627 |
3612 JVM_ENTRY_NO_ENV(void*, JVM_LoadLibrary(const char* name)) | 3628 JVM_ENTRY_NO_ENV(void*, JVM_LoadLibrary(const char* name)) |
3613 //%note jvm_ct | 3629 //%note jvm_ct |
3645 JVM_LEAF(void*, JVM_FindLibraryEntry(void* handle, const char* name)) | 3661 JVM_LEAF(void*, JVM_FindLibraryEntry(void* handle, const char* name)) |
3646 JVMWrapper2("JVM_FindLibraryEntry (%s)", name); | 3662 JVMWrapper2("JVM_FindLibraryEntry (%s)", name); |
3647 return os::dll_lookup(handle, name); | 3663 return os::dll_lookup(handle, name); |
3648 JVM_END | 3664 JVM_END |
3649 | 3665 |
3666 | |
3650 // Floating point support //////////////////////////////////////////////////////////////////// | 3667 // Floating point support //////////////////////////////////////////////////////////////////// |
3651 | 3668 |
3652 JVM_LEAF(jboolean, JVM_IsNaN(jdouble a)) | 3669 JVM_LEAF(jboolean, JVM_IsNaN(jdouble a)) |
3653 JVMWrapper("JVM_IsNaN"); | 3670 JVMWrapper("JVM_IsNaN"); |
3654 return g_isnan(a); | 3671 return g_isnan(a); |
3655 JVM_END | 3672 JVM_END |
3656 | |
3657 | 3673 |
3658 | 3674 |
3659 // JNI version /////////////////////////////////////////////////////////////////////////////// | 3675 // JNI version /////////////////////////////////////////////////////////////////////////////// |
3660 | 3676 |
3661 JVM_LEAF(jboolean, JVM_IsSupportedJNIVersion(jint version)) | 3677 JVM_LEAF(jboolean, JVM_IsSupportedJNIVersion(jint version)) |