| 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 #ifndef V8_FRAMES_INL_H_ | 5 #ifndef V8_FRAMES_INL_H_ |
| 6 #define V8_FRAMES_INL_H_ | 6 #define V8_FRAMES_INL_H_ |
| 7 | 7 |
| 8 #include "src/frames.h" | 8 #include "src/frames.h" |
| 9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
| 10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 inline ArgumentsAdaptorFrame::ArgumentsAdaptorFrame( | 217 inline ArgumentsAdaptorFrame::ArgumentsAdaptorFrame( |
| 218 StackFrameIteratorBase* iterator) : JavaScriptFrame(iterator) { | 218 StackFrameIteratorBase* iterator) : JavaScriptFrame(iterator) { |
| 219 } | 219 } |
| 220 | 220 |
| 221 inline BuiltinFrame::BuiltinFrame(StackFrameIteratorBase* iterator) | 221 inline BuiltinFrame::BuiltinFrame(StackFrameIteratorBase* iterator) |
| 222 : JavaScriptFrame(iterator) {} | 222 : JavaScriptFrame(iterator) {} |
| 223 | 223 |
| 224 inline WasmFrame::WasmFrame(StackFrameIteratorBase* iterator) | 224 inline WasmFrame::WasmFrame(StackFrameIteratorBase* iterator) |
| 225 : StandardFrame(iterator) {} | 225 : StandardFrame(iterator) {} |
| 226 | 226 |
| 227 inline WasmCompiledFrame::WasmCompiledFrame(StackFrameIteratorBase* iterator) |
| 228 : WasmFrame(iterator) {} |
| 229 |
| 230 inline WasmInterpretedFrame::WasmInterpretedFrame( |
| 231 StackFrameIteratorBase* iterator) |
| 232 : WasmFrame(iterator) {} |
| 233 |
| 227 inline WasmToJsFrame::WasmToJsFrame(StackFrameIteratorBase* iterator) | 234 inline WasmToJsFrame::WasmToJsFrame(StackFrameIteratorBase* iterator) |
| 228 : StubFrame(iterator) {} | 235 : StubFrame(iterator) {} |
| 229 | 236 |
| 230 inline JsToWasmFrame::JsToWasmFrame(StackFrameIteratorBase* iterator) | 237 inline JsToWasmFrame::JsToWasmFrame(StackFrameIteratorBase* iterator) |
| 231 : StubFrame(iterator) {} | 238 : StubFrame(iterator) {} |
| 232 | 239 |
| 233 inline InternalFrame::InternalFrame(StackFrameIteratorBase* iterator) | 240 inline InternalFrame::InternalFrame(StackFrameIteratorBase* iterator) |
| 234 : StandardFrame(iterator) { | 241 : StandardFrame(iterator) { |
| 235 } | 242 } |
| 236 | 243 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 262 // the JavaScript frame type, because we may encounter arguments | 269 // the JavaScript frame type, because we may encounter arguments |
| 263 // adaptor frames. | 270 // adaptor frames. |
| 264 StackFrame* frame = iterator_.frame(); | 271 StackFrame* frame = iterator_.frame(); |
| 265 DCHECK(frame->is_java_script() || frame->is_arguments_adaptor()); | 272 DCHECK(frame->is_java_script() || frame->is_arguments_adaptor()); |
| 266 return static_cast<JavaScriptFrame*>(frame); | 273 return static_cast<JavaScriptFrame*>(frame); |
| 267 } | 274 } |
| 268 | 275 |
| 269 inline StandardFrame* StackTraceFrameIterator::frame() const { | 276 inline StandardFrame* StackTraceFrameIterator::frame() const { |
| 270 StackFrame* frame = iterator_.frame(); | 277 StackFrame* frame = iterator_.frame(); |
| 271 DCHECK(frame->is_java_script() || frame->is_arguments_adaptor() || | 278 DCHECK(frame->is_java_script() || frame->is_arguments_adaptor() || |
| 272 frame->is_wasm()); | 279 frame->is_wasm_compiled() || frame->is_wasm_interpreted()); |
| 273 return static_cast<StandardFrame*>(frame); | 280 return static_cast<StandardFrame*>(frame); |
| 274 } | 281 } |
| 275 | 282 |
| 276 bool StackTraceFrameIterator::is_javascript() const { | 283 bool StackTraceFrameIterator::is_javascript() const { |
| 277 return frame()->is_java_script(); | 284 return frame()->is_java_script(); |
| 278 } | 285 } |
| 279 | 286 |
| 280 bool StackTraceFrameIterator::is_wasm() const { return frame()->is_wasm(); } | 287 bool StackTraceFrameIterator::is_wasm() const { return frame()->is_wasm(); } |
| 281 | 288 |
| 282 JavaScriptFrame* StackTraceFrameIterator::javascript_frame() const { | 289 JavaScriptFrame* StackTraceFrameIterator::javascript_frame() const { |
| 283 DCHECK(is_javascript()); | 290 DCHECK(is_javascript()); |
| 284 return static_cast<JavaScriptFrame*>(frame()); | 291 return static_cast<JavaScriptFrame*>(frame()); |
| 285 } | 292 } |
| 286 | 293 |
| 287 WasmFrame* StackTraceFrameIterator::wasm_frame() const { | 294 WasmFrame* StackTraceFrameIterator::wasm_frame() const { |
| 288 DCHECK(is_wasm()); | 295 DCHECK(is_wasm()); |
| 289 return static_cast<WasmFrame*>(frame()); | 296 return static_cast<WasmFrame*>(frame()); |
| 290 } | 297 } |
| 291 | 298 |
| 292 inline StackFrame* SafeStackFrameIterator::frame() const { | 299 inline StackFrame* SafeStackFrameIterator::frame() const { |
| 293 DCHECK(!done()); | 300 DCHECK(!done()); |
| 294 DCHECK(frame_->is_java_script() || frame_->is_exit()); | 301 DCHECK(frame_->is_java_script() || frame_->is_exit()); |
| 295 return frame_; | 302 return frame_; |
| 296 } | 303 } |
| 297 | 304 |
| 305 inline Handle<Object> FrameSummary::receiver() { |
| 306 DCHECK(is_javascript()); |
| 307 return receiver_; |
| 308 } |
| 309 |
| 310 Handle<Object> FrameSummary::wasm_object() { |
| 311 DCHECK(is_wasm()); |
| 312 return receiver_; |
| 313 } |
| 314 |
| 315 Handle<JSFunction> FrameSummary::function() { |
| 316 DCHECK(is_javascript()); |
| 317 return Handle<JSFunction>::cast(function_); |
| 318 } |
| 319 |
| 320 int FrameSummary::wasm_function_index() { |
| 321 DCHECK(is_wasm()); |
| 322 return Smi::cast(*function_)->value(); |
| 323 } |
| 324 |
| 325 bool FrameSummary::is_subject_to_debugging() { |
| 326 return is_wasm() || function()->shared()->IsSubjectToDebugging(); |
| 327 } |
| 298 | 328 |
| 299 } // namespace internal | 329 } // namespace internal |
| 300 } // namespace v8 | 330 } // namespace v8 |
| 301 | 331 |
| 302 #endif // V8_FRAMES_INL_H_ | 332 #endif // V8_FRAMES_INL_H_ |
| OLD | NEW |