| 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 2295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2306 | 2306 |
| 2307 | 2307 |
| 2308 static bool GetCoverage(Thread* thread, JSONStream* js) { | 2308 static bool GetCoverage(Thread* thread, JSONStream* js) { |
| 2309 // TODO(rmacnak): Remove this response; it is subsumed by GetCallSiteData. | 2309 // TODO(rmacnak): Remove this response; it is subsumed by GetCallSiteData. |
| 2310 return GetHitsOrSites(thread, js, false); | 2310 return GetHitsOrSites(thread, js, false); |
| 2311 } | 2311 } |
| 2312 | 2312 |
| 2313 | 2313 |
| 2314 static const char* kCallSitesStr = "CallSites"; | 2314 static const char* kCallSitesStr = "CallSites"; |
| 2315 static const char* kCoverageStr = "Coverage"; | 2315 static const char* kCoverageStr = "Coverage"; |
| 2316 static const char* kPossibleBreakpointsStr = "PossibleBreakpoints"; |
| 2316 | 2317 |
| 2317 | 2318 |
| 2318 static const char* const report_enum_names[] = { | 2319 static const char* const report_enum_names[] = { |
| 2319 kCallSitesStr, | 2320 kCallSitesStr, |
| 2320 kCoverageStr, | 2321 kCoverageStr, |
| 2322 kPossibleBreakpointsStr, |
| 2321 NULL, | 2323 NULL, |
| 2322 }; | 2324 }; |
| 2323 | 2325 |
| 2324 | 2326 |
| 2325 static const EnumListParameter* reports_parameter = | 2327 static const EnumListParameter* reports_parameter = |
| 2326 new EnumListParameter("reports", true, report_enum_names); | 2328 new EnumListParameter("reports", true, report_enum_names); |
| 2327 | 2329 |
| 2328 | 2330 |
| 2329 static const MethodParameter* get_source_report_params[] = { | 2331 static const MethodParameter* get_source_report_params[] = { |
| 2330 ISOLATE_PARAMETER, | 2332 ISOLATE_PARAMETER, |
| 2331 reports_parameter, | 2333 reports_parameter, |
| 2332 new IdParameter("scriptId", false), | 2334 new IdParameter("scriptId", false), |
| 2333 new UIntParameter("tokenPos", false), | 2335 new UIntParameter("tokenPos", false), |
| 2334 new UIntParameter("endTokenPos", false), | 2336 new UIntParameter("endTokenPos", false), |
| 2335 new BoolParameter("forceCompile", false), | 2337 new BoolParameter("forceCompile", false), |
| 2336 NULL, | 2338 NULL, |
| 2337 }; | 2339 }; |
| 2338 | 2340 |
| 2339 | 2341 |
| 2340 static bool GetSourceReport(Thread* thread, JSONStream* js) { | 2342 static bool GetSourceReport(Thread* thread, JSONStream* js) { |
| 2341 const char* reports_str = js->LookupParam("reports"); | 2343 const char* reports_str = js->LookupParam("reports"); |
| 2342 const char** reports = reports_parameter->Parse(thread->zone(), reports_str); | 2344 const char** reports = reports_parameter->Parse(thread->zone(), reports_str); |
| 2343 intptr_t report_set = 0; | 2345 intptr_t report_set = 0; |
| 2344 while (*reports != NULL) { | 2346 while (*reports != NULL) { |
| 2345 if (strcmp(*reports, kCallSitesStr) == 0) { | 2347 if (strcmp(*reports, kCallSitesStr) == 0) { |
| 2346 report_set |= SourceReport::kCallSites; | 2348 report_set |= SourceReport::kCallSites; |
| 2347 } else if (strcmp(*reports, kCoverageStr) == 0) { | 2349 } else if (strcmp(*reports, kCoverageStr) == 0) { |
| 2348 report_set |= SourceReport::kCoverage; | 2350 report_set |= SourceReport::kCoverage; |
| 2351 } else if (strcmp(*reports, kPossibleBreakpointsStr) == 0) { |
| 2352 report_set |= SourceReport::kPossibleBreakpoints; |
| 2349 } | 2353 } |
| 2350 reports++; | 2354 reports++; |
| 2351 } | 2355 } |
| 2352 | 2356 |
| 2353 SourceReport::CompileMode compile_mode = SourceReport::kNoCompile; | 2357 SourceReport::CompileMode compile_mode = SourceReport::kNoCompile; |
| 2354 if (BoolParameter::Parse(js->LookupParam("forceCompile"), false)) { | 2358 if (BoolParameter::Parse(js->LookupParam("forceCompile"), false)) { |
| 2355 compile_mode = SourceReport::kForceCompile; | 2359 compile_mode = SourceReport::kForceCompile; |
| 2356 } | 2360 } |
| 2357 | 2361 |
| 2358 Script& script = Script::Handle(); | 2362 Script& script = Script::Handle(); |
| (...skipping 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3862 const ServiceMethodDescriptor& method = service_methods_[i]; | 3866 const ServiceMethodDescriptor& method = service_methods_[i]; |
| 3863 if (strcmp(method_name, method.name) == 0) { | 3867 if (strcmp(method_name, method.name) == 0) { |
| 3864 return &method; | 3868 return &method; |
| 3865 } | 3869 } |
| 3866 } | 3870 } |
| 3867 return NULL; | 3871 return NULL; |
| 3868 } | 3872 } |
| 3869 | 3873 |
| 3870 | 3874 |
| 3871 } // namespace dart | 3875 } // namespace dart |
| OLD | NEW |