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

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

Issue 11125005: Support for type dynamic in VM (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intermediate_language.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 1189 matching lines...) Expand 10 before | Expand all | Expand 10 after
1200 1200
1201 void InstantiateTypeArgumentsInstr::EmitNativeCode( 1201 void InstantiateTypeArgumentsInstr::EmitNativeCode(
1202 FlowGraphCompiler* compiler) { 1202 FlowGraphCompiler* compiler) {
1203 Register instantiator_reg = locs()->in(0).reg(); 1203 Register instantiator_reg = locs()->in(0).reg();
1204 Register temp = locs()->temp(0).reg(); 1204 Register temp = locs()->temp(0).reg();
1205 Register result_reg = locs()->out().reg(); 1205 Register result_reg = locs()->out().reg();
1206 1206
1207 // 'instantiator_reg' is the instantiator AbstractTypeArguments object 1207 // 'instantiator_reg' is the instantiator AbstractTypeArguments object
1208 // (or null). 1208 // (or null).
1209 // If the instantiator is null and if the type argument vector 1209 // If the instantiator is null and if the type argument vector
1210 // instantiated from null becomes a vector of Dynamic, then use null as 1210 // instantiated from null becomes a vector of dynamic, then use null as
1211 // the type arguments. 1211 // the type arguments.
1212 Label type_arguments_instantiated; 1212 Label type_arguments_instantiated;
1213 const intptr_t len = type_arguments().Length(); 1213 const intptr_t len = type_arguments().Length();
1214 if (type_arguments().IsRawInstantiatedRaw(len)) { 1214 if (type_arguments().IsRawInstantiatedRaw(len)) {
1215 const Immediate raw_null = 1215 const Immediate raw_null =
1216 Immediate(reinterpret_cast<intptr_t>(Object::null())); 1216 Immediate(reinterpret_cast<intptr_t>(Object::null()));
1217 __ cmpl(instantiator_reg, raw_null); 1217 __ cmpl(instantiator_reg, raw_null);
1218 __ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump); 1218 __ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump);
1219 } 1219 }
1220 // Instantiate non-null type arguments. 1220 // Instantiate non-null type arguments.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1263 void ExtractConstructorTypeArgumentsInstr::EmitNativeCode( 1263 void ExtractConstructorTypeArgumentsInstr::EmitNativeCode(
1264 FlowGraphCompiler* compiler) { 1264 FlowGraphCompiler* compiler) {
1265 Register instantiator_reg = locs()->in(0).reg(); 1265 Register instantiator_reg = locs()->in(0).reg();
1266 Register result_reg = locs()->out().reg(); 1266 Register result_reg = locs()->out().reg();
1267 ASSERT(instantiator_reg == result_reg); 1267 ASSERT(instantiator_reg == result_reg);
1268 Register temp_reg = locs()->temp(0).reg(); 1268 Register temp_reg = locs()->temp(0).reg();
1269 1269
1270 // instantiator_reg is the instantiator type argument vector, i.e. an 1270 // instantiator_reg is the instantiator type argument vector, i.e. an
1271 // AbstractTypeArguments object (or null). 1271 // AbstractTypeArguments object (or null).
1272 // If the instantiator is null and if the type argument vector 1272 // If the instantiator is null and if the type argument vector
1273 // instantiated from null becomes a vector of Dynamic, then use null as 1273 // instantiated from null becomes a vector of dynamic, then use null as
1274 // the type arguments. 1274 // the type arguments.
1275 Label type_arguments_instantiated; 1275 Label type_arguments_instantiated;
1276 const intptr_t len = type_arguments().Length(); 1276 const intptr_t len = type_arguments().Length();
1277 if (type_arguments().IsRawInstantiatedRaw(len)) { 1277 if (type_arguments().IsRawInstantiatedRaw(len)) {
1278 const Immediate raw_null = 1278 const Immediate raw_null =
1279 Immediate(reinterpret_cast<intptr_t>(Object::null())); 1279 Immediate(reinterpret_cast<intptr_t>(Object::null()));
1280 __ cmpl(instantiator_reg, raw_null); 1280 __ cmpl(instantiator_reg, raw_null);
1281 __ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump); 1281 __ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump);
1282 } 1282 }
1283 // Instantiate non-null type arguments. 1283 // Instantiate non-null type arguments.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1319 1319
1320 1320
1321 void ExtractConstructorInstantiatorInstr::EmitNativeCode( 1321 void ExtractConstructorInstantiatorInstr::EmitNativeCode(
1322 FlowGraphCompiler* compiler) { 1322 FlowGraphCompiler* compiler) {
1323 Register instantiator_reg = locs()->in(0).reg(); 1323 Register instantiator_reg = locs()->in(0).reg();
1324 ASSERT(locs()->out().reg() == instantiator_reg); 1324 ASSERT(locs()->out().reg() == instantiator_reg);
1325 Register temp_reg = locs()->temp(0).reg(); 1325 Register temp_reg = locs()->temp(0).reg();
1326 1326
1327 // instantiator_reg is the instantiator AbstractTypeArguments object 1327 // instantiator_reg is the instantiator AbstractTypeArguments object
1328 // (or null). If the instantiator is null and if the type argument vector 1328 // (or null). If the instantiator is null and if the type argument vector
1329 // instantiated from null becomes a vector of Dynamic, then use null as 1329 // instantiated from null becomes a vector of dynamic, then use null as
1330 // the type arguments and do not pass the instantiator. 1330 // the type arguments and do not pass the instantiator.
1331 Label done; 1331 Label done;
1332 const intptr_t len = type_arguments().Length(); 1332 const intptr_t len = type_arguments().Length();
1333 if (type_arguments().IsRawInstantiatedRaw(len)) { 1333 if (type_arguments().IsRawInstantiatedRaw(len)) {
1334 const Immediate raw_null = 1334 const Immediate raw_null =
1335 Immediate(reinterpret_cast<intptr_t>(Object::null())); 1335 Immediate(reinterpret_cast<intptr_t>(Object::null()));
1336 Label instantiator_not_null; 1336 Label instantiator_not_null;
1337 __ cmpl(instantiator_reg, raw_null); 1337 __ cmpl(instantiator_reg, raw_null);
1338 __ j(NOT_EQUAL, &instantiator_not_null, Assembler::kNearJump); 1338 __ j(NOT_EQUAL, &instantiator_not_null, Assembler::kNearJump);
1339 // Null was used in VisitExtractConstructorTypeArguments as the 1339 // Null was used in VisitExtractConstructorTypeArguments as the
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after
2527 __ pcmpeqq(XMM0, XMM0); // Generate all 1's. 2527 __ pcmpeqq(XMM0, XMM0); // Generate all 1's.
2528 __ pxor(value, XMM0); 2528 __ pxor(value, XMM0);
2529 } 2529 }
2530 2530
2531 2531
2532 } // namespace dart 2532 } // namespace dart
2533 2533
2534 #undef __ 2534 #undef __
2535 2535
2536 #endif // defined TARGET_ARCH_X64 2536 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698