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

Unified Diff: runtime/vm/object.cc

Issue 206503007: Print inlined tree using --print_inline_tree. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 34207)
+++ runtime/vm/object.cc (working copy)
@@ -5502,7 +5502,8 @@
// Set 'chars' to allocated buffer and return number of written characters.
static intptr_t ConstructFunctionFullyQualifiedCString(const Function& function,
char** chars,
- intptr_t reserve_len) {
+ intptr_t reserve_len,
+ bool with_lib) {
const char* name = String::Handle(function.name()).ToCString();
const char* function_format = (reserve_len == 0) ? "%s" : "%s_";
reserve_len += OS::SNPrint(NULL, 0, function_format, name);
@@ -5515,10 +5516,16 @@
ASSERT(class_name != NULL);
const Library& library = Library::Handle(function_class.library());
ASSERT(!library.IsNull());
- const char* library_name = String::Handle(library.url()).ToCString();
- ASSERT(library_name != NULL);
- const char* lib_class_format =
- (library_name[0] == '\0') ? "%s%s_" : "%s_%s_";
+ const char* library_name = NULL;
+ const char* lib_class_format = NULL;
+ if (with_lib) {
+ library_name = String::Handle(library.url()).ToCString();
+ ASSERT(library_name != NULL);
+ lib_class_format = (library_name[0] == '\0') ? "%s%s_" : "%s_%s_";
+ } else {
+ library_name = "";
+ lib_class_format = "%s%s.";
+ }
reserve_len +=
OS::SNPrint(NULL, 0, lib_class_format, library_name, class_name);
ASSERT(chars != NULL);
@@ -5528,7 +5535,8 @@
} else {
written = ConstructFunctionFullyQualifiedCString(parent,
chars,
- reserve_len);
+ reserve_len,
+ with_lib);
}
ASSERT(*chars != NULL);
char* next = *chars + written;
@@ -5545,11 +5553,18 @@
const char* Function::ToFullyQualifiedCString() const {
char* chars = NULL;
- ConstructFunctionFullyQualifiedCString(*this, &chars, 0);
+ ConstructFunctionFullyQualifiedCString(*this, &chars, 0, true);
return chars;
}
+const char* Function::ToQualifiedCString() const {
+ char* chars = NULL;
+ ConstructFunctionFullyQualifiedCString(*this, &chars, 0, false);
+ return chars;
+}
+
+
bool Function::HasCompatibleParametersWith(const Function& other,
Error* bound_error) const {
ASSERT(FLAG_error_on_bad_override);
« no previous file with comments | « runtime/vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698