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

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

Issue 81363002: Improve type test and type equality for generics (issue 15148). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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/flow_graph_compiler_mips.cc ('k') | runtime/vm/flow_graph_optimizer.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_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 "vm/ast_printer.h" 10 #include "vm/ast_printer.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 const Type& int_type = Type::Handle(Type::IntType()); 229 const Type& int_type = Type::Handle(Type::IntType());
230 const bool smi_is_ok = int_type.IsSubtypeOf(type, &malformed_error); 230 const bool smi_is_ok = int_type.IsSubtypeOf(type, &malformed_error);
231 // Malformed type should have been handled at graph construction time. 231 // Malformed type should have been handled at graph construction time.
232 ASSERT(smi_is_ok || malformed_error.IsNull()); 232 ASSERT(smi_is_ok || malformed_error.IsNull());
233 __ testq(kInstanceReg, Immediate(kSmiTagMask)); 233 __ testq(kInstanceReg, Immediate(kSmiTagMask));
234 if (smi_is_ok) { 234 if (smi_is_ok) {
235 __ j(ZERO, is_instance_lbl); 235 __ j(ZERO, is_instance_lbl);
236 } else { 236 } else {
237 __ j(ZERO, is_not_instance_lbl); 237 __ j(ZERO, is_not_instance_lbl);
238 } 238 }
239 const intptr_t num_type_args = type_class.NumTypeArguments();
240 const intptr_t num_type_params = type_class.NumTypeParameters();
241 const intptr_t from_index = num_type_args - num_type_params;
239 const AbstractTypeArguments& type_arguments = 242 const AbstractTypeArguments& type_arguments =
240 AbstractTypeArguments::ZoneHandle(type.arguments()); 243 AbstractTypeArguments::ZoneHandle(type.arguments());
241 const bool is_raw_type = type_arguments.IsNull() || 244 const bool is_raw_type = type_arguments.IsNull() ||
242 type_arguments.IsRaw(type_arguments.Length()); 245 type_arguments.IsRaw(from_index, num_type_params);
243 // Signature class is an instantiated parameterized type. 246 // Signature class is an instantiated parameterized type.
244 if (!type_class.IsSignatureClass()) { 247 if (!type_class.IsSignatureClass()) {
245 if (is_raw_type) { 248 if (is_raw_type) {
246 const Register kClassIdReg = R10; 249 const Register kClassIdReg = R10;
247 // dynamic type argument, check only classes. 250 // dynamic type argument, check only classes.
248 __ LoadClassId(kClassIdReg, kInstanceReg); 251 __ LoadClassId(kClassIdReg, kInstanceReg);
249 __ cmpl(kClassIdReg, Immediate(type_class.id())); 252 __ cmpl(kClassIdReg, Immediate(type_class.id()));
250 __ j(EQUAL, is_instance_lbl); 253 __ j(EQUAL, is_instance_lbl);
251 // List is a very common case. 254 // List is a very common case.
252 if (IsListClass(type_class)) { 255 if (IsListClass(type_class)) {
(...skipping 1642 matching lines...) Expand 10 before | Expand all | Expand 10 after
1895 __ movups(reg, Address(RSP, 0)); 1898 __ movups(reg, Address(RSP, 0));
1896 __ AddImmediate(RSP, Immediate(kFpuRegisterSize), PP); 1899 __ AddImmediate(RSP, Immediate(kFpuRegisterSize), PP);
1897 } 1900 }
1898 1901
1899 1902
1900 #undef __ 1903 #undef __
1901 1904
1902 } // namespace dart 1905 } // namespace dart
1903 1906
1904 #endif // defined TARGET_ARCH_X64 1907 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_mips.cc ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698