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

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

Issue 10942025: Convert String and List to abstract classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated to tip-of-tree. 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
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/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 type_arguments.IsRaw(type_arguments.Length()); 145 type_arguments.IsRaw(type_arguments.Length());
146 if (is_raw_type) { 146 if (is_raw_type) {
147 const Register kClassIdReg = R10; 147 const Register kClassIdReg = R10;
148 // Dynamic type argument, check only classes. 148 // Dynamic type argument, check only classes.
149 // List is a very common case. 149 // List is a very common case.
150 __ LoadClassId(kClassIdReg, kInstanceReg); 150 __ LoadClassId(kClassIdReg, kInstanceReg);
151 if (!type_class.is_interface()) { 151 if (!type_class.is_interface()) {
152 __ cmpl(kClassIdReg, Immediate(type_class.id())); 152 __ cmpl(kClassIdReg, Immediate(type_class.id()));
153 __ j(EQUAL, is_instance_lbl); 153 __ j(EQUAL, is_instance_lbl);
154 } 154 }
155 if (type.IsListInterface()) { 155 if (type.IsListType()) {
156 GenerateListTypeCheck(kClassIdReg, is_instance_lbl); 156 GenerateListTypeCheck(kClassIdReg, is_instance_lbl);
157 } 157 }
158 return GenerateSubtype1TestCacheLookup( 158 return GenerateSubtype1TestCacheLookup(
159 token_pos, type_class, is_instance_lbl, is_not_instance_lbl); 159 token_pos, type_class, is_instance_lbl, is_not_instance_lbl);
160 } 160 }
161 // If one type argument only, check if type argument is Object or Dynamic. 161 // If one type argument only, check if type argument is Object or Dynamic.
162 if (type_arguments.Length() == 1) { 162 if (type_arguments.Length() == 1) {
163 const AbstractType& tp_argument = AbstractType::ZoneHandle( 163 const AbstractType& tp_argument = AbstractType::ZoneHandle(
164 type_arguments.TypeAt(0)); 164 type_arguments.TypeAt(0));
165 ASSERT(!tp_argument.IsMalformed()); 165 ASSERT(!tp_argument.IsMalformed());
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 __ jmp(is_not_instance_lbl); 254 __ jmp(is_not_instance_lbl);
255 return false; 255 return false;
256 } 256 }
257 // Custom checking for numbers (Smi, Mint, Bigint and Double). 257 // Custom checking for numbers (Smi, Mint, Bigint and Double).
258 // Note that instance is not Smi (checked above). 258 // Note that instance is not Smi (checked above).
259 if (type.IsSubtypeOf(Type::Handle(Type::Number()), NULL)) { 259 if (type.IsSubtypeOf(Type::Handle(Type::Number()), NULL)) {
260 GenerateNumberTypeCheck( 260 GenerateNumberTypeCheck(
261 kClassIdReg, type, is_instance_lbl, is_not_instance_lbl); 261 kClassIdReg, type, is_instance_lbl, is_not_instance_lbl);
262 return false; 262 return false;
263 } 263 }
264 if (type.IsStringInterface()) { 264 if (type.IsStringType()) {
265 GenerateStringTypeCheck(kClassIdReg, is_instance_lbl, is_not_instance_lbl); 265 GenerateStringTypeCheck(kClassIdReg, is_instance_lbl, is_not_instance_lbl);
266 return false; 266 return false;
267 } 267 }
268 // Otherwise fallthrough. 268 // Otherwise fallthrough.
269 return true; 269 return true;
270 } 270 }
271 271
272 272
273 // Uses SubtypeTestCache to store instance class and result. 273 // Uses SubtypeTestCache to store instance class and result.
274 // RAX: instance to test. 274 // RAX: instance to test.
(...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after
1360 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) { 1360 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) {
1361 __ Exchange(mem1, mem2); 1361 __ Exchange(mem1, mem2);
1362 } 1362 }
1363 1363
1364 1364
1365 #undef __ 1365 #undef __
1366 1366
1367 } // namespace dart 1367 } // namespace dart
1368 1368
1369 #endif // defined TARGET_ARCH_X64 1369 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698