Files
sdk/runtime/vm/stack_frame_mips.cc
T
zra@google.com a49ab3a890 Adds support for debugger API on MIPS.
Enable debugger api tests on MIPS.
Enable isolate tests on MIPS.
Enable code descriptors tests on MIPS.
Enable snapshot tests on MIPS.
Enable heap tests on MIPS.

Review URL: https://codereview.chromium.org//14284020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22042 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-25 18:03:15 +00:00

68 lines
1.7 KiB
C++

// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
#if defined(TARGET_ARCH_MIPS)
#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 = -11 * kWordSize;
static const int kExitLinkOffsetInEntryFrame = -10 * kWordSize;
static const int kPcAddressOffsetFromSp = -2 * kWordSize;
static const int kEntrypointMarkerOffsetFromFp = 2 * kWordSize;
static const int kSpOffsetFromPreviousFp = 3 * kWordSize;
intptr_t StackFrame::PcAddressOffsetFromSp() {
return kPcAddressOffsetFromSp;
}
intptr_t StackFrame::EntrypointMarkerOffsetFromFp() {
return kEntrypointMarkerOffsetFromFp;
}
uword StackFrame::GetCallerFp() const {
return *(reinterpret_cast<uword*>(fp()));
}
uword StackFrame::GetCallerSp() const {
return fp() + kSpOffsetFromPreviousFp;
}
intptr_t EntryFrame::ExitLinkOffset() const {
return kExitLinkOffsetInEntryFrame;
}
intptr_t EntryFrame::SavedContextOffset() const {
return kSavedContextOffsetInEntryFrame;
}
void StackFrameIterator::SetupLastExitFrameData() {
Isolate* current = Isolate::Current();
uword exit_marker = current->top_exit_frame_info();
frames_.fp_ = exit_marker;
}
void StackFrameIterator::SetupNextExitFrameData() {
uword exit_address = entry_.fp() + kExitLinkOffsetInEntryFrame;
uword exit_marker = *reinterpret_cast<uword*>(exit_address);
frames_.fp_ = exit_marker;
frames_.sp_ = 0;
}
} // namespace dart
#endif // defined TARGET_ARCH_MIPS