| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 "src/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
| 6 | 6 |
| 7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
| 8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
| 9 #include "src/debug/debug-coverage.h" | 9 #include "src/debug/debug-coverage.h" |
| 10 #include "src/debug/debug-evaluate.h" | 10 #include "src/debug/debug-evaluate.h" |
| (...skipping 1886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1897 | 1897 |
| 1898 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { | 1898 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { |
| 1899 UNIMPLEMENTED(); | 1899 UNIMPLEMENTED(); |
| 1900 return NULL; | 1900 return NULL; |
| 1901 } | 1901 } |
| 1902 | 1902 |
| 1903 RUNTIME_FUNCTION(Runtime_DebugCollectCoverage) { | 1903 RUNTIME_FUNCTION(Runtime_DebugCollectCoverage) { |
| 1904 HandleScope scope(isolate); | 1904 HandleScope scope(isolate); |
| 1905 DCHECK_EQ(0, args.length()); | 1905 DCHECK_EQ(0, args.length()); |
| 1906 // Collect coverage data. | 1906 // Collect coverage data. |
| 1907 std::unique_ptr<Coverage> coverage(Coverage::Collect(isolate, false)); | 1907 std::unique_ptr<Coverage> coverage(Coverage::CollectBestEffort(isolate)); |
| 1908 Factory* factory = isolate->factory(); | 1908 Factory* factory = isolate->factory(); |
| 1909 // Turn the returned data structure into JavaScript. | 1909 // Turn the returned data structure into JavaScript. |
| 1910 // Create an array of scripts. | 1910 // Create an array of scripts. |
| 1911 int num_scripts = static_cast<int>(coverage->size()); | 1911 int num_scripts = static_cast<int>(coverage->size()); |
| 1912 // Prepare property keys. | 1912 // Prepare property keys. |
| 1913 Handle<FixedArray> scripts_array = factory->NewFixedArray(num_scripts); | 1913 Handle<FixedArray> scripts_array = factory->NewFixedArray(num_scripts); |
| 1914 Handle<String> script_string = factory->NewStringFromStaticChars("script"); | 1914 Handle<String> script_string = factory->NewStringFromStaticChars("script"); |
| 1915 Handle<String> start_string = factory->NewStringFromStaticChars("start"); | 1915 Handle<String> start_string = factory->NewStringFromStaticChars("start"); |
| 1916 Handle<String> end_string = factory->NewStringFromStaticChars("end"); | 1916 Handle<String> end_string = factory->NewStringFromStaticChars("end"); |
| 1917 Handle<String> count_string = factory->NewStringFromStaticChars("count"); | 1917 Handle<String> count_string = factory->NewStringFromStaticChars("count"); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1945 RUNTIME_FUNCTION(Runtime_DebugTogglePreciseCoverage) { | 1945 RUNTIME_FUNCTION(Runtime_DebugTogglePreciseCoverage) { |
| 1946 SealHandleScope shs(isolate); | 1946 SealHandleScope shs(isolate); |
| 1947 CONVERT_BOOLEAN_ARG_CHECKED(enable, 0); | 1947 CONVERT_BOOLEAN_ARG_CHECKED(enable, 0); |
| 1948 Coverage::SelectMode(isolate, enable ? debug::Coverage::kPreciseCount | 1948 Coverage::SelectMode(isolate, enable ? debug::Coverage::kPreciseCount |
| 1949 : debug::Coverage::kBestEffort); | 1949 : debug::Coverage::kBestEffort); |
| 1950 return isolate->heap()->undefined_value(); | 1950 return isolate->heap()->undefined_value(); |
| 1951 } | 1951 } |
| 1952 | 1952 |
| 1953 } // namespace internal | 1953 } // namespace internal |
| 1954 } // namespace v8 | 1954 } // namespace v8 |
| OLD | NEW |