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

Side by Side Diff: src/vm-state-inl.h

Issue 1695733002: [counters] Making counter properly reentrant. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@2016-02-09_recursive_counters_1681943002
Patch Set: Created 4 years, 10 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
« src/counters.cc ('K') | « src/counters.cc ('k') | 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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_VM_STATE_INL_H_ 5 #ifndef V8_VM_STATE_INL_H_
6 #define V8_VM_STATE_INL_H_ 6 #define V8_VM_STATE_INL_H_
7 7
8 #include "src/vm-state.h" 8 #include "src/vm-state.h"
9 #include "src/log.h" 9 #include "src/log.h"
10 #include "src/simulator.h" 10 #include "src/simulator.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 48
49 template <StateTag Tag> 49 template <StateTag Tag>
50 VMState<Tag>::~VMState() { 50 VMState<Tag>::~VMState() {
51 if (FLAG_log_timer_events && previous_tag_ != EXTERNAL && Tag == EXTERNAL) { 51 if (FLAG_log_timer_events && previous_tag_ != EXTERNAL && Tag == EXTERNAL) {
52 LOG(isolate_, TimerEvent(Logger::END, TimerEventExternal::name())); 52 LOG(isolate_, TimerEvent(Logger::END, TimerEventExternal::name()));
53 } 53 }
54 isolate_->set_current_vm_state(previous_tag_); 54 isolate_->set_current_vm_state(previous_tag_);
55 } 55 }
56 56
57 ExternalCallbackScope::ExternalCallbackScope(Isolate* isolate, Address callback)
57 58
Jarin 2016/02/13 19:28:20 Nit: Extra newline?
58 ExternalCallbackScope::ExternalCallbackScope(Isolate* isolate, Address callback)
59 : isolate_(isolate), 59 : isolate_(isolate),
60 callback_(callback), 60 callback_(callback),
61 previous_scope_(isolate->external_callback_scope()) { 61 previous_scope_(isolate->external_callback_scope()) {
62 #ifdef USE_SIMULATOR 62 #ifdef USE_SIMULATOR
63 scope_address_ = Simulator::current(isolate)->get_sp(); 63 scope_address_ = Simulator::current(isolate)->get_sp();
64 #endif 64 #endif
65 isolate_->set_external_callback_scope(this); 65 isolate_->set_external_callback_scope(this);
66 if (FLAG_runtime_call_stats) {
67 RuntimeCallStats* stats = isolate_->counters()->runtime_call_stats();
68 stats->Enter(&stats->RuntimeCallbacks);
69 }
66 } 70 }
67 71
68 ExternalCallbackScope::~ExternalCallbackScope() { 72 ExternalCallbackScope::~ExternalCallbackScope() {
73 if (FLAG_runtime_call_stats) {
74 isolate_->counters()->runtime_call_stats()->Leave();
75 }
69 isolate_->set_external_callback_scope(previous_scope_); 76 isolate_->set_external_callback_scope(previous_scope_);
70 } 77 }
71 78
72 Address ExternalCallbackScope::scope_address() { 79 Address ExternalCallbackScope::scope_address() {
73 #ifdef USE_SIMULATOR 80 #ifdef USE_SIMULATOR
74 return scope_address_; 81 return scope_address_;
75 #else 82 #else
76 return reinterpret_cast<Address>(this); 83 return reinterpret_cast<Address>(this);
77 #endif 84 #endif
78 } 85 }
79 86
80 87
81 } // namespace internal 88 } // namespace internal
82 } // namespace v8 89 } // namespace v8
83 90
84 #endif // V8_VM_STATE_INL_H_ 91 #endif // V8_VM_STATE_INL_H_
OLDNEW
« src/counters.cc ('K') | « src/counters.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698