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

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') | 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) 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 6512 matching lines...) Expand 10 before | Expand all | Expand 10 after
9007 (state == RawType::kFinalizedInstantiated) || 9012 (state == RawType::kFinalizedInstantiated) ||
9008 (state == RawType::kFinalizedUninstantiated)); 9013 (state == RawType::kFinalizedUninstantiated));
9009 raw_ptr()->type_state_ = state; 9014 raw_ptr()->type_state_ = state;
9010 } 9015 }
9011 9016
9012 9017
9013 const char* Type::ToCString() const { 9018 const char* Type::ToCString() const {
9014 if (IsResolved()) { 9019 if (IsResolved()) {
9015 const AbstractTypeArguments& type_arguments = 9020 const AbstractTypeArguments& type_arguments =
9016 AbstractTypeArguments::Handle(arguments()); 9021 AbstractTypeArguments::Handle(arguments());
9022 const char* class_name;
9023 if (HasResolvedTypeClass()) {
9024 class_name = String::Handle(
9025 Class::Handle(type_class()).Name()).ToCString();
9026 } else {
9027 class_name = UnresolvedClass::Handle(unresolved_class()).ToCString();
9028 }
9017 if (type_arguments.IsNull()) { 9029 if (type_arguments.IsNull()) {
9018 const char* format = "Type: class '%s'"; 9030 const char* format = "Type: class '%s'";
9019 const char* class_name =
9020 String::Handle(Class::Handle(type_class()).Name()).ToCString();
9021 intptr_t len = OS::SNPrint(NULL, 0, format, class_name) + 1; 9031 intptr_t len = OS::SNPrint(NULL, 0, format, class_name) + 1;
9022 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 9032 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
9023 OS::SNPrint(chars, len, format, class_name); 9033 OS::SNPrint(chars, len, format, class_name);
9024 return chars; 9034 return chars;
9025 } else { 9035 } else {
9026 const char* format = "Type: class '%s', args:[%s]"; 9036 const char* format = "Type: class '%s', args:[%s]";
9027 const char* class_name =
9028 String::Handle(Class::Handle(type_class()).Name()).ToCString();
9029 const char* args_cstr = 9037 const char* args_cstr =
9030 AbstractTypeArguments::Handle(arguments()).ToCString(); 9038 AbstractTypeArguments::Handle(arguments()).ToCString();
9031 intptr_t len = OS::SNPrint(NULL, 0, format, class_name, args_cstr) + 1; 9039 intptr_t len = OS::SNPrint(NULL, 0, format, class_name, args_cstr) + 1;
9032 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 9040 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
9033 OS::SNPrint(chars, len, format, class_name, args_cstr); 9041 OS::SNPrint(chars, len, format, class_name, args_cstr);
9034 return chars; 9042 return chars;
9035 } 9043 }
9036 } else { 9044 } else {
9037 return "Unresolved Type"; 9045 return "Unresolved Type";
9038 } 9046 }
(...skipping 3114 matching lines...) Expand 10 before | Expand all | Expand 10 after
12153 } 12161 }
12154 return result.raw(); 12162 return result.raw();
12155 } 12163 }
12156 12164
12157 12165
12158 const char* WeakProperty::ToCString() const { 12166 const char* WeakProperty::ToCString() const {
12159 return "_WeakProperty"; 12167 return "_WeakProperty";
12160 } 12168 }
12161 12169
12162 } // namespace dart 12170 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698