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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 144 |
145 | 145 |
146 // ----------------------------------------------------------------------------- | 146 // ----------------------------------------------------------------------------- |
147 // Implementation of RelocInfo | 147 // Implementation of RelocInfo |
148 | 148 |
149 // The modes possibly affected by apply must be in kApplyMask. | 149 // The modes possibly affected by apply must be in kApplyMask. |
150 void RelocInfo::apply(int delta) { | 150 void RelocInfo::apply(int delta) { |
151 if (rmode_ == RUNTIME_ENTRY || IsCodeTarget(rmode_)) { | 151 if (rmode_ == RUNTIME_ENTRY || IsCodeTarget(rmode_)) { |
152 intptr_t* p = reinterpret_cast<intptr_t*>(pc_); | 152 intptr_t* p = reinterpret_cast<intptr_t*>(pc_); |
153 *p -= delta; // relocate entry | 153 *p -= delta; // relocate entry |
154 } else if (rmode_ == JS_RETURN && IsCallInstruction()) { | |
155 // Special handling of js_return when a break point is set (call | |
156 // instruction has been inserted). | |
157 intptr_t* p = reinterpret_cast<intptr_t*>(pc_ + 1); | |
158 *p -= delta; // relocate entry | |
159 } else if (IsInternalReference(rmode_)) { | 154 } else if (IsInternalReference(rmode_)) { |
160 // absolute code pointer inside code object moves with the code object. | 155 // absolute code pointer inside code object moves with the code object. |
161 intptr_t* p = reinterpret_cast<intptr_t*>(pc_); | 156 intptr_t* p = reinterpret_cast<intptr_t*>(pc_); |
162 *p += delta; // relocate entry | 157 *p += delta; // relocate entry |
163 } | 158 } |
164 } | 159 } |
165 | 160 |
166 | 161 |
167 Address RelocInfo::target_address() { | 162 Address RelocInfo::target_address() { |
168 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY); | 163 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 ASSERT(len_ == 1 || len_ == 2); | 275 ASSERT(len_ == 1 || len_ == 2); |
281 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]); | 276 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]); |
282 *p = disp; | 277 *p = disp; |
283 len_ += sizeof(int32_t); | 278 len_ += sizeof(int32_t); |
284 } | 279 } |
285 | 280 |
286 | 281 |
287 } } // namespace v8::internal | 282 } } // namespace v8::internal |
288 | 283 |
289 #endif // V8_X64_ASSEMBLER_X64_INL_H_ | 284 #endif // V8_X64_ASSEMBLER_X64_INL_H_ |
OLD | NEW |