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

Side by Side Diff: src/isolate.h

Issue 2765813002: [debug] refactor code coverage to use enum for mode. (Closed)
Patch Set: fix d8 Created 3 years, 9 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
« no previous file with comments | « src/inspector/v8-profiler-agent-impl.cc ('k') | src/isolate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef V8_ISOLATE_H_ 5 #ifndef V8_ISOLATE_H_
6 #define V8_ISOLATE_H_ 6 #define V8_ISOLATE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <queue> 9 #include <queue>
10 10
11 #include "include/v8-debug.h" 11 #include "include/v8-debug.h"
12 #include "src/allocation.h" 12 #include "src/allocation.h"
13 #include "src/base/atomicops.h" 13 #include "src/base/atomicops.h"
14 #include "src/builtins/builtins.h" 14 #include "src/builtins/builtins.h"
15 #include "src/contexts.h" 15 #include "src/contexts.h"
16 #include "src/date.h" 16 #include "src/date.h"
17 #include "src/debug/debug-interface.h"
17 #include "src/execution.h" 18 #include "src/execution.h"
18 #include "src/frames.h" 19 #include "src/frames.h"
19 #include "src/futex-emulation.h" 20 #include "src/futex-emulation.h"
20 #include "src/global-handles.h" 21 #include "src/global-handles.h"
21 #include "src/handles.h" 22 #include "src/handles.h"
22 #include "src/heap/heap.h" 23 #include "src/heap/heap.h"
23 #include "src/messages.h" 24 #include "src/messages.h"
24 #include "src/regexp/regexp-stack.h" 25 #include "src/regexp/regexp-stack.h"
25 #include "src/runtime/runtime.h" 26 #include "src/runtime/runtime.h"
26 #include "src/zone/zone.h" 27 #include "src/zone/zone.h"
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 V(PromiseRejectCallback, promise_reject_callback, nullptr) \ 416 V(PromiseRejectCallback, promise_reject_callback, nullptr) \
416 V(const v8::StartupData*, snapshot_blob, nullptr) \ 417 V(const v8::StartupData*, snapshot_blob, nullptr) \
417 V(int, code_and_metadata_size, 0) \ 418 V(int, code_and_metadata_size, 0) \
418 V(int, bytecode_and_metadata_size, 0) \ 419 V(int, bytecode_and_metadata_size, 0) \
419 /* true if being profiled. Causes collection of extra compile info. */ \ 420 /* true if being profiled. Causes collection of extra compile info. */ \
420 V(bool, is_profiling, false) \ 421 V(bool, is_profiling, false) \
421 /* true if a trace is being formatted through Error.prepareStackTrace. */ \ 422 /* true if a trace is being formatted through Error.prepareStackTrace. */ \
422 V(bool, formatting_stack_trace, false) \ 423 V(bool, formatting_stack_trace, false) \
423 /* Perform side effect checks on function call and API callbacks. */ \ 424 /* Perform side effect checks on function call and API callbacks. */ \
424 V(bool, needs_side_effect_check, false) \ 425 V(bool, needs_side_effect_check, false) \
426 /* Current code coverage mode */ \
427 V(debug::Coverage::Mode, code_coverage_mode, debug::Coverage::kBestEffort) \
425 ISOLATE_INIT_SIMULATOR_LIST(V) 428 ISOLATE_INIT_SIMULATOR_LIST(V)
426 429
427 #define THREAD_LOCAL_TOP_ACCESSOR(type, name) \ 430 #define THREAD_LOCAL_TOP_ACCESSOR(type, name) \
428 inline void set_##name(type v) { thread_local_top_.name##_ = v; } \ 431 inline void set_##name(type v) { thread_local_top_.name##_ = v; } \
429 inline type name() const { return thread_local_top_.name##_; } 432 inline type name() const { return thread_local_top_.name##_; }
430 433
431 #define THREAD_LOCAL_TOP_ADDRESS(type, name) \ 434 #define THREAD_LOCAL_TOP_ADDRESS(type, name) \
432 type* name##_address() { return &thread_local_top_.name##_; } 435 type* name##_address() { return &thread_local_top_.name##_; }
433 436
434 437
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 971
969 bool IsDead() { return has_fatal_error_; } 972 bool IsDead() { return has_fatal_error_; }
970 void SignalFatalError() { has_fatal_error_ = true; } 973 void SignalFatalError() { has_fatal_error_ = true; }
971 974
972 bool use_crankshaft(); 975 bool use_crankshaft();
973 976
974 bool initialized_from_snapshot() { return initialized_from_snapshot_; } 977 bool initialized_from_snapshot() { return initialized_from_snapshot_; }
975 978
976 bool NeedsSourcePositionsForProfiling() const; 979 bool NeedsSourcePositionsForProfiling() const;
977 980
978 bool IsCodeCoverageEnabled(); 981 bool is_best_effort_code_coverage() const {
982 return code_coverage_mode() == debug::Coverage::kBestEffort;
983 }
984
985 bool is_precise_count_code_coverage() const {
986 return code_coverage_mode() == debug::Coverage::kPreciseCount;
987 }
988
979 void SetCodeCoverageList(Object* value); 989 void SetCodeCoverageList(Object* value);
980 990
981 double time_millis_since_init() { 991 double time_millis_since_init() {
982 return heap_.MonotonicallyIncreasingTimeInMs() - time_millis_at_init_; 992 return heap_.MonotonicallyIncreasingTimeInMs() - time_millis_at_init_;
983 } 993 }
984 994
985 DateCache* date_cache() { 995 DateCache* date_cache() {
986 return date_cache_; 996 return date_cache_;
987 } 997 }
988 998
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
1760 1770
1761 EmbeddedVector<char, 128> filename_; 1771 EmbeddedVector<char, 128> filename_;
1762 FILE* file_; 1772 FILE* file_;
1763 int scope_depth_; 1773 int scope_depth_;
1764 }; 1774 };
1765 1775
1766 } // namespace internal 1776 } // namespace internal
1767 } // namespace v8 1777 } // namespace v8
1768 1778
1769 #endif // V8_ISOLATE_H_ 1779 #endif // V8_ISOLATE_H_
OLDNEW
« no previous file with comments | « src/inspector/v8-profiler-agent-impl.cc ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698