| 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_optimizer.h" | 5 #include "vm/flow_graph_optimizer.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/cha.h" | 8 #include "vm/cha.h" |
| 9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 2944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2955 (ic_data.NumberOfChecks() == 1) && | 2955 (ic_data.NumberOfChecks() == 1) && |
| 2956 (class_ids[0] == kGrowableObjectArrayCid)) { | 2956 (class_ids[0] == kGrowableObjectArrayCid)) { |
| 2957 // This is an internal method, no need to check argument types nor | 2957 // This is an internal method, no need to check argument types nor |
| 2958 // range. | 2958 // range. |
| 2959 Definition* array = call->ArgumentAt(0); | 2959 Definition* array = call->ArgumentAt(0); |
| 2960 Definition* value = call->ArgumentAt(1); | 2960 Definition* value = call->ArgumentAt(1); |
| 2961 StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr( | 2961 StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr( |
| 2962 GrowableObjectArray::length_offset(), | 2962 GrowableObjectArray::length_offset(), |
| 2963 new(I) Value(array), | 2963 new(I) Value(array), |
| 2964 new(I) Value(value), | 2964 new(I) Value(value), |
| 2965 kNoStoreBarrier, |
| 2966 call->token_pos()); |
| 2967 ReplaceCall(call, store); |
| 2968 return true; |
| 2969 } |
| 2970 |
| 2971 if ((recognized_kind == MethodRecognizer::kBigint_setUsed) && |
| 2972 (ic_data.NumberOfChecks() == 1) && |
| 2973 (class_ids[0] == kBigintCid)) { |
| 2974 // This is an internal method, no need to check argument types nor |
| 2975 // range. |
| 2976 Definition* bigint = call->ArgumentAt(0); |
| 2977 Definition* value = call->ArgumentAt(1); |
| 2978 StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr( |
| 2979 Bigint::used_offset(), |
| 2980 new(I) Value(bigint), |
| 2981 new(I) Value(value), |
| 2982 kNoStoreBarrier, |
| 2983 call->token_pos()); |
| 2984 ReplaceCall(call, store); |
| 2985 return true; |
| 2986 } |
| 2987 |
| 2988 if ((recognized_kind == MethodRecognizer::kBigint_setDigits) && |
| 2989 (ic_data.NumberOfChecks() == 1) && |
| 2990 (class_ids[0] == kBigintCid)) { |
| 2991 // This is an internal method, no need to check argument types nor |
| 2992 // range. |
| 2993 Definition* bigint = call->ArgumentAt(0); |
| 2994 Definition* value = call->ArgumentAt(1); |
| 2995 StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr( |
| 2996 Bigint::digits_offset(), |
| 2997 new(I) Value(bigint), |
| 2998 new(I) Value(value), |
| 2999 kEmitStoreBarrier, |
| 3000 call->token_pos()); |
| 3001 ReplaceCall(call, store); |
| 3002 return true; |
| 3003 } |
| 3004 |
| 3005 if ((recognized_kind == MethodRecognizer::kBigint_setNeg) && |
| 3006 (ic_data.NumberOfChecks() == 1) && |
| 3007 (class_ids[0] == kBigintCid)) { |
| 3008 // This is an internal method, no need to check argument types nor |
| 3009 // range. |
| 3010 Definition* bigint = call->ArgumentAt(0); |
| 3011 Definition* value = call->ArgumentAt(1); |
| 3012 StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr( |
| 3013 Bigint::neg_offset(), |
| 3014 new(I) Value(bigint), |
| 3015 new(I) Value(value), |
| 2965 kEmitStoreBarrier, | 3016 kEmitStoreBarrier, |
| 2966 call->token_pos()); | 3017 call->token_pos()); |
| 2967 ReplaceCall(call, store); | 3018 ReplaceCall(call, store); |
| 2968 return true; | 3019 return true; |
| 2969 } | 3020 } |
| 2970 | 3021 |
| 2971 if (((recognized_kind == MethodRecognizer::kStringBaseCodeUnitAt) || | 3022 if (((recognized_kind == MethodRecognizer::kStringBaseCodeUnitAt) || |
| 2972 (recognized_kind == MethodRecognizer::kStringBaseCharAt)) && | 3023 (recognized_kind == MethodRecognizer::kStringBaseCharAt)) && |
| 2973 (ic_data.NumberOfChecks() == 1) && | 3024 (ic_data.NumberOfChecks() == 1) && |
| 2974 ((class_ids[0] == kOneByteStringCid) || | 3025 ((class_ids[0] == kOneByteStringCid) || |
| (...skipping 7120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10095 | 10146 |
| 10096 // Insert materializations at environment uses. | 10147 // Insert materializations at environment uses. |
| 10097 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { | 10148 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { |
| 10098 CreateMaterializationAt( | 10149 CreateMaterializationAt( |
| 10099 exits_collector_.exits()[i], alloc, alloc->cls(), *slots); | 10150 exits_collector_.exits()[i], alloc, alloc->cls(), *slots); |
| 10100 } | 10151 } |
| 10101 } | 10152 } |
| 10102 | 10153 |
| 10103 | 10154 |
| 10104 } // namespace dart | 10155 } // namespace dart |
| OLD | NEW |