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

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

Issue 2799373002: Pass a second type argument vector to all type instantiation calls in the VM. (Closed)
Patch Set: addressed comments Created 3 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_arm64.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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_DBC. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_DBC.
6 #if defined(TARGET_ARCH_DBC) 6 #if defined(TARGET_ARCH_DBC)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 FOR_EACH_UNREACHABLE_INSTRUCTION(DEFINE_UNREACHABLE) 179 FOR_EACH_UNREACHABLE_INSTRUCTION(DEFINE_UNREACHABLE)
180 180
181 #undef DEFINE_UNREACHABLE 181 #undef DEFINE_UNREACHABLE
182 182
183 183
184 // Only used in AOT compilation. 184 // Only used in AOT compilation.
185 DEFINE_UNIMPLEMENTED_EMIT_BRANCH_CODE(CheckedSmiComparison) 185 DEFINE_UNIMPLEMENTED_EMIT_BRANCH_CODE(CheckedSmiComparison)
186 186
187 187
188 EMIT_NATIVE_CODE(InstanceOf, 188 EMIT_NATIVE_CODE(InstanceOf,
189 2, 189 3,
190 Location::SameAsFirstInput(), 190 Location::SameAsFirstInput(),
191 LocationSummary::kCall) { 191 LocationSummary::kCall) {
192 SubtypeTestCache& test_cache = SubtypeTestCache::Handle(); 192 SubtypeTestCache& test_cache = SubtypeTestCache::Handle();
193 if (!type().IsVoidType() && type().IsInstantiated()) { 193 if (!type().IsVoidType() && type().IsInstantiated()) {
194 test_cache = SubtypeTestCache::New(); 194 test_cache = SubtypeTestCache::New();
195 } 195 }
196 196
197 if (compiler->is_optimizing()) { 197 if (compiler->is_optimizing()) {
198 __ Push(locs()->in(0).reg()); // Value. 198 __ Push(locs()->in(0).reg()); // Value.
199 __ Push(locs()->in(1).reg()); // Instantiator type arguments. 199 __ Push(locs()->in(1).reg()); // Instantiator type arguments.
200 __ Push(locs()->in(2).reg()); // Function type arguments.
200 } 201 }
201 202
202 __ PushConstant(type()); 203 __ PushConstant(type());
203 __ PushConstant(test_cache); 204 __ PushConstant(test_cache);
204 __ InstanceOf(); 205 __ InstanceOf();
205 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id(), 206 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id(),
206 token_pos()); 207 token_pos());
207 compiler->RecordAfterCall(this, FlowGraphCompiler::kHasResult); 208 compiler->RecordAfterCall(this, FlowGraphCompiler::kHasResult);
208 if (compiler->is_optimizing()) { 209 if (compiler->is_optimizing()) {
209 __ PopLocal(locs()->out(0).reg()); 210 __ PopLocal(locs()->out(0).reg());
210 } 211 }
211 } 212 }
212 213
213 214
214 DEFINE_MAKE_LOCATION_SUMMARY(AssertAssignable, 215 DEFINE_MAKE_LOCATION_SUMMARY(AssertAssignable,
215 2, 216 3,
216 Location::SameAsFirstInput(), 217 Location::SameAsFirstInput(),
217 LocationSummary::kCall); 218 LocationSummary::kCall);
218 219
219 220
220 EMIT_NATIVE_CODE(AssertBoolean, 221 EMIT_NATIVE_CODE(AssertBoolean,
221 1, 222 1,
222 Location::SameAsFirstInput(), 223 Location::SameAsFirstInput(),
223 LocationSummary::kCall) { 224 LocationSummary::kCall) {
224 if (compiler->is_optimizing()) { 225 if (compiler->is_optimizing()) {
225 __ Push(locs()->in(0).reg()); 226 __ Push(locs()->in(0).reg());
(...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after
1265 EMIT_NATIVE_CODE(ReThrow, 0, Location::NoLocation(), LocationSummary::kCall) { 1266 EMIT_NATIVE_CODE(ReThrow, 0, Location::NoLocation(), LocationSummary::kCall) {
1266 compiler->SetNeedsStackTrace(catch_try_index()); 1267 compiler->SetNeedsStackTrace(catch_try_index());
1267 __ Throw(1); 1268 __ Throw(1);
1268 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id(), 1269 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id(),
1269 token_pos()); 1270 token_pos());
1270 compiler->RecordAfterCall(this, FlowGraphCompiler::kNoResult); 1271 compiler->RecordAfterCall(this, FlowGraphCompiler::kNoResult);
1271 __ Trap(); 1272 __ Trap();
1272 } 1273 }
1273 1274
1274 EMIT_NATIVE_CODE(InstantiateType, 1275 EMIT_NATIVE_CODE(InstantiateType,
1275 1, 1276 2,
1276 Location::RequiresRegister(), 1277 Location::RequiresRegister(),
1277 LocationSummary::kCall) { 1278 LocationSummary::kCall) {
1278 if (compiler->is_optimizing()) { 1279 if (compiler->is_optimizing()) {
1279 __ Push(locs()->in(0).reg()); 1280 __ Push(locs()->in(0).reg()); // Instantiator type arguments.
1281 __ Push(locs()->in(1).reg()); // Function type arguments.
1280 } 1282 }
1281 __ InstantiateType(__ AddConstant(type())); 1283 __ InstantiateType(__ AddConstant(type()));
1282 compiler->RecordSafepoint(locs()); 1284 compiler->RecordSafepoint(locs());
1283 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id(), 1285 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id(),
1284 token_pos()); 1286 token_pos());
1285 if (compiler->is_optimizing()) { 1287 if (compiler->is_optimizing()) {
1286 __ PopLocal(locs()->out(0).reg()); 1288 __ PopLocal(locs()->out(0).reg());
1287 } 1289 }
1288 } 1290 }
1289 1291
1290 EMIT_NATIVE_CODE(InstantiateTypeArguments, 1292 EMIT_NATIVE_CODE(InstantiateTypeArguments,
1291 1, 1293 2,
1292 Location::RequiresRegister(), 1294 Location::RequiresRegister(),
1293 LocationSummary::kCall) { 1295 LocationSummary::kCall) {
1294 if (compiler->is_optimizing()) { 1296 if (compiler->is_optimizing()) {
1295 __ Push(locs()->in(0).reg()); 1297 __ Push(locs()->in(0).reg()); // Instantiator type arguments.
1298 __ Push(locs()->in(1).reg()); // Function type arguments.
1296 } 1299 }
1297 __ InstantiateTypeArgumentsTOS( 1300 __ InstantiateTypeArgumentsTOS(
1298 type_arguments().IsRawInstantiatedRaw(type_arguments().Length()), 1301 type_arguments().IsRawWhenInstantiatedFromRaw(type_arguments().Length()),
1299 __ AddConstant(type_arguments())); 1302 __ AddConstant(type_arguments()));
1300 compiler->RecordSafepoint(locs()); 1303 compiler->RecordSafepoint(locs());
1301 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id(), 1304 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id(),
1302 token_pos()); 1305 token_pos());
1303 if (compiler->is_optimizing()) { 1306 if (compiler->is_optimizing()) {
1304 __ PopLocal(locs()->out(0).reg()); 1307 __ PopLocal(locs()->out(0).reg());
1305 } 1308 }
1306 } 1309 }
1307 1310
1308 1311
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
2095 } 2098 }
2096 __ IfULe(length, index); 2099 __ IfULe(length, index);
2097 compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckArrayBound, 2100 compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckArrayBound,
2098 (generalized_ ? ICData::kGeneralized : 0) | 2101 (generalized_ ? ICData::kGeneralized : 0) |
2099 (licm_hoisted_ ? ICData::kHoisted : 0)); 2102 (licm_hoisted_ ? ICData::kHoisted : 0));
2100 } 2103 }
2101 2104
2102 } // namespace dart 2105 } // namespace dart
2103 2106
2104 #endif // defined TARGET_ARCH_DBC 2107 #endif // defined TARGET_ARCH_DBC
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm64.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698