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

Unified Diff: runtime/vm/simulator_mips.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
« no previous file with comments | « runtime/vm/simulator_mips.h ('k') | runtime/vm/stack_frame_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/simulator_mips.cc
===================================================================
--- runtime/vm/simulator_mips.cc (revision 19151)
+++ runtime/vm/simulator_mips.cc (working copy)
@@ -17,7 +17,15 @@
namespace dart {
Simulator::Simulator() {
- UNIMPLEMENTED();
+ // Setup simulator support first. Some of this information is needed to
+ // setup the architecture state.
+ // We allocate the stack here, the size is computed as the sum of
+ // the size specified by the user and the buffer space needed for
+ // handling stack overflow exceptions. To be safe in potential
+ // stack underflows we also add some underflow buffer space.
+ stack_ = new char[(Isolate::GetSpecifiedStackSize() +
+ Isolate::kStackSizeBuffer +
+ kSimulatorStackUnderflowSize)];
}
@@ -40,6 +48,16 @@
}
+// Returns the top of the stack area to enable checking for stack pointer
+// validity.
+uword Simulator::StackTop() const {
+ // To be safe in potential stack underflows we leave some buffer above and
+ // set the stack top.
+ return reinterpret_cast<uword>(stack_) +
+ (Isolate::GetSpecifiedStackSize() + Isolate::kStackSizeBuffer);
+}
+
+
void Simulator::InitOnce() {
}
« no previous file with comments | « runtime/vm/simulator_mips.h ('k') | runtime/vm/stack_frame_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698