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

Unified Diff: runtime/vm/stub_code_ia32.cc

Issue 9128002: Print stop message. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 11 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/stub_code.h ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_ia32.cc
===================================================================
--- runtime/vm/stub_code_ia32.cc (revision 3123)
+++ runtime/vm/stub_code_ia32.cc (working copy)
@@ -112,8 +112,48 @@
}
+// Print the stop message.
+static void PrintStopMessage(const char* message) {
+ OS::Print("Stop message: %s\n", message);
+}
+
+
// Input parameters:
// ESP : points to return address.
+// EAX : stop message (const char*).
+// Must preserve all registers, except EAX.
+void StubCode::GeneratePrintStopMessageStub(Assembler* assembler) {
+ // Preserve caller-saved registers.
+ __ pushl(ECX);
+ __ pushl(EDX);
+
+ __ EnterFrame(0);
+
+ // Reserve space for the native argument and align frame before entering
+ // the C++ world.
+ __ AddImmediate(ESP, Immediate(-sizeof(kWordSize)));
+ if (OS::ActivationFrameAlignment() > 0) {
+ __ andl(ESP, Immediate(~(OS::ActivationFrameAlignment() - 1)));
+ }
+
+ // Pass argument and call native function.
+ __ movl(Address(ESP, 0), EAX);
+ __ movl(EAX, Immediate(reinterpret_cast<uword>(&PrintStopMessage)));
+ __ call(EAX);
+ __ popl(EAX);
+
+ __ LeaveFrame();
+
+ // Restore caller-saved registers.
+ __ popl(EDX);
+ __ popl(ECX);
+
+ __ ret();
+}
+
+
+// Input parameters:
+// ESP : points to return address.
// ESP + 4 : address of return value.
// EAX : address of first argument in argument array.
// EAX - 4*EDX + 4 : address of last argument in argument array.
« no previous file with comments | « runtime/vm/stub_code.h ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698