00001 /* Copyright 1994 - 1996 LongView Technologies L.L.C. $Revision: 1.32 $ */ 00002 /* Copyright (c) 2006, Sun Microsystems, Inc. 00003 All rights reserved. 00004 00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 00006 following conditions are met: 00007 00008 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 00009 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following 00010 disclaimer in the documentation and/or other materials provided with the distribution. 00011 * Neither the name of Sun Microsystems nor the names of its contributors may be used to endorse or promote products derived 00012 from this software without specific prior written permission. 00013 00014 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 00015 NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 00016 THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00017 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00018 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 00019 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 00020 00021 00022 */ 00023 00024 # include "incls/_precompiled.incl" 00025 # include "incls/_init.cpp.incl" 00026 00027 // Add new initialization/finalization methods to the macro below; your 00028 // functions must be parameterless and must be named after the .c file 00029 // they belong to (e.g. "void foo_init(); void foo_exit()" for foo.c). 00030 // The INIT_DO macro defines the initialization sequence; you need not 00031 // add a corresponding entry to EXIT_DO if you don't need finalization. 00032 00033 # define INIT_DO(template) \ 00034 template(ostream_init) \ 00035 template(os_init) \ 00036 template(prim_init) \ 00037 template(eventlog_init) \ 00038 template(integerOps_init) \ 00039 template(bytecodes_init) \ 00040 template(stubRoutines_init) \ 00041 template(interpreter_init) \ 00042 template(dispatchTable_init) \ 00043 template(disclaimer_init) \ 00044 template(universe_init) \ 00045 template(costModel_init) \ 00046 template(sweeper_init) \ 00047 template(fprofiler_init) \ 00048 template(systemAverage_init) \ 00049 00050 # define COMPILER_INIT_DO(template) \ 00051 template(compiler_init) \ 00052 template(mapping_init) \ 00053 00054 /* compiler related */ 00055 /* template(opcode_init) */ 00056 00057 # define EXIT_DO(template) \ 00058 template(lprintf_exit) \ 00059 template(os_exit) 00060 00061 # define DEFINE_TEMPLATE(name) void name(); 00062 00063 # define CALL_TEMPLATE(name) name(); 00064 00065 INIT_DO(DEFINE_TEMPLATE) 00066 #ifdef DELTA_COMPILER 00067 COMPILER_INIT_DO(DEFINE_TEMPLATE) 00068 #endif 00069 00070 EXIT_DO(DEFINE_TEMPLATE) 00071 00072 void init_globals() { 00073 ResourceMark rm; 00074 INIT_DO(CALL_TEMPLATE) 00075 #ifdef DELTA_COMPILER 00076 COMPILER_INIT_DO(CALL_TEMPLATE) 00077 #endif 00078 00079 if (!UseTimers) { 00080 SweeperUseTimer = false; 00081 } 00082 } 00083 00084 void exit_globals() { 00085 static bool destructorsCalled = false; 00086 if (!destructorsCalled) { 00087 destructorsCalled = true; 00088 EXIT_DO(CALL_TEMPLATE); 00089 } 00090 } 00091