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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 // argument in register rsi. | 164 // argument in register rsi. |
165 void LeaveExitFrame(bool save_doubles = false); | 165 void LeaveExitFrame(bool save_doubles = false); |
166 | 166 |
167 // Leave the current exit frame. Expects/provides the return value in | 167 // Leave the current exit frame. Expects/provides the return value in |
168 // register rax (untouched). | 168 // register rax (untouched). |
169 void LeaveApiExitFrame(); | 169 void LeaveApiExitFrame(); |
170 | 170 |
171 // Push and pop the registers that can hold pointers. | 171 // Push and pop the registers that can hold pointers. |
172 void PushSafepointRegisters() { Pushad(); } | 172 void PushSafepointRegisters() { Pushad(); } |
173 void PopSafepointRegisters() { Popad(); } | 173 void PopSafepointRegisters() { Popad(); } |
174 static int SafepointRegisterStackIndex(int reg_code) { | 174 // Store the value in register src in the safepoint register stack |
175 return kNumSafepointRegisters - 1 - | 175 // slot for register dst. |
176 kSafepointPushRegisterIndices[reg_code]; | 176 void StoreToSafepointRegisterSlot(Register dst, Register src); |
177 } | |
178 | 177 |
179 | 178 |
180 // --------------------------------------------------------------------------- | 179 // --------------------------------------------------------------------------- |
181 // JavaScript invokes | 180 // JavaScript invokes |
182 | 181 |
183 // Invoke the JavaScript function code by either calling or jumping. | 182 // Invoke the JavaScript function code by either calling or jumping. |
184 void InvokeCode(Register code, | 183 void InvokeCode(Register code, |
185 const ParameterCount& expected, | 184 const ParameterCount& expected, |
186 const ParameterCount& actual, | 185 const ParameterCount& actual, |
187 InvokeFlag flag, | 186 InvokeFlag flag, |
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1028 // Update allocation top with value in result_end register. | 1027 // Update allocation top with value in result_end register. |
1029 // If scratch is valid, it contains the address of the allocation top. | 1028 // If scratch is valid, it contains the address of the allocation top. |
1030 void UpdateAllocationTopHelper(Register result_end, Register scratch); | 1029 void UpdateAllocationTopHelper(Register result_end, Register scratch); |
1031 | 1030 |
1032 // Helper for PopHandleScope. Allowed to perform a GC and returns | 1031 // Helper for PopHandleScope. Allowed to perform a GC and returns |
1033 // NULL if gc_allowed. Does not perform a GC if !gc_allowed, and | 1032 // NULL if gc_allowed. Does not perform a GC if !gc_allowed, and |
1034 // possibly returns a failure object indicating an allocation failure. | 1033 // possibly returns a failure object indicating an allocation failure. |
1035 Object* PopHandleScopeHelper(Register saved, | 1034 Object* PopHandleScopeHelper(Register saved, |
1036 Register scratch, | 1035 Register scratch, |
1037 bool gc_allowed); | 1036 bool gc_allowed); |
| 1037 |
| 1038 |
| 1039 // Compute memory operands for safepoint stack slots. |
| 1040 Operand SafepointRegisterSlot(Register reg); |
| 1041 static int SafepointRegisterStackIndex(int reg_code) { |
| 1042 return kNumSafepointRegisters - kSafepointPushRegisterIndices[reg_code] - 1; |
| 1043 } |
| 1044 |
| 1045 // Needs access to SafepointRegisterStackIndex for optimized frame |
| 1046 // traversal. |
| 1047 friend class OptimizedFrame; |
1038 }; | 1048 }; |
1039 | 1049 |
1040 | 1050 |
1041 // The code patcher is used to patch (typically) small parts of code e.g. for | 1051 // The code patcher is used to patch (typically) small parts of code e.g. for |
1042 // debugging and other types of instrumentation. When using the code patcher | 1052 // debugging and other types of instrumentation. When using the code patcher |
1043 // the exact number of bytes specified must be emitted. Is not legal to emit | 1053 // the exact number of bytes specified must be emitted. Is not legal to emit |
1044 // relocation information. If any of these constraints are violated it causes | 1054 // relocation information. If any of these constraints are violated it causes |
1045 // an assertion. | 1055 // an assertion. |
1046 class CodePatcher { | 1056 class CodePatcher { |
1047 public: | 1057 public: |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1833 Jump(adaptor, RelocInfo::CODE_TARGET); | 1843 Jump(adaptor, RelocInfo::CODE_TARGET); |
1834 } | 1844 } |
1835 bind(&invoke); | 1845 bind(&invoke); |
1836 } | 1846 } |
1837 } | 1847 } |
1838 | 1848 |
1839 | 1849 |
1840 } } // namespace v8::internal | 1850 } } // namespace v8::internal |
1841 | 1851 |
1842 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1852 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |