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.
17 #ifndef _DALVIK_VM_DATAFLOW
18 #define _DALVIK_VM_DATAFLOW
21 #include "CompilerInternals.h"
23 typedef enum DataFlowAttributePos {
44 #define DF_UA (1 << kUA)
45 #define DF_UB (1 << kUB)
46 #define DF_UC (1 << kUC)
47 #define DF_UA_WIDE (1 << kUAWide)
48 #define DF_UB_WIDE (1 << kUBWide)
49 #define DF_UC_WIDE (1 << kUCWide)
50 #define DF_DA (1 << kDA)
51 #define DF_DA_WIDE (1 << kDAWide)
52 #define DF_IS_MOVE (1 << kIsMove)
53 #define DF_IS_LINEAR (1 << kIsLinear)
54 #define DF_SETS_CONST (1 << kSetsConst)
55 #define DF_FORMAT_35C (1 << kFormat35c)
56 #define DF_FORMAT_3RC (1 << kFormat3rc)
57 #define DF_PHI (1 << kPhi)
58 #define DF_NULL_N_RANGE_CHECK_0 (1 << kNullNRangeCheck0)
59 #define DF_NULL_N_RANGE_CHECK_1 (1 << kNullNRangeCheck1)
60 #define DF_NULL_N_RANGE_CHECK_2 (1 << kNullNRangeCheck2)
62 #define DF_HAS_USES (DF_UA | DF_UB | DF_UC | DF_UA_WIDE | \
63 DF_UB_WIDE | DF_UC_WIDE)
65 #define DF_HAS_DEFS (DF_DA | DF_DA_WIDE)
67 #define DF_HAS_NR_CHECKS (DF_NULL_N_RANGE_CHECK_0 | \
68 DF_NULL_N_RANGE_CHECK_1 | \
69 DF_NULL_N_RANGE_CHECK_2)
71 extern int dvmCompilerDataFlowAttributes[MIR_OP_LAST];
73 typedef struct BasicBlockDataFlow {
81 typedef struct SSARepresentation {
88 typedef struct InductionVariableInfo {
94 } InductionVariableInfo;
96 typedef struct ArrayAccessInfo {
99 int maxC; // For DIV - will affect upper bound checking
100 int minC; // For DIV - will affect lower bound checking
103 #define ENCODE_REG_SUB(r,s) ((s<<16) | r)
104 #define DECODE_REG(v) (v & 0xffff)
105 #define DECODE_SUB(v) (((unsigned int) v) >> 16)
107 #endif /* _DALVIK_VM_DATAFLOW */