include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(call all-subdir-java-files)
LOCAL_JAVA_LIBRARIES := dx junit
-LOCAL_MODULE_TAGS := optional
LOCAL_MODULE:= dx-tests
include $(BUILD_HOST_JAVA_LIBRARY)
"[--dump-width=<n>]\n" +
" [--dump-method=<name>[*]] [--verbose-dump] [--no-files] " +
"[--core-library]\n" +
- " [--num-threads=<n>]\n" +
+ " [--num-threads=<n>] [--incremental] [--force-jumbo]\n" +
" [<file>.class | <file>.{zip,jar,apk} | <directory>] ...\n" +
" Convert a set of classfiles into a dex file, optionally " +
"embedded in a\n" +
/** whether to merge with the output dex file if it exists. */
public boolean incremental = false;
+ /** whether to force generation of const-string/jumbo for all indexes,
+ * to allow merges between dex files with many strings. */
+ public boolean forceJumbo = false;
+
/** {@code non-null} after {@link #parse}; file name arguments */
public String[] fileNames;
numThreads = Integer.parseInt(parser.getLastValue());
} else if (parser.isArg("--incremental")) {
incremental = true;
+ } else if (parser.isArg("--force-jumbo")) {
+ forceJumbo = true;
} else {
System.err.println("unknown option: " + parser.getCurrent());
throw new UsageException();
dexOptions = new DexOptions();
dexOptions.targetApiLevel = targetApiLevel;
+ dexOptions.forceJumbo = forceJumbo;
}
}
/** target API level */
public int targetApiLevel = DexFormat.API_NO_EXTENDED_OPCODES;
+ /** force generation of jumbo opcodes */
+ public boolean forceJumbo = false;
+
/**
* Gets the dex file magic number corresponding to this instance.
*/
while (guess != null) {
if (guess.getFormat().isCompatible(insn)) {
- break;
+ /*
+ * Don't break out for const_string to generate jumbo version
+ * when option is enabled.
+ */
+ if (!dexOptions.forceJumbo ||
+ guess.getOpcode() != Opcodes.CONST_STRING) {
+ break;
+ }
}
guess = Dops.getNextOrNull(guess, dexOptions);
package com.android.dx.merge;
import com.android.dx.io.CodeReader;
+import com.android.dx.io.Opcodes;
import com.android.dx.io.instructions.DecodedInstruction;
import com.android.dx.io.instructions.ShortArrayCodeOutput;
import com.android.dx.util.DexException;
public void visit(DecodedInstruction[] all, DecodedInstruction one) {
int stringId = one.getIndex();
int mappedId = indexMap.adjustString(stringId);
- jumboCheck(stringId, mappedId);
+ boolean isJumbo = (one.getOpcode() == Opcodes.CONST_STRING_JUMBO);
+ jumboCheck(isJumbo, mappedId);
mappedInstructions[mappedAt++] = one.withIndex(mappedId);
}
}
public void visit(DecodedInstruction[] all, DecodedInstruction one) {
int fieldId = one.getIndex();
int mappedId = indexMap.adjustField(fieldId);
- jumboCheck(fieldId, mappedId);
+ boolean isJumbo = (one.getOpcode() == Opcodes.CONST_STRING_JUMBO);
+ jumboCheck(isJumbo, mappedId);
mappedInstructions[mappedAt++] = one.withIndex(mappedId);
}
}
public void visit(DecodedInstruction[] all, DecodedInstruction one) {
int typeId = one.getIndex();
int mappedId = indexMap.adjustType(typeId);
- jumboCheck(typeId, mappedId);
+ boolean isJumbo = (one.getOpcode() == Opcodes.CONST_STRING_JUMBO);
+ jumboCheck(isJumbo, mappedId);
mappedInstructions[mappedAt++] = one.withIndex(mappedId);
}
}
public void visit(DecodedInstruction[] all, DecodedInstruction one) {
int methodId = one.getIndex();
int mappedId = indexMap.adjustMethod(methodId);
- jumboCheck(methodId, mappedId);
+ boolean isJumbo = (one.getOpcode() == Opcodes.CONST_STRING_JUMBO);
+ jumboCheck(isJumbo, mappedId);
mappedInstructions[mappedAt++] = one.withIndex(mappedId);
}
}
- private static void jumboCheck(int oldIndex, int newIndex) {
- if ((oldIndex <= 0xffff) && (newIndex > 0xffff)) {
- throw new DexException("Cannot handle conversion to jumbo index!");
+ private static void jumboCheck(boolean isJumbo, int newIndex) {
+ if (!isJumbo && (newIndex > 0xffff)) {
+ throw new DexException("Cannot merge new index " + newIndex +
+ " into a non-jumbo instruction!");
}
}
}
LOCAL_CFLAGS := $(filter-out $(CLANG_CONFIG_UNKNOWN_CFLAGS),$(LOCAL_CFLAGS))
endif
+# TODO: split out the asflags.
+LOCAL_ASFLAGS := $(LOCAL_CFLAGS)
+
include $(BUILD_SHARED_LIBRARY)
# Derivation #1
include $(LOCAL_PATH)/ReconfigureDvm.mk
LOCAL_CFLAGS += -UNDEBUG -DDEBUG=1 -DLOG_NDEBUG=1 -DWITH_DALVIK_ASSERT \
-DWITH_JIT_TUNING $(target_smp_flag)
+# TODO: split out the asflags.
+LOCAL_ASFLAGS := $(LOCAL_CFLAGS)
LOCAL_MODULE := libdvm_assert
include $(BUILD_SHARED_LIBRARY)
include $(LOCAL_PATH)/ReconfigureDvm.mk
LOCAL_CFLAGS += -UNDEBUG -DDEBUG=1 -DLOG_NDEBUG=1 -DWITH_DALVIK_ASSERT \
-DWITH_SELF_VERIFICATION $(target_smp_flag)
+ # TODO: split out the asflags.
+ LOCAL_ASFLAGS := $(LOCAL_CFLAGS)
LOCAL_MODULE := libdvm_sv
include $(BUILD_SHARED_LIBRARY)
WITH_JIT := false
include $(LOCAL_PATH)/ReconfigureDvm.mk
LOCAL_CFLAGS += $(target_smp_flag)
+# TODO: split out the asflags.
+LOCAL_ASFLAGS := $(LOCAL_CFLAGS)
LOCAL_MODULE := libdvm_interp
include $(BUILD_SHARED_LIBRARY)
endif
LOCAL_CFLAGS += $(host_smp_flag)
+ # TODO: split out the asflags.
+ LOCAL_ASFLAGS := $(LOCAL_CFLAGS)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := libdvm