OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1259 return "OTHER"; | 1259 return "OTHER"; |
1260 default: | 1260 default: |
1261 UNREACHABLE(); | 1261 UNREACHABLE(); |
1262 return NULL; | 1262 return NULL; |
1263 } | 1263 } |
1264 } | 1264 } |
1265 | 1265 |
1266 VMState::VMState(StateTag state) { | 1266 VMState::VMState(StateTag state) { |
1267 #if !defined(ENABLE_HEAP_PROTECTION) | 1267 #if !defined(ENABLE_HEAP_PROTECTION) |
1268 // When not protecting the heap, there is no difference between | 1268 // When not protecting the heap, there is no difference between |
1269 // EXTERNAL and OTHER. As an optimizatin in that case, we will not | 1269 // EXTERNAL and OTHER. As an optimization in that case, we will not |
1270 // perform EXTERNAL->OTHER transitions through the API. We thus | 1270 // perform EXTERNAL->OTHER transitions through the API. We thus |
1271 // compress the two states into one. | 1271 // compress the two states into one. |
1272 if (state == EXTERNAL) state = OTHER; | 1272 if (state == EXTERNAL) state = OTHER; |
1273 #endif | 1273 #endif |
1274 state_ = state; | 1274 state_ = state; |
1275 previous_ = Logger::current_state_; | 1275 previous_ = Logger::current_state_; |
1276 Logger::current_state_ = this; | 1276 Logger::current_state_ = this; |
1277 | 1277 |
1278 if (FLAG_log_state_changes) { | 1278 if (FLAG_log_state_changes) { |
1279 LOG(UncheckedStringEvent("Entering", StateToString(state_))); | 1279 LOG(UncheckedStringEvent("Entering", StateToString(state_))); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 } else if (previous_->state_ == EXTERNAL) { | 1316 } else if (previous_->state_ == EXTERNAL) { |
1317 // We are leaving V8. | 1317 // We are leaving V8. |
1318 Heap::Protect(); | 1318 Heap::Protect(); |
1319 } | 1319 } |
1320 } | 1320 } |
1321 #endif | 1321 #endif |
1322 } | 1322 } |
1323 #endif | 1323 #endif |
1324 | 1324 |
1325 } } // namespace v8::internal | 1325 } } // namespace v8::internal |
OLD | NEW |