| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/service.h" | 5 #include "vm/service.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
| 9 #include "platform/globals.h" | 9 #include "platform/globals.h" |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "vm/message_handler.h" | 22 #include "vm/message_handler.h" |
| 23 #include "vm/native_arguments.h" | 23 #include "vm/native_arguments.h" |
| 24 #include "vm/native_entry.h" | 24 #include "vm/native_entry.h" |
| 25 #include "vm/native_symbol.h" | 25 #include "vm/native_symbol.h" |
| 26 #include "vm/object.h" | 26 #include "vm/object.h" |
| 27 #include "vm/object_graph.h" | 27 #include "vm/object_graph.h" |
| 28 #include "vm/object_id_ring.h" | 28 #include "vm/object_id_ring.h" |
| 29 #include "vm/object_store.h" | 29 #include "vm/object_store.h" |
| 30 #include "vm/parser.h" | 30 #include "vm/parser.h" |
| 31 #include "vm/port.h" | 31 #include "vm/port.h" |
| 32 #include "vm/profiler.h" | |
| 33 #include "vm/profiler_service.h" | 32 #include "vm/profiler_service.h" |
| 34 #include "vm/reusable_handles.h" | 33 #include "vm/reusable_handles.h" |
| 35 #include "vm/safepoint.h" | 34 #include "vm/safepoint.h" |
| 36 #include "vm/service_event.h" | 35 #include "vm/service_event.h" |
| 37 #include "vm/service_isolate.h" | 36 #include "vm/service_isolate.h" |
| 38 #include "vm/source_report.h" | 37 #include "vm/source_report.h" |
| 39 #include "vm/stack_frame.h" | 38 #include "vm/stack_frame.h" |
| 40 #include "vm/symbols.h" | 39 #include "vm/symbols.h" |
| 41 #include "vm/timeline.h" | 40 #include "vm/timeline.h" |
| 42 #include "vm/type_table.h" | 41 #include "vm/type_table.h" |
| (...skipping 3072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3115 // the service isolate directly, but would require some special case | 3114 // the service isolate directly, but would require some special case |
| 3116 // code. That would prevent this isolate getting double-interrupted | 3115 // code. That would prevent this isolate getting double-interrupted |
| 3117 // with OOB messages. | 3116 // with OOB messages. |
| 3118 Isolate* isolate = thread->isolate(); | 3117 Isolate* isolate = thread->isolate(); |
| 3119 isolate->SendInternalLibMessage(Isolate::kInterruptMsg, | 3118 isolate->SendInternalLibMessage(Isolate::kInterruptMsg, |
| 3120 isolate->pause_capability()); | 3119 isolate->pause_capability()); |
| 3121 PrintSuccess(js); | 3120 PrintSuccess(js); |
| 3122 return true; | 3121 return true; |
| 3123 } | 3122 } |
| 3124 | 3123 |
| 3125 static const MethodParameter* enable_profiler_params[] = { | |
| 3126 NULL, | |
| 3127 }; | |
| 3128 | |
| 3129 static bool EnableProfiler(Thread* thread, JSONStream* js) { | |
| 3130 if (!FLAG_profiler) { | |
| 3131 FLAG_profiler = true; | |
| 3132 Profiler::InitOnce(); | |
| 3133 } | |
| 3134 PrintSuccess(js); | |
| 3135 return true; | |
| 3136 } | |
| 3137 | |
| 3138 static const MethodParameter* get_tag_profile_params[] = { | 3124 static const MethodParameter* get_tag_profile_params[] = { |
| 3139 RUNNABLE_ISOLATE_PARAMETER, NULL, | 3125 RUNNABLE_ISOLATE_PARAMETER, NULL, |
| 3140 }; | 3126 }; |
| 3141 | 3127 |
| 3142 static bool GetTagProfile(Thread* thread, JSONStream* js) { | 3128 static bool GetTagProfile(Thread* thread, JSONStream* js) { |
| 3143 JSONObject miniProfile(js); | 3129 JSONObject miniProfile(js); |
| 3144 miniProfile.AddProperty("type", "TagProfile"); | 3130 miniProfile.AddProperty("type", "TagProfile"); |
| 3145 thread->isolate()->vm_tag_counters()->PrintToJSONObject(&miniProfile); | 3131 thread->isolate()->vm_tag_counters()->PrintToJSONObject(&miniProfile); |
| 3146 return true; | 3132 return true; |
| 3147 } | 3133 } |
| (...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4029 { "addBreakpointWithScriptUri", AddBreakpointWithScriptUri, | 4015 { "addBreakpointWithScriptUri", AddBreakpointWithScriptUri, |
| 4030 add_breakpoint_with_script_uri_params }, | 4016 add_breakpoint_with_script_uri_params }, |
| 4031 { "addBreakpointAtEntry", AddBreakpointAtEntry, | 4017 { "addBreakpointAtEntry", AddBreakpointAtEntry, |
| 4032 add_breakpoint_at_entry_params }, | 4018 add_breakpoint_at_entry_params }, |
| 4033 { "_addBreakpointAtActivation", AddBreakpointAtActivation, | 4019 { "_addBreakpointAtActivation", AddBreakpointAtActivation, |
| 4034 add_breakpoint_at_activation_params }, | 4020 add_breakpoint_at_activation_params }, |
| 4035 { "_clearCpuProfile", ClearCpuProfile, | 4021 { "_clearCpuProfile", ClearCpuProfile, |
| 4036 clear_cpu_profile_params }, | 4022 clear_cpu_profile_params }, |
| 4037 { "_clearVMTimeline", ClearVMTimeline, | 4023 { "_clearVMTimeline", ClearVMTimeline, |
| 4038 clear_vm_timeline_params, }, | 4024 clear_vm_timeline_params, }, |
| 4039 { "_enableProfiler", EnableProfiler, | |
| 4040 enable_profiler_params, }, | |
| 4041 { "evaluate", Evaluate, | 4025 { "evaluate", Evaluate, |
| 4042 evaluate_params }, | 4026 evaluate_params }, |
| 4043 { "evaluateInFrame", EvaluateInFrame, | 4027 { "evaluateInFrame", EvaluateInFrame, |
| 4044 evaluate_in_frame_params }, | 4028 evaluate_in_frame_params }, |
| 4045 { "_getAllocationProfile", GetAllocationProfile, | 4029 { "_getAllocationProfile", GetAllocationProfile, |
| 4046 get_allocation_profile_params }, | 4030 get_allocation_profile_params }, |
| 4047 { "_getAllocationSamples", GetAllocationSamples, | 4031 { "_getAllocationSamples", GetAllocationSamples, |
| 4048 get_allocation_samples_params }, | 4032 get_allocation_samples_params }, |
| 4049 { "_getNativeAllocationSamples", GetNativeAllocationSamples, | 4033 { "_getNativeAllocationSamples", GetNativeAllocationSamples, |
| 4050 get_native_allocation_samples_params }, | 4034 get_native_allocation_samples_params }, |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4142 if (strcmp(method_name, method.name) == 0) { | 4126 if (strcmp(method_name, method.name) == 0) { |
| 4143 return &method; | 4127 return &method; |
| 4144 } | 4128 } |
| 4145 } | 4129 } |
| 4146 return NULL; | 4130 return NULL; |
| 4147 } | 4131 } |
| 4148 | 4132 |
| 4149 #endif // !PRODUCT | 4133 #endif // !PRODUCT |
| 4150 | 4134 |
| 4151 } // namespace dart | 4135 } // namespace dart |
| OLD | NEW |