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_H_
18 #define DALVIK_VM_DATAFLOW_H_
21 #include "CompilerInternals.h"
23 typedef enum DataFlowAttributePos {
49 #define DF_UA (1 << kUA)
50 #define DF_UB (1 << kUB)
51 #define DF_UC (1 << kUC)
52 #define DF_UA_WIDE (1 << kUAWide)
53 #define DF_UB_WIDE (1 << kUBWide)
54 #define DF_UC_WIDE (1 << kUCWide)
55 #define DF_DA (1 << kDA)
56 #define DF_DA_WIDE (1 << kDAWide)
57 #define DF_IS_MOVE (1 << kIsMove)
58 #define DF_IS_LINEAR (1 << kIsLinear)
59 #define DF_SETS_CONST (1 << kSetsConst)
60 #define DF_FORMAT_35C (1 << kFormat35c)
61 #define DF_FORMAT_3RC (1 << kFormat3rc)
62 #define DF_PHI (1 << kPhi)
63 #define DF_NULL_N_RANGE_CHECK_0 (1 << kNullNRangeCheck0)
64 #define DF_NULL_N_RANGE_CHECK_1 (1 << kNullNRangeCheck1)
65 #define DF_NULL_N_RANGE_CHECK_2 (1 << kNullNRangeCheck2)
66 #define DF_FP_A (1 << kFPA)
67 #define DF_FP_B (1 << kFPB)
68 #define DF_FP_C (1 << kFPC)
69 #define DF_IS_GETTER (1 << kGetter)
70 #define DF_IS_SETTER (1 << kSetter)
72 #define DF_HAS_USES (DF_UA | DF_UB | DF_UC | DF_UA_WIDE | \
73 DF_UB_WIDE | DF_UC_WIDE)
75 #define DF_HAS_DEFS (DF_DA | DF_DA_WIDE)
77 #define DF_HAS_NR_CHECKS (DF_NULL_N_RANGE_CHECK_0 | \
78 DF_NULL_N_RANGE_CHECK_1 | \
79 DF_NULL_N_RANGE_CHECK_2)
81 #define DF_A_IS_REG (DF_UA | DF_UA_WIDE | DF_DA | DF_DA_WIDE)
82 #define DF_B_IS_REG (DF_UB | DF_UB_WIDE)
83 #define DF_C_IS_REG (DF_UC | DF_UC_WIDE)
84 #define DF_IS_GETTER_OR_SETTER (DF_IS_GETTER | DF_IS_SETTER)
86 extern int dvmCompilerDataFlowAttributes[kMirOpLast];
88 typedef struct BasicBlockDataFlow {
96 typedef struct SSARepresentation {
106 * An induction variable is represented by "m*i + c", where i is a basic
107 * induction variable.
109 typedef struct InductionVariableInfo {
114 int inc; // loop incriment
115 } InductionVariableInfo;
117 typedef struct ArrayAccessInfo {
120 int maxC; // For DIV - will affect upper bound checking
121 int minC; // For DIV - will affect lower bound checking
124 #define ENCODE_REG_SUB(r,s) ((s<<16) | r)
125 #define DECODE_REG(v) (v & 0xffff)
126 #define DECODE_SUB(v) (((unsigned int) v) >> 16)
128 #endif // DALVIK_VM_DATAFLOW_H_