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

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

Issue 2823253005: Fix #28740 demangle constructors in stack traces (A.A becomes new A) REDO (Closed)
Patch Set: Don't recurse in QualifiedName, just check the ending function kind for ctor Created 3 years, 7 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
« no previous file with comments | « no previous file | runtime/vm/object_test.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/become.h" 10 #include "vm/become.h"
(...skipping 7157 matching lines...) Expand 10 before | Expand all | Expand 10 after
7168 // the parent. 7168 // the parent.
7169 fun = fun.parent_function(); 7169 fun = fun.parent_function();
7170 } 7170 }
7171 result = String::Concat(Symbols::Dot(), result, Heap::kOld); 7171 result = String::Concat(Symbols::Dot(), result, Heap::kOld);
7172 result = String::Concat(String::Handle(fun.UserVisibleName()), result, 7172 result = String::Concat(String::Handle(fun.UserVisibleName()), result,
7173 Heap::kOld); 7173 Heap::kOld);
7174 } 7174 }
7175 } 7175 }
7176 const Class& cls = Class::Handle(Owner()); 7176 const Class& cls = Class::Handle(Owner());
7177 if (!cls.IsTopLevel()) { 7177 if (!cls.IsTopLevel()) {
7178 result = String::Concat(Symbols::Dot(), result, Heap::kOld); 7178 if (fun.kind() == RawFunction::kConstructor) {
7179 const String& cls_name = String::Handle(name_visibility == kScrubbedName 7179 result = String::Concat(Symbols::ConstructorStacktracePrefix(), result,
7180 ? cls.ScrubbedName() 7180 Heap::kOld);
7181 : cls.UserVisibleName()); 7181 } else {
7182 result = String::Concat(cls_name, result, Heap::kOld); 7182 result = String::Concat(Symbols::Dot(), result, Heap::kOld);
7183 const String& cls_name = String::Handle(name_visibility == kScrubbedName
7184 ? cls.ScrubbedName()
7185 : cls.UserVisibleName());
7186 result = String::Concat(cls_name, result, Heap::kOld);
7187 }
7183 } 7188 }
7184 return result.raw(); 7189 return result.raw();
7185 } 7190 }
7186 7191
7187 7192
7188 RawString* Function::GetSource() const { 7193 RawString* Function::GetSource() const {
7189 if (IsImplicitConstructor() || IsSignatureFunction()) { 7194 if (IsImplicitConstructor() || IsSignatureFunction()) {
7190 // We may need to handle more cases when the restrictions on mixins are 7195 // We may need to handle more cases when the restrictions on mixins are
7191 // relaxed. In particular we might start associating some source with the 7196 // relaxed. In particular we might start associating some source with the
7192 // forwarding constructors when it becomes possible to specify a particular 7197 // forwarding constructors when it becomes possible to specify a particular
(...skipping 15993 matching lines...) Expand 10 before | Expand all | Expand 10 after
23186 return UserTag::null(); 23191 return UserTag::null();
23187 } 23192 }
23188 23193
23189 23194
23190 const char* UserTag::ToCString() const { 23195 const char* UserTag::ToCString() const {
23191 const String& tag_label = String::Handle(label()); 23196 const String& tag_label = String::Handle(label());
23192 return tag_label.ToCString(); 23197 return tag_label.ToCString();
23193 } 23198 }
23194 23199
23195 } // namespace dart 23200 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698