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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 static const byte kCallOpcode = 0xE8; | 45 static const byte kCallOpcode = 0xE8; |
46 | 46 |
47 | 47 |
48 void Assembler::emitl(uint32_t x) { | 48 void Assembler::emitl(uint32_t x) { |
49 Memory::uint32_at(pc_) = x; | 49 Memory::uint32_at(pc_) = x; |
50 pc_ += sizeof(uint32_t); | 50 pc_ += sizeof(uint32_t); |
51 } | 51 } |
52 | 52 |
53 | 53 |
| 54 void Assembler::emitp(void* x, RelocInfo::Mode rmode) { |
| 55 uintptr_t value = reinterpret_cast<uintptr_t>(x); |
| 56 Memory::uintptr_at(pc_) = value; |
| 57 if (!RelocInfo::IsNone(rmode)) { |
| 58 RecordRelocInfo(rmode, value); |
| 59 } |
| 60 pc_ += sizeof(uintptr_t); |
| 61 } |
| 62 |
| 63 |
54 void Assembler::emitq(uint64_t x, RelocInfo::Mode rmode) { | 64 void Assembler::emitq(uint64_t x, RelocInfo::Mode rmode) { |
55 Memory::uint64_at(pc_) = x; | 65 Memory::uint64_at(pc_) = x; |
56 if (!RelocInfo::IsNone(rmode)) { | 66 if (!RelocInfo::IsNone(rmode)) { |
57 RecordRelocInfo(rmode, x); | 67 RecordRelocInfo(rmode, x); |
58 } | 68 } |
59 pc_ += sizeof(uint64_t); | 69 pc_ += sizeof(uint64_t); |
60 } | 70 } |
61 | 71 |
62 | 72 |
63 void Assembler::emitw(uint16_t x) { | 73 void Assembler::emitw(uint16_t x) { |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 ASSERT(len_ == 1 || len_ == 2); | 539 ASSERT(len_ == 1 || len_ == 2); |
530 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]); | 540 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]); |
531 *p = disp; | 541 *p = disp; |
532 len_ += sizeof(int32_t); | 542 len_ += sizeof(int32_t); |
533 } | 543 } |
534 | 544 |
535 | 545 |
536 } } // namespace v8::internal | 546 } } // namespace v8::internal |
537 | 547 |
538 #endif // V8_X64_ASSEMBLER_X64_INL_H_ | 548 #endif // V8_X64_ASSEMBLER_X64_INL_H_ |
OLD | NEW |