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

Unified Diff: runtime/vm/stack_frame.cc

Issue 1411703004: Pass Thread into StackFrameIterator (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 | « runtime/vm/stack_frame.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stack_frame.cc
diff --git a/runtime/vm/stack_frame.cc b/runtime/vm/stack_frame.cc
index 4bb0858bee95c0f6f25f71b64efda5a0bcb972c7..4f27688b38e929c96578efa43e4ba1c5dde237b9 100644
--- a/runtime/vm/stack_frame.cc
+++ b/runtime/vm/stack_frame.cc
@@ -35,7 +35,7 @@ bool StackFrame::IsStubFrame() const {
const char* StackFrame::ToCString() const {
- ASSERT(isolate_ == Isolate::Current());
+ ASSERT(thread_ == Thread::Current());
Zone* zone = Thread::Current()->zone();
if (IsDartFrame()) {
const Code& code = Code::Handle(LookupDartCode());
@@ -68,7 +68,7 @@ void ExitFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) {
void EntryFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) {
- ASSERT(isolate() == Isolate::Current());
+ ASSERT(thread() == Thread::Current());
// Visit objects between SP and (FP - callee_save_area).
ASSERT(visitor != NULL);
RawObject** first = reinterpret_cast<RawObject**>(sp());
@@ -85,7 +85,7 @@ void StackFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) {
// these handles are not traversed. The use of handles is mainly to
// be able to reuse the handle based code and avoid having to add
// helper functions to the raw object interface.
- ASSERT(isolate_ == Isolate::Current());
+ ASSERT(thread() == Thread::Current());
ASSERT(visitor != NULL);
NoSafepointScope no_safepoint;
Code code;
@@ -165,7 +165,6 @@ void StackFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) {
RawFunction* StackFrame::LookupDartFunction() const {
- ASSERT(isolate_ == Isolate::Current());
const Code& code = Code::Handle(LookupDartCode());
if (!code.IsNull()) {
return code.function();
@@ -175,7 +174,6 @@ RawFunction* StackFrame::LookupDartFunction() const {
RawCode* StackFrame::LookupDartCode() const {
- ASSERT(isolate_ == Isolate::Current());
// We add a no gc scope to ensure that the code below does not trigger
// a GC as we are handling raw object references here. It is possible
// that the code is called while a GC is in progress, that is ok.
@@ -271,7 +269,8 @@ bool StackFrame::IsValid() const {
void StackFrameIterator::SetupLastExitFrameData() {
- uword exit_marker = Thread::Current()->top_exit_frame_info();
+ ASSERT(thread_ != NULL);
+ uword exit_marker = thread_->top_exit_frame_info();
srdjan 2015/10/20 21:33:47 Please sync with my temporary fix and remove Isola
Cutch 2015/10/20 21:39:01 Done.
frames_.fp_ = exit_marker;
}
@@ -294,28 +293,29 @@ static void UnpoisonStack(Isolate* isolate, uword fp) {
}
-StackFrameIterator::StackFrameIterator(bool validate, Isolate* isolate)
+StackFrameIterator::StackFrameIterator(bool validate,
+ Thread* thread)
srdjan 2015/10/20 21:33:47 One line.
Cutch 2015/10/20 21:39:01 Done.
: validate_(validate),
- entry_(isolate),
- exit_(isolate),
- frames_(isolate),
+ entry_(thread),
+ exit_(thread),
+ frames_(thread),
current_frame_(NULL),
- isolate_(isolate) {
- ASSERT((isolate_ == Isolate::Current()) ||
+ thread_(thread) {
+ ASSERT((thread_ == Thread::Current()) ||
OS::AllowStackFrameIteratorFromAnotherThread());
SetupLastExitFrameData(); // Setup data for last exit frame.
}
StackFrameIterator::StackFrameIterator(uword last_fp, bool validate,
- Isolate* isolate)
+ Thread* thread)
: validate_(validate),
- entry_(isolate),
- exit_(isolate),
- frames_(isolate),
+ entry_(thread),
+ exit_(thread),
+ frames_(thread),
current_frame_(NULL),
- isolate_(isolate) {
- ASSERT((isolate_ == Isolate::Current()) ||
+ thread_(thread) {
+ ASSERT((thread_ == Thread::Current()) ||
OS::AllowStackFrameIteratorFromAnotherThread());
frames_.fp_ = last_fp;
frames_.sp_ = 0;
@@ -324,14 +324,14 @@ StackFrameIterator::StackFrameIterator(uword last_fp, bool validate,
StackFrameIterator::StackFrameIterator(uword fp, uword sp, uword pc,
- bool validate, Isolate* isolate)
+ bool validate, Thread* thread)
: validate_(validate),
- entry_(isolate),
- exit_(isolate),
- frames_(isolate),
+ entry_(thread),
+ exit_(thread),
+ frames_(thread),
current_frame_(NULL),
- isolate_(isolate) {
- ASSERT((isolate_ == Isolate::Current()) ||
+ thread_(thread) {
+ ASSERT((thread_ == Thread::Current()) ||
OS::AllowStackFrameIteratorFromAnotherThread());
frames_.fp_ = fp;
frames_.sp_ = sp;
@@ -356,7 +356,7 @@ StackFrame* StackFrameIterator::NextFrame() {
if (!HasNextFrame()) {
return NULL;
}
- UnpoisonStack(isolate_, frames_.fp_);
+ UnpoisonStack(thread_->isolate(), frames_.fp_);
if (frames_.pc_ == 0) {
// Iteration starts from an exit frame given by its fp.
current_frame_ = NextExitFrame();
« no previous file with comments | « runtime/vm/stack_frame.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698