| 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 3646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3657 return this; | 3657 return this; |
| 3658 } | 3658 } |
| 3659 } | 3659 } |
| 3660 | 3660 |
| 3661 const String& concatenated = String::ZoneHandle(zone, | 3661 const String& concatenated = String::ZoneHandle(zone, |
| 3662 Symbols::FromConcatAll(thread, pieces)); | 3662 Symbols::FromConcatAll(thread, pieces)); |
| 3663 return flow_graph->GetConstant(concatenated); | 3663 return flow_graph->GetConstant(concatenated); |
| 3664 } | 3664 } |
| 3665 | 3665 |
| 3666 | 3666 |
| 3667 static AlignmentType StrengthenAlignment(intptr_t cid, |
| 3668 AlignmentType alignment) { |
| 3669 switch (cid) { |
| 3670 case kTypedDataInt8ArrayCid: |
| 3671 case kTypedDataUint8ArrayCid: |
| 3672 case kTypedDataUint8ClampedArrayCid: |
| 3673 case kExternalTypedDataUint8ArrayCid: |
| 3674 case kExternalTypedDataUint8ClampedArrayCid: |
| 3675 case kOneByteStringCid: |
| 3676 case kExternalOneByteStringCid: |
| 3677 // Don't need to worry about alignment for accessing bytes. |
| 3678 return kAlignedAccess; |
| 3679 case kTypedDataFloat32ArrayCid: |
| 3680 case kTypedDataFloat64ArrayCid: |
| 3681 case kTypedDataFloat64x2ArrayCid: |
| 3682 case kTypedDataInt32x4ArrayCid: |
| 3683 case kTypedDataFloat32x4ArrayCid: |
| 3684 // TODO(rmacnak): Investigate alignment requirements of floating point |
| 3685 // loads. |
| 3686 return kAlignedAccess; |
| 3687 } |
| 3688 |
| 3689 return alignment; |
| 3690 } |
| 3691 |
| 3692 |
| 3693 LoadIndexedInstr::LoadIndexedInstr(Value* array, |
| 3694 Value* index, |
| 3695 intptr_t index_scale, |
| 3696 intptr_t class_id, |
| 3697 AlignmentType alignment, |
| 3698 intptr_t deopt_id, |
| 3699 TokenPosition token_pos) |
| 3700 : TemplateDefinition(deopt_id), |
| 3701 index_scale_(index_scale), |
| 3702 class_id_(class_id), |
| 3703 alignment_(StrengthenAlignment(class_id, alignment)), |
| 3704 token_pos_(token_pos) { |
| 3705 SetInputAt(0, array); |
| 3706 SetInputAt(1, index); |
| 3707 } |
| 3708 |
| 3709 |
| 3710 |
| 3711 StoreIndexedInstr::StoreIndexedInstr(Value* array, |
| 3712 Value* index, |
| 3713 Value* value, |
| 3714 StoreBarrierType emit_store_barrier, |
| 3715 intptr_t index_scale, |
| 3716 intptr_t class_id, |
| 3717 AlignmentType alignment, |
| 3718 intptr_t deopt_id, |
| 3719 TokenPosition token_pos) |
| 3720 : TemplateDefinition(deopt_id), |
| 3721 emit_store_barrier_(emit_store_barrier), |
| 3722 index_scale_(index_scale), |
| 3723 class_id_(class_id), |
| 3724 alignment_(StrengthenAlignment(class_id, alignment)), |
| 3725 token_pos_(token_pos) { |
| 3726 SetInputAt(kArrayPos, array); |
| 3727 SetInputAt(kIndexPos, index); |
| 3728 SetInputAt(kValuePos, value); |
| 3729 } |
| 3730 |
| 3731 |
| 3667 InvokeMathCFunctionInstr::InvokeMathCFunctionInstr( | 3732 InvokeMathCFunctionInstr::InvokeMathCFunctionInstr( |
| 3668 ZoneGrowableArray<Value*>* inputs, | 3733 ZoneGrowableArray<Value*>* inputs, |
| 3669 intptr_t deopt_id, | 3734 intptr_t deopt_id, |
| 3670 MethodRecognizer::Kind recognized_kind, | 3735 MethodRecognizer::Kind recognized_kind, |
| 3671 TokenPosition token_pos) | 3736 TokenPosition token_pos) |
| 3672 : PureDefinition(deopt_id), | 3737 : PureDefinition(deopt_id), |
| 3673 inputs_(inputs), | 3738 inputs_(inputs), |
| 3674 recognized_kind_(recognized_kind), | 3739 recognized_kind_(recognized_kind), |
| 3675 token_pos_(token_pos) { | 3740 token_pos_(token_pos) { |
| 3676 ASSERT(inputs_->length() == ArgumentCountFor(recognized_kind_)); | 3741 ASSERT(inputs_->length() == ArgumentCountFor(recognized_kind_)); |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3871 set_native_c_function(native_function); | 3936 set_native_c_function(native_function); |
| 3872 function().SetIsNativeAutoSetupScope(auto_setup_scope); | 3937 function().SetIsNativeAutoSetupScope(auto_setup_scope); |
| 3873 Dart_NativeEntryResolver resolver = library.native_entry_resolver(); | 3938 Dart_NativeEntryResolver resolver = library.native_entry_resolver(); |
| 3874 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver); | 3939 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver); |
| 3875 set_is_bootstrap_native(is_bootstrap_native); | 3940 set_is_bootstrap_native(is_bootstrap_native); |
| 3876 } | 3941 } |
| 3877 | 3942 |
| 3878 #undef __ | 3943 #undef __ |
| 3879 | 3944 |
| 3880 } // namespace dart | 3945 } // namespace dart |
| OLD | NEW |