| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 954 } | 954 } |
| 955 #endif | 955 #endif |
| 956 | 956 |
| 957 #ifdef ENABLE_VMSTATE_TRACKING | 957 #ifdef ENABLE_VMSTATE_TRACKING |
| 958 StateTag current_vm_state() { | 958 StateTag current_vm_state() { |
| 959 return thread_local_top_.current_vm_state_; | 959 return thread_local_top_.current_vm_state_; |
| 960 } | 960 } |
| 961 | 961 |
| 962 void SetCurrentVMState(StateTag state) { | 962 void SetCurrentVMState(StateTag state) { |
| 963 if (RuntimeProfiler::IsEnabled()) { | 963 if (RuntimeProfiler::IsEnabled()) { |
| 964 // Make sure thread local top is initialized. |
| 965 ASSERT(thread_local_top_.isolate_ == this); |
| 964 StateTag current_state = thread_local_top_.current_vm_state_; | 966 StateTag current_state = thread_local_top_.current_vm_state_; |
| 965 if (current_state != JS && state == JS) { | 967 if (current_state != JS && state == JS) { |
| 966 // Non-JS -> JS transition. | 968 // Non-JS -> JS transition. |
| 967 RuntimeProfiler::IsolateEnteredJS(this); | 969 RuntimeProfiler::IsolateEnteredJS(this); |
| 968 } else if (current_state == JS && state != JS) { | 970 } else if (current_state == JS && state != JS) { |
| 969 // JS -> non-JS transition. | 971 // JS -> non-JS transition. |
| 970 ASSERT(RuntimeProfiler::IsSomeIsolateInJS()); | 972 ASSERT(RuntimeProfiler::IsSomeIsolateInJS()); |
| 971 RuntimeProfiler::IsolateExitedJS(this); | 973 RuntimeProfiler::IsolateExitedJS(this); |
| 972 } else { | 974 } else { |
| 973 // Other types of state transitions are not interesting to the | 975 // Other types of state transitions are not interesting to the |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1354 | 1356 |
| 1355 } } // namespace v8::internal | 1357 } } // namespace v8::internal |
| 1356 | 1358 |
| 1357 // TODO(isolates): Get rid of these -inl.h includes and place them only where | 1359 // TODO(isolates): Get rid of these -inl.h includes and place them only where |
| 1358 // they're needed. | 1360 // they're needed. |
| 1359 #include "allocation-inl.h" | 1361 #include "allocation-inl.h" |
| 1360 #include "zone-inl.h" | 1362 #include "zone-inl.h" |
| 1361 #include "frames-inl.h" | 1363 #include "frames-inl.h" |
| 1362 | 1364 |
| 1363 #endif // V8_ISOLATE_H_ | 1365 #endif // V8_ISOLATE_H_ |
| OLD | NEW |