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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 #include "cpu.h" | 31 #include "cpu.h" |
32 | 32 |
33 namespace v8 { | 33 namespace v8 { |
34 namespace internal { | 34 namespace internal { |
35 | 35 |
36 Condition NegateCondition(Condition cc) { | 36 Condition NegateCondition(Condition cc) { |
37 return static_cast<Condition>(cc ^ 1); | 37 return static_cast<Condition>(cc ^ 1); |
38 } | 38 } |
39 | 39 |
| 40 // ----------------------------------------------------------------------------- |
| 41 |
| 42 Immediate::Immediate(Smi* value) { |
| 43 value_ = static_cast<int32_t>(reinterpret_cast<intptr_t>(value)); |
| 44 } |
40 | 45 |
41 // ----------------------------------------------------------------------------- | 46 // ----------------------------------------------------------------------------- |
42 // Implementation of Assembler | 47 // Implementation of Assembler |
43 | 48 |
44 | 49 |
45 | 50 |
46 void Assembler::emitl(uint32_t x) { | 51 void Assembler::emitl(uint32_t x) { |
47 Memory::uint32_at(pc_) = x; | 52 Memory::uint32_at(pc_) = x; |
48 pc_ += sizeof(uint32_t); | 53 pc_ += sizeof(uint32_t); |
49 } | 54 } |
50 | 55 |
51 | 56 |
52 void Assembler::emitq(uint64_t x, RelocInfo::Mode rmode) { | 57 void Assembler::emitq(uint64_t x, RelocInfo::Mode rmode) { |
53 Memory::uint64_at(pc_) = x; | 58 Memory::uint64_at(pc_) = x; |
54 RecordRelocInfo(rmode, x); | 59 if (rmode != RelocInfo::NONE) { |
| 60 RecordRelocInfo(rmode, x); |
| 61 } |
| 62 pc_ += sizeof(uint64_t); |
55 } | 63 } |
56 | 64 |
57 | 65 |
58 void Assembler::emitw(uint16_t x) { | 66 void Assembler::emitw(uint16_t x) { |
59 Memory::uint16_at(pc_) = x; | 67 Memory::uint16_at(pc_) = x; |
60 pc_ += sizeof(uint16_t); | 68 pc_ += sizeof(uint16_t); |
61 } | 69 } |
62 | 70 |
63 | 71 |
64 void Assembler::emit_rex_64(Register reg, Register rm_reg) { | 72 void Assembler::emit_rex_64(Register reg, Register rm_reg) { |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 ASSERT(len_ == 1 || len_ == 2); | 297 ASSERT(len_ == 1 || len_ == 2); |
290 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]); | 298 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]); |
291 *p = disp; | 299 *p = disp; |
292 len_ += sizeof(int32_t); | 300 len_ += sizeof(int32_t); |
293 } | 301 } |
294 | 302 |
295 | 303 |
296 } } // namespace v8::internal | 304 } } // namespace v8::internal |
297 | 305 |
298 #endif // V8_X64_ASSEMBLER_X64_INL_H_ | 306 #endif // V8_X64_ASSEMBLER_X64_INL_H_ |
OLD | NEW |