diff --git a/core/base_rules.mk b/core/base_rules.mk index 6b8386060..7355c300c 100644 --- a/core/base_rules.mk +++ b/core/base_rules.mk @@ -706,27 +706,8 @@ endif # LOCAL_SDK_VERSION endif # TARGET_ $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_STATIC_JACK_LIBRARIES := $(full_static_jack_libs) - -$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_VM_ARGS := $(DEFAULT_JACK_VM_ARGS) -ifneq ($(ANDROID_JACK_VM_ARGS),) -$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_VM_ARGS := $(ANDROID_JACK_VM_ARGS) -endif -ifneq ($(LOCAL_JACK_VM_ARGS),) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_VM_ARGS := $(LOCAL_JACK_VM_ARGS) -endif - -$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_EXTRA_ARGS := $(DEFAULT_JACK_EXTRA_ARGS) -ifneq ($(ANDROID_JACK_EXTRA_ARGS),) -$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_EXTRA_ARGS := $(ANDROID_JACK_EXTRA_ARGS) -endif -ifneq ($(LOCAL_JACK_EXTRA_ARGS),) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_EXTRA_ARGS := $(LOCAL_JACK_EXTRA_ARGS) -endif - -$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_VM := $(DEFAULT_JACK_VM) -ifneq ($(strip $(ANDROID_JACK_VM)),) -$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_VM := $(ANDROID_JACK_VM) -endif ifdef LOCAL_IS_HOST_MODULE ifeq ($(USE_CORE_LIB_BOOTCLASSPATH),true) diff --git a/core/clear_vars.mk b/core/clear_vars.mk index bc6661ee8..085b5fc6a 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -107,9 +107,9 @@ LOCAL_JARJAR_RULES:= LOCAL_ADDITIONAL_JAVA_DIR:= LOCAL_ALLOW_UNDEFINED_SYMBOLS:= LOCAL_DX_FLAGS:= -LOCAL_USE_JACK:=$(ANDROID_COMPILE_WITH_JACK) -LOCAL_JACK_VM_ARGS := -LOCAL_JACK_EXTRA_ARGS := +LOCAL_USE_JACK:= $(ANDROID_COMPILE_WITH_JACK) +LOCAL_JACK_VM_ARGS := $(DEFAULT_JACK_VM_ARGS) +LOCAL_JACK_EXTRA_ARGS := $(DEFAULT_JACK_EXTRA_ARGS) LOCAL_JACK_FLAGS:= LOCAL_CERTIFICATE:= LOCAL_SDK_VERSION:= diff --git a/core/config.mk b/core/config.mk index 065ab904b..83ef07434 100644 --- a/core/config.mk +++ b/core/config.mk @@ -405,17 +405,30 @@ MKTARBALL := build/tools/mktarball.sh TUNE2FS := $(HOST_OUT_EXECUTABLES)/tune2fs$(HOST_EXECUTABLE_SUFFIX) E2FSCK := $(HOST_OUT_EXECUTABLES)/e2fsck$(HOST_EXECUTABLE_SUFFIX) JARJAR := $(HOST_OUT_JAVA_LIBRARIES)/jarjar.jar + +ifneq ($(strip $(ANDROID_JACK_VM)),) +JACK_VM := $(ANDROID_JACK_VM) +else +JACK_VM := java +endif # call jack # -# $(1): vm -# $(2): vm arguments -# $(3): jack perf arguments +# $(1): vm arguments +# $(2): jack perf arguments define call-jack -$(1) $(2) -cp $(JACK_JAR) com.android.jack.Main $(3) +$(JACK_VM) $(1) -cp $(JACK_JAR) com.android.jack.Main $(2) endef -DEFAULT_JACK_VM := java +$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_VM_ARGS := $(DEFAULT_JACK_VM_ARGS) +ifneq ($(ANDROID_JACK_VM_ARGS),) +DEFAULT_JACK_VM_ARGS := $(ANDROID_JACK_VM_ARGS) +else DEFAULT_JACK_VM_ARGS := -Dfile.encoding=UTF-8 -Xmx3584m -Xms2560m -XX:+TieredCompilation +endif +ifneq ($(ANDROID_JACK_EXTRA_ARGS),) +DEFAULT_JACK_EXTRA_ARGS := $(ANDROID_JACK_EXTRA_ARGS) +else DEFAULT_JACK_EXTRA_ARGS := -D sched.runner=single-threaded --sanity-checks off +endif JILL := java -Xmx3500m -cp $(JILL_JAR) com.android.jill.Main PROGUARD := external/proguard/bin/proguard.sh JAVATAGS := build/tools/java-event-log-tags.py diff --git a/core/definitions.mk b/core/definitions.mk index 56051bc03..6ff62ed69 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -1752,7 +1752,7 @@ $(hide) if [ -s $(PRIVATE_JACK_INTERMEDIATES_DIR)/java-source-list-uniq ] ; then else \ export tmpEcjArg=""; \ fi; \ -$(call call-jack,$(PRIVATE_JACK_VM),$(PRIVATE_JACK_VM_ARGS),$(PRIVATE_JACK_EXTRA_ARGS)) \ +$(call call-jack,$(PRIVATE_JACK_VM_ARGS),$(PRIVATE_JACK_EXTRA_ARGS)) \ $(strip $(PRIVATE_JACK_FLAGS)) \ $(strip $(PRIVATE_JACK_DEBUG_FLAGS)) \ $(if $(NO_OPTIMIZE_DX), \ @@ -1785,7 +1785,7 @@ define transform-jar-to-jack $(hide) mkdir -p $@.tmpjill.res $(hide) $(call unzip-jar-files,$<,$@.tmpjill.res) $(hide) find $@.tmpjill.res -iname "*.class" -delete - $(hide) $(call call-jack,$(PRIVATE_JACK_VM),$(PRIVATE_JACK_VM_ARGS),$(PRIVATE_JACK_EXTRA_ARGS)) \ + $(hide) $(call call-jack,$(PRIVATE_JACK_VM_ARGS),$(PRIVATE_JACK_EXTRA_ARGS)) \ -D jack.import.resource.policy=keep-first \ -D jack.import.type.policy=keep-first \ --import $@.tmpjill.jack \ @@ -1828,7 +1828,7 @@ $(hide) if [ -s $(PRIVATE_JACK_INTERMEDIATES_DIR)/java-source-list-uniq ] ; then else \ export tmpEcjArg=""; \ fi; \ -$(call call-jack,$(PRIVATE_JACK_VM),$(PRIVATE_JACK_VM_ARGS),$(PRIVATE_JACK_EXTRA_ARGS)) \ +$(call call-jack,$(PRIVATE_JACK_VM_ARGS),$(PRIVATE_JACK_EXTRA_ARGS)) \ $(strip $(PRIVATE_JACK_FLAGS)) \ $(strip $(PRIVATE_JACK_DEBUG_FLAGS)) \ $(if $(NO_OPTIMIZE_DX), \