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

Side by Side Diff: runtime/vm/flow_graph_compiler_ia32.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, 1 month 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_arm.cc ('k') | runtime/vm/flow_graph_compiler_mips.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_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/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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 const Type& int_type = Type::Handle(Type::IntType()); 236 const Type& int_type = Type::Handle(Type::IntType());
237 const bool smi_is_ok = int_type.IsSubtypeOf(type, &malformed_error); 237 const bool smi_is_ok = int_type.IsSubtypeOf(type, &malformed_error);
238 // Malformed type should have been handled at graph construction time. 238 // Malformed type should have been handled at graph construction time.
239 ASSERT(smi_is_ok || malformed_error.IsNull()); 239 ASSERT(smi_is_ok || malformed_error.IsNull());
240 __ testl(kInstanceReg, Immediate(kSmiTagMask)); 240 __ testl(kInstanceReg, Immediate(kSmiTagMask));
241 if (smi_is_ok) { 241 if (smi_is_ok) {
242 __ j(ZERO, is_instance_lbl); 242 __ j(ZERO, is_instance_lbl);
243 } else { 243 } else {
244 __ j(ZERO, is_not_instance_lbl); 244 __ j(ZERO, is_not_instance_lbl);
245 } 245 }
246 const intptr_t num_type_args = type_class.NumTypeArguments();
247 const intptr_t num_type_params = type_class.NumTypeParameters();
248 const intptr_t from_index = num_type_args - num_type_params;
246 const AbstractTypeArguments& type_arguments = 249 const AbstractTypeArguments& type_arguments =
247 AbstractTypeArguments::ZoneHandle(type.arguments()); 250 AbstractTypeArguments::ZoneHandle(type.arguments());
248 const bool is_raw_type = type_arguments.IsNull() || 251 const bool is_raw_type = type_arguments.IsNull() ||
249 type_arguments.IsRaw(type_arguments.Length()); 252 type_arguments.IsRaw(from_index, num_type_params);
250 // Signature class is an instantiated parameterized type. 253 // Signature class is an instantiated parameterized type.
251 if (!type_class.IsSignatureClass()) { 254 if (!type_class.IsSignatureClass()) {
252 if (is_raw_type) { 255 if (is_raw_type) {
253 const Register kClassIdReg = ECX; 256 const Register kClassIdReg = ECX;
254 // dynamic type argument, check only classes. 257 // dynamic type argument, check only classes.
255 __ LoadClassId(kClassIdReg, kInstanceReg); 258 __ LoadClassId(kClassIdReg, kInstanceReg);
256 __ cmpl(kClassIdReg, Immediate(type_class.id())); 259 __ cmpl(kClassIdReg, Immediate(type_class.id()));
257 __ j(EQUAL, is_instance_lbl); 260 __ j(EQUAL, is_instance_lbl);
258 // List is a very common case. 261 // List is a very common case.
259 if (IsListClass(type_class)) { 262 if (IsListClass(type_class)) {
(...skipping 1615 matching lines...) Expand 10 before | Expand all | Expand 10 after
1875 __ movups(reg, Address(ESP, 0)); 1878 __ movups(reg, Address(ESP, 0));
1876 __ addl(ESP, Immediate(kFpuRegisterSize)); 1879 __ addl(ESP, Immediate(kFpuRegisterSize));
1877 } 1880 }
1878 1881
1879 1882
1880 #undef __ 1883 #undef __
1881 1884
1882 } // namespace dart 1885 } // namespace dart
1883 1886
1884 #endif // defined TARGET_ARCH_IA32 1887 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm.cc ('k') | runtime/vm/flow_graph_compiler_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698