1 /*
2  * Copyright (C) 2011 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.dx.dex;
18 
19 import com.android.dex.DexFormat;
20 
21 import com.android.dx.dex.code.DalvInsnList;
22 
23 /**
24  * Container for options used to control details of dex file generation.
25  */
26 public class DexOptions {
27 
28     /**
29      * Enable alignment support of 64-bit registers on Dalvik even registers. This is a temporary
30      * configuration flag allowing to quickly go back on the default behavior to face up to problem.
31      */
32     public static final boolean ALIGN_64BIT_REGS_SUPPORT = true;
33 
34    /**
35     * Does final processing of 64-bit alignment into output finisher to gets output as
36     * {@link DalvInsnList} with 64-bit registers aligned at best. Disabled the final processing is
37     * required for tools such as Dasm to avoid modifying user inputs.
38     */
39     public boolean ALIGN_64BIT_REGS_IN_OUTPUT_FINISHER = ALIGN_64BIT_REGS_SUPPORT;
40 
41     /** target API level */
42     public int targetApiLevel = DexFormat.API_NO_EXTENDED_OPCODES;
43 
44     /** force generation of jumbo opcodes */
45     public boolean forceJumbo = false;
46 
47     /**
48      * Gets the dex file magic number corresponding to this instance.
49      */
getMagic()50     public String getMagic() {
51         return DexFormat.apiToMagic(targetApiLevel);
52     }
53 }
54