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

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

Issue 1897983002: VM: Avoid smi-check when loading class-ids from known non-smi values (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comments Created 4 years, 8 months 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
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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/globals.h" // Needed here to get TARGET_ARCH_ARM64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
6 #if defined(TARGET_ARCH_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 return LocationSummary::Make(zone, 925 return LocationSummary::Make(zone,
926 kNumInputs, 926 kNumInputs,
927 Location::RequiresRegister(), 927 Location::RequiresRegister(),
928 LocationSummary::kNoCall); 928 LocationSummary::kNoCall);
929 } 929 }
930 930
931 931
932 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 932 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
933 const Register object = locs()->in(0).reg(); 933 const Register object = locs()->in(0).reg();
934 const Register result = locs()->out(0).reg(); 934 const Register result = locs()->out(0).reg();
935 935 const AbstractType& value_type = *this->object()->Type()->ToAbstractType();
936 __ LoadTaggedClassIdMayBeSmi(result, object); 936 if (CompileType::Smi().IsAssignableTo(value_type) ||
937 value_type.IsTypeParameter()) {
938 __ LoadTaggedClassIdMayBeSmi(result, object);
939 } else {
940 __ LoadClassId(result, object);
941 __ SmiTag(result);
942 }
937 } 943 }
938 944
939 945
940 CompileType LoadIndexedInstr::ComputeType() const { 946 CompileType LoadIndexedInstr::ComputeType() const {
941 switch (class_id_) { 947 switch (class_id_) {
942 case kArrayCid: 948 case kArrayCid:
943 case kImmutableArrayCid: 949 case kImmutableArrayCid:
944 return CompileType::Dynamic(); 950 return CompileType::Dynamic();
945 951
946 case kTypedDataFloat32ArrayCid: 952 case kTypedDataFloat32ArrayCid:
(...skipping 4752 matching lines...) Expand 10 before | Expand all | Expand 10 after
5699 1, 5705 1,
5700 locs()); 5706 locs());
5701 __ Drop(1); 5707 __ Drop(1);
5702 __ Pop(result); 5708 __ Pop(result);
5703 } 5709 }
5704 5710
5705 5711
5706 } // namespace dart 5712 } // namespace dart
5707 5713
5708 #endif // defined TARGET_ARCH_ARM64 5714 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698