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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 // of parameters. | 366 // of parameters. |
367 void TailCallExternalReference(const ExternalReference& ext, | 367 void TailCallExternalReference(const ExternalReference& ext, |
368 int num_arguments, | 368 int num_arguments, |
369 int result_size); | 369 int result_size); |
370 | 370 |
371 // Convenience function: tail call a runtime routine (jump). | 371 // Convenience function: tail call a runtime routine (jump). |
372 void TailCallRuntime(Runtime::FunctionId fid, | 372 void TailCallRuntime(Runtime::FunctionId fid, |
373 int num_arguments, | 373 int num_arguments, |
374 int result_size); | 374 int result_size); |
375 | 375 |
| 376 // Before calling a C-function from generated code, align arguments on stack. |
| 377 // After aligning the frame, non-register arguments must be stored in |
| 378 // sp[0], sp[4], etc., not pushed. The argument count assumes all arguments |
| 379 // are word sized. |
| 380 // Some compilers/platforms require the stack to be aligned when calling |
| 381 // C++ code. |
| 382 // Needs a scratch register to do some arithmetic. This register will be |
| 383 // trashed. |
| 384 void PrepareCallCFunction(int num_arguments, Register scratch); |
| 385 |
| 386 // Calls a C function and cleans up the space for arguments allocated |
| 387 // by PrepareCallCFunction. The called function is not allowed to trigger a |
| 388 // garbage collection, since that might move the code and invalidate the |
| 389 // return address (unless this is somehow accounted for by the called |
| 390 // function). |
| 391 void CallCFunction(ExternalReference function, int num_arguments); |
| 392 void CallCFunction(Register function, int num_arguments); |
| 393 |
376 // Jump to a runtime routine. | 394 // Jump to a runtime routine. |
377 void JumpToExternalReference(const ExternalReference& builtin); | 395 void JumpToExternalReference(const ExternalReference& builtin); |
378 | 396 |
379 // Invoke specified builtin JavaScript function. Adds an entry to | 397 // Invoke specified builtin JavaScript function. Adds an entry to |
380 // the unresolved list if the name does not resolve. | 398 // the unresolved list if the name does not resolve. |
381 void InvokeBuiltin(Builtins::JavaScript id, InvokeJSFlags flags); | 399 void InvokeBuiltin(Builtins::JavaScript id, InvokeJSFlags flags); |
382 | 400 |
383 // Store the code object for the given builtin in the target register and | 401 // Store the code object for the given builtin in the target register and |
384 // setup the function in r1. | 402 // setup the function in r1. |
385 void GetBuiltinEntry(Register target, Builtins::JavaScript id); | 403 void GetBuiltinEntry(Register target, Builtins::JavaScript id); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 539 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
522 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 540 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
523 #else | 541 #else |
524 #define ACCESS_MASM(masm) masm-> | 542 #define ACCESS_MASM(masm) masm-> |
525 #endif | 543 #endif |
526 | 544 |
527 | 545 |
528 } } // namespace v8::internal | 546 } } // namespace v8::internal |
529 | 547 |
530 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 548 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
OLD | NEW |