| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 80df97c commit 758c02e
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,8 +32,7 @@ void EmitBeforeExit(Environment* env) { | |||
| 32 | 32 | } | |
| 33 | 33 | ||
| 34 | 34 | Maybe<bool> EmitProcessBeforeExit(Environment* env) { | |
| 35 | - TraceEventScope trace_scope(TRACING_CATEGORY_NODE1(environment), | ||
| 36 | - "BeforeExit", env); | ||
| 35 | + TRACE_EVENT0(TRACING_CATEGORY_NODE1(environment), "BeforeExit"); | ||
| 37 | 36 | if (!env->destroy_async_id_list()->empty()) | |
| 38 | 37 | AsyncWrap::DestroyAsyncIdsCallback(env); | |
| 39 | 38 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -673,8 +673,7 @@ void Environment::PrintSyncTrace() const { | |||
| 673 | 673 | ||
| 674 | 674 | void Environment::RunCleanup() { | |
| 675 | 675 | started_cleanup_ = true; | |
| 676 | - TraceEventScope trace_scope(TRACING_CATEGORY_NODE1(environment), | ||
| 677 | - "RunCleanup", this); | ||
| 676 | + TRACE_EVENT0(TRACING_CATEGORY_NODE1(environment), "RunCleanup"); | ||
| 678 | 677 | bindings_.clear(); | |
| 679 | 678 | CleanupHandles(); | |
| 680 | 679 | ||
@@ -716,8 +715,7 @@ void Environment::RunCleanup() { | |||
| 716 | 715 | } | |
| 717 | 716 | ||
| 718 | 717 | void Environment::RunAtExitCallbacks() { | |
| 719 | - TraceEventScope trace_scope(TRACING_CATEGORY_NODE1(environment), | ||
| 720 | - "AtExit", this); | ||
| 718 | + TRACE_EVENT0(TRACING_CATEGORY_NODE1(environment), "AtExit"); | ||
| 721 | 719 | for (ExitCallback at_exit : at_exit_functions_) { | |
| 722 | 720 | at_exit.cb_(at_exit.arg_); | |
| 723 | 721 | } | |
@@ -743,8 +741,8 @@ void Environment::RunAndClearInterrupts() { | |||
| 743 | 741 | } | |
| 744 | 742 | ||
| 745 | 743 | void Environment::RunAndClearNativeImmediates(bool only_refed) { | |
| 746 | - TraceEventScope trace_scope(TRACING_CATEGORY_NODE1(environment), | ||
| 747 | - "RunAndClearNativeImmediates", this); | ||
| 744 | + TRACE_EVENT0(TRACING_CATEGORY_NODE1(environment), | ||
| 745 | + "RunAndClearNativeImmediates"); | ||
| 748 | 746 | HandleScope handle_scope(isolate_); | |
| 749 | 747 | InternalCallbackScope cb_scope(this, Object::New(isolate_), { 0, 0 }); | |
| 750 | 748 | ||
@@ -848,8 +846,7 @@ void Environment::ToggleTimerRef(bool ref) { | |||
| 848 | 846 | ||
| 849 | 847 | void Environment::RunTimers(uv_timer_t* handle) { | |
| 850 | 848 | Environment* env = Environment::from_timer_handle(handle); | |
| 851 | - TraceEventScope trace_scope(TRACING_CATEGORY_NODE1(environment), | ||
| 852 | - "RunTimers", env); | ||
| 849 | + TRACE_EVENT0(TRACING_CATEGORY_NODE1(environment), "RunTimers"); | ||
| 853 | 850 | ||
| 854 | 851 | if (!env->can_call_into_js()) | |
| 855 | 852 | return; | |
@@ -910,8 +907,7 @@ void Environment::RunTimers(uv_timer_t* handle) { | |||
| 910 | 907 | ||
| 911 | 908 | void Environment::CheckImmediate(uv_check_t* handle) { | |
| 912 | 909 | Environment* env = Environment::from_immediate_check_handle(handle); | |
| 913 | - TraceEventScope trace_scope(TRACING_CATEGORY_NODE1(environment), | ||
| 914 | - "CheckImmediate", env); | ||
| 910 | + TRACE_EVENT0(TRACING_CATEGORY_NODE1(environment), "CheckImmediate"); | ||
| 915 | 911 | ||
| 916 | 912 | HandleScope scope(env->isolate()); | |
| 917 | 913 | Context::Scope context_scope(env->context()); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -732,11 +732,10 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) { | |||
| 732 | 732 | if (*TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED( | |
| 733 | 733 | TRACING_CATEGORY_NODE2(vm, script)) != 0) { | |
| 734 | 734 | Utf8Value fn(isolate, filename); | |
| 735 | - TRACE_EVENT_NESTABLE_ASYNC_BEGIN1( | ||
| 736 | - TRACING_CATEGORY_NODE2(vm, script), | ||
| 737 | - "ContextifyScript::New", | ||
| 738 | - contextify_script, | ||
| 739 | - "filename", TRACE_STR_COPY(*fn)); | ||
| 735 | + TRACE_EVENT_BEGIN1(TRACING_CATEGORY_NODE2(vm, script), | ||
| 736 | + "ContextifyScript::New", | ||
| 737 | + "filename", | ||
| 738 | + TRACE_STR_COPY(*fn)); | ||
| 740 | 739 | } | |
| 741 | 740 | ||
| 742 | 741 | ScriptCompiler::CachedData* cached_data = nullptr; | |
@@ -786,10 +785,8 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) { | |||
| 786 | 785 | no_abort_scope.Close(); | |
| 787 | 786 | if (!try_catch.HasTerminated()) | |
| 788 | 787 | try_catch.ReThrow(); | |
| 789 | - TRACE_EVENT_NESTABLE_ASYNC_END0( | ||
| 790 | - TRACING_CATEGORY_NODE2(vm, script), | ||
| 791 | - "ContextifyScript::New", | ||
| 792 | - contextify_script); | ||
| 788 | + TRACE_EVENT_END0(TRACING_CATEGORY_NODE2(vm, script), | ||
| 789 | + "ContextifyScript::New"); | ||
| 793 | 790 | return; | |
| 794 | 791 | } | |
| 795 | 792 | contextify_script->script_.Reset(isolate, v8_script.ToLocalChecked()); | |
@@ -818,10 +815,7 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) { | |||
| 818 | 815 | env->cached_data_produced_string(), | |
| 819 | 816 | Boolean::New(isolate, cached_data_produced)).Check(); | |
| 820 | 817 | } | |
| 821 | - TRACE_EVENT_NESTABLE_ASYNC_END0( | ||
| 822 | - TRACING_CATEGORY_NODE2(vm, script), | ||
| 823 | - "ContextifyScript::New", | ||
| 824 | - contextify_script); | ||
| 818 | + TRACE_EVENT_END0(TRACING_CATEGORY_NODE2(vm, script), "ContextifyScript::New"); | ||
| 825 | 819 | } | |
| 826 | 820 | ||
| 827 | 821 | bool ContextifyScript::InstanceOf(Environment* env, | |
@@ -857,8 +851,7 @@ void ContextifyScript::RunInThisContext( | |||
| 857 | 851 | ContextifyScript* wrapped_script; | |
| 858 | 852 | ASSIGN_OR_RETURN_UNWRAP(&wrapped_script, args.Holder()); | |
| 859 | 853 | ||
| 860 | - TRACE_EVENT_NESTABLE_ASYNC_BEGIN0( | ||
| 861 | - TRACING_CATEGORY_NODE2(vm, script), "RunInThisContext", wrapped_script); | ||
| 854 | + TRACE_EVENT0(TRACING_CATEGORY_NODE2(vm, script), "RunInThisContext"); | ||
| 862 | 855 | ||
| 863 | 856 | // TODO(addaleax): Use an options object or otherwise merge this with | |
| 864 | 857 | // RunInContext(). | |
@@ -884,9 +877,6 @@ void ContextifyScript::RunInThisContext( | |||
| 884 | 877 | break_on_first_line, | |
| 885 | 878 | nullptr, // microtask_queue | |
| 886 | 879 | args); | |
| 887 | - | ||
| 888 | - TRACE_EVENT_NESTABLE_ASYNC_END0( | ||
| 889 | - TRACING_CATEGORY_NODE2(vm, script), "RunInThisContext", wrapped_script); | ||
| 890 | 880 | } | |
| 891 | 881 | ||
| 892 | 882 | void ContextifyScript::RunInContext(const FunctionCallbackInfo<Value>& args) { | |
@@ -908,8 +898,7 @@ void ContextifyScript::RunInContext(const FunctionCallbackInfo<Value>& args) { | |||
| 908 | 898 | if (context.IsEmpty()) | |
| 909 | 899 | return; | |
| 910 | 900 | ||
| 911 | - TRACE_EVENT_NESTABLE_ASYNC_BEGIN0( | ||
| 912 | - TRACING_CATEGORY_NODE2(vm, script), "RunInContext", wrapped_script); | ||
| 901 | + TRACE_EVENT0(TRACING_CATEGORY_NODE2(vm, script), "RunInContext"); | ||
| 913 | 902 | ||
| 914 | 903 | CHECK(args[1]->IsNumber()); | |
| 915 | 904 | int64_t timeout = args[1]->IntegerValue(env->context()).FromJust(); | |
@@ -932,9 +921,6 @@ void ContextifyScript::RunInContext(const FunctionCallbackInfo<Value>& args) { | |||
| 932 | 921 | break_on_first_line, | |
| 933 | 922 | contextify_context->microtask_queue(), | |
| 934 | 923 | args); | |
| 935 | - | ||
| 936 | - TRACE_EVENT_NESTABLE_ASYNC_END0( | ||
| 937 | - TRACING_CATEGORY_NODE2(vm, script), "RunInContext", wrapped_script); | ||
| 938 | 924 | } | |
| 939 | 925 | ||
| 940 | 926 | bool ContextifyScript::EvalMachine(Environment* env, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -383,23 +383,6 @@ namespace heap { | |||
| 383 | 383 | bool WriteSnapshot(v8::Isolate* isolate, const char* filename); | |
| 384 | 384 | } | |
| 385 | 385 | ||
| 386 | - class TraceEventScope { | ||
| 387 | - public: | ||
| 388 | - TraceEventScope(const char* category, | ||
| 389 | - const char* name, | ||
| 390 | - void* id) : category_(category), name_(name), id_(id) { | ||
| 391 | - TRACE_EVENT_NESTABLE_ASYNC_BEGIN0(category_, name_, id_); | ||
| 392 | - } | ||
| 393 | - ~TraceEventScope() { | ||
| 394 | - TRACE_EVENT_NESTABLE_ASYNC_END0(category_, name_, id_); | ||
| 395 | - } | ||
| 396 | - | ||
| 397 | - private: | ||
| 398 | - const char* category_; | ||
| 399 | - const char* name_; | ||
| 400 | - void* id_; | ||
| 401 | - }; | ||
| 402 | - | ||
| 403 | 386 | namespace heap { | |
| 404 | 387 | ||
| 405 | 388 | void DeleteHeapSnapshot(const v8::HeapSnapshot* snapshot); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments