| 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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/bootstrap.h" | 8 #include "vm/bootstrap.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/constant_propagator.h" | 10 #include "vm/constant_propagator.h" |
| (...skipping 3168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3179 deopt_id(), token_pos(), locs()); | 3179 deopt_id(), token_pos(), locs()); |
| 3180 } else { | 3180 } else { |
| 3181 compiler->GenerateInstanceCall(deopt_id(), | 3181 compiler->GenerateInstanceCall(deopt_id(), |
| 3182 token_pos(), | 3182 token_pos(), |
| 3183 ArgumentCount(), | 3183 ArgumentCount(), |
| 3184 locs(), | 3184 locs(), |
| 3185 *call_ic_data); | 3185 *call_ic_data); |
| 3186 } | 3186 } |
| 3187 } | 3187 } |
| 3188 #else | 3188 #else |
| 3189 ICData* ic_data = &ICData::ZoneHandle(call_ic_data->Original()); | 3189 ICData* original_ic_data = &ICData::ZoneHandle(call_ic_data->Original()); |
| 3190 | 3190 |
| 3191 // Emit smi fast path instruction. If fast-path succeeds it skips the next | 3191 // Emit smi fast path instruction. If fast-path succeeds it skips the next |
| 3192 // instruction otherwise it falls through. | 3192 // instruction otherwise it falls through. Only attempt in unoptimized code |
| 3193 TryFastPathSmiOp(compiler, ic_data, function_name()); | 3193 // because TryFastPathSmiOp will update original_ic_data. |
| 3194 if (!compiler->is_optimizing()) { |
| 3195 TryFastPathSmiOp(compiler, original_ic_data, function_name()); |
| 3196 } |
| 3194 | 3197 |
| 3195 const intptr_t call_ic_data_kidx = __ AddConstant(*call_ic_data); | 3198 const intptr_t call_ic_data_kidx = __ AddConstant(*original_ic_data); |
| 3196 switch (ic_data->NumArgsTested()) { | 3199 switch (original_ic_data->NumArgsTested()) { |
| 3197 case 1: | 3200 case 1: |
| 3198 if (compiler->is_optimizing()) { | 3201 if (compiler->is_optimizing()) { |
| 3199 __ InstanceCall1Opt(ArgumentCount(), call_ic_data_kidx); | 3202 __ InstanceCall1Opt(ArgumentCount(), call_ic_data_kidx); |
| 3200 } else { | 3203 } else { |
| 3201 __ InstanceCall1(ArgumentCount(), call_ic_data_kidx); | 3204 __ InstanceCall1(ArgumentCount(), call_ic_data_kidx); |
| 3202 } | 3205 } |
| 3203 break; | 3206 break; |
| 3204 case 2: | 3207 case 2: |
| 3205 if (compiler->is_optimizing()) { | 3208 if (compiler->is_optimizing()) { |
| 3206 __ InstanceCall2Opt(ArgumentCount(), call_ic_data_kidx); | 3209 __ InstanceCall2Opt(ArgumentCount(), call_ic_data_kidx); |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3923 set_native_c_function(native_function); | 3926 set_native_c_function(native_function); |
| 3924 function().SetIsNativeAutoSetupScope(auto_setup_scope); | 3927 function().SetIsNativeAutoSetupScope(auto_setup_scope); |
| 3925 Dart_NativeEntryResolver resolver = library.native_entry_resolver(); | 3928 Dart_NativeEntryResolver resolver = library.native_entry_resolver(); |
| 3926 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver); | 3929 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver); |
| 3927 set_is_bootstrap_native(is_bootstrap_native); | 3930 set_is_bootstrap_native(is_bootstrap_native); |
| 3928 } | 3931 } |
| 3929 | 3932 |
| 3930 #undef __ | 3933 #undef __ |
| 3931 | 3934 |
| 3932 } // namespace dart | 3935 } // namespace dart |
| OLD | NEW |