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

Side by Side Diff: src/d8.cc

Issue 2436273002: [Tracing] Implement TracingCategoryObserver. (Closed)
Patch Set: fix compilation error Created 4 years, 2 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <errno.h> 5 #include <errno.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
7 #include <string.h> 7 #include <string.h>
8 #include <sys/stat.h> 8 #include <sys/stat.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 141 }
142 142
143 private: 143 private:
144 double synthetic_time_in_sec_ = 0.0; 144 double synthetic_time_in_sec_ = 0.0;
145 145
146 DISALLOW_COPY_AND_ASSIGN(PredictablePlatform); 146 DISALLOW_COPY_AND_ASSIGN(PredictablePlatform);
147 }; 147 };
148 148
149 149
150 v8::Platform* g_platform = NULL; 150 v8::Platform* g_platform = NULL;
151 std::unique_ptr<Platform::TracingFlag> g_tracing_flag;
151 152
152 153
153 static Local<Value> Throw(Isolate* isolate, const char* message) { 154 static Local<Value> Throw(Isolate* isolate, const char* message) {
154 return isolate->ThrowException( 155 return isolate->ThrowException(
155 String::NewFromUtf8(isolate, message, NewStringType::kNormal) 156 String::NewFromUtf8(isolate, message, NewStringType::kNormal)
156 .ToLocalChecked()); 157 .ToLocalChecked());
157 } 158 }
158 159
159 160
160 bool FindInObjectList(Local<Object> object, const Shell::ObjectList& list) { 161 bool FindInObjectList(Local<Object> object, const Shell::ObjectList& list) {
(...skipping 2575 matching lines...) Expand 10 before | Expand all | Expand 10 after
2736 int size = 0; 2737 int size = 0;
2737 char* trace_config_json_str = 2738 char* trace_config_json_str =
2738 ReadChars(nullptr, options.trace_config, &size); 2739 ReadChars(nullptr, options.trace_config, &size);
2739 trace_config = 2740 trace_config =
2740 tracing::CreateTraceConfigFromJSON(isolate, trace_config_json_str); 2741 tracing::CreateTraceConfigFromJSON(isolate, trace_config_json_str);
2741 delete[] trace_config_json_str; 2742 delete[] trace_config_json_str;
2742 } else { 2743 } else {
2743 trace_config = 2744 trace_config =
2744 platform::tracing::TraceConfig::CreateDefaultTraceConfig(); 2745 platform::tracing::TraceConfig::CreateDefaultTraceConfig();
2745 } 2746 }
2746 tracing_controller->Initialize(trace_buffer);
2747 tracing_controller->StartTracing(trace_config);
2748 if (!i::FLAG_verify_predictable) { 2747 if (!i::FLAG_verify_predictable) {
2749 platform::SetTracingController(g_platform, tracing_controller); 2748 platform::SetTracingController(g_platform, tracing_controller);
2750 } 2749 }
2750 tracing_controller->Initialize(trace_buffer);
2751 g_tracing_flag = Platform::TracingFlag::Create();
2752 tracing_controller->StartTracing(trace_config);
2751 } 2753 }
2752 2754
2753 if (options.dump_heap_constants) { 2755 if (options.dump_heap_constants) {
2754 DumpHeapConstants(reinterpret_cast<i::Isolate*>(isolate)); 2756 DumpHeapConstants(reinterpret_cast<i::Isolate*>(isolate));
2755 return 0; 2757 return 0;
2756 } 2758 }
2757 2759
2758 if (options.stress_opt || options.stress_deopt) { 2760 if (options.stress_opt || options.stress_deopt) {
2759 Testing::SetStressRunType(options.stress_opt 2761 Testing::SetStressRunType(options.stress_opt
2760 ? Testing::kStressTypeOpt 2762 ? Testing::kStressTypeOpt
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
2814 } 2816 }
2815 2817
2816 } // namespace v8 2818 } // namespace v8
2817 2819
2818 2820
2819 #ifndef GOOGLE3 2821 #ifndef GOOGLE3
2820 int main(int argc, char* argv[]) { 2822 int main(int argc, char* argv[]) {
2821 return v8::Shell::Main(argc, argv); 2823 return v8::Shell::Main(argc, argv);
2822 } 2824 }
2823 #endif 2825 #endif
OLDNEW
« no previous file with comments | « include/v8-platform.h ('k') | src/flag-definitions.h » ('j') | src/flag-definitions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698