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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 | 116 |
117 void EnterConstructFrame() { EnterFrame(StackFrame::CONSTRUCT); } | 117 void EnterConstructFrame() { EnterFrame(StackFrame::CONSTRUCT); } |
118 void LeaveConstructFrame() { LeaveFrame(StackFrame::CONSTRUCT); } | 118 void LeaveConstructFrame() { LeaveFrame(StackFrame::CONSTRUCT); } |
119 | 119 |
120 // Enter specific kind of exit frame; either in normal or debug mode. | 120 // Enter specific kind of exit frame; either in normal or debug mode. |
121 // Expects the number of arguments in register eax and | 121 // Expects the number of arguments in register eax and |
122 // sets up the number of arguments in register edi and the pointer | 122 // sets up the number of arguments in register edi and the pointer |
123 // to the first argument in register esi. | 123 // to the first argument in register esi. |
124 void EnterExitFrame(); | 124 void EnterExitFrame(); |
125 | 125 |
126 void EnterApiExitFrame(int stack_space, int argc); | 126 void EnterApiExitFrame(int argc); |
127 | 127 |
128 // Leave the current exit frame. Expects the return value in | 128 // Leave the current exit frame. Expects the return value in |
129 // register eax:edx (untouched) and the pointer to the first | 129 // register eax:edx (untouched) and the pointer to the first |
130 // argument in register esi. | 130 // argument in register esi. |
131 void LeaveExitFrame(); | 131 void LeaveExitFrame(); |
132 | 132 |
133 // Leave the current exit frame. Expects the return value in | |
134 // register eax (untouched). | |
135 void LeaveApiExitFrame(); | |
136 | |
133 // Find the function context up the context chain. | 137 // Find the function context up the context chain. |
134 void LoadContext(Register dst, int context_chain_length); | 138 void LoadContext(Register dst, int context_chain_length); |
135 | 139 |
136 // Load the global function with the given index. | 140 // Load the global function with the given index. |
137 void LoadGlobalFunction(int index, Register function); | 141 void LoadGlobalFunction(int index, Register function); |
138 | 142 |
139 // Load the initial map from the global function. The registers | 143 // Load the initial map from the global function. The registers |
140 // function and map can be the same. | 144 // function and map can be the same. |
141 void LoadGlobalFunctionInitialMap(Register function, Register map); | 145 void LoadGlobalFunctionInitialMap(Register function, Register map); |
142 | 146 |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
492 // return address (unless this is somehow accounted for by the called | 496 // return address (unless this is somehow accounted for by the called |
493 // function). | 497 // function). |
494 void CallCFunction(ExternalReference function, int num_arguments); | 498 void CallCFunction(ExternalReference function, int num_arguments); |
495 void CallCFunction(Register function, int num_arguments); | 499 void CallCFunction(Register function, int num_arguments); |
496 | 500 |
497 // Prepares stack to put arguments (aligns and so on). Reserves | 501 // Prepares stack to put arguments (aligns and so on). Reserves |
498 // space for return value if needed (assumes the return value is a handle). | 502 // space for return value if needed (assumes the return value is a handle). |
499 // Uses callee-saved esi to restore stack state after call. Arguments must be | 503 // Uses callee-saved esi to restore stack state after call. Arguments must be |
500 // stored in ApiParameterOperand(0), ApiParameterOperand(1) etc. Saves | 504 // stored in ApiParameterOperand(0), ApiParameterOperand(1) etc. Saves |
501 // context (esi). | 505 // context (esi). |
502 void PrepareCallApiFunction(int stack_space, int argc); | 506 void PrepareCallApiFunction(int argc, Register scratch); |
503 | 507 |
504 // Calls an API function. Allocates HandleScope, extracts | 508 // Calls an API function. Allocates HandleScope, extracts |
505 // returned value from handle and propagates exceptions. | 509 // returned value from handle and propagates exceptions. |
506 // Clobbers ebx, edi and caller-save registers. Restores context. | 510 // Clobbers ebx, edi and caller-save registers. Restores context. |
507 MaybeObject* TryCallApiFunctionAndReturn(ApiFunction* function, int argc); | 511 // Returning removes stack_space * kPointerSize (GCed). |
antonm
2010/11/16 14:32:26
I'd use 'on return' instead of 'returning'
SeRya
2010/11/16 14:53:28
Done.
| |
512 MaybeObject* TryCallApiFunctionAndReturn(ApiFunction* function, | |
513 int stack_space); | |
508 | 514 |
509 // Jump to a runtime routine. | 515 // Jump to a runtime routine. |
510 void JumpToExternalReference(const ExternalReference& ext); | 516 void JumpToExternalReference(const ExternalReference& ext); |
511 | 517 |
512 MaybeObject* TryJumpToExternalReference(const ExternalReference& ext); | 518 MaybeObject* TryJumpToExternalReference(const ExternalReference& ext); |
513 | 519 |
514 | 520 |
515 // --------------------------------------------------------------------------- | 521 // --------------------------------------------------------------------------- |
516 // Utilities | 522 // Utilities |
517 | 523 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
690 } \ | 696 } \ |
691 masm-> | 697 masm-> |
692 #else | 698 #else |
693 #define ACCESS_MASM(masm) masm-> | 699 #define ACCESS_MASM(masm) masm-> |
694 #endif | 700 #endif |
695 | 701 |
696 | 702 |
697 } } // namespace v8::internal | 703 } } // namespace v8::internal |
698 | 704 |
699 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 705 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
OLD | NEW |