OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 if (IsInternalReference(rmode_)) { | 216 if (IsInternalReference(rmode_)) { |
217 // absolute code pointer inside code object moves with the code object. | 217 // absolute code pointer inside code object moves with the code object. |
218 Memory::Address_at(pc_) += static_cast<int32_t>(delta); | 218 Memory::Address_at(pc_) += static_cast<int32_t>(delta); |
219 CPU::FlushICache(pc_, sizeof(Address)); | 219 CPU::FlushICache(pc_, sizeof(Address)); |
220 } else if (IsCodeTarget(rmode_)) { | 220 } else if (IsCodeTarget(rmode_)) { |
221 Memory::int32_at(pc_) -= static_cast<int32_t>(delta); | 221 Memory::int32_at(pc_) -= static_cast<int32_t>(delta); |
222 CPU::FlushICache(pc_, sizeof(int32_t)); | 222 CPU::FlushICache(pc_, sizeof(int32_t)); |
223 } else if (rmode_ == CODE_AGE_SEQUENCE) { | 223 } else if (rmode_ == CODE_AGE_SEQUENCE) { |
224 if (*pc_ == kCallOpcode) { | 224 if (*pc_ == kCallOpcode) { |
225 int32_t* p = reinterpret_cast<int32_t*>(pc_ + 1); | 225 int32_t* p = reinterpret_cast<int32_t*>(pc_ + 1); |
226 *p -= delta; // Relocate entry. | 226 *p -= static_cast<int32_t>(delta); // Relocate entry. |
227 CPU::FlushICache(p, sizeof(uint32_t)); | 227 CPU::FlushICache(p, sizeof(uint32_t)); |
228 } | 228 } |
229 } | 229 } |
230 } | 230 } |
231 | 231 |
232 | 232 |
233 Address RelocInfo::target_address() { | 233 Address RelocInfo::target_address() { |
234 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY); | 234 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY); |
235 if (IsCodeTarget(rmode_)) { | 235 if (IsCodeTarget(rmode_)) { |
236 return Assembler::target_address_at(pc_); | 236 return Assembler::target_address_at(pc_); |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 ASSERT(len_ == 1 || len_ == 2); | 512 ASSERT(len_ == 1 || len_ == 2); |
513 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]); | 513 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]); |
514 *p = disp; | 514 *p = disp; |
515 len_ += sizeof(int32_t); | 515 len_ += sizeof(int32_t); |
516 } | 516 } |
517 | 517 |
518 | 518 |
519 } } // namespace v8::internal | 519 } } // namespace v8::internal |
520 | 520 |
521 #endif // V8_X64_ASSEMBLER_X64_INL_H_ | 521 #endif // V8_X64_ASSEMBLER_X64_INL_H_ |
OLD | NEW |