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

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

Issue 154393003: Implement eager instantiation and canonicalization of type arguments at run (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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 "include/dart_debugger_api.h" 5 #include "include/dart_debugger_api.h"
6 6
7 #include "vm/class_finalizer.h" 7 #include "vm/class_finalizer.h"
8 #include "vm/compiler.h" 8 #include "vm/compiler.h"
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/dart_api_state.h" 10 #include "vm/dart_api_state.h"
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 const AbstractType& type = AbstractType::Handle(cls.super_type()); 601 const AbstractType& type = AbstractType::Handle(cls.super_type());
602 if (type.IsNull()) { 602 if (type.IsNull()) {
603 return Dart_Null(); 603 return Dart_Null();
604 } 604 }
605 return Api::NewHandle(isolate, type.Canonicalize()); 605 return Api::NewHandle(isolate, type.Canonicalize());
606 } 606 }
607 // Set up the type arguments array for the super class type. 607 // Set up the type arguments array for the super class type.
608 const Class& super_cls = Class::Handle(cls.SuperClass()); 608 const Class& super_cls = Class::Handle(cls.SuperClass());
609 intptr_t num_expected_type_arguments = super_cls.NumTypeArguments(); 609 intptr_t num_expected_type_arguments = super_cls.NumTypeArguments();
610 TypeArguments& super_type_args_array = TypeArguments::Handle(); 610 TypeArguments& super_type_args_array = TypeArguments::Handle();
611 const AbstractTypeArguments& type_args_array = 611 const TypeArguments& type_args_array =
612 AbstractTypeArguments::Handle(type.arguments()); 612 TypeArguments::Handle(type.arguments());
613 if (!type_args_array.IsNull() && (num_expected_type_arguments > 0)) { 613 if (!type_args_array.IsNull() && (num_expected_type_arguments > 0)) {
614 super_type_args_array = TypeArguments::New(num_expected_type_arguments); 614 super_type_args_array = TypeArguments::New(num_expected_type_arguments);
615 AbstractType& type_arg = AbstractType::Handle(); 615 AbstractType& type_arg = AbstractType::Handle();
616 for (intptr_t i = 0; i < num_expected_type_arguments; i++) { 616 for (intptr_t i = 0; i < num_expected_type_arguments; i++) {
617 type_arg ^= type_args_array.TypeAt(i); 617 type_arg ^= type_args_array.TypeAt(i);
618 super_type_args_array.SetTypeAt(i, type_arg); 618 super_type_args_array.SetTypeAt(i, type_arg);
619 } 619 }
620 } 620 }
621 621
622 // Construct the super type object, canonicalize it and return. 622 // Construct the super type object, canonicalize it and return.
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 return Api::CastIsolate(isolate); 972 return Api::CastIsolate(isolate);
973 } 973 }
974 974
975 975
976 DART_EXPORT Dart_IsolateId Dart_GetIsolateId(Dart_Isolate dart_isolate) { 976 DART_EXPORT Dart_IsolateId Dart_GetIsolateId(Dart_Isolate dart_isolate) {
977 Isolate* isolate = reinterpret_cast<Isolate*>(dart_isolate); 977 Isolate* isolate = reinterpret_cast<Isolate*>(dart_isolate);
978 return isolate->debugger()->GetIsolateId(); 978 return isolate->debugger()->GetIsolateId();
979 } 979 }
980 980
981 } // namespace dart 981 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698