OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 // of parameters. | 370 // of parameters. |
371 void TailCallExternalReference(const ExternalReference& ext, | 371 void TailCallExternalReference(const ExternalReference& ext, |
372 int num_arguments, | 372 int num_arguments, |
373 int result_size); | 373 int result_size); |
374 | 374 |
375 // Convenience function: tail call a runtime routine (jump). | 375 // Convenience function: tail call a runtime routine (jump). |
376 void TailCallRuntime(Runtime::FunctionId fid, | 376 void TailCallRuntime(Runtime::FunctionId fid, |
377 int num_arguments, | 377 int num_arguments, |
378 int result_size); | 378 int result_size); |
379 | 379 |
| 380 // Before calling a C-function from generated code, align arguments on stack. |
| 381 // After aligning the frame, arguments must be stored in esp[0], esp[4], |
| 382 // etc., not pushed. The argument count assumes all arguments are word sized. |
| 383 // Some compilers/platforms require the stack to be aligned when calling |
| 384 // C++ code. |
| 385 // Needs a scratch register to do some arithmetic. This register will be |
| 386 // trashed. |
| 387 void PrepareCallCFunction(int num_arguments, Register scratch); |
| 388 |
| 389 // Calls a C function and cleans up the space for arguments allocated |
| 390 // by PrepareCallCFunction. The called function is not allowed to trigger a |
| 391 // garbage collection, since that might move the code and invalidate the |
| 392 // return address (unless this is somehow accounted for by the called |
| 393 // function). |
| 394 void CallCFunction(ExternalReference function, int num_arguments); |
| 395 void CallCFunction(Register function, int num_arguments); |
| 396 |
380 void PushHandleScope(Register scratch); | 397 void PushHandleScope(Register scratch); |
381 | 398 |
382 // Pops a handle scope using the specified scratch register and | 399 // Pops a handle scope using the specified scratch register and |
383 // ensuring that saved register, it is not no_reg, is left unchanged. | 400 // ensuring that saved register, it is not no_reg, is left unchanged. |
384 void PopHandleScope(Register saved, Register scratch); | 401 void PopHandleScope(Register saved, Register scratch); |
385 | 402 |
386 // As PopHandleScope, but does not perform a GC. Instead, returns a | 403 // As PopHandleScope, but does not perform a GC. Instead, returns a |
387 // retry after GC failure object if GC is necessary. | 404 // retry after GC failure object if GC is necessary. |
388 Object* TryPopHandleScope(Register saved, Register scratch); | 405 Object* TryPopHandleScope(Register saved, Register scratch); |
389 | 406 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 } \ | 564 } \ |
548 masm-> | 565 masm-> |
549 #else | 566 #else |
550 #define ACCESS_MASM(masm) masm-> | 567 #define ACCESS_MASM(masm) masm-> |
551 #endif | 568 #endif |
552 | 569 |
553 | 570 |
554 } } // namespace v8::internal | 571 } } // namespace v8::internal |
555 | 572 |
556 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 573 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
OLD | NEW |