OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #include "src/profiler/tick-sample.h" | 5 #include "src/profiler/tick-sample.h" |
6 | 6 |
7 #include "src/frames-inl.h" | 7 #include "src/frames-inl.h" |
8 #include "src/vm-state-inl.h" | 8 #include "src/vm-state-inl.h" |
9 | 9 |
10 | 10 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // is not the top function. | 140 // is not the top function. |
141 if (scope && scope->scope_address() < handler) { | 141 if (scope && scope->scope_address() < handler) { |
142 sample_info->external_callback_entry = | 142 sample_info->external_callback_entry = |
143 *scope->callback_entrypoint_address(); | 143 *scope->callback_entrypoint_address(); |
144 } | 144 } |
145 | 145 |
146 SafeStackFrameIterator it(isolate, reinterpret_cast<Address>(regs.fp), | 146 SafeStackFrameIterator it(isolate, reinterpret_cast<Address>(regs.fp), |
147 reinterpret_cast<Address>(regs.sp), js_entry_sp); | 147 reinterpret_cast<Address>(regs.sp), js_entry_sp); |
148 size_t i = 0; | 148 size_t i = 0; |
149 if (record_c_entry_frame == kIncludeCEntryFrame && !it.done() && | 149 if (record_c_entry_frame == kIncludeCEntryFrame && !it.done() && |
150 (it.top_frame_type() == StackFrame::EXIT || | 150 it.top_frame_type() == StackFrame::EXIT) { |
151 it.top_frame_type() == StackFrame::BUILTIN_EXIT)) { | |
152 frames[i++] = isolate->c_function(); | 151 frames[i++] = isolate->c_function(); |
153 } | 152 } |
154 while (!it.done() && i < frames_limit) { | 153 while (!it.done() && i < frames_limit) { |
155 if (it.frame()->is_interpreted()) { | 154 if (it.frame()->is_interpreted()) { |
156 // For interpreted frames use the bytecode array pointer as the pc. | 155 // For interpreted frames use the bytecode array pointer as the pc. |
157 InterpretedFrame* frame = static_cast<InterpretedFrame*>(it.frame()); | 156 InterpretedFrame* frame = static_cast<InterpretedFrame*>(it.frame()); |
158 // Since the sampler can interrupt execution at any point the | 157 // Since the sampler can interrupt execution at any point the |
159 // bytecode_array might be garbage, so don't dereference it. | 158 // bytecode_array might be garbage, so don't dereference it. |
160 Address bytecode_array = | 159 Address bytecode_array = |
161 reinterpret_cast<Address>(frame->GetBytecodeArray()) - kHeapObjectTag; | 160 reinterpret_cast<Address>(frame->GetBytecodeArray()) - kHeapObjectTag; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 // it is not guaranteed to be atomic even when both host and target | 218 // it is not guaranteed to be atomic even when both host and target |
220 // are of same bitness. | 219 // are of same bitness. |
221 return false; | 220 return false; |
222 } | 221 } |
223 return true; | 222 return true; |
224 } | 223 } |
225 #endif // USE_SIMULATOR | 224 #endif // USE_SIMULATOR |
226 | 225 |
227 } // namespace internal | 226 } // namespace internal |
228 } // namespace v8 | 227 } // namespace v8 |
OLD | NEW |