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

Side by Side Diff: src/isolate.h

Issue 6801060: Fix auto suspension of the sampler thread. (Closed)
Patch Set: Cover other transitions Created 9 years, 8 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 } 890 }
891 #endif 891 #endif
892 892
893 #ifdef ENABLE_VMSTATE_TRACKING 893 #ifdef ENABLE_VMSTATE_TRACKING
894 StateTag current_vm_state() { 894 StateTag current_vm_state() {
895 return thread_local_top_.current_vm_state_; 895 return thread_local_top_.current_vm_state_;
896 } 896 }
897 897
898 void SetCurrentVMState(StateTag state) { 898 void SetCurrentVMState(StateTag state) {
899 if (RuntimeProfiler::IsEnabled()) { 899 if (RuntimeProfiler::IsEnabled()) {
900 if (state == JS) { 900 StateTag current_state = thread_local_top_.current_vm_state_;
901 // JS or non-JS -> JS transition. 901 if (current_state != JS && state == JS) {
902 // Non-JS -> JS transition.
902 RuntimeProfiler::IsolateEnteredJS(this); 903 RuntimeProfiler::IsolateEnteredJS(this);
903 } else if (thread_local_top_.current_vm_state_ == JS) { 904 } else if (current_state == JS && state != JS) {
904 // JS -> non-JS transition. 905 // JS -> non-JS transition.
905 ASSERT(RuntimeProfiler::IsSomeIsolateInJS()); 906 ASSERT(RuntimeProfiler::IsSomeIsolateInJS());
906 RuntimeProfiler::IsolateExitedJS(this); 907 RuntimeProfiler::IsolateExitedJS(this);
908 } else {
909 // Other types of state transitions are not interesting to the
910 // runtime profiler, because they don't affect whether we're
911 // in JS or not.
912 ASSERT((current_state == JS) == (state == JS));
907 } 913 }
908 } 914 }
909 thread_local_top_.current_vm_state_ = state; 915 thread_local_top_.current_vm_state_ = state;
910 } 916 }
911 #endif 917 #endif
912 918
913 void ResetEagerOptimizingData(); 919 void ResetEagerOptimizingData();
914 920
915 private: 921 private:
916 Isolate(); 922 Isolate();
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 1303
1298 } } // namespace v8::internal 1304 } } // namespace v8::internal
1299 1305
1300 // TODO(isolates): Get rid of these -inl.h includes and place them only where 1306 // TODO(isolates): Get rid of these -inl.h includes and place them only where
1301 // they're needed. 1307 // they're needed.
1302 #include "allocation-inl.h" 1308 #include "allocation-inl.h"
1303 #include "zone-inl.h" 1309 #include "zone-inl.h"
1304 #include "frames-inl.h" 1310 #include "frames-inl.h"
1305 1311
1306 #endif // V8_ISOLATE_H_ 1312 #endif // V8_ISOLATE_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698