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

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
Index: runtime/vm/stub_code_ia32.cc
===================================================================
--- runtime/vm/stub_code_ia32.cc (revision 3122)
+++ runtime/vm/stub_code_ia32.cc (working copy)
@@ -112,8 +112,45 @@
}
+// 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);
+
+ // Align frame before entering C++ world.
+ if (OS::ActivationFrameAlignment() > 0) {
+ __ andl(ESP, Immediate(~(OS::ActivationFrameAlignment() - 1)));
+ }
+
+ __ pushl(EAX);
Ivan Posva 2012/01/10 00:18:17 Destroys stack alignment.
regis 2012/01/10 00:32:37 Good catch. Fixed.
+ __ 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.

Powered by Google App Engine
This is Rietveld 408576698