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

Unified Diff: runtime/vm/stack_frame.cc

Issue 1858283002: Initial SIMDBC interpreter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 | « runtime/vm/stack_frame.h ('k') | runtime/vm/stack_frame_dbc.h » ('j') | 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 ebfe69ef7a39f9ecfccec78c91a2b7598bfc0eab..aac196b171d3fe197c0b02e68bf0f820d74aa89c 100644
--- a/runtime/vm/stack_frame.cc
+++ b/runtime/vm/stack_frame.cc
@@ -69,6 +69,7 @@ void ExitFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) {
void EntryFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) {
+#if !defined(TARGET_ARCH_DBC)
ASSERT(thread() == Thread::Current());
// Visit objects between SP and (FP - callee_save_area).
ASSERT(visitor != NULL);
@@ -76,10 +77,17 @@ void EntryFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) {
RawObject** last = reinterpret_cast<RawObject**>(
fp() + (kExitLinkSlotFromEntryFp - 1) * kWordSize);
visitor->VisitPointers(first, last);
+#else
+ // On DBC stack is growing upwards which implies fp() <= sp().
+ RawObject** first = reinterpret_cast<RawObject**>(fp());
+ RawObject** last = reinterpret_cast<RawObject**>(sp());
+ visitor->VisitPointers(first, last);
+#endif
}
void StackFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) {
+#if !defined(TARGET_ARCH_DBC)
// NOTE: This code runs while GC is in progress and runs within
// a NoHandleScope block. Hence it is not ok to use regular Zone or
// Scope handles. We use direct stack handles, the raw pointers in
@@ -159,6 +167,13 @@ void StackFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) {
RawObject** last = reinterpret_cast<RawObject**>(
fp() + (kFirstObjectSlotFromFp * kWordSize));
visitor->VisitPointers(first, last);
+#else
+ // On DBC stack grows upwards: fp() <= sp().
+ RawObject** first = reinterpret_cast<RawObject**>(
+ fp() + (kFirstObjectSlotFromFp * kWordSize));
+ RawObject** last = reinterpret_cast<RawObject**>(sp());
+ visitor->VisitPointers(first, last);
+#endif // !defined(TARGET_ARCH_DBC)
}
@@ -319,6 +334,7 @@ StackFrameIterator::StackFrameIterator(uword last_fp, bool validate,
}
+#if !defined(TARGET_ARCH_DBC)
StackFrameIterator::StackFrameIterator(uword fp, uword sp, uword pc,
bool validate, Thread* thread)
: validate_(validate),
@@ -333,6 +349,7 @@ StackFrameIterator::StackFrameIterator(uword fp, uword sp, uword pc,
frames_.sp_ = sp;
frames_.pc_ = pc;
}
+#endif
StackFrame* StackFrameIterator::NextFrame() {
@@ -353,6 +370,7 @@ StackFrame* StackFrameIterator::NextFrame() {
return NULL;
}
UnpoisonStack(frames_.fp_);
+#if !defined(TARGET_ARCH_DBC)
if (frames_.pc_ == 0) {
// Iteration starts from an exit frame given by its fp.
current_frame_ = NextExitFrame();
@@ -364,6 +382,12 @@ StackFrame* StackFrameIterator::NextFrame() {
// Iteration starts from a Dart or stub frame given by its fp, sp, and pc.
current_frame_ = frames_.NextFrame(validate_);
}
+#else
+ // Iteration starts from an exit frame given by its fp. This is the only
+ // mode supported on DBC.
+ ASSERT(frames_.pc_ == 0);
+ current_frame_ = NextExitFrame();
+#endif // !defined(TARGET_ARCH_DBC)
return current_frame_;
}
ASSERT((validate_ == kDontValidateFrames) || current_frame_->IsValid());
« no previous file with comments | « runtime/vm/stack_frame.h ('k') | runtime/vm/stack_frame_dbc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698