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

Side by Side Diff: src/arm/macro-assembler-arm.h

Issue 6170001: Direct call api functions (arm implementation) (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 581
582 // --------------------------------------------------------------------------- 582 // ---------------------------------------------------------------------------
583 // Runtime calls 583 // Runtime calls
584 584
585 // Call a code stub. 585 // Call a code stub.
586 void CallStub(CodeStub* stub, Condition cond = al); 586 void CallStub(CodeStub* stub, Condition cond = al);
587 587
588 // Call a code stub. 588 // Call a code stub.
589 void TailCallStub(CodeStub* stub, Condition cond = al); 589 void TailCallStub(CodeStub* stub, Condition cond = al);
590 590
591 // Tail call a code stub (jump) and return the code object called. Try to
592 // generate the code if necessary. Do not perform a GC but instead return
593 // a retry after GC failure.
594 MUST_USE_RESULT MaybeObject* TryTailCallStub(CodeStub* stub,
595 Condition cond = al);
596
591 // Call a runtime routine. 597 // Call a runtime routine.
592 void CallRuntime(Runtime::Function* f, int num_arguments); 598 void CallRuntime(Runtime::Function* f, int num_arguments);
593 void CallRuntimeSaveDoubles(Runtime::FunctionId id); 599 void CallRuntimeSaveDoubles(Runtime::FunctionId id);
594 600
595 // Convenience function: Same as above, but takes the fid instead. 601 // Convenience function: Same as above, but takes the fid instead.
596 void CallRuntime(Runtime::FunctionId fid, int num_arguments); 602 void CallRuntime(Runtime::FunctionId fid, int num_arguments);
597 603
598 // Convenience function: call an external reference. 604 // Convenience function: call an external reference.
599 void CallExternalReference(const ExternalReference& ext, 605 void CallExternalReference(const ExternalReference& ext,
600 int num_arguments); 606 int num_arguments);
601 607
602 // Tail call of a runtime routine (jump). 608 // Tail call of a runtime routine (jump).
603 // Like JumpToExternalReference, but also takes care of passing the number 609 // Like JumpToExternalReference, but also takes care of passing the number
604 // of parameters. 610 // of parameters.
605 void TailCallExternalReference(const ExternalReference& ext, 611 void TailCallExternalReference(const ExternalReference& ext,
606 int num_arguments, 612 int num_arguments,
607 int result_size); 613 int result_size);
608 614
615 // Tail call of a runtime routine (jump). Try to generate the code if
616 // necessary. Do not perform a GC but instead return a retry after GC
617 // failure.
618 MUST_USE_RESULT MaybeObject* TryTailCallExternalReference(
619 const ExternalReference& ext, int num_arguments, int result_size);
620
609 // Convenience function: tail call a runtime routine (jump). 621 // Convenience function: tail call a runtime routine (jump).
610 void TailCallRuntime(Runtime::FunctionId fid, 622 void TailCallRuntime(Runtime::FunctionId fid,
611 int num_arguments, 623 int num_arguments,
612 int result_size); 624 int result_size);
613 625
614 // Before calling a C-function from generated code, align arguments on stack. 626 // Before calling a C-function from generated code, align arguments on stack.
615 // After aligning the frame, non-register arguments must be stored in 627 // 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 628 // sp[0], sp[4], etc., not pushed. The argument count assumes all arguments
617 // are word sized. 629 // are word sized.
618 // Some compilers/platforms require the stack to be aligned when calling 630 // Some compilers/platforms require the stack to be aligned when calling
619 // C++ code. 631 // C++ code.
620 // Needs a scratch register to do some arithmetic. This register will be 632 // Needs a scratch register to do some arithmetic. This register will be
621 // trashed. 633 // trashed.
622 void PrepareCallCFunction(int num_arguments, Register scratch); 634 void PrepareCallCFunction(int num_arguments, Register scratch);
623 635
624 // Calls a C function and cleans up the space for arguments allocated 636 // Calls a C function and cleans up the space for arguments allocated
625 // by PrepareCallCFunction. The called function is not allowed to trigger a 637 // by PrepareCallCFunction. The called function is not allowed to trigger a
626 // garbage collection, since that might move the code and invalidate the 638 // garbage collection, since that might move the code and invalidate the
627 // return address (unless this is somehow accounted for by the called 639 // return address (unless this is somehow accounted for by the called
628 // function). 640 // function).
629 void CallCFunction(ExternalReference function, int num_arguments); 641 void CallCFunction(ExternalReference function, int num_arguments);
630 void CallCFunction(Register function, int num_arguments); 642 void CallCFunction(Register function, int num_arguments);
631 643
644 // Creates the exit frame, pushes the arguments and aligns the stack
645 // for the C call. saves the fp and context in top
646 // arg_stack_space - space allocated for the structure (e.g.
antonm 2011/01/13 12:47:08 nit: we use |<parameter name>| convention. Ditto
antonm 2011/01/13 12:47:08 maybe some other name? allocation_size or somethi
Zaheer 2011/01/13 14:17:09 Done.
Zaheer 2011/01/13 14:17:09 hmm arg_stack_size is taken from x64. do you insis
647 // v8::arguments in a direct call) on top of the exit frame
648 // unwind_space - space to be unwound on exit (includes the call js
649 // arguments space and the additonal space allocated for the fast call)
650 void PrepareCallApiFunction(int arg_stack_space,
651 int unwind_space);
652
653 void EnterExitFramePrologue(int arg_stack_space);
654 void EnterExitFrameEpilogue(int unwind_space);
655
656 // Calls an API function. Allocates HandleScope, extracts
657 // returned value from handle and propagates exceptions.
658 // Restores context.
659 MaybeObject* TryCallApiFunctionAndReturn(ApiFunction* function);
660
632 // Jump to a runtime routine. 661 // Jump to a runtime routine.
633 void JumpToExternalReference(const ExternalReference& builtin); 662 void JumpToExternalReference(const ExternalReference& builtin);
634 663
664 MaybeObject* TryJumpToExternalReference(const ExternalReference& ext);
665
635 // Invoke specified builtin JavaScript function. Adds an entry to 666 // Invoke specified builtin JavaScript function. Adds an entry to
636 // the unresolved list if the name does not resolve. 667 // the unresolved list if the name does not resolve.
637 void InvokeBuiltin(Builtins::JavaScript id, InvokeJSFlags flags); 668 void InvokeBuiltin(Builtins::JavaScript id, InvokeJSFlags flags);
638 669
639 // Store the code object for the given builtin in the target register and 670 // Store the code object for the given builtin in the target register and
640 // setup the function in r1. 671 // setup the function in r1.
641 void GetBuiltinEntry(Register target, Builtins::JavaScript id); 672 void GetBuiltinEntry(Register target, Builtins::JavaScript id);
642 673
643 // Store the function for the given builtin in the target register. 674 // Store the function for the given builtin in the target register.
644 void GetBuiltinFunction(Register target, Builtins::JavaScript id); 675 void GetBuiltinFunction(Register target, Builtins::JavaScript id);
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) 851 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__)
821 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> 852 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm->
822 #else 853 #else
823 #define ACCESS_MASM(masm) masm-> 854 #define ACCESS_MASM(masm) masm->
824 #endif 855 #endif
825 856
826 857
827 } } // namespace v8::internal 858 } } // namespace v8::internal
828 859
829 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ 860 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_
OLDNEW
« no previous file with comments | « AUTHORS ('k') | src/arm/macro-assembler-arm.cc » ('j') | src/arm/macro-assembler-arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698