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

Side by Side Diff: runtime/vm/isolate.cc

Issue 2133823002: Improve hot reload test mode (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: rmacnak review Created 4 years, 5 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 | « runtime/vm/isolate.h ('k') | tests/corelib/corelib.status » ('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 (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/isolate.h" 5 #include "vm/isolate.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/assert.h" 9 #include "platform/assert.h"
10 #include "platform/text_buffer.h" 10 #include "platform/text_buffer.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "vm/timeline_analysis.h" 46 #include "vm/timeline_analysis.h"
47 #include "vm/timer.h" 47 #include "vm/timer.h"
48 #include "vm/visitor.h" 48 #include "vm/visitor.h"
49 49
50 50
51 namespace dart { 51 namespace dart {
52 52
53 DECLARE_FLAG(bool, print_metrics); 53 DECLARE_FLAG(bool, print_metrics);
54 DECLARE_FLAG(bool, timing); 54 DECLARE_FLAG(bool, timing);
55 DECLARE_FLAG(bool, trace_service); 55 DECLARE_FLAG(bool, trace_service);
56 DECLARE_FLAG(bool, warn_on_pause_with_no_debugger);
57
58 // Reload flags.
59 DECLARE_FLAG(bool, check_reloaded);
60 DECLARE_FLAG(int, reload_every);
61 DECLARE_FLAG(bool, reload_every_back_off);
56 DECLARE_FLAG(bool, trace_reload); 62 DECLARE_FLAG(bool, trace_reload);
57 DECLARE_FLAG(bool, warn_on_pause_with_no_debugger); 63
58 DECLARE_FLAG(bool, check_reloaded);
59 64
60 NOT_IN_PRODUCT( 65 NOT_IN_PRODUCT(
61 static void CheckedModeHandler(bool value) { 66 static void CheckedModeHandler(bool value) {
62 FLAG_enable_asserts = value; 67 FLAG_enable_asserts = value;
63 FLAG_enable_type_checks = value; 68 FLAG_enable_type_checks = value;
64 } 69 }
65 70
66 // --enable-checked-mode and --checked both enable checked mode which is 71 // --enable-checked-mode and --checked both enable checked mode which is
67 // equivalent to setting --enable-asserts and --enable-type-checks. 72 // equivalent to setting --enable-asserts and --enable-type-checks.
68 DEFINE_FLAG_HANDLER(CheckedModeHandler, 73 DEFINE_FLAG_HANDLER(CheckedModeHandler,
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 next_(NULL), 831 next_(NULL),
827 pause_loop_monitor_(NULL), 832 pause_loop_monitor_(NULL),
828 loading_invalidation_gen_(kInvalidGen), 833 loading_invalidation_gen_(kInvalidGen),
829 top_level_parsing_count_(0), 834 top_level_parsing_count_(0),
830 field_list_mutex_(new Mutex()), 835 field_list_mutex_(new Mutex()),
831 boxed_field_list_(GrowableObjectArray::null()), 836 boxed_field_list_(GrowableObjectArray::null()),
832 spawn_count_monitor_(new Monitor()), 837 spawn_count_monitor_(new Monitor()),
833 spawn_count_(0), 838 spawn_count_(0),
834 has_attempted_reload_(false), 839 has_attempted_reload_(false),
835 no_reload_scope_depth_(0), 840 no_reload_scope_depth_(0),
841 reload_every_n_stack_overflow_checks_(FLAG_reload_every),
836 reload_context_(NULL) { 842 reload_context_(NULL) {
837 NOT_IN_PRODUCT(FlagsCopyFrom(api_flags)); 843 NOT_IN_PRODUCT(FlagsCopyFrom(api_flags));
838 // TODO(asiva): A Thread is not available here, need to figure out 844 // TODO(asiva): A Thread is not available here, need to figure out
839 // how the vm_tag (kEmbedderTagId) can be set, these tags need to 845 // how the vm_tag (kEmbedderTagId) can be set, these tags need to
840 // move to the OSThread structure. 846 // move to the OSThread structure.
841 set_user_tag(UserTags::kDefaultUserTag); 847 set_user_tag(UserTags::kDefaultUserTag);
842 } 848 }
843 849
844 #undef REUSABLE_HANDLE_SCOPE_INIT 850 #undef REUSABLE_HANDLE_SCOPE_INIT
845 #undef REUSABLE_HANDLE_INITIALIZERS 851 #undef REUSABLE_HANDLE_INITIALIZERS
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
1636 1642
1637 1643
1638 void Isolate::StopBackgroundCompiler() { 1644 void Isolate::StopBackgroundCompiler() {
1639 // Wait until all background compilation has finished. 1645 // Wait until all background compilation has finished.
1640 if (background_compiler_ != NULL) { 1646 if (background_compiler_ != NULL) {
1641 BackgroundCompiler::Stop(this); 1647 BackgroundCompiler::Stop(this);
1642 } 1648 }
1643 } 1649 }
1644 1650
1645 1651
1652 void Isolate::MaybeIncreaseReloadEveryNStackOverflowChecks() {
1653 if (FLAG_reload_every_back_off) {
1654 if (reload_every_n_stack_overflow_checks_ < 5000) {
1655 reload_every_n_stack_overflow_checks_ += 100;
1656 } else {
1657 reload_every_n_stack_overflow_checks_ *= 2;
1658 }
1659 // Cap the value.
1660 if (reload_every_n_stack_overflow_checks_ > 1000000) {
1661 reload_every_n_stack_overflow_checks_ = 1000000;
1662 }
1663 }
1664 }
1665
1666
1646 void Isolate::Shutdown() { 1667 void Isolate::Shutdown() {
1647 ASSERT(this == Isolate::Current()); 1668 ASSERT(this == Isolate::Current());
1648 StopBackgroundCompiler(); 1669 StopBackgroundCompiler();
1649 1670
1650 #if defined(DEBUG) 1671 #if defined(DEBUG)
1651 if (heap_ != NULL) { 1672 if (heap_ != NULL) {
1652 // The VM isolate keeps all objects marked. 1673 // The VM isolate keeps all objects marked.
1653 heap_->Verify(this == Dart::vm_isolate() ? kRequireMarked : kForbidMarked); 1674 heap_->Verify(this == Dart::vm_isolate() ? kRequireMarked : kForbidMarked);
1654 } 1675 }
1655 #endif // DEBUG 1676 #endif // DEBUG
(...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after
2831 void IsolateSpawnState::DecrementSpawnCount() { 2852 void IsolateSpawnState::DecrementSpawnCount() {
2832 ASSERT(spawn_count_monitor_ != NULL); 2853 ASSERT(spawn_count_monitor_ != NULL);
2833 ASSERT(spawn_count_ != NULL); 2854 ASSERT(spawn_count_ != NULL);
2834 MonitorLocker ml(spawn_count_monitor_); 2855 MonitorLocker ml(spawn_count_monitor_);
2835 ASSERT(*spawn_count_ > 0); 2856 ASSERT(*spawn_count_ > 0);
2836 *spawn_count_ = *spawn_count_ - 1; 2857 *spawn_count_ = *spawn_count_ - 1;
2837 ml.Notify(); 2858 ml.Notify();
2838 } 2859 }
2839 2860
2840 } // namespace dart 2861 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/isolate.h ('k') | tests/corelib/corelib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698