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

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

Issue 131363008: A64: Synchronize with r15922. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/vm-state.h ('k') | src/x64/assembler-x64.h » ('j') | 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 11 matching lines...) Expand all
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 #ifndef V8_VM_STATE_INL_H_ 28 #ifndef V8_VM_STATE_INL_H_
29 #define V8_VM_STATE_INL_H_ 29 #define V8_VM_STATE_INL_H_
30 30
31 #include "vm-state.h" 31 #include "vm-state.h"
32 #include "runtime-profiler.h" 32 #include "log.h"
33 #include "simulator.h"
33 34
34 namespace v8 { 35 namespace v8 {
35 namespace internal { 36 namespace internal {
36 37
37 // 38 //
38 // VMState class implementation. A simple stack of VM states held by the 39 // VMState class implementation. A simple stack of VM states held by the
39 // logger and partially threaded through the call stack. States are pushed by 40 // logger and partially threaded through the call stack. States are pushed by
40 // VMState construction and popped by destruction. 41 // VMState construction and popped by destruction.
41 // 42 //
42 inline const char* StateToString(StateTag state) { 43 inline const char* StateToString(StateTag state) {
(...skipping 30 matching lines...) Expand all
73 VMState<Tag>::~VMState() { 74 VMState<Tag>::~VMState() {
74 if (FLAG_log_timer_events && previous_tag_ != EXTERNAL && Tag == EXTERNAL) { 75 if (FLAG_log_timer_events && previous_tag_ != EXTERNAL && Tag == EXTERNAL) {
75 LOG(isolate_, 76 LOG(isolate_,
76 TimerEvent(Logger::END, Logger::TimerEventScope::v8_external)); 77 TimerEvent(Logger::END, Logger::TimerEventScope::v8_external));
77 } 78 }
78 isolate_->set_current_vm_state(previous_tag_); 79 isolate_->set_current_vm_state(previous_tag_);
79 } 80 }
80 81
81 82
82 ExternalCallbackScope::ExternalCallbackScope(Isolate* isolate, Address callback) 83 ExternalCallbackScope::ExternalCallbackScope(Isolate* isolate, Address callback)
83 : isolate_(isolate), previous_callback_(isolate->external_callback()) { 84 : isolate_(isolate),
84 isolate_->set_external_callback(callback); 85 callback_(callback),
86 previous_scope_(isolate->external_callback_scope()) {
87 #ifdef USE_SIMULATOR
88 #if V8_TARGET_ARCH_A64
89 scope_address_ = reinterpret_cast<Address>(Simulator::current(isolate)->sp());
90 #else
91 int32_t sp = Simulator::current(isolate)->get_register(Simulator::sp);
92 scope_address_ = reinterpret_cast<Address>(static_cast<intptr_t>(sp));
93 #endif
94 #endif
95 isolate_->set_external_callback_scope(this);
85 } 96 }
86 97
87 ExternalCallbackScope::~ExternalCallbackScope() { 98 ExternalCallbackScope::~ExternalCallbackScope() {
88 isolate_->set_external_callback(previous_callback_); 99 isolate_->set_external_callback_scope(previous_scope_);
100 }
101
102 Address ExternalCallbackScope::scope_address() {
103 #ifdef USE_SIMULATOR
104 return scope_address_;
105 #else
106 return reinterpret_cast<Address>(this);
107 #endif
89 } 108 }
90 109
91 110
92 } } // namespace v8::internal 111 } } // namespace v8::internal
93 112
94 #endif // V8_VM_STATE_INL_H_ 113 #endif // V8_VM_STATE_INL_H_
OLDNEW
« no previous file with comments | « src/vm-state.h ('k') | src/x64/assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698