annotate src/share/vm/ci/ciUtilities.hpp @ 1563:c18cbe5936b8

6941466: Oracle rebranding changes for Hotspot repositories Summary: Change all the Sun copyrights to Oracle copyright Reviewed-by: ohair
author trims
date Thu, 27 May 2010 19:08:38 -0700
parents 4ce7240d622c
children f95d63e2154a
rev   line source
duke@0 1 /*
trims@1563 2 * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
duke@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@0 4 *
duke@0 5 * This code is free software; you can redistribute it and/or modify it
duke@0 6 * under the terms of the GNU General Public License version 2 only, as
duke@0 7 * published by the Free Software Foundation.
duke@0 8 *
duke@0 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@0 13 * accompanied this code).
duke@0 14 *
duke@0 15 * You should have received a copy of the GNU General Public License version
duke@0 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@0 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 18 *
trims@1563 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1563 20 * or visit www.oracle.com if you need additional information or have any
trims@1563 21 * questions.
duke@0 22 *
duke@0 23 */
duke@0 24
duke@0 25 // The following routines and definitions are used internally in the
duke@0 26 // compiler interface.
duke@0 27
duke@0 28
duke@0 29 // Add a ci native entry wrapper?
duke@0 30
duke@0 31 // Bring the compilation thread into the VM state.
duke@0 32 #define VM_ENTRY_MARK \
duke@0 33 CompilerThread* thread=CompilerThread::current(); \
duke@0 34 ThreadInVMfromNative __tiv(thread); \
duke@0 35 ResetNoHandleMark rnhm; \
duke@0 36 HandleMarkCleaner __hm(thread); \
duke@0 37 Thread* THREAD = thread; \
duke@0 38 debug_only(VMNativeEntryWrapper __vew;)
duke@0 39
duke@0 40
duke@0 41
duke@0 42 // Bring the compilation thread into the VM state. No handle mark.
duke@0 43 #define VM_QUICK_ENTRY_MARK \
duke@0 44 CompilerThread* thread=CompilerThread::current(); \
duke@0 45 ThreadInVMfromNative __tiv(thread); \
duke@0 46 /* \
duke@0 47 * [TODO] The NoHandleMark line does nothing but declare a function prototype \
duke@0 48 * The NoHandkeMark constructor is NOT executed. If the ()'s are \
duke@0 49 * removed, causes the NoHandleMark assert to trigger. \
duke@0 50 * debug_only(NoHandleMark __hm();) \
duke@0 51 */ \
duke@0 52 Thread* THREAD = thread; \
duke@0 53 debug_only(VMNativeEntryWrapper __vew;)
duke@0 54
duke@0 55
duke@0 56 #define EXCEPTION_CONTEXT \
duke@0 57 CompilerThread* thread=CompilerThread::current(); \
duke@0 58 Thread* THREAD = thread;
duke@0 59
duke@0 60
duke@0 61 #define CURRENT_ENV \
duke@0 62 ciEnv::current()
duke@0 63
duke@0 64 // where current thread is THREAD
duke@0 65 #define CURRENT_THREAD_ENV \
duke@0 66 ciEnv::current(thread)
duke@0 67
duke@0 68 #define IS_IN_VM \
duke@0 69 ciEnv::is_in_vm()
duke@0 70
duke@0 71 #define ASSERT_IN_VM \
duke@0 72 assert(IS_IN_VM, "must be in vm state");
duke@0 73
duke@0 74 #define GUARDED_VM_ENTRY(action) \
duke@0 75 {if (IS_IN_VM) { action } else { VM_ENTRY_MARK; { action }}}
duke@0 76
duke@0 77 // Redefine this later.
duke@0 78 #define KILL_COMPILE_ON_FATAL_(result) \
duke@0 79 THREAD); \
duke@0 80 if (HAS_PENDING_EXCEPTION) { \
duke@0 81 if (PENDING_EXCEPTION->klass() == \
never@1219 82 SystemDictionary::ThreadDeath_klass()) { \
duke@0 83 /* Kill the compilation. */ \
duke@0 84 fatal("unhandled ci exception"); \
duke@0 85 return (result); \
duke@0 86 } \
duke@0 87 CLEAR_PENDING_EXCEPTION; \
duke@0 88 return (result); \
duke@0 89 } \
duke@0 90 (0
duke@0 91
duke@0 92 #define KILL_COMPILE_ON_ANY \
duke@0 93 THREAD); \
duke@0 94 if (HAS_PENDING_EXCEPTION) { \
duke@0 95 fatal("unhandled ci exception"); \
duke@0 96 CLEAR_PENDING_EXCEPTION; \
duke@0 97 } \
duke@0 98 (0
duke@0 99
duke@0 100
duke@0 101 inline const char* bool_to_str(bool b) {
duke@0 102 return ((b) ? "true" : "false");
duke@0 103 }
duke@0 104
duke@0 105 const char* basictype_to_str(BasicType t);
duke@0 106 const char basictype_to_char(BasicType t);