make/solaris/makefiles/adlc.make

Mon, 28 Jul 2014 15:06:38 -0700

author
fzhinkin
date
Mon, 28 Jul 2014 15:06:38 -0700
changeset 6997
dbb05f6d93c4
parent 6198
55fb97c4c58d
child 6876
710a3c8b516e
child 9312
9d85c3e90648
permissions
-rw-r--r--

8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
Summary: call rtm_deopt() only if there were no compilation bailouts before.
Reviewed-by: kvn

duke@435 1 #
mikael@6198 2 # Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
duke@435 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 #
duke@435 5 # This code is free software; you can redistribute it and/or modify it
duke@435 6 # under the terms of the GNU General Public License version 2 only, as
duke@435 7 # published by the Free Software Foundation.
duke@435 8 #
duke@435 9 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 # version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 # accompanied this code).
duke@435 14 #
duke@435 15 # You should have received a copy of the GNU General Public License version
duke@435 16 # 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 #
trims@1907 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 # or visit www.oracle.com if you need additional information or have any
trims@1907 21 # questions.
duke@435 22 #
duke@435 23 #
duke@435 24
duke@435 25 # This makefile (adlc.make) is included from the adlc.make in the
duke@435 26 # build directories.
duke@435 27 # It knows how to compile, link, and run the adlc.
duke@435 28
kamg@526 29 include $(GAMMADIR)/make/$(Platform_os_family)/makefiles/rules.make
kamg@2515 30 include $(GAMMADIR)/make/altsrc.make
duke@435 31
duke@435 32 # #########################################################################
duke@435 33
duke@435 34 # OUTDIR must be the same as AD_Dir = $(GENERATED)/adfiles in top.make:
duke@435 35 GENERATED = ../generated
duke@435 36 OUTDIR = $(GENERATED)/adfiles
duke@435 37
duke@435 38 ARCH = $(Platform_arch)
duke@435 39 OS = $(Platform_os_family)
duke@435 40
duke@435 41 SOURCE.AD = $(OUTDIR)/$(OS)_$(Platform_arch_model).ad
duke@435 42
kvn@3390 43 ifeq ("${Platform_arch_model}", "${Platform_arch}")
kvn@3390 44 SOURCES.AD = \
adlertz@5510 45 $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad)
kvn@3390 46 else
kvn@3390 47 SOURCES.AD = \
kvn@3390 48 $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad) \
adlertz@5510 49 $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch).ad)
kvn@3390 50 endif
duke@435 51
duke@435 52 EXEC = $(OUTDIR)/adlc
duke@435 53
duke@435 54 # set VPATH so make knows where to look for source files
stefank@2314 55 Src_Dirs_V += $(GAMMADIR)/src/share/vm/adlc
stefank@2314 56 VPATH += $(Src_Dirs_V:%=%:)
duke@435 57
duke@435 58 # set INCLUDES for C preprocessor
stefank@2314 59 Src_Dirs_I += $(GAMMADIR)/src/share/vm/adlc $(GENERATED)
duke@435 60 INCLUDES += $(Src_Dirs_I:%=-I%)
duke@435 61
jrose@910 62 # set flags for adlc compilation
erikj@3518 63 CXXFLAGS = $(SYSDEFS) $(INCLUDES)
jrose@910 64
duke@435 65 # Force assertions on.
erikj@3518 66 CXXFLAGS += -DASSERT
duke@435 67
duke@435 68 ifndef USE_GCC
duke@435 69 # We need libCstd.so for adlc
duke@435 70 CFLAGS += -library=Cstd -g
duke@435 71 LFLAGS += -library=Cstd -g
duke@435 72 endif
duke@435 73
duke@435 74 # CFLAGS_WARN holds compiler options to suppress/enable warnings.
twisti@1038 75 # Compiler warnings are treated as errors
twisti@1256 76 ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1)
twisti@1256 77 CFLAGS_WARN = +w -errwarn
twisti@1256 78 endif
duke@435 79 CFLAGS += $(CFLAGS_WARN)
duke@435 80
duke@435 81 ifeq ("${Platform_compiler}", "sparcWorks")
duke@435 82 # Enable the following CFLAGS addition if you need to compare the
duke@435 83 # built ELF objects.
duke@435 84 #
duke@435 85 # The -g option makes static data global and the "-Qoption ccfe
duke@435 86 # -xglobalstatic" option tells the compiler to not globalize static
duke@435 87 # data using a unique globalization prefix. Instead force the use
duke@435 88 # of a static globalization prefix based on the source filepath so
duke@435 89 # the objects from two identical compilations are the same.
duke@435 90 #CFLAGS += -Qoption ccfe -xglobalstatic
duke@435 91 endif # Platform_compiler == sparcWorks
duke@435 92
duke@435 93 OBJECTNAMES = \
duke@435 94 adlparse.o \
duke@435 95 archDesc.o \
duke@435 96 arena.o \
duke@435 97 dfa.o \
duke@435 98 dict2.o \
duke@435 99 filebuff.o \
duke@435 100 forms.o \
duke@435 101 formsopt.o \
duke@435 102 formssel.o \
duke@435 103 main.o \
duke@435 104 adlc-opcodes.o \
duke@435 105 output_c.o \
duke@435 106 output_h.o \
duke@435 107
duke@435 108 OBJECTS = $(OBJECTNAMES:%=$(OUTDIR)/%)
duke@435 109
duke@435 110 GENERATEDNAMES = \
duke@435 111 ad_$(Platform_arch_model).cpp \
duke@435 112 ad_$(Platform_arch_model).hpp \
duke@435 113 ad_$(Platform_arch_model)_clone.cpp \
duke@435 114 ad_$(Platform_arch_model)_expand.cpp \
duke@435 115 ad_$(Platform_arch_model)_format.cpp \
duke@435 116 ad_$(Platform_arch_model)_gen.cpp \
duke@435 117 ad_$(Platform_arch_model)_misc.cpp \
duke@435 118 ad_$(Platform_arch_model)_peephole.cpp \
duke@435 119 ad_$(Platform_arch_model)_pipeline.cpp \
duke@435 120 adGlobals_$(Platform_arch_model).hpp \
duke@435 121 dfa_$(Platform_arch_model).cpp \
duke@435 122
duke@435 123 GENERATEDFILES = $(GENERATEDNAMES:%=$(OUTDIR)/%)
duke@435 124
duke@435 125 # #########################################################################
duke@435 126
duke@435 127 all: $(EXEC)
duke@435 128
duke@435 129 $(EXEC) : $(OBJECTS)
duke@435 130 @echo Making adlc
erikj@3518 131 $(QUIETLY) $(LINK_NOPROF.CXX) -o $(EXEC) $(OBJECTS)
duke@435 132
duke@435 133 # Random dependencies:
duke@435 134 $(OBJECTS): opcodes.hpp classes.hpp adlc.hpp adlcVMDeps.hpp adlparse.hpp archDesc.hpp arena.hpp dict2.hpp filebuff.hpp forms.hpp formsopt.hpp formssel.hpp
duke@435 135
duke@435 136 # The source files refer to ostream.h, which sparcworks calls iostream.h
duke@435 137 $(OBJECTS): ostream.h
duke@435 138
duke@435 139 ostream.h :
duke@435 140 @echo >$@ '#include <iostream.h>'
duke@435 141
duke@435 142 dump:
duke@435 143 : OUTDIR=$(OUTDIR)
duke@435 144 : OBJECTS=$(OBJECTS)
duke@435 145 : products = $(GENERATEDFILES)
duke@435 146
duke@435 147 all: $(GENERATEDFILES)
duke@435 148
duke@435 149 $(GENERATEDFILES): refresh_adfiles
duke@435 150
duke@435 151 # Get a unique temporary directory name, so multiple makes can run in parallel.
duke@435 152 # Note that product files are updated via "mv", which is atomic.
duke@435 153 TEMPDIR := $(OUTDIR)/mktmp$(shell echo $$$$)
duke@435 154
never@1831 155 # Debuggable by default
never@1831 156 CFLAGS += -g
never@1831 157
jrose@910 158 # Pass -D flags into ADLC.
jrose@910 159 ADLCFLAGS += $(SYSDEFS)
jrose@910 160
jrose@910 161 # Note "+="; it is a hook so flags.make can add more flags, like -g or -DFOO.
jrose@910 162 ADLCFLAGS += -q -T
jrose@910 163
jrose@910 164 # Normally, debugging is done directly on the ad_<arch>*.cpp files.
jrose@910 165 # But -g will put #line directives in those files pointing back to <arch>.ad.
never@1831 166 ADLCFLAGS += -g
duke@435 167
duke@435 168 ifdef LP64
duke@435 169 ADLCFLAGS += -D_LP64
duke@435 170 else
duke@435 171 ADLCFLAGS += -U_LP64
duke@435 172 endif
duke@435 173
duke@435 174 #
duke@435 175 # adlc_updater is a simple sh script, under sccs control. It is
duke@435 176 # used to selectively update generated adlc files. This should
duke@435 177 # provide a nice compilation speed improvement.
duke@435 178 #
kamg@526 179 ADLC_UPDATER_DIRECTORY = $(GAMMADIR)/make/$(OS)
duke@435 180 ADLC_UPDATER = adlc_updater
jrose@910 181 $(ADLC_UPDATER): $(ADLC_UPDATER_DIRECTORY)/$(ADLC_UPDATER)
jrose@910 182 $(QUIETLY) cp $< $@; chmod +x $@
duke@435 183
duke@435 184 # This action refreshes all generated adlc files simultaneously.
duke@435 185 # The way it works is this:
duke@435 186 # 1) create a scratch directory to work in.
duke@435 187 # 2) if the current working directory does not have $(ADLC_UPDATER), copy it.
duke@435 188 # 3) run the compiled adlc executable. This will create new adlc files in the scratch directory.
duke@435 189 # 4) call $(ADLC_UPDATER) on each generated adlc file. It will selectively update changed or missing files.
duke@435 190 # 5) If we actually updated any files, echo a notice.
duke@435 191 #
jrose@910 192 refresh_adfiles: $(EXEC) $(SOURCE.AD) $(ADLC_UPDATER)
duke@435 193 @rm -rf $(TEMPDIR); mkdir $(TEMPDIR)
duke@435 194 $(QUIETLY) $(EXEC) $(ADLCFLAGS) $(SOURCE.AD) \
duke@435 195 -c$(TEMPDIR)/ad_$(Platform_arch_model).cpp -h$(TEMPDIR)/ad_$(Platform_arch_model).hpp -a$(TEMPDIR)/dfa_$(Platform_arch_model).cpp -v$(TEMPDIR)/adGlobals_$(Platform_arch_model).hpp \
duke@435 196 || { rm -rf $(TEMPDIR); exit 1; }
duke@435 197 $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model).cpp $(TEMPDIR) $(OUTDIR)
duke@435 198 $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model).hpp $(TEMPDIR) $(OUTDIR)
duke@435 199 $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_clone.cpp $(TEMPDIR) $(OUTDIR)
duke@435 200 $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_expand.cpp $(TEMPDIR) $(OUTDIR)
duke@435 201 $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_format.cpp $(TEMPDIR) $(OUTDIR)
duke@435 202 $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_gen.cpp $(TEMPDIR) $(OUTDIR)
duke@435 203 $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_misc.cpp $(TEMPDIR) $(OUTDIR)
duke@435 204 $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_peephole.cpp $(TEMPDIR) $(OUTDIR)
duke@435 205 $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_pipeline.cpp $(TEMPDIR) $(OUTDIR)
duke@435 206 $(QUIETLY) ./$(ADLC_UPDATER) adGlobals_$(Platform_arch_model).hpp $(TEMPDIR) $(OUTDIR)
duke@435 207 $(QUIETLY) ./$(ADLC_UPDATER) dfa_$(Platform_arch_model).cpp $(TEMPDIR) $(OUTDIR)
duke@435 208 $(QUIETLY) [ -f $(TEMPDIR)/made-change ] \
duke@435 209 || echo "Rescanned $(SOURCE.AD) but encountered no changes."
duke@435 210 $(QUIETLY) rm -rf $(TEMPDIR)
duke@435 211
duke@435 212
duke@435 213 # #########################################################################
duke@435 214
duke@435 215 $(SOURCE.AD): $(SOURCES.AD)
jrose@910 216 $(QUIETLY) $(PROCESS_AD_FILES) $(SOURCES.AD) > $(SOURCE.AD)
jrose@910 217
jrose@910 218 #PROCESS_AD_FILES = cat
jrose@910 219 # Pass through #line directives, in case user enables -g option above:
jrose@910 220 PROCESS_AD_FILES = awk '{ \
jrose@910 221 if (CUR_FN != FILENAME) { CUR_FN=FILENAME; NR_BASE=NR-1; need_lineno=1 } \
jrose@910 222 if (need_lineno && $$0 !~ /\/\//) \
jrose@910 223 { print "\n\n\#line " (NR-NR_BASE) " \"" FILENAME "\""; need_lineno=0 }; \
jrose@910 224 print }'
duke@435 225
duke@435 226 $(OUTDIR)/%.o: %.cpp
duke@435 227 @echo Compiling $<
duke@435 228 $(QUIETLY) $(REMOVE_TARGET)
erikj@3518 229 $(QUIETLY) $(COMPILE.CXX) -o $@ $< $(COMPILE_DONE)
duke@435 230
duke@435 231 # Some object files are given a prefix, to disambiguate
duke@435 232 # them from objects of the same name built for the VM.
duke@435 233 $(OUTDIR)/adlc-%.o: %.cpp
duke@435 234 @echo Compiling $<
duke@435 235 $(QUIETLY) $(REMOVE_TARGET)
erikj@3518 236 $(QUIETLY) $(COMPILE.CXX) -o $@ $< $(COMPILE_DONE)
duke@435 237
duke@435 238 # #########################################################################
duke@435 239
duke@435 240 clean :
duke@435 241 rm $(OBJECTS)
duke@435 242
duke@435 243 cleanall :
duke@435 244 rm $(OBJECTS) $(EXEC)
duke@435 245
duke@435 246 # #########################################################################
duke@435 247
duke@435 248 .PHONY: all dump refresh_adfiles clean cleanall

mercurial