| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/frames.h" | 5 #include "src/frames.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 | 9 |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 STACK_FRAME_TYPE_LIST(FRAME_TYPE_CASE) | 124 STACK_FRAME_TYPE_LIST(FRAME_TYPE_CASE) |
| 125 default: break; | 125 default: break; |
| 126 } | 126 } |
| 127 return NULL; | 127 return NULL; |
| 128 | 128 |
| 129 #undef FRAME_TYPE_CASE | 129 #undef FRAME_TYPE_CASE |
| 130 } | 130 } |
| 131 | 131 |
| 132 // ------------------------------------------------------------------------- | 132 // ------------------------------------------------------------------------- |
| 133 | 133 |
| 134 JavaScriptFrameIterator::JavaScriptFrameIterator(Isolate* isolate, | |
| 135 StackFrame::Id id) | |
| 136 : iterator_(isolate) { | |
| 137 while (!done()) { | |
| 138 Advance(); | |
| 139 if (frame()->id() == id) return; | |
| 140 } | |
| 141 } | |
| 142 | |
| 143 | |
| 144 void JavaScriptFrameIterator::Advance() { | 134 void JavaScriptFrameIterator::Advance() { |
| 145 do { | 135 do { |
| 146 iterator_.Advance(); | 136 iterator_.Advance(); |
| 147 } while (!iterator_.done() && !iterator_.frame()->is_java_script()); | 137 } while (!iterator_.done() && !iterator_.frame()->is_java_script()); |
| 148 } | 138 } |
| 149 | 139 |
| 150 | 140 |
| 151 void JavaScriptFrameIterator::AdvanceToArgumentsFrame() { | 141 void JavaScriptFrameIterator::AdvanceToArgumentsFrame() { |
| 152 if (!frame()->has_adapted_arguments()) return; | 142 if (!frame()->has_adapted_arguments()) return; |
| 153 iterator_.Advance(); | 143 iterator_.Advance(); |
| (...skipping 2083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2237 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 2227 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
| 2238 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 2228 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
| 2239 list.Add(frame, zone); | 2229 list.Add(frame, zone); |
| 2240 } | 2230 } |
| 2241 return list.ToVector(); | 2231 return list.ToVector(); |
| 2242 } | 2232 } |
| 2243 | 2233 |
| 2244 | 2234 |
| 2245 } // namespace internal | 2235 } // namespace internal |
| 2246 } // namespace v8 | 2236 } // namespace v8 |
| OLD | NEW |