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

Side by Side Diff: runtime/vm/flow_graph_compiler_mips.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_ia32.cc ('k') | runtime/vm/flow_graph_compiler_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) 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_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
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 __ andi(CMPRES1, kInstanceReg, Immediate(kSmiTagMask)); 233 __ andi(CMPRES1, kInstanceReg, Immediate(kSmiTagMask));
234 if (smi_is_ok) { 234 if (smi_is_ok) {
235 __ beq(CMPRES1, ZR, is_instance_lbl); 235 __ beq(CMPRES1, ZR, is_instance_lbl);
236 } else { 236 } else {
237 __ beq(CMPRES1, ZR, is_not_instance_lbl); 237 __ beq(CMPRES1, ZR, 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 = T0; 249 const Register kClassIdReg = T0;
247 // dynamic type argument, check only classes. 250 // dynamic type argument, check only classes.
248 __ LoadClassId(kClassIdReg, kInstanceReg); 251 __ LoadClassId(kClassIdReg, kInstanceReg);
249 __ BranchEqual(kClassIdReg, type_class.id(), is_instance_lbl); 252 __ BranchEqual(kClassIdReg, type_class.id(), is_instance_lbl);
250 // List is a very common case. 253 // List is a very common case.
251 if (IsListClass(type_class)) { 254 if (IsListClass(type_class)) {
252 GenerateListTypeCheck(kClassIdReg, is_instance_lbl); 255 GenerateListTypeCheck(kClassIdReg, is_instance_lbl);
(...skipping 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after
1925 __ AddImmediate(SP, kDoubleSize); 1928 __ AddImmediate(SP, kDoubleSize);
1926 } 1929 }
1927 1930
1928 1931
1929 #undef __ 1932 #undef __
1930 1933
1931 1934
1932 } // namespace dart 1935 } // namespace dart
1933 1936
1934 #endif // defined TARGET_ARCH_MIPS 1937 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698