| Index: src/frames.h
|
| diff --git a/src/frames.h b/src/frames.h
|
| index a1e438c6943494684ced2512f82f4ea78f598cfe..c0fe3b07a96376f3921e2b089bad8004cbf9a6af 100644
|
| --- a/src/frames.h
|
| +++ b/src/frames.h
|
| @@ -112,7 +112,8 @@ class StackHandler BASE_EMBEDDED {
|
| V(INTERNAL, InternalFrame) \
|
| V(CONSTRUCT, ConstructFrame) \
|
| V(ARGUMENTS_ADAPTOR, ArgumentsAdaptorFrame) \
|
| - V(BUILTIN, BuiltinFrame)
|
| + V(BUILTIN, BuiltinFrame) \
|
| + V(BUILTIN_EXIT, BuiltinExitFrame)
|
|
|
| // Every pointer in a frame has a slot id. On 32-bit platforms, doubles consume
|
| // two slots.
|
| @@ -426,6 +427,7 @@ class StackFrame BASE_EMBEDDED {
|
| return type() == STUB_FAILURE_TRAMPOLINE;
|
| }
|
| bool is_construct() const { return type() == CONSTRUCT; }
|
| + bool is_builtin_exit() const { return type() == BUILTIN_EXIT; }
|
| virtual bool is_standard() const { return false; }
|
|
|
| bool is_java_script() const {
|
| @@ -630,6 +632,7 @@ class ExitFrame: public StackFrame {
|
| // iterator and the frames following entry frames.
|
| static Type GetStateForFramePointer(Address fp, State* state);
|
| static Address ComputeStackPointer(Address fp);
|
| + static StackFrame::Type ComputeFrameType(Address fp);
|
| static void FillState(Address fp, Address sp, State* state);
|
|
|
| protected:
|
| @@ -643,6 +646,33 @@ class ExitFrame: public StackFrame {
|
| friend class StackFrameIteratorBase;
|
| };
|
|
|
| +// Builtin exit frames are a special case of exit frames, which are used
|
| +// whenever C++ builtins (e.g., Math.acos) are called. Their main purpose is
|
| +// to allow such builtins to appear in stack traces.
|
| +class BuiltinExitFrame : public ExitFrame {
|
| + public:
|
| + Type type() const override { return BUILTIN_EXIT; }
|
| +
|
| + static BuiltinExitFrame* cast(StackFrame* frame) {
|
| + DCHECK(frame->is_builtin_exit());
|
| + return static_cast<BuiltinExitFrame*>(frame);
|
| + }
|
| +
|
| + virtual JSFunction* function() const;
|
| +
|
| + protected:
|
| + inline explicit BuiltinExitFrame(StackFrameIteratorBase* iterator);
|
| +
|
| + private:
|
| + // The function is stored after the original args for every builtin
|
| + // exit frame.
|
| + static const int kFunctionOffset = 3 * kPointerSize;
|
| +
|
| + inline Object* function_slot_object() const;
|
| +
|
| + friend class StackFrameIteratorBase;
|
| +};
|
| +
|
| class JavaScriptFrame;
|
|
|
| class FrameSummary BASE_EMBEDDED {
|
| @@ -1199,8 +1229,10 @@ class StackTraceFrameIterator BASE_EMBEDDED {
|
|
|
| inline bool is_javascript() const;
|
| inline bool is_wasm() const;
|
| + inline bool is_builtin_exit() const;
|
| inline JavaScriptFrame* javascript_frame() const;
|
| inline WasmFrame* wasm_frame() const;
|
| + inline BuiltinExitFrame* builtin_exit_frame() const;
|
|
|
| private:
|
| StackFrameIterator iterator_;
|
|
|