Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: runtime/vm/intermediate_language.cc

Issue 2452453002: Support unaligned integer loads on ARM and MIPS. (Closed)
Patch Set: . Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 3641 matching lines...) Expand 10 before | Expand all | Expand 10 after
3652 return this; 3652 return this;
3653 } 3653 }
3654 } 3654 }
3655 3655
3656 const String& concatenated = String::ZoneHandle(zone, 3656 const String& concatenated = String::ZoneHandle(zone,
3657 Symbols::FromConcatAll(thread, pieces)); 3657 Symbols::FromConcatAll(thread, pieces));
3658 return flow_graph->GetConstant(concatenated); 3658 return flow_graph->GetConstant(concatenated);
3659 } 3659 }
3660 3660
3661 3661
3662 LoadIndexedInstr::LoadIndexedInstr(Value* array,
3663 Value* index,
3664 intptr_t index_scale,
3665 intptr_t class_id,
3666 bool aligned,
3667 intptr_t deopt_id,
3668 TokenPosition token_pos)
3669 : TemplateDefinition(deopt_id),
3670 index_scale_(index_scale),
3671 class_id_(class_id),
3672 aligned_(aligned),
3673 token_pos_(token_pos) {
3674 SetInputAt(0, array);
3675 SetInputAt(1, index);
3676
3677 switch (class_id) {
3678 case kTypedDataInt8ArrayCid:
3679 case kTypedDataUint8ArrayCid:
3680 case kTypedDataUint8ClampedArrayCid:
3681 case kExternalTypedDataUint8ArrayCid:
3682 case kExternalTypedDataUint8ClampedArrayCid:
3683 case kOneByteStringCid:
3684 case kExternalOneByteStringCid:
3685 // Don't need to worry about alignment for accessing bytes.
3686 aligned_ = true;
3687 break;
3688 case kTypedDataFloat32ArrayCid:
3689 case kTypedDataFloat64ArrayCid:
3690 case kTypedDataFloat64x2ArrayCid:
3691 case kTypedDataInt32x4ArrayCid:
3692 case kTypedDataFloat32x4ArrayCid:
3693 // TODO(rmacnak): Investigate alignment requirements of floating point
3694 // loads.
3695 aligned_ = true;
3696 break;
zra 2016/10/26 06:59:41 I'd sort of prefer leaving aligned_ out of the ini
Cutch 2016/10/26 09:00:29 I'd like to see the switch statement factored into
rmacnak 2016/10/31 22:57:26 Switched to enum and separate narrowing function.
3697 }
3698 }
3699
3700
3701
3702 StoreIndexedInstr::StoreIndexedInstr(Value* array,
3703 Value* index,
3704 Value* value,
3705 StoreBarrierType emit_store_barrier,
3706 intptr_t index_scale,
3707 intptr_t class_id,
3708 bool aligned,
3709 intptr_t deopt_id,
3710 TokenPosition token_pos)
3711 : TemplateDefinition(deopt_id),
3712 emit_store_barrier_(emit_store_barrier),
3713 index_scale_(index_scale),
3714 class_id_(class_id),
3715 aligned_(aligned),
3716 token_pos_(token_pos) {
3717 SetInputAt(kArrayPos, array);
3718 SetInputAt(kIndexPos, index);
3719 SetInputAt(kValuePos, value);
3720
3721 switch (class_id) {
3722 case kTypedDataInt8ArrayCid:
3723 case kTypedDataUint8ArrayCid:
3724 case kTypedDataUint8ClampedArrayCid:
3725 case kExternalTypedDataUint8ArrayCid:
3726 case kExternalTypedDataUint8ClampedArrayCid:
3727 case kOneByteStringCid:
3728 case kExternalOneByteStringCid:
3729 // Don't need to worry about alignment for accessing bytes.
3730 aligned_ = true;
3731 break;
3732 case kTypedDataFloat32ArrayCid:
3733 case kTypedDataFloat64ArrayCid:
3734 case kTypedDataFloat64x2ArrayCid:
3735 case kTypedDataInt32x4ArrayCid:
3736 case kTypedDataFloat32x4ArrayCid:
3737 // TODO(rmacnak): Investigate alignment requirements of floating point
3738 // loads.
3739 aligned_ = true;
3740 break;
zra 2016/10/26 06:59:41 ditto
3741 }
3742 }
3743
3744
3662 InvokeMathCFunctionInstr::InvokeMathCFunctionInstr( 3745 InvokeMathCFunctionInstr::InvokeMathCFunctionInstr(
3663 ZoneGrowableArray<Value*>* inputs, 3746 ZoneGrowableArray<Value*>* inputs,
3664 intptr_t deopt_id, 3747 intptr_t deopt_id,
3665 MethodRecognizer::Kind recognized_kind, 3748 MethodRecognizer::Kind recognized_kind,
3666 TokenPosition token_pos) 3749 TokenPosition token_pos)
3667 : PureDefinition(deopt_id), 3750 : PureDefinition(deopt_id),
3668 inputs_(inputs), 3751 inputs_(inputs),
3669 recognized_kind_(recognized_kind), 3752 recognized_kind_(recognized_kind),
3670 token_pos_(token_pos) { 3753 token_pos_(token_pos) {
3671 ASSERT(inputs_->length() == ArgumentCountFor(recognized_kind_)); 3754 ASSERT(inputs_->length() == ArgumentCountFor(recognized_kind_));
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
3866 set_native_c_function(native_function); 3949 set_native_c_function(native_function);
3867 function().SetIsNativeAutoSetupScope(auto_setup_scope); 3950 function().SetIsNativeAutoSetupScope(auto_setup_scope);
3868 Dart_NativeEntryResolver resolver = library.native_entry_resolver(); 3951 Dart_NativeEntryResolver resolver = library.native_entry_resolver();
3869 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver); 3952 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver);
3870 set_is_bootstrap_native(is_bootstrap_native); 3953 set_is_bootstrap_native(is_bootstrap_native);
3871 } 3954 }
3872 3955
3873 #undef __ 3956 #undef __
3874 3957
3875 } // namespace dart 3958 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698