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

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

Issue 5055004: API call code refactoring (ia32). (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 1 month 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
« no previous file with comments | « no previous file | src/ia32/macro-assembler-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 // On return removes stack_space * kPointerSize (GCed).
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 const Operand& code_operand, 602 const Operand& code_operand,
597 Label* done, 603 Label* done,
598 InvokeFlag flag); 604 InvokeFlag flag);
599 605
600 // Activation support. 606 // Activation support.
601 void EnterFrame(StackFrame::Type type); 607 void EnterFrame(StackFrame::Type type);
602 void LeaveFrame(StackFrame::Type type); 608 void LeaveFrame(StackFrame::Type type);
603 609
604 void EnterExitFramePrologue(); 610 void EnterExitFramePrologue();
605 void EnterExitFrameEpilogue(int argc); 611 void EnterExitFrameEpilogue(int argc);
612
613 void LeaveExitFrameEpilogue();
606 614
607 // Allocation support helpers. 615 // Allocation support helpers.
608 void LoadAllocationTopHelper(Register result, 616 void LoadAllocationTopHelper(Register result,
609 Register result_end, 617 Register result_end,
610 Register scratch, 618 Register scratch,
611 AllocationFlags flags); 619 AllocationFlags flags);
612 void UpdateAllocationTopHelper(Register result_end, Register scratch); 620 void UpdateAllocationTopHelper(Register result_end, Register scratch);
613 621
614 // Helper for PopHandleScope. Allowed to perform a GC and returns 622 // Helper for PopHandleScope. Allowed to perform a GC and returns
615 // NULL if gc_allowed. Does not perform a GC if !gc_allowed, and 623 // NULL if gc_allowed. Does not perform a GC if !gc_allowed, and
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 } \ 698 } \
691 masm-> 699 masm->
692 #else 700 #else
693 #define ACCESS_MASM(masm) masm-> 701 #define ACCESS_MASM(masm) masm->
694 #endif 702 #endif
695 703
696 704
697 } } // namespace v8::internal 705 } } // namespace v8::internal
698 706
699 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ 707 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_
OLDNEW
« no previous file with comments | « no previous file | src/ia32/macro-assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698