Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/flow_graph_inliner.h" | 5 #include "vm/flow_graph_inliner.h" |
| 6 | 6 |
| 7 #include "vm/aot_optimizer.h" | 7 #include "vm/aot_optimizer.h" |
| 8 #include "vm/block_scheduler.h" | 8 #include "vm/block_scheduler.h" |
| 9 #include "vm/branch_optimizer.h" | 9 #include "vm/branch_optimizer.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 2874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2885 last->LinkTo(call); | 2885 last->LinkTo(call); |
| 2886 // Remove through the iterator. | 2886 // Remove through the iterator. |
| 2887 ASSERT(iterator->Current() == call); | 2887 ASSERT(iterator->Current() == call); |
| 2888 iterator->RemoveCurrentFromGraph(); | 2888 iterator->RemoveCurrentFromGraph(); |
| 2889 call->set_previous(NULL); | 2889 call->set_previous(NULL); |
| 2890 call->set_next(NULL); | 2890 call->set_next(NULL); |
| 2891 return true; | 2891 return true; |
| 2892 } | 2892 } |
| 2893 | 2893 |
| 2894 | 2894 |
| 2895 bool FlowGraphInliner::TryReplaceStaticCallWithInline( | |
| 2896 FlowGraph* flow_graph, | |
| 2897 ForwardInstructionIterator* iterator, | |
| 2898 StaticCallInstr* call) { | |
| 2899 TargetEntryInstr* entry; | |
| 2900 Definition* last; | |
|
rmacnak
2016/08/18 18:09:54
I think this would read easier as
if (TryInline)
Florian Schneider
2016/08/18 19:42:44
Done. Also for TryReplaceInstanceCallWithInline.
| |
| 2901 if (!FlowGraphInliner::TryInlineRecognizedMethod(flow_graph, | |
| 2902 kIllegalCid, | |
| 2903 call->function(), | |
| 2904 call, | |
| 2905 call->ArgumentAt(0), | |
| 2906 call->token_pos(), | |
| 2907 *call->ic_data(), | |
| 2908 &entry, &last)) { | |
| 2909 return false; | |
| 2910 } | |
| 2911 | |
| 2912 // Remove the original push arguments. | |
| 2913 for (intptr_t i = 0; i < call->ArgumentCount(); ++i) { | |
| 2914 PushArgumentInstr* push = call->PushArgumentAt(i); | |
| 2915 push->ReplaceUsesWith(push->value()->definition()); | |
| 2916 push->RemoveFromGraph(); | |
| 2917 } | |
| 2918 // Replace all uses of this definition with the result. | |
| 2919 call->ReplaceUsesWith(last); | |
| 2920 // Finally insert the sequence other definition in place of this one in the | |
| 2921 // graph. | |
| 2922 call->previous()->LinkTo(entry->next()); | |
| 2923 entry->UnuseAllInputs(); // Entry block is not in the graph. | |
| 2924 last->LinkTo(call); | |
| 2925 // Remove through the iterator. | |
| 2926 ASSERT(iterator->Current() == call); | |
| 2927 iterator->RemoveCurrentFromGraph(); | |
| 2928 call->set_previous(NULL); | |
| 2929 call->set_next(NULL); | |
| 2930 return true; | |
| 2931 } | |
| 2932 | |
| 2933 | |
| 2934 static bool InlineFloat32x4Method(FlowGraph* flow_graph, | |
| 2935 Instruction* call, | |
| 2936 MethodRecognizer::Kind kind, | |
| 2937 TargetEntryInstr** entry, | |
| 2938 Definition** last) { | |
| 2939 if (!ShouldInlineSimd()) { | |
| 2940 return false; | |
| 2941 } | |
| 2942 *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(), | |
| 2943 call->GetBlock()->try_index()); | |
| 2944 (*entry)->InheritDeoptTarget(Z, call); | |
| 2945 Instruction* cursor = *entry; | |
| 2946 switch (kind) { | |
| 2947 case MethodRecognizer::kFloat32x4ShuffleX: | |
| 2948 case MethodRecognizer::kFloat32x4ShuffleY: | |
| 2949 case MethodRecognizer::kFloat32x4ShuffleZ: | |
| 2950 case MethodRecognizer::kFloat32x4ShuffleW: { | |
| 2951 *last = new(Z) Simd32x4ShuffleInstr(kind, | |
| 2952 new(Z) Value(call->ArgumentAt(0)), | |
| 2953 0, // mask ignored. | |
| 2954 call->deopt_id()); | |
| 2955 break; | |
| 2956 } | |
| 2957 case MethodRecognizer::kFloat32x4GetSignMask: { | |
| 2958 *last = new(Z) Simd32x4GetSignMaskInstr(kind, | |
| 2959 new(Z) Value(call->ArgumentAt(0)), | |
| 2960 call->deopt_id()); | |
| 2961 break; | |
| 2962 } | |
| 2963 case MethodRecognizer::kFloat32x4Equal: | |
| 2964 case MethodRecognizer::kFloat32x4GreaterThan: | |
| 2965 case MethodRecognizer::kFloat32x4GreaterThanOrEqual: | |
| 2966 case MethodRecognizer::kFloat32x4LessThan: | |
| 2967 case MethodRecognizer::kFloat32x4LessThanOrEqual: | |
| 2968 case MethodRecognizer::kFloat32x4NotEqual: { | |
| 2969 Definition* left = call->ArgumentAt(0); | |
| 2970 Definition* right = call->ArgumentAt(1); | |
| 2971 *last = new(Z) Float32x4ComparisonInstr(kind, | |
| 2972 new(Z) Value(left), | |
| 2973 new(Z) Value(right), | |
| 2974 call->deopt_id()); | |
| 2975 break; | |
| 2976 } | |
| 2977 case MethodRecognizer::kFloat32x4Min: | |
| 2978 case MethodRecognizer::kFloat32x4Max: { | |
| 2979 Definition* left = call->ArgumentAt(0); | |
| 2980 Definition* right = call->ArgumentAt(1); | |
| 2981 *last = new(Z) Float32x4MinMaxInstr(kind, | |
| 2982 new(Z) Value(left), | |
| 2983 new(Z) Value(right), | |
| 2984 call->deopt_id()); | |
| 2985 break; | |
| 2986 } | |
| 2987 case MethodRecognizer::kFloat32x4Scale: { | |
| 2988 Definition* left = call->ArgumentAt(0); | |
| 2989 Definition* right = call->ArgumentAt(1); | |
| 2990 // Left and right values are swapped when handed to the instruction, | |
| 2991 // this is done so that the double value is loaded into the output | |
| 2992 // register and can be destroyed. | |
| 2993 *last = new(Z) Float32x4ScaleInstr(kind, | |
| 2994 new(Z) Value(right), | |
| 2995 new(Z) Value(left), | |
| 2996 call->deopt_id()); | |
| 2997 break; | |
| 2998 } | |
| 2999 case MethodRecognizer::kFloat32x4Sqrt: | |
| 3000 case MethodRecognizer::kFloat32x4ReciprocalSqrt: | |
| 3001 case MethodRecognizer::kFloat32x4Reciprocal: { | |
| 3002 Definition* left = call->ArgumentAt(0); | |
| 3003 *last = new(Z) Float32x4SqrtInstr(kind, | |
| 3004 new(Z) Value(left), | |
| 3005 call->deopt_id()); | |
| 3006 break; | |
| 3007 } | |
| 3008 case MethodRecognizer::kFloat32x4WithX: | |
| 3009 case MethodRecognizer::kFloat32x4WithY: | |
| 3010 case MethodRecognizer::kFloat32x4WithZ: | |
| 3011 case MethodRecognizer::kFloat32x4WithW: { | |
| 3012 Definition* left = call->ArgumentAt(0); | |
| 3013 Definition* right = call->ArgumentAt(1); | |
| 3014 *last = new(Z) Float32x4WithInstr(kind, | |
| 3015 new(Z) Value(left), | |
| 3016 new(Z) Value(right), | |
| 3017 call->deopt_id()); | |
| 3018 break; | |
| 3019 } | |
| 3020 case MethodRecognizer::kFloat32x4Absolute: | |
| 3021 case MethodRecognizer::kFloat32x4Negate: { | |
| 3022 Definition* left = call->ArgumentAt(0); | |
| 3023 *last = new(Z) Float32x4ZeroArgInstr(kind, | |
| 3024 new(Z) Value(left), | |
| 3025 call->deopt_id()); | |
| 3026 break; | |
| 3027 } | |
| 3028 case MethodRecognizer::kFloat32x4Clamp: { | |
| 3029 Definition* left = call->ArgumentAt(0); | |
| 3030 Definition* lower = call->ArgumentAt(1); | |
| 3031 Definition* upper = call->ArgumentAt(2); | |
| 3032 *last = new(Z) Float32x4ClampInstr( | |
| 3033 new(Z) Value(left), | |
| 3034 new(Z) Value(lower), | |
| 3035 new(Z) Value(upper), | |
| 3036 call->deopt_id()); | |
| 3037 break; | |
| 3038 } | |
| 3039 default: | |
| 3040 UNREACHABLE(); | |
| 3041 return false; | |
| 3042 } | |
| 3043 flow_graph->AppendTo(cursor, *last, | |
| 3044 call->deopt_id() != Thread::kNoDeoptId ? | |
| 3045 call->env() : NULL, | |
| 3046 FlowGraph::kValue); | |
| 3047 return true; | |
| 3048 } | |
| 3049 | |
| 3050 | |
| 3051 static bool CheckMask(Definition* definition, intptr_t* mask_ptr) { | |
| 3052 if (!definition->IsConstant()) return false; | |
| 3053 ConstantInstr* constant_instruction = definition->AsConstant(); | |
| 3054 const Object& constant_mask = constant_instruction->value(); | |
| 3055 if (!constant_mask.IsSmi()) return false; | |
| 3056 const intptr_t mask = Smi::Cast(constant_mask).Value(); | |
| 3057 if ((mask < 0) || (mask > 255)) { | |
| 3058 return false; // Not a valid mask. | |
| 3059 } | |
| 3060 *mask_ptr = mask; | |
| 3061 return true; | |
| 3062 } | |
| 3063 | |
| 3064 | |
| 3065 static bool InlineSimdShuffleMethod(FlowGraph* flow_graph, | |
| 3066 Instruction* call, | |
| 3067 MethodRecognizer::Kind kind, | |
| 3068 TargetEntryInstr** entry, | |
| 3069 Definition** last) { | |
| 3070 if (!ShouldInlineSimd()) { | |
| 3071 return false; | |
| 3072 } | |
| 3073 *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(), | |
| 3074 call->GetBlock()->try_index()); | |
| 3075 (*entry)->InheritDeoptTarget(Z, call); | |
| 3076 Instruction* cursor = *entry; | |
| 3077 Definition* mask_definition = call->ArgumentAt(1); | |
| 3078 intptr_t mask = 0; | |
| 3079 if (!CheckMask(mask_definition, &mask)) { | |
| 3080 return false; | |
| 3081 } | |
| 3082 *last = new(Z) Simd32x4ShuffleInstr( | |
| 3083 kind, | |
| 3084 new(Z) Value(call->ArgumentAt(0)), | |
| 3085 mask, | |
| 3086 call->deopt_id()); | |
| 3087 flow_graph->AppendTo(cursor, *last, | |
| 3088 call->deopt_id() != Thread::kNoDeoptId ? | |
| 3089 call->env() : NULL, | |
| 3090 FlowGraph::kValue); | |
| 3091 return true; | |
| 3092 } | |
| 3093 | |
| 3094 | |
| 3095 static bool InlineSimdShuffleMixMethod(FlowGraph* flow_graph, | |
| 3096 Instruction* call, | |
| 3097 MethodRecognizer::Kind kind, | |
| 3098 TargetEntryInstr** entry, | |
| 3099 Definition** last) { | |
| 3100 if (!ShouldInlineSimd()) { | |
| 3101 return false; | |
| 3102 } | |
| 3103 *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(), | |
| 3104 call->GetBlock()->try_index()); | |
| 3105 (*entry)->InheritDeoptTarget(Z, call); | |
| 3106 Instruction* cursor = *entry; | |
| 3107 Definition* mask_definition = call->ArgumentAt(2); | |
| 3108 intptr_t mask = 0; | |
| 3109 if (!CheckMask(mask_definition, &mask)) { | |
| 3110 return false; | |
| 3111 } | |
| 3112 *last = new(Z) Simd32x4ShuffleMixInstr( | |
| 3113 kind, | |
| 3114 new(Z) Value(call->ArgumentAt(0)), | |
| 3115 new(Z) Value(call->ArgumentAt(1)), | |
| 3116 mask, | |
| 3117 call->deopt_id()); | |
| 3118 flow_graph->AppendTo(cursor, *last, | |
| 3119 call->deopt_id() != Thread::kNoDeoptId ? | |
| 3120 call->env() : NULL, | |
| 3121 FlowGraph::kValue); | |
| 3122 return true; | |
| 3123 } | |
| 3124 | |
| 3125 | |
| 3126 | |
| 3127 static bool InlineInt32x4Method(FlowGraph* flow_graph, | |
| 3128 Instruction* call, | |
| 3129 MethodRecognizer::Kind kind, | |
| 3130 TargetEntryInstr** entry, | |
| 3131 Definition** last) { | |
| 3132 if (!ShouldInlineSimd()) { | |
| 3133 return false; | |
| 3134 } | |
| 3135 *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(), | |
| 3136 call->GetBlock()->try_index()); | |
| 3137 (*entry)->InheritDeoptTarget(Z, call); | |
| 3138 Instruction* cursor = *entry; | |
| 3139 switch (kind) { | |
| 3140 case MethodRecognizer::kInt32x4GetFlagX: | |
| 3141 case MethodRecognizer::kInt32x4GetFlagY: | |
| 3142 case MethodRecognizer::kInt32x4GetFlagZ: | |
| 3143 case MethodRecognizer::kInt32x4GetFlagW: { | |
| 3144 *last = new(Z) Int32x4GetFlagInstr( | |
| 3145 kind, | |
| 3146 new(Z) Value(call->ArgumentAt(0)), | |
| 3147 call->deopt_id()); | |
| 3148 break; | |
| 3149 } | |
| 3150 case MethodRecognizer::kInt32x4GetSignMask: { | |
| 3151 *last = new(Z) Simd32x4GetSignMaskInstr( | |
| 3152 kind, | |
| 3153 new(Z) Value(call->ArgumentAt(0)), | |
| 3154 call->deopt_id()); | |
| 3155 break; | |
| 3156 } | |
| 3157 case MethodRecognizer::kInt32x4Select: { | |
| 3158 Definition* mask = call->ArgumentAt(0); | |
| 3159 Definition* trueValue = call->ArgumentAt(1); | |
| 3160 Definition* falseValue = call->ArgumentAt(2); | |
| 3161 *last = new(Z) Int32x4SelectInstr( | |
| 3162 new(Z) Value(mask), | |
| 3163 new(Z) Value(trueValue), | |
| 3164 new(Z) Value(falseValue), | |
| 3165 call->deopt_id()); | |
| 3166 break; | |
| 3167 } | |
| 3168 case MethodRecognizer::kInt32x4WithFlagX: | |
| 3169 case MethodRecognizer::kInt32x4WithFlagY: | |
| 3170 case MethodRecognizer::kInt32x4WithFlagZ: | |
| 3171 case MethodRecognizer::kInt32x4WithFlagW: { | |
| 3172 *last = new(Z) Int32x4SetFlagInstr( | |
| 3173 kind, | |
| 3174 new(Z) Value(call->ArgumentAt(0)), | |
| 3175 new(Z) Value(call->ArgumentAt(1)), | |
| 3176 call->deopt_id()); | |
| 3177 break; | |
| 3178 } | |
| 3179 default: | |
| 3180 return false; | |
| 3181 } | |
| 3182 flow_graph->AppendTo(cursor, *last, | |
| 3183 call->deopt_id() != Thread::kNoDeoptId ? | |
| 3184 call->env() : NULL, | |
| 3185 FlowGraph::kValue); | |
| 3186 return true; | |
| 3187 } | |
| 3188 | |
| 3189 | |
| 3190 static bool InlineFloat64x2Method(FlowGraph* flow_graph, | |
| 3191 Instruction* call, | |
| 3192 MethodRecognizer::Kind kind, | |
| 3193 TargetEntryInstr** entry, | |
| 3194 Definition** last) { | |
| 3195 if (!ShouldInlineSimd()) { | |
| 3196 return false; | |
| 3197 } | |
| 3198 *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(), | |
| 3199 call->GetBlock()->try_index()); | |
| 3200 (*entry)->InheritDeoptTarget(Z, call); | |
| 3201 Instruction* cursor = *entry; | |
| 3202 switch (kind) { | |
| 3203 case MethodRecognizer::kFloat64x2GetX: | |
| 3204 case MethodRecognizer::kFloat64x2GetY: { | |
| 3205 *last = new(Z) Simd64x2ShuffleInstr( | |
| 3206 kind, | |
| 3207 new(Z) Value(call->ArgumentAt(0)), | |
| 3208 0, // mask is ignored. | |
| 3209 call->deopt_id()); | |
| 3210 break; | |
| 3211 } | |
| 3212 case MethodRecognizer::kFloat64x2Negate: | |
| 3213 case MethodRecognizer::kFloat64x2Abs: | |
| 3214 case MethodRecognizer::kFloat64x2Sqrt: | |
| 3215 case MethodRecognizer::kFloat64x2GetSignMask: { | |
| 3216 *last = new(Z) Float64x2ZeroArgInstr( | |
| 3217 kind, new(Z) Value(call->ArgumentAt(0)), call->deopt_id()); | |
| 3218 break; | |
| 3219 } | |
| 3220 case MethodRecognizer::kFloat64x2Scale: | |
| 3221 case MethodRecognizer::kFloat64x2WithX: | |
| 3222 case MethodRecognizer::kFloat64x2WithY: | |
| 3223 case MethodRecognizer::kFloat64x2Min: | |
| 3224 case MethodRecognizer::kFloat64x2Max: { | |
| 3225 Definition* left = call->ArgumentAt(0); | |
| 3226 Definition* right = call->ArgumentAt(1); | |
| 3227 *last = new(Z) Float64x2OneArgInstr(kind, | |
| 3228 new(Z) Value(left), | |
| 3229 new(Z) Value(right), | |
| 3230 call->deopt_id()); | |
| 3231 break; | |
| 3232 } | |
| 3233 default: | |
| 3234 UNREACHABLE(); | |
| 3235 return false; | |
| 3236 } | |
| 3237 flow_graph->AppendTo(cursor, *last, | |
| 3238 call->deopt_id() != Thread::kNoDeoptId ? | |
| 3239 call->env() : NULL, | |
| 3240 FlowGraph::kValue); | |
| 3241 return true; | |
| 3242 } | |
| 3243 | |
| 3244 | |
| 3245 static bool InlineSimdConstructor(FlowGraph* flow_graph, | |
| 3246 Instruction* call, | |
| 3247 MethodRecognizer::Kind kind, | |
| 3248 TargetEntryInstr** entry, | |
| 3249 Definition** last) { | |
| 3250 if (!ShouldInlineSimd()) { | |
| 3251 return false; | |
| 3252 } | |
| 3253 *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(), | |
| 3254 call->GetBlock()->try_index()); | |
| 3255 (*entry)->InheritDeoptTarget(Z, call); | |
| 3256 Instruction* cursor = *entry; | |
| 3257 switch (kind) { | |
| 3258 case MethodRecognizer::kFloat32x4Zero: | |
| 3259 *last = new(Z) Float32x4ZeroInstr(); | |
| 3260 break; | |
| 3261 case MethodRecognizer::kFloat32x4Splat: | |
| 3262 *last = new(Z) Float32x4SplatInstr(new(Z) Value(call->ArgumentAt(1)), | |
| 3263 call->deopt_id()); | |
| 3264 break; | |
| 3265 case MethodRecognizer::kFloat32x4Constructor: | |
| 3266 *last = new(Z) Float32x4ConstructorInstr( | |
| 3267 new(Z) Value(call->ArgumentAt(1)), | |
| 3268 new(Z) Value(call->ArgumentAt(2)), | |
| 3269 new(Z) Value(call->ArgumentAt(3)), | |
| 3270 new(Z) Value(call->ArgumentAt(4)), | |
| 3271 call->deopt_id()); | |
| 3272 break; | |
| 3273 case MethodRecognizer::kFloat32x4FromInt32x4Bits: | |
| 3274 *last = new(Z) Int32x4ToFloat32x4Instr(new(Z) Value(call->ArgumentAt(1)), | |
| 3275 call->deopt_id()); | |
| 3276 break; | |
| 3277 case MethodRecognizer::kFloat32x4FromFloat64x2: | |
| 3278 *last = new(Z) Float64x2ToFloat32x4Instr( | |
| 3279 new(Z) Value(call->ArgumentAt(1)), | |
| 3280 call->deopt_id()); | |
| 3281 break; | |
| 3282 case MethodRecognizer::kFloat64x2Zero: | |
| 3283 *last = new(Z) Float64x2ZeroInstr(); | |
| 3284 break; | |
| 3285 case MethodRecognizer::kFloat64x2Splat: | |
| 3286 *last = new(Z) Float64x2SplatInstr(new(Z) Value(call->ArgumentAt(1)), | |
| 3287 call->deopt_id()); | |
| 3288 break; | |
| 3289 case MethodRecognizer::kFloat64x2Constructor: | |
| 3290 *last = new(Z) Float64x2ConstructorInstr( | |
| 3291 new(Z) Value(call->ArgumentAt(1)), | |
| 3292 new(Z) Value(call->ArgumentAt(2)), | |
| 3293 call->deopt_id()); | |
| 3294 break; | |
| 3295 case MethodRecognizer::kFloat64x2FromFloat32x4: | |
| 3296 *last = new(Z) Float32x4ToFloat64x2Instr( | |
| 3297 new(Z) Value(call->ArgumentAt(1)), | |
| 3298 call->deopt_id()); | |
| 3299 break; | |
| 3300 case MethodRecognizer::kInt32x4BoolConstructor: | |
| 3301 *last = new(Z) Int32x4BoolConstructorInstr( | |
| 3302 new(Z) Value(call->ArgumentAt(1)), | |
| 3303 new(Z) Value(call->ArgumentAt(2)), | |
| 3304 new(Z) Value(call->ArgumentAt(3)), | |
| 3305 new(Z) Value(call->ArgumentAt(4)), | |
| 3306 call->deopt_id()); | |
| 3307 break; | |
| 3308 case MethodRecognizer::kInt32x4Constructor: | |
| 3309 *last = new(Z) Int32x4ConstructorInstr( | |
| 3310 new(Z) Value(call->ArgumentAt(1)), | |
| 3311 new(Z) Value(call->ArgumentAt(2)), | |
| 3312 new(Z) Value(call->ArgumentAt(3)), | |
| 3313 new(Z) Value(call->ArgumentAt(4)), | |
| 3314 call->deopt_id()); | |
| 3315 break; | |
| 3316 case MethodRecognizer::kInt32x4FromFloat32x4Bits: | |
| 3317 *last = new(Z) Float32x4ToInt32x4Instr(new(Z) Value(call->ArgumentAt(1)), | |
| 3318 call->deopt_id()); | |
| 3319 break; | |
| 3320 default: | |
| 3321 UNREACHABLE(); | |
| 3322 return false; | |
| 3323 } | |
| 3324 flow_graph->AppendTo(cursor, *last, | |
| 3325 call->deopt_id() != Thread::kNoDeoptId ? | |
| 3326 call->env() : NULL, | |
| 3327 FlowGraph::kValue); | |
| 3328 return true; | |
| 3329 } | |
| 3330 | |
| 3331 | |
| 2895 bool FlowGraphInliner::TryInlineRecognizedMethod(FlowGraph* flow_graph, | 3332 bool FlowGraphInliner::TryInlineRecognizedMethod(FlowGraph* flow_graph, |
| 2896 intptr_t receiver_cid, | 3333 intptr_t receiver_cid, |
| 2897 const Function& target, | 3334 const Function& target, |
| 2898 Instruction* call, | 3335 Instruction* call, |
| 2899 Definition* receiver, | 3336 Definition* receiver, |
| 2900 TokenPosition token_pos, | 3337 TokenPosition token_pos, |
| 2901 const ICData& ic_data, | 3338 const ICData& ic_data, |
| 2902 TargetEntryInstr** entry, | 3339 TargetEntryInstr** entry, |
| 2903 Definition** last) { | 3340 Definition** last) { |
| 2904 ICData& value_check = ICData::ZoneHandle(Z); | 3341 ICData& value_check = ICData::ZoneHandle(Z); |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3138 flow_graph, GrowableObjectArray::data_offset(), kEmitStoreBarrier, | 3575 flow_graph, GrowableObjectArray::data_offset(), kEmitStoreBarrier, |
| 3139 call, entry, last); | 3576 call, entry, last); |
| 3140 case MethodRecognizer::kGrowableArraySetLength: | 3577 case MethodRecognizer::kGrowableArraySetLength: |
| 3141 ASSERT(receiver_cid == kGrowableObjectArrayCid); | 3578 ASSERT(receiver_cid == kGrowableObjectArrayCid); |
| 3142 ASSERT(ic_data.NumberOfChecks() == 1); | 3579 ASSERT(ic_data.NumberOfChecks() == 1); |
| 3143 return InlineGrowableArraySetter( | 3580 return InlineGrowableArraySetter( |
| 3144 flow_graph, GrowableObjectArray::length_offset(), kNoStoreBarrier, | 3581 flow_graph, GrowableObjectArray::length_offset(), kNoStoreBarrier, |
| 3145 call, entry, last); | 3582 call, entry, last); |
| 3146 case MethodRecognizer::kSmi_bitAndFromSmi: | 3583 case MethodRecognizer::kSmi_bitAndFromSmi: |
| 3147 return InlineSmiBitAndFromSmi(flow_graph, call, entry, last); | 3584 return InlineSmiBitAndFromSmi(flow_graph, call, entry, last); |
| 3585 | |
| 3586 case MethodRecognizer::kFloat32x4ShuffleX: | |
| 3587 case MethodRecognizer::kFloat32x4ShuffleY: | |
| 3588 case MethodRecognizer::kFloat32x4ShuffleZ: | |
| 3589 case MethodRecognizer::kFloat32x4ShuffleW: | |
| 3590 case MethodRecognizer::kFloat32x4GetSignMask: | |
| 3591 case MethodRecognizer::kFloat32x4Equal: | |
| 3592 case MethodRecognizer::kFloat32x4GreaterThan: | |
| 3593 case MethodRecognizer::kFloat32x4GreaterThanOrEqual: | |
| 3594 case MethodRecognizer::kFloat32x4LessThan: | |
| 3595 case MethodRecognizer::kFloat32x4LessThanOrEqual: | |
| 3596 case MethodRecognizer::kFloat32x4NotEqual: | |
| 3597 case MethodRecognizer::kFloat32x4Min: | |
| 3598 case MethodRecognizer::kFloat32x4Max: | |
| 3599 case MethodRecognizer::kFloat32x4Scale: | |
| 3600 case MethodRecognizer::kFloat32x4Sqrt: | |
| 3601 case MethodRecognizer::kFloat32x4ReciprocalSqrt: | |
| 3602 case MethodRecognizer::kFloat32x4Reciprocal: | |
| 3603 case MethodRecognizer::kFloat32x4WithX: | |
| 3604 case MethodRecognizer::kFloat32x4WithY: | |
| 3605 case MethodRecognizer::kFloat32x4WithZ: | |
| 3606 case MethodRecognizer::kFloat32x4WithW: | |
| 3607 case MethodRecognizer::kFloat32x4Absolute: | |
| 3608 case MethodRecognizer::kFloat32x4Negate: | |
| 3609 case MethodRecognizer::kFloat32x4Clamp: | |
| 3610 return InlineFloat32x4Method(flow_graph, call, kind, entry, last); | |
| 3611 | |
| 3612 case MethodRecognizer::kFloat32x4ShuffleMix: | |
| 3613 case MethodRecognizer::kInt32x4ShuffleMix: | |
| 3614 return InlineSimdShuffleMixMethod(flow_graph, call, kind, entry, last); | |
| 3615 | |
| 3616 case MethodRecognizer::kFloat32x4Shuffle: | |
| 3617 case MethodRecognizer::kInt32x4Shuffle: | |
| 3618 return InlineSimdShuffleMethod(flow_graph, call, kind, entry, last); | |
| 3619 | |
| 3620 case MethodRecognizer::kInt32x4GetFlagX: | |
| 3621 case MethodRecognizer::kInt32x4GetFlagY: | |
| 3622 case MethodRecognizer::kInt32x4GetFlagZ: | |
| 3623 case MethodRecognizer::kInt32x4GetFlagW: | |
| 3624 case MethodRecognizer::kInt32x4GetSignMask: | |
| 3625 case MethodRecognizer::kInt32x4Select: | |
| 3626 case MethodRecognizer::kInt32x4WithFlagX: | |
| 3627 case MethodRecognizer::kInt32x4WithFlagY: | |
| 3628 case MethodRecognizer::kInt32x4WithFlagZ: | |
| 3629 case MethodRecognizer::kInt32x4WithFlagW: | |
| 3630 return InlineInt32x4Method(flow_graph, call, kind, entry, last); | |
| 3631 | |
| 3632 case MethodRecognizer::kFloat64x2GetX: | |
| 3633 case MethodRecognizer::kFloat64x2GetY: | |
| 3634 case MethodRecognizer::kFloat64x2Negate: | |
| 3635 case MethodRecognizer::kFloat64x2Abs: | |
| 3636 case MethodRecognizer::kFloat64x2Sqrt: | |
| 3637 case MethodRecognizer::kFloat64x2GetSignMask: | |
| 3638 case MethodRecognizer::kFloat64x2Scale: | |
| 3639 case MethodRecognizer::kFloat64x2WithX: | |
| 3640 case MethodRecognizer::kFloat64x2WithY: | |
| 3641 case MethodRecognizer::kFloat64x2Min: | |
| 3642 case MethodRecognizer::kFloat64x2Max: | |
| 3643 return InlineFloat64x2Method(flow_graph, call, kind, entry, last); | |
| 3644 | |
| 3645 case MethodRecognizer::kFloat32x4Zero: | |
| 3646 case MethodRecognizer::kFloat32x4Splat: | |
| 3647 case MethodRecognizer::kFloat32x4Constructor: | |
| 3648 case MethodRecognizer::kFloat32x4FromFloat64x2: | |
| 3649 case MethodRecognizer::kFloat64x2Constructor: | |
| 3650 case MethodRecognizer::kFloat64x2Zero: | |
| 3651 case MethodRecognizer::kFloat64x2Splat: | |
| 3652 case MethodRecognizer::kFloat64x2FromFloat32x4: | |
| 3653 case MethodRecognizer::kInt32x4BoolConstructor: | |
| 3654 case MethodRecognizer::kInt32x4Constructor: | |
| 3655 case MethodRecognizer::kInt32x4FromFloat32x4Bits: | |
| 3656 return InlineSimdConstructor(flow_graph, call, kind, entry, last); | |
| 3657 | |
| 3148 default: | 3658 default: |
| 3149 return false; | 3659 return false; |
| 3150 } | 3660 } |
| 3151 } | 3661 } |
| 3152 | 3662 |
| 3153 | 3663 |
| 3154 } // namespace dart | 3664 } // namespace dart |
| OLD | NEW |