1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/vm/adlc/adlc.hpp Sat Dec 01 00:00:00 2007 +0000 1.3 @@ -0,0 +1,106 @@ 1.4 +/* 1.5 + * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. 1.11 + * 1.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.15 + * version 2 for more details (a copy is included in the LICENSE file that 1.16 + * accompanied this code). 1.17 + * 1.18 + * You should have received a copy of the GNU General Public License version 1.19 + * 2 along with this work; if not, write to the Free Software Foundation, 1.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.21 + * 1.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 1.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 1.24 + * have any questions. 1.25 + * 1.26 + */ 1.27 + 1.28 +// 1.29 +// Standard include file for ADLC parser 1.30 +// 1.31 + 1.32 +// standard library constants 1.33 +#include "stdio.h" 1.34 +#include "stdlib.h" 1.35 +#if _MSC_VER >= 1300 // Visual C++ 7.0 or later 1.36 +#include <iostream> 1.37 +#else 1.38 +#include <iostream.h> 1.39 +#endif 1.40 +#include "string.h" 1.41 +#include "ctype.h" 1.42 +#include "stdarg.h" 1.43 +#include <sys/types.h> 1.44 + 1.45 +#if _MSC_VER >= 1300 1.46 +using namespace std; 1.47 +#endif 1.48 + 1.49 +// make sure the MSC_VER and _MSC_VER settings make sense 1.50 +#if _MSC_VER != MSC_VER && (_MSC_VER != 1400 || MSC_VER != 1399) 1.51 +#error "Something is wrong with the detection of MSC_VER in the makefiles" 1.52 +#endif 1.53 + 1.54 +#if _MSC_VER >= 1400 && !defined(_WIN64) 1.55 +#define strdup _strdup 1.56 +#endif 1.57 + 1.58 +/* Make sure that we have the intptr_t and uintptr_t definitions */ 1.59 +#ifdef _WIN32 1.60 +#ifndef _INTPTR_T_DEFINED 1.61 +#ifdef _WIN64 1.62 +typedef __int64 intptr_t; 1.63 +#else 1.64 +typedef int intptr_t; 1.65 +#endif 1.66 +#define _INTPTR_T_DEFINED 1.67 +#endif 1.68 + 1.69 +#ifndef _UINTPTR_T_DEFINED 1.70 +#ifdef _WIN64 1.71 +typedef unsigned __int64 uintptr_t; 1.72 +#else 1.73 +typedef unsigned int uintptr_t; 1.74 +#endif 1.75 +#define _UINTPTR_T_DEFINED 1.76 +#endif 1.77 +#endif // _WIN32 1.78 + 1.79 +#ifdef LINUX 1.80 + #include <inttypes.h> 1.81 +#endif // LINUX 1.82 + 1.83 +// Macros 1.84 +#define uint32 unsigned int 1.85 +#define uint unsigned int 1.86 + 1.87 +// Macros 1.88 +// Debugging note: Put a breakpoint on "abort". 1.89 +#define assert(cond, msg) { if (!(cond)) { fprintf(stderr, "assert fails %s %d: %s\n", __FILE__, __LINE__, msg); abort(); }} 1.90 +#define max(a, b) (((a)>(b)) ? (a) : (b)) 1.91 + 1.92 +// VM components 1.93 +#include "opcodes.hpp" 1.94 + 1.95 +// ADLC components 1.96 +#include "arena.hpp" 1.97 +#include "adlcVMDeps.hpp" 1.98 +#include "filebuff.hpp" 1.99 +#include "dict2.hpp" 1.100 +#include "forms.hpp" 1.101 +#include "formsopt.hpp" 1.102 +#include "formssel.hpp" 1.103 +#include "archDesc.hpp" 1.104 +#include "adlparse.hpp" 1.105 + 1.106 +// globally define ArchDesc for convenience. Alternatively every form 1.107 +// could have a backpointer to the AD but it's too complicated to pass 1.108 +// it everywhere it needs to be available. 1.109 +extern ArchDesc* globalAD;