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

Side by Side Diff: runtime/vm/intermediate_language_mips.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_ia32.cc ('k') | runtime/vm/intermediate_language_x64.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_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
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 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 return LocationSummary::Make(zone, 1128 return LocationSummary::Make(zone,
1129 kNumInputs, 1129 kNumInputs,
1130 Location::RequiresRegister(), 1130 Location::RequiresRegister(),
1131 LocationSummary::kNoCall); 1131 LocationSummary::kNoCall);
1132 } 1132 }
1133 1133
1134 1134
1135 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1135 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1136 Register object = locs()->in(0).reg(); 1136 Register object = locs()->in(0).reg();
1137 Register result = locs()->out(0).reg(); 1137 Register result = locs()->out(0).reg();
1138 __ LoadTaggedClassIdMayBeSmi(result, object); 1138 const AbstractType& value_type = *this->object()->Type()->ToAbstractType();
1139 if (CompileType::Smi().IsAssignableTo(value_type) ||
1140 value_type.IsTypeParameter()) {
1141 __ LoadTaggedClassIdMayBeSmi(result, object);
1142 } else {
1143 __ LoadClassId(result, object);
1144 __ SmiTag(result);
1145 }
1139 } 1146 }
1140 1147
1141 1148
1142 CompileType LoadIndexedInstr::ComputeType() const { 1149 CompileType LoadIndexedInstr::ComputeType() const {
1143 switch (class_id_) { 1150 switch (class_id_) {
1144 case kArrayCid: 1151 case kArrayCid:
1145 case kImmutableArrayCid: 1152 case kImmutableArrayCid:
1146 return CompileType::Dynamic(); 1153 return CompileType::Dynamic();
1147 1154
1148 case kTypedDataFloat32ArrayCid: 1155 case kTypedDataFloat32ArrayCid:
(...skipping 4563 matching lines...) Expand 10 before | Expand all | Expand 10 after
5712 1, 5719 1,
5713 locs()); 5720 locs());
5714 __ lw(result, Address(SP, 1 * kWordSize)); 5721 __ lw(result, Address(SP, 1 * kWordSize));
5715 __ addiu(SP, SP, Immediate(2 * kWordSize)); 5722 __ addiu(SP, SP, Immediate(2 * kWordSize));
5716 } 5723 }
5717 5724
5718 5725
5719 } // namespace dart 5726 } // namespace dart
5720 5727
5721 #endif // defined TARGET_ARCH_MIPS 5728 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698