Chromium Code Reviews| Index: runtime/vm/dart_api_impl.h |
| =================================================================== |
| --- runtime/vm/dart_api_impl.h (revision 27137) |
| +++ runtime/vm/dart_api_impl.h (working copy) |
| @@ -11,6 +11,8 @@ |
| namespace dart { |
| +DECLARE_FLAG(bool, trace_api); |
| + |
| class ApiLocalScope; |
| class ApiState; |
| class FinalizablePersistentHandle; |
| @@ -21,9 +23,20 @@ |
| #define CURRENT_FUNC CanonicalFunction(__FUNCTION__) |
| +#if defined(DEBUG) |
| +#define TRACE_API_CALLS(name) \ |
|
regis
2013/09/04 23:05:15
Should it be TRACE_API_CALL(name), since you use i
siva
2013/09/04 23:27:42
Done.
|
| + if (FLAG_trace_api) { \ |
| + OS::Print("Calling API func: %s\n", name); \ |
| + } |
| +#else |
| +#define TRACE_API_CALLS(name) |
| +#endif |
| + |
| + |
| // Checks that the current isolate is not NULL. |
| #define CHECK_ISOLATE(isolate) \ |
| do { \ |
| + TRACE_API_CALLS(CURRENT_FUNC); \ |
| if ((isolate) == NULL) { \ |
| FATAL1("%s expects there to be a current isolate. Did you " \ |
| "forget to call Dart_CreateIsolate or Dart_EnterIsolate?", \ |
| @@ -34,6 +47,7 @@ |
| // Checks that the current isolate is NULL. |
| #define CHECK_NO_ISOLATE(isolate) \ |
| do { \ |
| + TRACE_API_CALLS(CURRENT_FUNC); \ |
| if ((isolate) != NULL) { \ |
| FATAL1("%s expects there to be no current isolate. Did you " \ |
| "forget to call Dart_ExitIsolate?", CURRENT_FUNC); \ |