Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 249 void EnterInternalFrame() { EnterFrame(StackFrame::INTERNAL); } | 249 void EnterInternalFrame() { EnterFrame(StackFrame::INTERNAL); } |
| 250 void LeaveInternalFrame() { LeaveFrame(StackFrame::INTERNAL); } | 250 void LeaveInternalFrame() { LeaveFrame(StackFrame::INTERNAL); } |
| 251 | 251 |
| 252 void EnterConstructFrame() { EnterFrame(StackFrame::CONSTRUCT); } | 252 void EnterConstructFrame() { EnterFrame(StackFrame::CONSTRUCT); } |
| 253 void LeaveConstructFrame() { LeaveFrame(StackFrame::CONSTRUCT); } | 253 void LeaveConstructFrame() { LeaveFrame(StackFrame::CONSTRUCT); } |
| 254 | 254 |
| 255 // Enter exit frame. | 255 // Enter exit frame. |
| 256 // Expects the number of arguments in register r0 and | 256 // Expects the number of arguments in register r0 and |
| 257 // the builtin function to call in register r1. Exits with argc in | 257 // the builtin function to call in register r1. Exits with argc in |
| 258 // r4, argv in r6, and and the builtin function to call in r5. | 258 // r4, argv in r6, and and the builtin function to call in r5. |
| 259 void EnterExitFrame(bool save_doubles); | 259 // |stack_space| pending pushes, used for alignment before call to C. |
|
Erik Corry
2011/01/21 14:28:40
We haven't used this |parameter_name| style elsewh
antonm
2011/01/21 17:56:36
Erik, it was my request. I saw this style in vari
Zaheer
2011/01/24 09:43:31
i have replaced |stack_space| -> stack_space -
Erik Corry
2011/01/24 21:45:15
Sorry for causing this confusion. I didn't check
| |
| 260 void EnterExitFrame(bool save_doubles, int stack_space); | |
| 260 | 261 |
| 261 // Leave the current exit frame. Expects the return value in r0. | 262 // Leave the current exit frame. Expects the return value in r0. |
| 262 void LeaveExitFrame(bool save_doubles); | 263 void LeaveExitFrame(bool save_doubles); |
| 263 | 264 |
| 264 // Get the actual activation frame alignment for target environment. | 265 // Get the actual activation frame alignment for target environment. |
| 265 static int ActivationFrameAlignment(); | 266 static int ActivationFrameAlignment(); |
| 266 | 267 |
| 267 void LoadContext(Register dst, int context_chain_length); | 268 void LoadContext(Register dst, int context_chain_length); |
| 268 | 269 |
| 269 void LoadGlobalFunction(int index, Register function); | 270 void LoadGlobalFunction(int index, Register function); |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 581 | 582 |
| 582 // --------------------------------------------------------------------------- | 583 // --------------------------------------------------------------------------- |
| 583 // Runtime calls | 584 // Runtime calls |
| 584 | 585 |
| 585 // Call a code stub. | 586 // Call a code stub. |
| 586 void CallStub(CodeStub* stub, Condition cond = al); | 587 void CallStub(CodeStub* stub, Condition cond = al); |
| 587 | 588 |
| 588 // Call a code stub. | 589 // Call a code stub. |
| 589 void TailCallStub(CodeStub* stub, Condition cond = al); | 590 void TailCallStub(CodeStub* stub, Condition cond = al); |
| 590 | 591 |
| 592 // Tail call a code stub (jump) and return the code object called. Try to | |
| 593 // generate the code if necessary. Do not perform a GC but instead return | |
| 594 // a retry after GC failure. | |
| 595 MUST_USE_RESULT MaybeObject* TryTailCallStub(CodeStub* stub, | |
| 596 Condition cond = al); | |
| 597 | |
| 591 // Call a runtime routine. | 598 // Call a runtime routine. |
| 592 void CallRuntime(Runtime::Function* f, int num_arguments); | 599 void CallRuntime(Runtime::Function* f, int num_arguments); |
| 593 void CallRuntimeSaveDoubles(Runtime::FunctionId id); | 600 void CallRuntimeSaveDoubles(Runtime::FunctionId id); |
| 594 | 601 |
| 595 // Convenience function: Same as above, but takes the fid instead. | 602 // Convenience function: Same as above, but takes the fid instead. |
| 596 void CallRuntime(Runtime::FunctionId fid, int num_arguments); | 603 void CallRuntime(Runtime::FunctionId fid, int num_arguments); |
| 597 | 604 |
| 598 // Convenience function: call an external reference. | 605 // Convenience function: call an external reference. |
| 599 void CallExternalReference(const ExternalReference& ext, | 606 void CallExternalReference(const ExternalReference& ext, |
| 600 int num_arguments); | 607 int num_arguments); |
| 601 | 608 |
| 602 // Tail call of a runtime routine (jump). | 609 // Tail call of a runtime routine (jump). |
| 603 // Like JumpToExternalReference, but also takes care of passing the number | 610 // Like JumpToExternalReference, but also takes care of passing the number |
| 604 // of parameters. | 611 // of parameters. |
| 605 void TailCallExternalReference(const ExternalReference& ext, | 612 void TailCallExternalReference(const ExternalReference& ext, |
| 606 int num_arguments, | 613 int num_arguments, |
| 607 int result_size); | 614 int result_size); |
| 608 | 615 |
| 616 // Tail call of a runtime routine (jump). Try to generate the code if | |
| 617 // necessary. Do not perform a GC but instead return a retry after GC | |
| 618 // failure. | |
| 619 MUST_USE_RESULT MaybeObject* TryTailCallExternalReference( | |
| 620 const ExternalReference& ext, int num_arguments, int result_size); | |
| 621 | |
| 609 // Convenience function: tail call a runtime routine (jump). | 622 // Convenience function: tail call a runtime routine (jump). |
| 610 void TailCallRuntime(Runtime::FunctionId fid, | 623 void TailCallRuntime(Runtime::FunctionId fid, |
| 611 int num_arguments, | 624 int num_arguments, |
| 612 int result_size); | 625 int result_size); |
| 613 | 626 |
| 614 // Before calling a C-function from generated code, align arguments on stack. | 627 // Before calling a C-function from generated code, align arguments on stack. |
| 615 // After aligning the frame, non-register arguments must be stored in | 628 // After aligning the frame, non-register arguments must be stored in |
| 616 // sp[0], sp[4], etc., not pushed. The argument count assumes all arguments | 629 // sp[0], sp[4], etc., not pushed. The argument count assumes all arguments |
| 617 // are word sized. | 630 // are word sized. |
| 618 // Some compilers/platforms require the stack to be aligned when calling | 631 // Some compilers/platforms require the stack to be aligned when calling |
| 619 // C++ code. | 632 // C++ code. |
| 620 // Needs a scratch register to do some arithmetic. This register will be | 633 // Needs a scratch register to do some arithmetic. This register will be |
| 621 // trashed. | 634 // trashed. |
| 622 void PrepareCallCFunction(int num_arguments, Register scratch); | 635 void PrepareCallCFunction(int num_arguments, Register scratch); |
| 623 | 636 |
| 624 // Calls a C function and cleans up the space for arguments allocated | 637 // Calls a C function and cleans up the space for arguments allocated |
| 625 // by PrepareCallCFunction. The called function is not allowed to trigger a | 638 // by PrepareCallCFunction. The called function is not allowed to trigger a |
| 626 // garbage collection, since that might move the code and invalidate the | 639 // garbage collection, since that might move the code and invalidate the |
| 627 // return address (unless this is somehow accounted for by the called | 640 // return address (unless this is somehow accounted for by the called |
| 628 // function). | 641 // function). |
| 629 void CallCFunction(ExternalReference function, int num_arguments); | 642 void CallCFunction(ExternalReference function, int num_arguments); |
| 630 void CallCFunction(Register function, int num_arguments); | 643 void CallCFunction(Register function, int num_arguments); |
| 631 | 644 |
| 645 // Creates the exit frame, pushes the arguments and aligns the stack | |
| 646 // for the C call. saves the fp and context in top. | |
| 647 // |arg_stack_space| - space allocated for the structure (e.g. | |
| 648 // v8::arguments in a direct call) on top of the exit frame. | |
| 649 // |unwind_space| - space to be unwound on exit (includes the call js | |
| 650 // arguments space and the additonal space allocated for the fast call). | |
| 651 void PrepareCallApiFunction(int arg_stack_space, | |
| 652 int unwind_space); | |
| 653 | |
| 654 // Calls an API function. Allocates HandleScope, extracts | |
| 655 // returned value from handle and propagates exceptions. | |
| 656 // Restores context. | |
| 657 MaybeObject* TryCallApiFunctionAndReturn(ApiFunction* function); | |
| 658 | |
| 632 // Jump to a runtime routine. | 659 // Jump to a runtime routine. |
| 633 void JumpToExternalReference(const ExternalReference& builtin); | 660 void JumpToExternalReference(const ExternalReference& builtin); |
| 634 | 661 |
| 662 MaybeObject* TryJumpToExternalReference(const ExternalReference& ext); | |
| 663 | |
| 635 // Invoke specified builtin JavaScript function. Adds an entry to | 664 // Invoke specified builtin JavaScript function. Adds an entry to |
| 636 // the unresolved list if the name does not resolve. | 665 // the unresolved list if the name does not resolve. |
| 637 void InvokeBuiltin(Builtins::JavaScript id, InvokeJSFlags flags); | 666 void InvokeBuiltin(Builtins::JavaScript id, InvokeJSFlags flags); |
| 638 | 667 |
| 639 // Store the code object for the given builtin in the target register and | 668 // Store the code object for the given builtin in the target register and |
| 640 // setup the function in r1. | 669 // setup the function in r1. |
| 641 void GetBuiltinEntry(Register target, Builtins::JavaScript id); | 670 void GetBuiltinEntry(Register target, Builtins::JavaScript id); |
| 642 | 671 |
| 643 // Store the function for the given builtin in the target register. | 672 // Store the function for the given builtin in the target register. |
| 644 void GetBuiltinFunction(Register target, Builtins::JavaScript id); | 673 void GetBuiltinFunction(Register target, Builtins::JavaScript id); |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 820 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 849 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
| 821 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 850 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
| 822 #else | 851 #else |
| 823 #define ACCESS_MASM(masm) masm-> | 852 #define ACCESS_MASM(masm) masm-> |
| 824 #endif | 853 #endif |
| 825 | 854 |
| 826 | 855 |
| 827 } } // namespace v8::internal | 856 } } // namespace v8::internal |
| 828 | 857 |
| 829 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 858 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
| OLD | NEW |