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

Unified Diff: src/frames.h

Issue 7223: Introduce a special kind of frames for construct frames, e.g.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 2 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/builtins-ia32.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
===================================================================
--- src/frames.h (revision 483)
+++ src/frames.h (working copy)
@@ -98,6 +98,7 @@
V(EXIT_DEBUG, ExitDebugFrame) \
V(JAVA_SCRIPT, JavaScriptFrame) \
V(INTERNAL, InternalFrame) \
+ V(CONSTRUCT, ConstructFrame) \
V(ARGUMENTS_ADAPTOR, ArgumentsAdaptorFrame)
@@ -124,6 +125,7 @@
bool is_java_script() const { return type() == JAVA_SCRIPT; }
bool is_arguments_adaptor() const { return type() == ARGUMENTS_ADAPTOR; }
bool is_internal() const { return type() == INTERNAL; }
+ bool is_construct() const { return type() == CONSTRUCT; }
virtual bool is_standard() const { return false; }
// Accessors.
@@ -352,9 +354,9 @@
// an arguments adaptor frame.
static inline bool IsArgumentsAdaptorFrame(Address fp);
- // Determines if the standard frame for the given program counter is
- // a construct trampoline.
- static inline bool IsConstructTrampolineFrame(Address pc);
+ // Determines if the standard frame for the given frame pointer is a
+ // construct frame.
+ static inline bool IsConstructFrame(Address fp);
private:
friend class StackFrame;
@@ -380,9 +382,7 @@
// computed parameters count.
int GetProvidedParametersCount() const;
- // Check if this frame is a constructor frame invoked through
- // 'new'. The operation may involve digging through a few stack
- // frames to account for arguments adaptors.
+ // Check if this frame is a constructor frame invoked through 'new'.
bool IsConstructor() const;
// Check if this frame has "adapted" arguments in the sense that the
@@ -459,11 +459,6 @@
public:
virtual Type type() const { return INTERNAL; }
- // Returns if this frame is a special trampoline frame introduced by
- // the construct trampoline. NOTE: We should consider introducing a
- // special stack frame type for this.
- inline bool is_construct_trampoline() const;
-
// Garbage colletion support.
virtual void Iterate(ObjectVisitor* v) const;
@@ -486,6 +481,26 @@
};
+// Construct frames are special trampoline frames introduced to handle
+// function invocations through 'new'.
+class ConstructFrame: public InternalFrame {
+ public:
+ virtual Type type() const { return CONSTRUCT; }
+
+ static ConstructFrame* cast(StackFrame* frame) {
+ ASSERT(frame->is_construct());
+ return static_cast<ConstructFrame*>(frame);
+ }
+
+ protected:
+ explicit ConstructFrame(StackFrameIterator* iterator)
+ : InternalFrame(iterator) { }
+
+ private:
+ friend class StackFrameIterator;
+};
+
+
class StackFrameIterator BASE_EMBEDDED {
public:
// An iterator that iterates over the current thread's stack.
« no previous file with comments | « src/builtins-ia32.cc ('k') | src/frames.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698