jdk

Форк
0
/
JvmFeatures.gmk 
270 строк · 8.4 Кб
1
#
2
# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
#
5
# This code is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License version 2 only, as
7
# published by the Free Software Foundation.  Oracle designates this
8
# particular file as subject to the "Classpath" exception as provided
9
# by Oracle in the LICENSE file that accompanied this code.
10
#
11
# This code is distributed in the hope that it will be useful, but WITHOUT
12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14
# version 2 for more details (a copy is included in the LICENSE file that
15
# accompanied this code).
16
#
17
# You should have received a copy of the GNU General Public License version
18
# 2 along with this work; if not, write to the Free Software Foundation,
19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
#
21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
# or visit www.oracle.com if you need additional information or have any
23
# questions.
24
#
25

26
$(eval $(call IncludeCustomExtension, hotspot/lib/JvmFeatures.gmk))
27

28
################################################################################
29
# Setup CFLAGS and EXCLUDES for the libjvm compilation, depending on which
30
# jvm features are selected for this jvm variant.
31

32
ifeq ($(call check-jvm-feature, compiler1), true)
33
  JVM_CFLAGS_FEATURES += -DCOMPILER1
34
else
35
  JVM_EXCLUDE_PATTERNS += c1_ c1/
36
endif
37

38
ifeq ($(call check-jvm-feature, compiler2), true)
39
  JVM_CFLAGS_FEATURES += -DCOMPILER2
40
  JVM_SRC_DIRS += $(JVM_VARIANT_OUTPUTDIR)/gensrc/adfiles
41
else
42
  JVM_EXCLUDES += opto libadt
43
  JVM_EXCLUDE_FILES += bcEscapeAnalyzer.cpp ciTypeFlow.cpp
44
  JVM_EXCLUDE_PATTERNS += c2_ runtime_ /c2/
45
endif
46

47
ifeq ($(call check-jvm-feature, zero), true)
48
  JVM_EXCLUDES += opto libadt
49
  JVM_EXCLUDE_PATTERNS += c1_ c1/ c2_ runtime_ /c2/
50
  JVM_EXCLUDE_FILES += templateInterpreter.cpp templateInterpreterGenerator.cpp \
51
                       bcEscapeAnalyzer.cpp ciTypeFlow.cpp
52
  JVM_CFLAGS_FEATURES += -DZERO -DZERO_LIBARCH='"$(OPENJDK_TARGET_CPU_LEGACY_LIB)"' $(LIBFFI_CFLAGS)
53
  JVM_LIBS_FEATURES += $(LIBFFI_LIBS)
54
  ifeq ($(ENABLE_LIBFFI_BUNDLING), true)
55
    JVM_LDFLAGS_FEATURES += $(call SET_EXECUTABLE_ORIGIN,/..)
56
  endif
57
else
58
  JVM_EXCLUDE_PATTERNS += /zero/
59
endif
60

61
ifeq ($(JVM_VARIANT), core)
62
  JVM_CFLAGS_FEATURES += -DVMTYPE=\"Core\"
63
endif
64

65
ifeq ($(JVM_VARIANT), custom)
66
  JVM_CFLAGS_FEATURES += -DVMTYPE=\"Custom\"
67
endif
68

69
ifeq ($(call check-jvm-feature, minimal), true)
70
  JVM_CFLAGS_FEATURES += -DMINIMAL_JVM -DVMTYPE=\"Minimal\"
71
  ifeq ($(call isTargetOs, linux), true)
72
    # Override the default -g with a more liberal strip policy for the minimal JVM
73
    JVM_STRIPFLAGS := --strip-unneeded
74
  endif
75
endif
76

77
ifeq ($(call check-jvm-feature, dtrace), true)
78
  JVM_CFLAGS_FEATURES += -DDTRACE_ENABLED
79
endif
80

81
ifneq ($(call check-jvm-feature, jvmti), true)
82
  JVM_CFLAGS_FEATURES += -DINCLUDE_JVMTI=0
83
  JVM_EXCLUDE_FILES += jvmtiGetLoadedClasses.cpp jvmtiThreadState.cpp jvmtiExtensions.cpp \
84
      jvmtiImpl.cpp jvmtiManageCapabilities.cpp jvmtiRawMonitor.cpp jvmtiUtil.cpp jvmtiTrace.cpp \
85
      jvmtiCodeBlobEvents.cpp jvmtiEnv.cpp jvmtiRedefineClasses.cpp jvmtiEnvBase.cpp jvmtiEnvThreadState.cpp \
86
      jvmtiTagMap.cpp jvmtiEventController.cpp evmCompat.cpp jvmtiEnter.xsl jvmtiExport.cpp \
87
      jvmtiClassFileReconstituter.cpp jvmtiTagMapTable.cpp jvmtiAgent.cpp jvmtiAgentList.cpp jfrJvmtiAgent.cpp
88
endif
89

90
ifneq ($(call check-jvm-feature, jvmci), true)
91
  JVM_CFLAGS_FEATURES += -DINCLUDE_JVMCI=0
92
  JVM_EXCLUDES += jvmci
93
  JVM_EXCLUDE_FILES += jvmciCodeInstaller_$(HOTSPOT_TARGET_CPU_ARCH).cpp
94
endif
95

96
ifneq ($(call check-jvm-feature, vm-structs), true)
97
  JVM_CFLAGS_FEATURES += -DINCLUDE_VM_STRUCTS=0
98
  JVM_EXCLUDE_FILES += vmStructs.cpp
99
endif
100

101
ifneq ($(call check-jvm-feature, jni-check), true)
102
  JVM_CFLAGS_FEATURES += -DINCLUDE_JNI_CHECK=0
103
  JVM_EXCLUDE_FILES += jniCheck.cpp
104
endif
105

106
ifneq ($(call check-jvm-feature, services), true)
107
  JVM_CFLAGS_FEATURES += -DINCLUDE_SERVICES=0
108
  JVM_EXCLUDE_FILES += heapDumper.cpp heapInspection.cpp \
109
      attachListener_$(HOTSPOT_TARGET_OS).cpp attachListener.cpp
110
endif
111

112
ifneq ($(call check-jvm-feature, management), true)
113
  JVM_CFLAGS_FEATURES += -DINCLUDE_MANAGEMENT=0
114
endif
115

116
ifneq ($(call check-jvm-feature, cds), true)
117
  JVM_CFLAGS_FEATURES += -DINCLUDE_CDS=0
118
  JVM_EXCLUDE_FILES += \
119
      classLoaderDataShared.cpp \
120
      classLoaderExt.cpp \
121
      systemDictionaryShared.cpp
122
  JVM_EXCLUDE_PATTERNS += cds/
123
endif
124

125
ifneq ($(call check-jvm-feature, g1gc), true)
126
  JVM_CFLAGS_FEATURES += -DINCLUDE_G1GC=0
127
  JVM_EXCLUDE_PATTERNS += gc/g1
128
endif
129

130
ifneq ($(call check-jvm-feature, parallelgc), true)
131
  JVM_CFLAGS_FEATURES += -DINCLUDE_PARALLELGC=0
132
  JVM_EXCLUDE_PATTERNS += gc/parallel
133
endif
134

135
ifneq ($(call check-jvm-feature, serialgc), true)
136
  JVM_CFLAGS_FEATURES += -DINCLUDE_SERIALGC=0
137
  JVM_EXCLUDE_PATTERNS += gc/serial
138
endif
139

140
ifneq ($(call check-jvm-feature, epsilongc), true)
141
  JVM_CFLAGS_FEATURES += -DINCLUDE_EPSILONGC=0
142
  JVM_EXCLUDE_PATTERNS += gc/epsilon
143
endif
144

145
ifneq ($(call check-jvm-feature, zgc), true)
146
  JVM_CFLAGS_FEATURES += -DINCLUDE_ZGC=0
147
  JVM_EXCLUDE_PATTERNS += gc/z
148
  JVM_EXCLUDE_PATTERNS += gc/x
149
endif
150

151
ifneq ($(call check-jvm-feature, shenandoahgc), true)
152
  JVM_CFLAGS_FEATURES += -DINCLUDE_SHENANDOAHGC=0
153
  JVM_EXCLUDE_PATTERNS += gc/shenandoah
154
endif
155

156
ifneq ($(call check-jvm-feature, jfr), true)
157
  JVM_CFLAGS_FEATURES += -DINCLUDE_JFR=0
158
  JVM_EXCLUDE_PATTERNS += jfr
159
  JVM_EXCLUDE_FILES += compilerEvent.cpp
160
endif
161

162
################################################################################
163

164
ifeq ($(call check-jvm-feature, link-time-opt), true)
165
  # Set JVM_OPTIMIZATION directly so other jvm-feature flags can override it
166
  # later on if desired
167
  JVM_OPTIMIZATION := HIGHEST_JVM
168
  ifeq ($(call isCompiler, gcc), true)
169
    JVM_CFLAGS_FEATURES += -flto=auto -fuse-linker-plugin -fno-strict-aliasing -fno-fat-lto-objects
170
    JVM_LDFLAGS_FEATURES += $(CXX_O_FLAG_HIGHEST_JVM) -flto=auto -fuse-linker-plugin -fno-strict-aliasing
171
  else ifeq ($(call isCompiler, microsoft), true)
172
    JVM_CFLAGS_FEATURES += -GL
173
    JVM_LDFLAGS_FEATURES += -LTCG:INCREMENTAL
174
  endif
175
else
176
  ifeq ($(call isCompiler, gcc), true)
177
    JVM_LDFLAGS_FEATURES += -O1
178
  endif
179
endif
180

181
ifeq ($(call check-jvm-feature, opt-size), true)
182
  JVM_OPTIMIZATION := SIZE
183
  OPT_SPEED_SRC := \
184
      allocation.cpp \
185
      assembler.cpp \
186
      barrierSet.cpp \
187
      basicLock.cpp \
188
      bytecode.cpp \
189
      bytecodeInterpreter.cpp \
190
      c1_Compilation.cpp \
191
      c1_Compiler.cpp \
192
      c1_GraphBuilder.cpp \
193
      c1_LinearScan.cpp \
194
      c1_LIR.cpp \
195
      ciEnv.cpp \
196
      ciObjectFactory.cpp \
197
      codeBlob.cpp \
198
      constantPool.cpp \
199
      constMethod.cpp \
200
      classLoader.cpp \
201
      classLoaderData.cpp \
202
      classFileParser.cpp \
203
      classFileStream.cpp \
204
      cpCache.cpp \
205
      defNewGeneration.cpp \
206
      frame_arm.cpp \
207
      frame_aarch64.cpp \
208
      frame_ppc.cpp \
209
      frame_s390.cpp \
210
      frame_x86.cpp \
211
      genCollectedHeap.cpp \
212
      generation.cpp \
213
      growableArray.cpp \
214
      handles.cpp \
215
      hashtable.cpp \
216
      heap.cpp \
217
      icache.cpp \
218
      icache_arm.cpp \
219
      icache_aarch64.cpp \
220
      icache_ppc.cpp \
221
      icache_s390.cpp \
222
      icache_x86.cpp \
223
      instanceKlass.cpp \
224
      invocationCounter.cpp \
225
      iterator.cpp \
226
      javaCalls.cpp \
227
      javaClasses.cpp \
228
      jniFastGetField_arm.cpp \
229
      jvm.cpp \
230
      linkResolver.cpp \
231
      klass.cpp \
232
      klassVtable.cpp \
233
      markSweep.cpp \
234
      memRegion.cpp \
235
      memoryPool.cpp \
236
      method.cpp \
237
      methodHandles.cpp \
238
      methodHandles_arm.cpp \
239
      methodLiveness.cpp \
240
      metaspace.cpp \
241
      mutex.cpp \
242
      mutexLocker.cpp \
243
      nativeLookup.cpp \
244
      objArrayKlass.cpp \
245
      os_linux.cpp \
246
      os_linux_arm.cpp \
247
      resourceArea.cpp \
248
      rewriter.cpp \
249
      sharedRuntime.cpp \
250
      signature.cpp \
251
      space.cpp \
252
      stackMapTable.cpp \
253
      symbolTable.cpp \
254
      systemDictionary.cpp \
255
      symbol.cpp \
256
      synchronizer.cpp \
257
      timer.cpp \
258
      typeArrayKlass.cpp \
259
      unsafe.cpp \
260
      utf8.cpp \
261
      vmSymbols.cpp \
262
      #
263

264
  $(foreach s, $(OPT_SPEED_SRC), \
265
      $(eval BUILD_LIBJVM_$s_OPTIMIZATION := HIGHEST_JVM))
266

267
  ifneq ($(filter $(TOOLCHAIN_TYPE), gcc clang), )
268
    BUILD_LIBJVM_systemDictionary.cpp_CXXFLAGS := -fno-optimize-sibling-calls
269
  endif
270
endif
271

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.