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

Side by Side Diff: runtime/vm/intermediate_language_arm.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.h ('k') | runtime/vm/intermediate_language_arm64.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) 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/globals.h" // Needed here to get TARGET_ARCH_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
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 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after
1068 return LocationSummary::Make(zone, 1068 return LocationSummary::Make(zone,
1069 kNumInputs, 1069 kNumInputs,
1070 Location::RequiresRegister(), 1070 Location::RequiresRegister(),
1071 LocationSummary::kNoCall); 1071 LocationSummary::kNoCall);
1072 } 1072 }
1073 1073
1074 1074
1075 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1075 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1076 const Register object = locs()->in(0).reg(); 1076 const Register object = locs()->in(0).reg();
1077 const Register result = locs()->out(0).reg(); 1077 const Register result = locs()->out(0).reg();
1078 __ LoadTaggedClassIdMayBeSmi(result, object); 1078 const AbstractType& value_type = *this->object()->Type()->ToAbstractType();
1079 if (CompileType::Smi().IsAssignableTo(value_type) ||
1080 value_type.IsTypeParameter()) {
1081 __ LoadTaggedClassIdMayBeSmi(result, object);
1082 } else {
1083 __ LoadClassId(result, object);
1084 __ SmiTag(result);
1085 }
1079 } 1086 }
1080 1087
1081 1088
1082 CompileType LoadIndexedInstr::ComputeType() const { 1089 CompileType LoadIndexedInstr::ComputeType() const {
1083 switch (class_id_) { 1090 switch (class_id_) {
1084 case kArrayCid: 1091 case kArrayCid:
1085 case kImmutableArrayCid: 1092 case kImmutableArrayCid:
1086 return CompileType::Dynamic(); 1093 return CompileType::Dynamic();
1087 1094
1088 case kTypedDataFloat32ArrayCid: 1095 case kTypedDataFloat32ArrayCid:
(...skipping 5848 matching lines...) Expand 10 before | Expand all | Expand 10 after
6937 1, 6944 1,
6938 locs()); 6945 locs());
6939 __ Drop(1); 6946 __ Drop(1);
6940 __ Pop(result); 6947 __ Pop(result);
6941 } 6948 }
6942 6949
6943 6950
6944 } // namespace dart 6951 } // namespace dart
6945 6952
6946 #endif // defined TARGET_ARCH_ARM 6953 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698