Chromium Code Reviews| 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. |