| OLD | NEW |
| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } | 60 } |
| 61 | 61 |
| 62 | 62 |
| 63 VMState::VMState(Isolate* isolate, StateTag tag) | 63 VMState::VMState(Isolate* isolate, StateTag tag) |
| 64 : isolate_(isolate), previous_tag_(isolate->current_vm_state()) { | 64 : isolate_(isolate), previous_tag_(isolate->current_vm_state()) { |
| 65 if (FLAG_log_state_changes) { | 65 if (FLAG_log_state_changes) { |
| 66 LOG(isolate, UncheckedStringEvent("Entering", StateToString(tag))); | 66 LOG(isolate, UncheckedStringEvent("Entering", StateToString(tag))); |
| 67 LOG(isolate, UncheckedStringEvent("From", StateToString(previous_tag_))); | 67 LOG(isolate, UncheckedStringEvent("From", StateToString(previous_tag_))); |
| 68 } | 68 } |
| 69 | 69 |
| 70 if (FLAG_log_timer_events) { |
| 71 LOG(isolate, ExternalSwitch(previous_tag_, tag)); |
| 72 } |
| 73 |
| 70 isolate_->SetCurrentVMState(tag); | 74 isolate_->SetCurrentVMState(tag); |
| 71 } | 75 } |
| 72 | 76 |
| 73 | 77 |
| 74 VMState::~VMState() { | 78 VMState::~VMState() { |
| 75 if (FLAG_log_state_changes) { | 79 if (FLAG_log_state_changes) { |
| 76 LOG(isolate_, | 80 LOG(isolate_, |
| 77 UncheckedStringEvent("Leaving", | 81 UncheckedStringEvent("Leaving", |
| 78 StateToString(isolate_->current_vm_state()))); | 82 StateToString(isolate_->current_vm_state()))); |
| 79 LOG(isolate_, | 83 LOG(isolate_, |
| 80 UncheckedStringEvent("To", StateToString(previous_tag_))); | 84 UncheckedStringEvent("To", StateToString(previous_tag_))); |
| 81 } | 85 } |
| 82 | 86 |
| 87 if (FLAG_log_timer_events) { |
| 88 LOG(isolate_, ExternalSwitch(isolate_->current_vm_state(), previous_tag_)); |
| 89 } |
| 90 |
| 83 isolate_->SetCurrentVMState(previous_tag_); | 91 isolate_->SetCurrentVMState(previous_tag_); |
| 84 } | 92 } |
| 85 | 93 |
| 86 | 94 |
| 87 ExternalCallbackScope::ExternalCallbackScope(Isolate* isolate, Address callback) | 95 ExternalCallbackScope::ExternalCallbackScope(Isolate* isolate, Address callback) |
| 88 : isolate_(isolate), previous_callback_(isolate->external_callback()) { | 96 : isolate_(isolate), previous_callback_(isolate->external_callback()) { |
| 89 isolate_->set_external_callback(callback); | 97 isolate_->set_external_callback(callback); |
| 90 } | 98 } |
| 91 | 99 |
| 92 ExternalCallbackScope::~ExternalCallbackScope() { | 100 ExternalCallbackScope::~ExternalCallbackScope() { |
| 93 isolate_->set_external_callback(previous_callback_); | 101 isolate_->set_external_callback(previous_callback_); |
| 94 } | 102 } |
| 95 | 103 |
| 96 | 104 |
| 97 } } // namespace v8::internal | 105 } } // namespace v8::internal |
| 98 | 106 |
| 99 #endif // V8_VM_STATE_INL_H_ | 107 #endif // V8_VM_STATE_INL_H_ |
| OLD | NEW |