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

Side by Side Diff: runtime/vm/intermediate_language_x64.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_ia32.cc ('k') | runtime/vm/intrinsifier_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) 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_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
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 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1154 1154
1155 1155
1156 void InstantiateTypeArgumentsInstr::EmitNativeCode( 1156 void InstantiateTypeArgumentsInstr::EmitNativeCode(
1157 FlowGraphCompiler* compiler) { 1157 FlowGraphCompiler* compiler) {
1158 Register instantiator_reg = locs()->in(0).reg(); 1158 Register instantiator_reg = locs()->in(0).reg();
1159 Register result_reg = locs()->out().reg(); 1159 Register result_reg = locs()->out().reg();
1160 1160
1161 // 'instantiator_reg' is the instantiator AbstractTypeArguments object 1161 // 'instantiator_reg' is the instantiator AbstractTypeArguments object
1162 // (or null). 1162 // (or null).
1163 // If the instantiator is null and if the type argument vector 1163 // If the instantiator is null and if the type argument vector
1164 // instantiated from null becomes a vector of Dynamic, then use null as 1164 // instantiated from null becomes a vector of dynamic, then use null as
1165 // the type arguments. 1165 // the type arguments.
1166 Label type_arguments_instantiated; 1166 Label type_arguments_instantiated;
1167 const intptr_t len = type_arguments().Length(); 1167 const intptr_t len = type_arguments().Length();
1168 if (type_arguments().IsRawInstantiatedRaw(len)) { 1168 if (type_arguments().IsRawInstantiatedRaw(len)) {
1169 const Immediate raw_null = 1169 const Immediate raw_null =
1170 Immediate(reinterpret_cast<intptr_t>(Object::null())); 1170 Immediate(reinterpret_cast<intptr_t>(Object::null()));
1171 __ cmpq(instantiator_reg, raw_null); 1171 __ cmpq(instantiator_reg, raw_null);
1172 __ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump); 1172 __ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump);
1173 } 1173 }
1174 // Instantiate non-null type arguments. 1174 // Instantiate non-null type arguments.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
1215 1215
1216 void ExtractConstructorTypeArgumentsInstr::EmitNativeCode( 1216 void ExtractConstructorTypeArgumentsInstr::EmitNativeCode(
1217 FlowGraphCompiler* compiler) { 1217 FlowGraphCompiler* compiler) {
1218 Register instantiator_reg = locs()->in(0).reg(); 1218 Register instantiator_reg = locs()->in(0).reg();
1219 Register result_reg = locs()->out().reg(); 1219 Register result_reg = locs()->out().reg();
1220 ASSERT(instantiator_reg == result_reg); 1220 ASSERT(instantiator_reg == result_reg);
1221 1221
1222 // instantiator_reg is the instantiator type argument vector, i.e. an 1222 // instantiator_reg is the instantiator type argument vector, i.e. an
1223 // AbstractTypeArguments object (or null). 1223 // AbstractTypeArguments object (or null).
1224 // If the instantiator is null and if the type argument vector 1224 // If the instantiator is null and if the type argument vector
1225 // instantiated from null becomes a vector of Dynamic, then use null as 1225 // instantiated from null becomes a vector of dynamic, then use null as
1226 // the type arguments. 1226 // the type arguments.
1227 Label type_arguments_instantiated; 1227 Label type_arguments_instantiated;
1228 const intptr_t len = type_arguments().Length(); 1228 const intptr_t len = type_arguments().Length();
1229 if (type_arguments().IsRawInstantiatedRaw(len)) { 1229 if (type_arguments().IsRawInstantiatedRaw(len)) {
1230 const Immediate raw_null = 1230 const Immediate raw_null =
1231 Immediate(reinterpret_cast<intptr_t>(Object::null())); 1231 Immediate(reinterpret_cast<intptr_t>(Object::null()));
1232 __ cmpq(instantiator_reg, raw_null); 1232 __ cmpq(instantiator_reg, raw_null);
1233 __ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump); 1233 __ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump);
1234 } 1234 }
1235 // Instantiate non-null type arguments. 1235 // Instantiate non-null type arguments.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1269 } 1269 }
1270 1270
1271 1271
1272 void ExtractConstructorInstantiatorInstr::EmitNativeCode( 1272 void ExtractConstructorInstantiatorInstr::EmitNativeCode(
1273 FlowGraphCompiler* compiler) { 1273 FlowGraphCompiler* compiler) {
1274 Register instantiator_reg = locs()->in(0).reg(); 1274 Register instantiator_reg = locs()->in(0).reg();
1275 ASSERT(locs()->out().reg() == instantiator_reg); 1275 ASSERT(locs()->out().reg() == instantiator_reg);
1276 1276
1277 // instantiator_reg is the instantiator AbstractTypeArguments object 1277 // instantiator_reg is the instantiator AbstractTypeArguments object
1278 // (or null). If the instantiator is null and if the type argument vector 1278 // (or null). If the instantiator is null and if the type argument vector
1279 // instantiated from null becomes a vector of Dynamic, then use null as 1279 // instantiated from null becomes a vector of dynamic, then use null as
1280 // the type arguments and do not pass the instantiator. 1280 // the type arguments and do not pass the instantiator.
1281 Label done; 1281 Label done;
1282 const intptr_t len = type_arguments().Length(); 1282 const intptr_t len = type_arguments().Length();
1283 if (type_arguments().IsRawInstantiatedRaw(len)) { 1283 if (type_arguments().IsRawInstantiatedRaw(len)) {
1284 const Immediate raw_null = 1284 const Immediate raw_null =
1285 Immediate(reinterpret_cast<intptr_t>(Object::null())); 1285 Immediate(reinterpret_cast<intptr_t>(Object::null()));
1286 Label instantiator_not_null; 1286 Label instantiator_not_null;
1287 __ cmpq(instantiator_reg, raw_null); 1287 __ cmpq(instantiator_reg, raw_null);
1288 __ j(NOT_EQUAL, &instantiator_not_null, Assembler::kNearJump); 1288 __ j(NOT_EQUAL, &instantiator_not_null, Assembler::kNearJump);
1289 // Null was used in VisitExtractConstructorTypeArguments as the 1289 // Null was used in VisitExtractConstructorTypeArguments as the
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
2254 2254
2255 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2255 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2256 UNIMPLEMENTED(); 2256 UNIMPLEMENTED();
2257 } 2257 }
2258 2258
2259 } // namespace dart 2259 } // namespace dart
2260 2260
2261 #undef __ 2261 #undef __
2262 2262
2263 #endif // defined TARGET_ARCH_X64 2263 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intrinsifier_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698