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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 void StackTraceFrameIterator::Advance() { | 170 void StackTraceFrameIterator::Advance() { |
171 do { | 171 do { |
172 iterator_.Advance(); | 172 iterator_.Advance(); |
173 } while (!done() && !IsValidFrame(iterator_.frame())); | 173 } while (!done() && !IsValidFrame(iterator_.frame())); |
174 } | 174 } |
175 | 175 |
176 bool StackTraceFrameIterator::IsValidFrame(StackFrame* frame) const { | 176 bool StackTraceFrameIterator::IsValidFrame(StackFrame* frame) const { |
177 if (frame->is_java_script()) { | 177 if (frame->is_java_script()) { |
178 JavaScriptFrame* jsFrame = static_cast<JavaScriptFrame*>(frame); | 178 JavaScriptFrame* jsFrame = static_cast<JavaScriptFrame*>(frame); |
179 if (!jsFrame->function()->IsJSFunction()) return false; | 179 if (!jsFrame->function()->IsJSFunction()) return false; |
180 Object* script = jsFrame->function()->shared()->script(); | 180 return jsFrame->function()->shared()->IsSubjectToDebugging(); |
181 // Don't show functions from native scripts to user. | |
182 return (script->IsScript() && | |
183 Script::TYPE_NATIVE != Script::cast(script)->type()); | |
184 } | 181 } |
185 // apart from javascript, only wasm is valid | 182 // apart from javascript, only wasm is valid |
186 return frame->is_wasm(); | 183 return frame->is_wasm(); |
187 } | 184 } |
188 | 185 |
189 void StackTraceFrameIterator::AdvanceToArgumentsFrame() { | 186 void StackTraceFrameIterator::AdvanceToArgumentsFrame() { |
190 if (!is_javascript() || !javascript_frame()->has_adapted_arguments()) return; | 187 if (!is_javascript() || !javascript_frame()->has_adapted_arguments()) return; |
191 iterator_.Advance(); | 188 iterator_.Advance(); |
192 DCHECK(iterator_.frame()->is_arguments_adaptor()); | 189 DCHECK(iterator_.frame()->is_arguments_adaptor()); |
193 } | 190 } |
(...skipping 1776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1970 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1967 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
1971 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1968 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
1972 list.Add(frame, zone); | 1969 list.Add(frame, zone); |
1973 } | 1970 } |
1974 return list.ToVector(); | 1971 return list.ToVector(); |
1975 } | 1972 } |
1976 | 1973 |
1977 | 1974 |
1978 } // namespace internal | 1975 } // namespace internal |
1979 } // namespace v8 | 1976 } // namespace v8 |
OLD | NEW |