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

Unified Diff: src/objects.h

Issue 2230953002: Use a custom Struct for stack trace storage (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tweaks Created 4 years, 4 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/messages.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 0432b83d9fdbc97b2f124ceaf6d9fc3244e89c14..5be622d7824fd93997b77dc7a0e869699c4c53bc 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -389,6 +389,7 @@ const int kStubMinorKeyBits = kSmiValueSize - kStubMajorKeyBits - 1;
V(ALLOCATION_MEMENTO_TYPE) \
V(ALLOCATION_SITE_TYPE) \
V(SCRIPT_TYPE) \
+ V(STACK_TRACE_FRAME_TYPE) \
V(TYPE_FEEDBACK_INFO_TYPE) \
V(ALIASED_ARGUMENTS_ENTRY_TYPE) \
V(BOX_TYPE) \
@@ -504,6 +505,7 @@ const int kStubMinorKeyBits = kSmiValueSize - kStubMajorKeyBits - 1;
V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \
V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \
V(SCRIPT, Script, script) \
+ V(STACK_TRACE_FRAME, StackTraceFrame, stack_trace_frame) \
V(ALLOCATION_SITE, AllocationSite, allocation_site) \
V(ALLOCATION_MEMENTO, AllocationMemento, allocation_memento) \
V(TYPE_FEEDBACK_INFO, TypeFeedbackInfo, type_feedback_info) \
@@ -675,6 +677,7 @@ enum InstanceType {
ALLOCATION_SITE_TYPE,
ALLOCATION_MEMENTO_TYPE,
SCRIPT_TYPE,
+ STACK_TRACE_FRAME_TYPE,
TYPE_FEEDBACK_INFO_TYPE,
ALIASED_ARGUMENTS_ENTRY_TYPE,
BOX_TYPE,
@@ -6504,7 +6507,6 @@ class Box : public Struct {
DISALLOW_IMPLICIT_CONSTRUCTORS(Box);
};
-
// Container for metadata stored on each prototype map.
class PrototypeInfo : public Struct {
public:
@@ -6789,6 +6791,88 @@ class Script: public Struct {
DISALLOW_IMPLICIT_CONSTRUCTORS(Script);
};
+class StackTraceFrame : public Struct {
+ public:
+ // --- Fields for JS and Wasm frames. ---
+
+ static const int kIsWasmFrame = 1 << 0;
+ static const int kForceConstructor = 1 << 1;
+ static const int kIsStrict = 1 << 2;
+
+ // [flags]
+ DECL_INT_ACCESSORS(flags)
+
+ // [abstract_code]
+ DECL_ACCESSORS(abstract_code, AbstractCode)
+
+ // [offset]
+ DECL_INT_ACCESSORS(offset)
+
+ // --- Fields for JS frames. ---
+
+ // [receiver]
+ DECL_ACCESSORS(receiver, Object)
+
+ // [function]
+ DECL_ACCESSORS(function, JSFunction)
+
+ // --- Fields for Wasm frames. ---
+
+ // [wasm_object]
+ DECL_ACCESSORS(wasm_object, Object)
+
+ // [wasm_function_index]
+ DECL_INT_ACCESSORS(wasm_function_index)
+
+ inline bool IsWasmFrame() const;
+ inline bool IsJavaScriptFrame() const;
+ inline bool IsStrict() const;
+ inline bool ForceConstructor() const;
+
+ Handle<Object> GetFileName();
+ Handle<Object> GetFunctionName();
+ Handle<Object> GetScriptNameOrSourceUrl();
+ Handle<Object> GetMethodName();
+ Handle<Object> GetTypeName();
+ Handle<Object> GetEvalOrigin();
+
+ int GetPosition();
+ // Return 1-based line number, including line offset.
+ int GetLineNumber();
+ // Return 1-based column number, including column offset if first line.
+ int GetColumnNumber();
+
+ bool IsNative();
+ bool IsToplevel();
+ bool IsEval();
+ bool IsConstructor();
+
+ Handle<String> ToString();
+
+ DECLARE_CAST(StackTraceFrame)
+
+ // Dispatched behavior.
+ DECLARE_PRINTER(StackTraceFrame)
+ DECLARE_VERIFIER(StackTraceFrame)
+
+ // Fields for all frame types.
+ static const int kFlagsOffset = HeapObject::kHeaderSize;
+ static const int kAbstractCodeOffset = kFlagsOffset + kPointerSize;
+ static const int kOffsetOffset = kAbstractCodeOffset + kPointerSize;
+
+ // Fields for JS frames.
+ static const int kReceiverOffset = kOffsetOffset + kPointerSize;
+ static const int kFunctionOffset = kReceiverOffset + kPointerSize;
+
+ // Fields for Wasm frames.
+ static const int kWasmObjectOffset = kOffsetOffset + kPointerSize;
+ static const int kWasmFunctionIndexOffset = kWasmObjectOffset + kPointerSize;
+
+ static const int kSize = kFunctionOffset + kPointerSize;
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(StackTraceFrame);
+};
// List of builtin functions we want to identify to improve code
// generation.
« no previous file with comments | « src/messages.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698