2 * Copyright (C) 2009 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 * Determine the initial instruction set to be used for this trace.
19 * Later components may decide to change this.
21 JitInstructionSetType dvmCompilerInstructionSet(void)
23 return DALVIK_JIT_THUMB2;
26 /* Architecture-specific initializations and checks go here */
27 bool dvmCompilerArchVariantInit(void)
29 /* First, declare dvmCompiler_TEMPLATE_XXX for each template */
30 #define JIT_TEMPLATE(X) extern void dvmCompiler_TEMPLATE_##X();
31 #include "../../../template/armv5te-vfp/TemplateOpList.h"
35 extern void dvmCompilerTemplateStart(void);
38 * Then, populate the templateEntryOffsets array with the offsets from the
39 * the dvmCompilerTemplateStart symbol for each template.
41 #define JIT_TEMPLATE(X) templateEntryOffsets[i++] = \
42 (intptr_t) dvmCompiler_TEMPLATE_##X - (intptr_t) dvmCompilerTemplateStart;
43 #include "../../../template/armv5te-vfp/TemplateOpList.h"
46 /* Target-specific configuration */
47 gDvmJit.jitTableSize = 1 << 12; // 4096
48 gDvmJit.jitTableMask = gDvmJit.jitTableSize - 1;
49 gDvmJit.threshold = 40;
50 gDvmJit.codeCacheSize = 1024*1024;
52 #if defined(WITH_SELF_VERIFICATION)
53 /* Force into blocking */
54 gDvmJit.blockingMode = true;
55 gDvm.nativeDebuggerActive = true;
58 /* Codegen-specific assumptions */
59 assert(offsetof(ClassObject, vtable) < 128 &&
60 (offsetof(ClassObject, vtable) & 0x3) == 0);
61 assert(offsetof(ArrayObject, length) < 128 &&
62 (offsetof(ArrayObject, length) & 0x3) == 0);
63 assert(offsetof(ArrayObject, contents) < 256);
65 /* Up to 5 args are pushed on top of FP - sizeofStackSaveArea */
66 assert(sizeof(StackSaveArea) < 236);
69 * EA is calculated by doing "Rn + imm5 << 2", make sure that the last
70 * offset from the struct is less than 128.
72 assert((offsetof(InterpState, jitToInterpEntries) +
73 sizeof(struct JitToInterpEntries)) <= 128);
77 int dvmCompilerTargetOptHint(int key)
81 case kMaxHoistDistance:
85 LOGE("Unknown target optimization hint key: %d",key);