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

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

Issue 11420066: Fix bug 6713 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | « no previous file | runtime/vm/parser.cc » ('j') | runtime/vm/parser.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/bigint_operations.h" 10 #include "vm/bigint_operations.h"
(...skipping 2463 matching lines...) Expand 10 before | Expand all | Expand 10 after
2474 str = ident(); 2474 str = ident();
2475 name = String::Concat(name, str); 2475 name = String::Concat(name, str);
2476 return name.raw(); 2476 return name.raw();
2477 } else { 2477 } else {
2478 return ident(); 2478 return ident();
2479 } 2479 }
2480 } 2480 }
2481 2481
2482 2482
2483 const char* UnresolvedClass::ToCString() const { 2483 const char* UnresolvedClass::ToCString() const {
2484 return "UnresolvedClass"; 2484 const char* format = "unresolved class '%s'";
2485 const char* cname = String::Handle(Name()).ToCString();
2486 intptr_t len = OS::SNPrint(NULL, 0, format, cname) + 1;
2487 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
2488 OS::SNPrint(chars, len, format, cname);
2489 return chars;
2485 } 2490 }
2486 2491
2487 2492
2488 intptr_t AbstractTypeArguments::Length() const { 2493 intptr_t AbstractTypeArguments::Length() const {
2489 // AbstractTypeArguments is an abstract class. 2494 // AbstractTypeArguments is an abstract class.
2490 UNREACHABLE(); 2495 UNREACHABLE();
2491 return -1; 2496 return -1;
2492 } 2497 }
2493 2498
2494 2499
(...skipping 6513 matching lines...) Expand 10 before | Expand all | Expand 10 after
9008 (state == RawType::kFinalizedInstantiated) || 9013 (state == RawType::kFinalizedInstantiated) ||
9009 (state == RawType::kFinalizedUninstantiated)); 9014 (state == RawType::kFinalizedUninstantiated));
9010 raw_ptr()->type_state_ = state; 9015 raw_ptr()->type_state_ = state;
9011 } 9016 }
9012 9017
9013 9018
9014 const char* Type::ToCString() const { 9019 const char* Type::ToCString() const {
9015 if (IsResolved()) { 9020 if (IsResolved()) {
9016 const AbstractTypeArguments& type_arguments = 9021 const AbstractTypeArguments& type_arguments =
9017 AbstractTypeArguments::Handle(arguments()); 9022 AbstractTypeArguments::Handle(arguments());
9023 const char* class_name;
9024 if (HasResolvedTypeClass()) {
9025 class_name = String::Handle(
9026 Class::Handle(type_class()).Name()).ToCString();
9027 } else {
9028 class_name = UnresolvedClass::Handle(unresolved_class()).ToCString();
9029 }
9018 if (type_arguments.IsNull()) { 9030 if (type_arguments.IsNull()) {
9019 const char* format = "Type: class '%s'"; 9031 const char* format = "Type: class '%s'";
9020 const char* class_name =
9021 String::Handle(Class::Handle(type_class()).Name()).ToCString();
9022 intptr_t len = OS::SNPrint(NULL, 0, format, class_name) + 1; 9032 intptr_t len = OS::SNPrint(NULL, 0, format, class_name) + 1;
9023 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 9033 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
9024 OS::SNPrint(chars, len, format, class_name); 9034 OS::SNPrint(chars, len, format, class_name);
9025 return chars; 9035 return chars;
9026 } else { 9036 } else {
9027 const char* format = "Type: class '%s', args:[%s]"; 9037 const char* format = "Type: class '%s', args:[%s]";
9028 const char* class_name =
9029 String::Handle(Class::Handle(type_class()).Name()).ToCString();
9030 const char* args_cstr = 9038 const char* args_cstr =
9031 AbstractTypeArguments::Handle(arguments()).ToCString(); 9039 AbstractTypeArguments::Handle(arguments()).ToCString();
9032 intptr_t len = OS::SNPrint(NULL, 0, format, class_name, args_cstr) + 1; 9040 intptr_t len = OS::SNPrint(NULL, 0, format, class_name, args_cstr) + 1;
9033 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 9041 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
9034 OS::SNPrint(chars, len, format, class_name, args_cstr); 9042 OS::SNPrint(chars, len, format, class_name, args_cstr);
9035 return chars; 9043 return chars;
9036 } 9044 }
9037 } else { 9045 } else {
9038 return "Unresolved Type"; 9046 return "Unresolved Type";
9039 } 9047 }
(...skipping 3084 matching lines...) Expand 10 before | Expand all | Expand 10 after
12124 } 12132 }
12125 return result.raw(); 12133 return result.raw();
12126 } 12134 }
12127 12135
12128 12136
12129 const char* WeakProperty::ToCString() const { 12137 const char* WeakProperty::ToCString() const {
12130 return "_WeakProperty"; 12138 return "_WeakProperty";
12131 } 12139 }
12132 12140
12133 } // namespace dart 12141 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/parser.cc » ('j') | runtime/vm/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698