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 27 matching lines...) Expand all Loading... |
38 namespace internal { | 38 namespace internal { |
39 | 39 |
40 | 40 |
41 // ----------------------------------------------------------------------------- | 41 // ----------------------------------------------------------------------------- |
42 // Implementation of Assembler | 42 // Implementation of Assembler |
43 | 43 |
44 | 44 |
45 static const byte kCallOpcode = 0xE8; | 45 static const byte kCallOpcode = 0xE8; |
46 | 46 |
47 | 47 |
| 48 void Assembler::emit(uintptr_t x, RelocInfo::Mode rmode) { |
| 49 Memory::uintptr_at(pc_) = x; |
| 50 if (!RelocInfo::IsNone(rmode)) { |
| 51 RecordRelocInfo(rmode, x); |
| 52 } |
| 53 pc_ += sizeof(uintptr_t); |
| 54 } |
| 55 |
| 56 |
48 void Assembler::emitl(uint32_t x) { | 57 void Assembler::emitl(uint32_t x) { |
49 Memory::uint32_at(pc_) = x; | 58 Memory::uint32_at(pc_) = x; |
50 pc_ += sizeof(uint32_t); | 59 pc_ += sizeof(uint32_t); |
51 } | 60 } |
52 | 61 |
53 | 62 |
54 void Assembler::emitq(uint64_t x, RelocInfo::Mode rmode) { | |
55 Memory::uint64_at(pc_) = x; | |
56 if (!RelocInfo::IsNone(rmode)) { | |
57 RecordRelocInfo(rmode, x); | |
58 } | |
59 pc_ += sizeof(uint64_t); | |
60 } | |
61 | |
62 | |
63 void Assembler::emitw(uint16_t x) { | 63 void Assembler::emitw(uint16_t x) { |
64 Memory::uint16_at(pc_) = x; | 64 Memory::uint16_at(pc_) = x; |
65 pc_ += sizeof(uint16_t); | 65 pc_ += sizeof(uint16_t); |
66 } | 66 } |
67 | 67 |
68 | 68 |
69 void Assembler::emit_code_target(Handle<Code> target, | 69 void Assembler::emit_code_target(Handle<Code> target, |
70 RelocInfo::Mode rmode, | 70 RelocInfo::Mode rmode, |
71 TypeFeedbackId ast_id) { | 71 TypeFeedbackId ast_id) { |
72 ASSERT(RelocInfo::IsCodeTarget(rmode)); | 72 ASSERT(RelocInfo::IsCodeTarget(rmode)); |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 ASSERT(len_ == 1 || len_ == 2); | 529 ASSERT(len_ == 1 || len_ == 2); |
530 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]); | 530 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]); |
531 *p = disp; | 531 *p = disp; |
532 len_ += sizeof(int32_t); | 532 len_ += sizeof(int32_t); |
533 } | 533 } |
534 | 534 |
535 | 535 |
536 } } // namespace v8::internal | 536 } } // namespace v8::internal |
537 | 537 |
538 #endif // V8_X64_ASSEMBLER_X64_INL_H_ | 538 #endif // V8_X64_ASSEMBLER_X64_INL_H_ |
OLD | NEW |