Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Unified Diff: src/frames.h

Issue 2090723005: [builtins] New frame type for exits to C++ builtins (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add missing condition in SafeStackFrameIter::frame() Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/external-reference-table.cc ('k') | src/frames.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/frames.h
diff --git a/src/frames.h b/src/frames.h
index a1e438c6943494684ced2512f82f4ea78f598cfe..cb786202dff880152f419bbe754b5503e9e476a6 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.
@@ -323,6 +324,12 @@ class StubFailureTrampolineFrameConstants : public InternalFrameConstants {
DEFINE_TYPED_FRAME_SIZES(3);
};
+// Behaves like an exit frame but with target and new target args.
+class BuiltinExitFrameConstants : public CommonFrameConstants {
+ public:
+ static const int kNewTargetOffset = kCallerPCOffset + 1 * kPointerSize;
+ static const int kTargetOffset = kNewTargetOffset + 1 * kPointerSize;
+};
class InterpreterFrameConstants : public AllStatic {
public:
@@ -426,6 +433,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 +638,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 +652,29 @@ 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:
+ inline Object* function_slot_object() const;
+
+ friend class StackFrameIteratorBase;
+};
+
class JavaScriptFrame;
class FrameSummary BASE_EMBEDDED {
« no previous file with comments | « src/external-reference-table.cc ('k') | src/frames.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698