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 void LeaveExitFrame(bool save_doubles = false); | 164 void LeaveExitFrame(bool save_doubles = false); |
165 | 165 |
166 // Leave the current exit frame. Expects/provides the return value in | 166 // Leave the current exit frame. Expects/provides the return value in |
167 // register rax (untouched). | 167 // register rax (untouched). |
168 void LeaveApiExitFrame(); | 168 void LeaveApiExitFrame(); |
169 | 169 |
170 // Push and pop the registers that can hold pointers. | 170 // Push and pop the registers that can hold pointers. |
171 void PushSafepointRegisters() { Pushad(); } | 171 void PushSafepointRegisters() { Pushad(); } |
172 void PopSafepointRegisters() { Popad(); } | 172 void PopSafepointRegisters() { Popad(); } |
173 static int SafepointRegisterStackIndex(int reg_code) { | 173 static int SafepointRegisterStackIndex(int reg_code) { |
174 return kRegistersPushedByPushad - 1 - | 174 return kNumSafepointRegisters - 1 - |
175 kSafepointPushRegisterIndices[reg_code]; | 175 kSafepointPushRegisterIndices[reg_code]; |
176 } | 176 } |
177 | 177 |
178 | 178 |
179 // --------------------------------------------------------------------------- | 179 // --------------------------------------------------------------------------- |
180 // JavaScript invokes | 180 // JavaScript invokes |
181 | 181 |
182 // Invoke the JavaScript function code by either calling or jumping. | 182 // Invoke the JavaScript function code by either calling or jumping. |
183 void InvokeCode(Register code, | 183 void InvokeCode(Register code, |
184 const ParameterCount& expected, | 184 const ParameterCount& expected, |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 // Verify restrictions about code generated in stubs. | 960 // Verify restrictions about code generated in stubs. |
961 void set_generating_stub(bool value) { generating_stub_ = value; } | 961 void set_generating_stub(bool value) { generating_stub_ = value; } |
962 bool generating_stub() { return generating_stub_; } | 962 bool generating_stub() { return generating_stub_; } |
963 void set_allow_stub_calls(bool value) { allow_stub_calls_ = value; } | 963 void set_allow_stub_calls(bool value) { allow_stub_calls_ = value; } |
964 bool allow_stub_calls() { return allow_stub_calls_; } | 964 bool allow_stub_calls() { return allow_stub_calls_; } |
965 | 965 |
966 private: | 966 private: |
967 // Order general registers are pushed by Pushad. | 967 // Order general registers are pushed by Pushad. |
968 // rax, rcx, rdx, rbx, rsi, rdi, r8, r9, r11, r12, r14. | 968 // rax, rcx, rdx, rbx, rsi, rdi, r8, r9, r11, r12, r14. |
969 static int kSafepointPushRegisterIndices[Register::kNumRegisters]; | 969 static int kSafepointPushRegisterIndices[Register::kNumRegisters]; |
970 static const int kRegistersPushedByPushad = 11; | 970 static const int kNumSafepointSavedRegisters = 11; |
971 | 971 |
972 bool generating_stub_; | 972 bool generating_stub_; |
973 bool allow_stub_calls_; | 973 bool allow_stub_calls_; |
974 | 974 |
975 // Returns a register holding the smi value. The register MUST NOT be | 975 // Returns a register holding the smi value. The register MUST NOT be |
976 // modified. It may be the "smi 1 constant" register. | 976 // modified. It may be the "smi 1 constant" register. |
977 Register GetSmiConstant(Smi* value); | 977 Register GetSmiConstant(Smi* value); |
978 | 978 |
979 // Moves the smi value to the destination register. | 979 // Moves the smi value to the destination register. |
980 void LoadSmiConstant(Register dst, Smi* value); | 980 void LoadSmiConstant(Register dst, Smi* value); |
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1805 Jump(adaptor, RelocInfo::CODE_TARGET); | 1805 Jump(adaptor, RelocInfo::CODE_TARGET); |
1806 } | 1806 } |
1807 bind(&invoke); | 1807 bind(&invoke); |
1808 } | 1808 } |
1809 } | 1809 } |
1810 | 1810 |
1811 | 1811 |
1812 } } // namespace v8::internal | 1812 } } // namespace v8::internal |
1813 | 1813 |
1814 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1814 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |