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 * This file is included by Codegen-armv5te.c, and implements architecture
19 * variant-specific code.
23 * Determine the initial instruction set to be used for this trace.
24 * Later components may decide to change this.
26 JitInstructionSetType dvmCompilerInstructionSet(void)
28 return DALVIK_JIT_THUMB;
31 /* Architecture-specific initializations and checks go here */
32 bool dvmCompilerArchVariantInit(void)
34 /* First, declare dvmCompiler_TEMPLATE_XXX for each template */
35 #define JIT_TEMPLATE(X) extern void dvmCompiler_TEMPLATE_##X();
36 #include "../../../template/armv5te/TemplateOpList.h"
40 extern void dvmCompilerTemplateStart(void);
43 * Then, populate the templateEntryOffsets array with the offsets from the
44 * the dvmCompilerTemplateStart symbol for each template.
46 #define JIT_TEMPLATE(X) templateEntryOffsets[i++] = \
47 (intptr_t) dvmCompiler_TEMPLATE_##X - (intptr_t) dvmCompilerTemplateStart;
48 #include "../../../template/armv5te/TemplateOpList.h"
51 /* Target-specific configuration */
52 gDvmJit.jitTableSize = 1 << 9; // 512
53 gDvmJit.jitTableMask = gDvmJit.jitTableSize - 1;
54 gDvmJit.threshold = 200;
55 gDvmJit.codeCacheSize = 512*1024;
57 #if defined(WITH_SELF_VERIFICATION)
58 /* Force into blocking mode */
59 gDvmJit.blockingMode = true;
62 /* Codegen-specific assumptions */
63 assert(offsetof(ClassObject, vtable) < 128 &&
64 (offsetof(ClassObject, vtable) & 0x3) == 0);
65 assert(offsetof(ArrayObject, length) < 128 &&
66 (offsetof(ArrayObject, length) & 0x3) == 0);
67 assert(offsetof(ArrayObject, contents) < 256);
69 /* Up to 5 args are pushed on top of FP - sizeofStackSaveArea */
70 assert(sizeof(StackSaveArea) < 236);
73 * EA is calculated by doing "Rn + imm5 << 2", and there are 5 entry points
74 * that codegen may access, make sure that the offset from the top of the
75 * struct is less than 108.
77 assert(offsetof(InterpState, jitToInterpEntries) < 108);
81 int dvmCompilerTargetOptHint(int key)
85 case kMaxHoistDistance:
89 LOGE("Unknown target optimization hint key: %d",key);