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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 1951003002: Include the field name and function name in Dart_GetField and Dart_Invoke timeline events (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index a53ede7909ea2035b94d7b2defc00a3f3fb9161e..75bf78bc83a22dd43192e761a6a0325e70c2f1bd 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -4119,6 +4119,15 @@ DART_EXPORT Dart_Handle Dart_Invoke(Dart_Handle target,
cls_name.ToCString(),
function_name.ToCString());
}
+ NOT_IN_PRODUCT(if (tds.enabled()) {
+ const String& cls_name = String::Handle(Z, cls.Name());
+ tds.SetNumArguments(1);
+ tds.FormatArgument(0,
+ "name",
+ "%s.%s",
+ cls_name.ToCString(),
+ function_name.ToCString());
+ });
// Setup args and check for malformed arguments in the arguments list.
result = SetupArguments(T, number_of_arguments, arguments, 0, &args);
if (!::Dart_IsError(result)) {
@@ -4154,6 +4163,17 @@ DART_EXPORT Dart_Handle Dart_Invoke(Dart_Handle target,
}
return result;
}
+ NOT_IN_PRODUCT(if (tds.enabled()) {
+ const Class& cls = Class::Handle(Z, instance.clazz());
+ ASSERT(!cls.IsNull());
+ const String& cls_name = String::Handle(Z, cls.Name());
+ tds.SetNumArguments(1);
+ tds.FormatArgument(0,
+ "name",
+ "%s.%s",
+ cls_name.ToCString(),
+ function_name.ToCString());
+ });
// Setup args and check for malformed arguments in the arguments list.
result = SetupArguments(T, number_of_arguments, arguments, 1, &args);
if (!::Dart_IsError(result)) {
@@ -4179,6 +4199,17 @@ DART_EXPORT Dart_Handle Dart_Invoke(Dart_Handle target,
CURRENT_FUNC,
function_name.ToCString());
}
+
+ NOT_IN_PRODUCT(if (tds.enabled()) {
+ const String& lib_name = String::Handle(Z, lib.name());
rmacnak 2016/05/05 23:30:54 This is often the empty string, consider lib.uri i
Cutch 2016/05/05 23:50:03 Done.
+ tds.SetNumArguments(1);
+ tds.FormatArgument(0,
+ "name",
+ "%s.%s",
+ lib_name.ToCString(),
+ function_name.ToCString());
+ });
+
// LookupFunctionAllowPrivate does not check argument arity, so we
// do it here.
String& error_message = String::Handle(Z);
@@ -4269,6 +4300,15 @@ DART_EXPORT Dart_Handle Dart_GetField(Dart_Handle container, Dart_Handle name) {
getter = cls.LookupStaticFunctionAllowPrivate(getter_name);
}
+ NOT_IN_PRODUCT(if (tds.enabled()) {
+ const String& cls_name = String::Handle(cls.Name());
+ tds.SetNumArguments(1);
+ tds.FormatArgument(0,
+ "name",
+ "%s.%s",
+ cls_name.ToCString(), field_name.ToCString());
+ });
+
if (!getter.IsNull()) {
// Invoke the getter and return the result.
return Api::NewHandle(
@@ -4295,6 +4335,15 @@ DART_EXPORT Dart_Handle Dart_GetField(Dart_Handle container, Dart_Handle name) {
cls = cls.SuperClass();
}
+ NOT_IN_PRODUCT(if (tds.enabled()) {
+ const String& cls_name = String::Handle(cls.Name());
+ tds.SetNumArguments(1);
+ tds.FormatArgument(0,
+ "name",
+ "%s.%s",
+ cls_name.ToCString(), field_name.ToCString());
+ });
+
// Invoke the getter and return the result.
const int kNumArgs = 1;
const Array& args = Array::Handle(Z, Array::New(kNumArgs));
@@ -4334,6 +4383,15 @@ DART_EXPORT Dart_Handle Dart_GetField(Dart_Handle container, Dart_Handle name) {
getter = cls.LookupStaticFunctionAllowPrivate(getter_name);
}
+ NOT_IN_PRODUCT(if (tds.enabled()) {
+ const String& lib_name = String::Handle(lib.name());
rmacnak 2016/05/05 23:30:54 This is often the empty string, consider lib.uri i
Cutch 2016/05/05 23:50:04 Done.
+ tds.SetNumArguments(1);
+ tds.FormatArgument(0,
+ "name",
+ "%s.%s",
+ lib_name.ToCString(), field_name.ToCString());
+ });
+
if (!getter.IsNull()) {
// Invoke the getter and return the result.
return Api::NewHandle(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698