| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 Code* re_code, | 122 Code* re_code, |
| 123 Address re_frame); | 123 Address re_frame); |
| 124 | 124 |
| 125 private: | 125 private: |
| 126 // Offsets from rbp of function parameters and stored registers. | 126 // Offsets from rbp of function parameters and stored registers. |
| 127 static const int kFramePointer = 0; | 127 static const int kFramePointer = 0; |
| 128 // Above the frame pointer - function parameters and return address. | 128 // Above the frame pointer - function parameters and return address. |
| 129 static const int kReturn_eip = kFramePointer + kPointerSize; | 129 static const int kReturn_eip = kFramePointer + kPointerSize; |
| 130 static const int kFrameAlign = kReturn_eip + kPointerSize; | 130 static const int kFrameAlign = kReturn_eip + kPointerSize; |
| 131 | 131 |
| 132 #ifdef __MSVC__ | 132 #ifdef _WIN64 |
| 133 // Parameters (first four passed as registers, but with room on stack). | 133 // Parameters (first four passed as registers, but with room on stack). |
| 134 // In Microsoft 64-bit Calling Convention, there is room on the callers | 134 // In Microsoft 64-bit Calling Convention, there is room on the callers |
| 135 // stack (before the return address) to spill parameter registers. We | 135 // stack (before the return address) to spill parameter registers. We |
| 136 // use this space to store the register passed parameters. | 136 // use this space to store the register passed parameters. |
| 137 static const int kInputString = kFrameAlign; | 137 static const int kInputString = kFrameAlign; |
| 138 // StartIndex is passed as 32 bit int. |
| 138 static const int kStartIndex = kInputString + kPointerSize; | 139 static const int kStartIndex = kInputString + kPointerSize; |
| 139 static const int kInputStart = kStartIndex + kPointerSize; | 140 static const int kInputStart = kStartIndex + kPointerSize; |
| 140 static const int kInputEnd = kInputStart + kPointerSize; | 141 static const int kInputEnd = kInputStart + kPointerSize; |
| 141 static const int kRegisterOutput = kInputEnd + kPointerSize; | 142 static const int kRegisterOutput = kInputEnd + kPointerSize; |
| 143 // AtStart is passed as 32 bit int (values 0 or 1). |
| 142 static const int kAtStart = kRegisterOutput + kPointerSize; | 144 static const int kAtStart = kRegisterOutput + kPointerSize; |
| 143 static const int kStackHighEnd = kAtStart + kPointerSize; | 145 static const int kStackHighEnd = kAtStart + kPointerSize; |
| 144 #else | 146 #else |
| 145 // In AMD64 ABI Calling Convention, the first six integer parameters | 147 // In AMD64 ABI Calling Convention, the first six integer parameters |
| 146 // are passed as registers, and caller must allocate space on the stack | 148 // are passed as registers, and caller must allocate space on the stack |
| 147 // if it wants them stored. We push the parameters after the frame pointer. | 149 // if it wants them stored. We push the parameters after the frame pointer. |
| 148 static const int kInputString = kFramePointer - kPointerSize; | 150 static const int kInputString = kFramePointer - kPointerSize; |
| 149 static const int kStartIndex = kInputString - kPointerSize; | 151 static const int kStartIndex = kInputString - kPointerSize; |
| 150 static const int kInputStart = kStartIndex - kPointerSize; | 152 static const int kInputStart = kStartIndex - kPointerSize; |
| 151 static const int kInputEnd = kInputStart - kPointerSize; | 153 static const int kInputEnd = kInputStart - kPointerSize; |
| 152 static const int kRegisterOutput = kInputEnd - kPointerSize; | 154 static const int kRegisterOutput = kInputEnd - kPointerSize; |
| 153 static const int kAtStart = kRegisterOutput - kPointerSize; | 155 static const int kAtStart = kRegisterOutput - kPointerSize; |
| 154 static const int kStackHighEnd = kFrameAlign; | 156 static const int kStackHighEnd = kFrameAlign; |
| 155 #endif | 157 #endif |
| 156 | 158 |
| 157 #ifdef __MSVC__ | 159 #ifdef _WIN64 |
| 158 // Microsoft calling convention has three callee-saved registers | 160 // Microsoft calling convention has three callee-saved registers |
| 159 // (that we are using). We push these after the frame pointer. | 161 // (that we are using). We push these after the frame pointer. |
| 160 static const int kBackup_rsi = kFramePointer - kPointerSize; | 162 static const int kBackup_rsi = kFramePointer - kPointerSize; |
| 161 static const int kBackup_rdi = kBackup_rsi - kPointerSize; | 163 static const int kBackup_rdi = kBackup_rsi - kPointerSize; |
| 162 static const int kBackup_rbx = kBackup_rdi - kPointerSize; | 164 static const int kBackup_rbx = kBackup_rdi - kPointerSize; |
| 163 static const int kLastCalleeSaveRegister = kBackup_rbx; | 165 static const int kLastCalleeSaveRegister = kBackup_rbx; |
| 164 #else | 166 #else |
| 165 // AMD64 Calling Convention has only one callee-save register that | 167 // AMD64 Calling Convention has only one callee-save register that |
| 166 // we use. We push this after the frame pointer (and after the | 168 // we use. We push this after the frame pointer (and after the |
| 167 // parameters). | 169 // parameters). |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 Label exit_label_; | 285 Label exit_label_; |
| 284 Label check_preempt_label_; | 286 Label check_preempt_label_; |
| 285 Label stack_overflow_label_; | 287 Label stack_overflow_label_; |
| 286 }; | 288 }; |
| 287 | 289 |
| 288 #endif // V8_NATIVE_REGEXP | 290 #endif // V8_NATIVE_REGEXP |
| 289 | 291 |
| 290 }} // namespace v8::internal | 292 }} // namespace v8::internal |
| 291 | 293 |
| 292 #endif // V8_X64_REGEXP_MACRO_ASSEMBLER_X64_H_ | 294 #endif // V8_X64_REGEXP_MACRO_ASSEMBLER_X64_H_ |
| OLD | NEW |