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

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

Issue 8403003: Rename the VM internal 'var' type to 'Dynamic' type. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 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/ast_test.cc ('k') | runtime/vm/code_generator_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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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/class_finalizer.h" 5 #include "vm/class_finalizer.h"
6 6
7 #include "vm/flags.h" 7 #include "vm/flags.h"
8 #include "vm/heap.h" 8 #include "vm/heap.h"
9 #include "vm/isolate.h" 9 #include "vm/isolate.h"
10 #include "vm/longjump.h" 10 #include "vm/longjump.h"
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 const intptr_t num_type_params = cls.NumTypeParameters(); 389 const intptr_t num_type_params = cls.NumTypeParameters();
390 const intptr_t offset = cls.NumTypeArguments() - num_type_params; 390 const intptr_t offset = cls.NumTypeArguments() - num_type_params;
391 Type& type = Type::Handle(); 391 Type& type = Type::Handle();
392 Type& type_extends = Type::Handle(); 392 Type& type_extends = Type::Handle();
393 const TypeArguments& extends_array = 393 const TypeArguments& extends_array =
394 TypeArguments::Handle(cls.type_parameter_extends()); 394 TypeArguments::Handle(cls.type_parameter_extends());
395 ASSERT((extends_array.IsNull() && (num_type_params == 0)) || 395 ASSERT((extends_array.IsNull() && (num_type_params == 0)) ||
396 (extends_array.Length() == num_type_params)); 396 (extends_array.Length() == num_type_params));
397 for (intptr_t i = 0; i < num_type_params; i++) { 397 for (intptr_t i = 0; i < num_type_params; i++) {
398 type_extends = extends_array.TypeAt(i); 398 type_extends = extends_array.TypeAt(i);
399 if (!type_extends.IsVarType()) { 399 if (!type_extends.IsDynamicType()) {
400 type = arguments.TypeAt(offset + i); 400 type = arguments.TypeAt(offset + i);
401 if (type.IsInstantiated()) { 401 if (type.IsInstantiated()) {
402 if (!type_extends.IsInstantiated()) { 402 if (!type_extends.IsInstantiated()) {
403 type_extends = type_extends.InstantiateFrom(arguments, offset); 403 type_extends = type_extends.InstantiateFrom(arguments, offset);
404 } 404 }
405 // TODO(regis): Where do we check the constraints when the type is 405 // TODO(regis): Where do we check the constraints when the type is
406 // generic? 406 // generic?
407 if (!type.IsSubtypeOf(type_extends)) { 407 if (!type.IsSubtypeOf(type_extends)) {
408 const String& type_name = String::Handle(type.Name()); 408 const String& type_name = String::Handle(type.Name());
409 const String& extends_name = String::Handle(type_extends.Name()); 409 const String& extends_name = String::Handle(type_extends.Name());
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 } 489 }
490 // The full type argument vector consists of the type arguments of the 490 // The full type argument vector consists of the type arguments of the
491 // super types of type_class, which may be initialized from the parsed 491 // super types of type_class, which may be initialized from the parsed
492 // type arguments, followed by the parsed type arguments. 492 // type arguments, followed by the parsed type arguments.
493 if (num_type_arguments > 0) { 493 if (num_type_arguments > 0) {
494 const TypeArguments& full_arguments = TypeArguments::Handle( 494 const TypeArguments& full_arguments = TypeArguments::Handle(
495 TypeArguments::NewTypeArray(num_type_arguments)); 495 TypeArguments::NewTypeArray(num_type_arguments));
496 // Copy the parsed type arguments at the correct offset in the full type 496 // Copy the parsed type arguments at the correct offset in the full type
497 // argument vector. 497 // argument vector.
498 const intptr_t offset = num_type_arguments - num_type_parameters; 498 const intptr_t offset = num_type_arguments - num_type_parameters;
499 Type& type = Type::Handle(Type::VarType()); 499 Type& type = Type::Handle(Type::DynamicType());
500 for (intptr_t i = 0; i < num_type_parameters; i++) { 500 for (intptr_t i = 0; i < num_type_parameters; i++) {
501 // If no type parameters were provided, a raw type is desired, so we 501 // If no type parameters were provided, a raw type is desired, so we
502 // create a vector of VarType. 502 // create a vector of DynamicType.
503 if (!arguments.IsNull()) { 503 if (!arguments.IsNull()) {
504 type = arguments.TypeAt(i); 504 type = arguments.TypeAt(i);
505 } 505 }
506 full_arguments.SetTypeAt(offset + i, type); 506 full_arguments.SetTypeAt(offset + i, type);
507 } 507 }
508 FinalizeTypeArguments(type_class, full_arguments); 508 FinalizeTypeArguments(type_class, full_arguments);
509 parameterized_type.set_arguments(full_arguments); 509 parameterized_type.set_arguments(full_arguments);
510 } 510 }
511 511
512 // If the type is a function type, finalize the result and parameter types. 512 // If the type is a function type, finalize the result and parameter types.
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 ASSERT(msg_buffer != NULL); 1012 ASSERT(msg_buffer != NULL);
1013 va_list args; 1013 va_list args;
1014 va_start(args, format); 1014 va_start(args, format);
1015 OS::VSNPrint(msg_buffer, kBufferLength, format, args); 1015 OS::VSNPrint(msg_buffer, kBufferLength, format, args);
1016 va_end(args); 1016 va_end(args);
1017 isolate->long_jump_base()->Jump(1, msg_buffer); 1017 isolate->long_jump_base()->Jump(1, msg_buffer);
1018 UNREACHABLE(); 1018 UNREACHABLE();
1019 } 1019 }
1020 1020
1021 } // namespace dart 1021 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/ast_test.cc ('k') | runtime/vm/code_generator_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698