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

Unified Diff: src/frames.h

Issue 6800012: Version 3.2.8... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 9 years, 8 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/execution.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 7511)
+++ src/frames.h (working copy)
@@ -158,10 +158,12 @@
Address* pc_address;
};
- // Copy constructor; it breaks the connection to host iterator.
+ // Copy constructor; it breaks the connection to host iterator
+ // (as an iterator usually lives on stack).
StackFrame(const StackFrame& original) {
this->state_ = original.state_;
this->iterator_ = NULL;
+ this->isolate_ = original.isolate_;
}
// Type testers.
@@ -205,8 +207,8 @@
virtual Code* unchecked_code() const = 0;
// Get the code associated with this frame.
- Code* LookupCode(Isolate* isolate) const {
- return GetContainingCode(isolate, pc());
+ Code* LookupCode() const {
+ return GetContainingCode(isolate(), pc());
}
// Get the code object that contains the given pc.
@@ -215,7 +217,8 @@
// Get the code object containing the given pc and fill in the
// safepoint entry and the number of stack slots. The pc must be at
// a safepoint.
- static Code* GetSafepointData(Address pc,
+ static Code* GetSafepointData(Isolate* isolate,
+ Address pc,
SafepointEntry* safepoint_entry,
unsigned* stack_slots);
@@ -230,9 +233,11 @@
int index) const { }
protected:
- explicit StackFrame(StackFrameIterator* iterator) : iterator_(iterator) { }
+ inline explicit StackFrame(StackFrameIterator* iterator);
virtual ~StackFrame() { }
+ Isolate* isolate() const { return isolate_; }
+
// Compute the stack pointer for the calling frame.
virtual Address GetCallerStackPointer() const = 0;
@@ -245,10 +250,11 @@
inline StackHandler* top_handler() const;
// Compute the stack frame type for the given state.
- static Type ComputeType(State* state);
+ static Type ComputeType(Isolate* isolate, State* state);
private:
const StackFrameIterator* iterator_;
+ Isolate* isolate_;
State state_;
// Fill in the state of the calling frame.
@@ -257,6 +263,8 @@
// Get the type and the state of the calling frame.
virtual Type GetCallerState(State* state) const;
+ static const intptr_t kIsolateTag = 1;
+
friend class StackFrameIterator;
friend class StackHandlerIterator;
friend class SafeStackFrameIterator;
@@ -609,11 +617,15 @@
class StackFrameIterator BASE_EMBEDDED {
public:
- // An iterator that iterates over the current thread's stack.
+ // An iterator that iterates over the current thread's stack,
+ // and uses current isolate.
StackFrameIterator();
+ // An iterator that iterates over the isolate's current thread's stack,
+ explicit StackFrameIterator(Isolate* isolate);
+
// An iterator that iterates over a given thread's stack.
- explicit StackFrameIterator(ThreadLocalTop* thread);
+ StackFrameIterator(Isolate* isolate, ThreadLocalTop* t);
// An iterator that can start from a given FP address.
// If use_top, then work as usual, if fp isn't NULL, use it,
@@ -625,6 +637,8 @@
return frame_;
}
+ Isolate* isolate() const { return isolate_; }
+
bool done() const { return frame_ == NULL; }
void Advance() { (this->*advance_)(); }
@@ -632,6 +646,7 @@
void Reset();
private:
+ Isolate* isolate_;
#define DECLARE_SINGLETON(ignore, type) type type##_;
STACK_FRAME_TYPE_LIST(DECLARE_SINGLETON)
#undef DECLARE_SINGLETON
@@ -667,14 +682,13 @@
public:
JavaScriptFrameIteratorTemp() { if (!done()) Advance(); }
- explicit JavaScriptFrameIteratorTemp(ThreadLocalTop* thread) :
- iterator_(thread) {
- if (!done()) Advance();
- }
+ inline explicit JavaScriptFrameIteratorTemp(Isolate* isolate);
// Skip frames until the frame with the given id is reached.
- explicit JavaScriptFrameIteratorTemp(StackFrame::Id id);
+ explicit JavaScriptFrameIteratorTemp(StackFrame::Id id) { AdvanceToId(id); }
+ inline JavaScriptFrameIteratorTemp(Isolate* isolate, StackFrame::Id id);
+
JavaScriptFrameIteratorTemp(Address fp, Address sp,
Address low_bound, Address high_bound) :
iterator_(fp, sp, low_bound, high_bound) {
@@ -702,6 +716,8 @@
void Reset();
private:
+ inline void AdvanceToId(StackFrame::Id id);
+
Iterator iterator_;
};
@@ -716,6 +732,7 @@
class StackTraceFrameIterator: public JavaScriptFrameIterator {
public:
StackTraceFrameIterator();
+ explicit StackTraceFrameIterator(Isolate* isolate);
void Advance();
private:
@@ -739,7 +756,7 @@
void Advance();
void Reset();
- static bool is_active() { return active_count_ > 0; }
+ static bool is_active(Isolate* isolate);
static bool IsWithinBounds(
Address low_bound, Address high_bound, Address addr) {
@@ -786,13 +803,13 @@
// heap objects.
class ActiveCountMaintainer BASE_EMBEDDED {
public:
- ActiveCountMaintainer() { active_count_++; }
- ~ActiveCountMaintainer() { active_count_--; }
+ explicit ActiveCountMaintainer(Isolate* isolate);
+ ~ActiveCountMaintainer();
+ private:
+ Isolate* isolate_;
};
ActiveCountMaintainer maintainer_;
- // TODO(isolates): this is dangerous.
- static int active_count_;
StackAddressValidator stack_validator_;
const bool is_valid_top_;
const bool is_valid_fp_;
« no previous file with comments | « src/execution.cc ('k') | src/frames.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698