Path: blob/master/src/hotspot/share/adlc/adlc.hpp
41144 views
/*1* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef SHARE_ADLC_ADLC_HPP25#define SHARE_ADLC_ADLC_HPP2627//28// Standard include file for ADLC parser29//3031// standard library constants32#include <iostream>3334#include <stdio.h>35#include <stdlib.h>36#include <string.h>37#include <ctype.h>38#include <stdarg.h>39#include <sys/types.h>4041/* Make sure that we have the intptr_t and uintptr_t definitions */42#ifdef _WIN324344#if _MSC_VER >= 130045using namespace std;46#endif4748#if _MSC_VER >= 140049#define strdup _strdup50#endif5152#if _MSC_VER < 190053#define snprintf _snprintf54#endif5556#ifndef _INTPTR_T_DEFINED57#ifdef _WIN6458typedef __int64 intptr_t;59#else60typedef int intptr_t;61#endif62#define _INTPTR_T_DEFINED63#endif6465#ifndef _UINTPTR_T_DEFINED66#ifdef _WIN6467typedef unsigned __int64 uintptr_t;68#else69typedef unsigned int uintptr_t;70#endif71#define _UINTPTR_T_DEFINED72#endif7374#endif // _WIN327576#if defined(LINUX) || defined(_ALLBSD_SOURCE)77#include <inttypes.h>78#endif // LINUX || _ALLBSD_SOURCE7980// Macros81#define uint32 unsigned int82#define uint unsigned int8384// VM components85#include "opto/opcodes.hpp"8687// Macros88// Debugging note: Put a breakpoint on "abort".89#undef assert90#define assert(cond, msg) { if (!(cond)) { fprintf(stderr, "assert fails %s %d: %s\n", __FILE__, __LINE__, msg); abort(); }}91#undef max92#define max(a, b) (((a)>(b)) ? (a) : (b))9394// ADLC components95#include "arena.hpp"96#include "opto/adlcVMDeps.hpp"97#include "filebuff.hpp"98#include "dict2.hpp"99#include "forms.hpp"100#include "formsopt.hpp"101#include "formssel.hpp"102#include "archDesc.hpp"103#include "adlparse.hpp"104105// globally define ArchDesc for convenience. Alternatively every form106// could have a backpointer to the AD but it's too complicated to pass107// it everywhere it needs to be available.108extern ArchDesc* globalAD;109110#endif // SHARE_ADLC_ADLC_HPP111112113