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

Unified Diff: runtime/vm/stack_frame_arm.cc

Issue 12335102: Compile and simulate first dart function on arm generated from ast. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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
Index: runtime/vm/stack_frame_arm.cc
===================================================================
--- runtime/vm/stack_frame_arm.cc (revision 19074)
+++ runtime/vm/stack_frame_arm.cc (working copy)
@@ -5,47 +5,57 @@
#include "vm/globals.h"
#if defined(TARGET_ARCH_ARM)
+#include "vm/instructions.h"
+#include "vm/isolate.h"
#include "vm/stack_frame.h"
namespace dart {
+// The constant kExitLinkOffsetInEntryFrame must be kept in sync with the
+// code in the InvokeDartCode stub.
+static const int kSavedContextOffsetInEntryFrame = -10 * kWordSize;
+static const int kExitLinkOffsetInEntryFrame = -9 * kWordSize;
+static const int kPcAddressOffsetFromSp = -1 * kWordSize;
+static const int kSpOffsetFromPreviousFp = 3 * kWordSize;
+
+
intptr_t StackFrame::PcAddressOffsetFromSp() {
- UNIMPLEMENTED();
- return 0;
+ return kPcAddressOffsetFromSp;
}
-uword StackFrame::GetCallerFp() const {
- UNIMPLEMENTED();
- return 0;
+uword StackFrame::GetCallerSp() const {
+ return fp() + kSpOffsetFromPreviousFp;
}
-uword StackFrame::GetCallerSp() const {
- UNIMPLEMENTED();
- return 0;
+uword StackFrame::GetCallerFp() const {
+ return *(reinterpret_cast<uword*>(fp()));
}
intptr_t EntryFrame::ExitLinkOffset() const {
- UNIMPLEMENTED();
- return 0;
+ return kExitLinkOffsetInEntryFrame;
}
intptr_t EntryFrame::SavedContextOffset() const {
- UNIMPLEMENTED();
- return 0;
+ return kSavedContextOffsetInEntryFrame;
}
void StackFrameIterator::SetupLastExitFrameData() {
- UNIMPLEMENTED();
+ Isolate* current = Isolate::Current();
+ uword exit_marker = current->top_exit_frame_info();
+ frames_.fp_ = exit_marker;
}
void StackFrameIterator::SetupNextExitFrameData() {
- UNIMPLEMENTED();
+ uword exit_address = entry_.fp() + kExitLinkOffsetInEntryFrame;
+ uword exit_marker = *reinterpret_cast<uword*>(exit_address);
+ frames_.fp_ = exit_marker;
+ frames_.sp_ = 0;
}
} // namespace dart

Powered by Google App Engine
This is Rietveld 408576698