OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_X64_ASSEMBLER_X64_INL_H_ | 5 #ifndef V8_X64_ASSEMBLER_X64_INL_H_ |
6 #define V8_X64_ASSEMBLER_X64_INL_H_ | 6 #define V8_X64_ASSEMBLER_X64_INL_H_ |
7 | 7 |
8 #include "src/x64/assembler-x64.h" | 8 #include "src/x64/assembler-x64.h" |
9 | 9 |
10 #include "src/base/cpu.h" | 10 #include "src/base/cpu.h" |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 *p -= static_cast<int32_t>(delta); // Relocate entry. | 315 *p -= static_cast<int32_t>(delta); // Relocate entry. |
316 } | 316 } |
317 } else if (IsInternalReference(rmode_)) { | 317 } else if (IsInternalReference(rmode_)) { |
318 // absolute code pointer inside code object moves with the code object. | 318 // absolute code pointer inside code object moves with the code object. |
319 Memory::Address_at(pc_) += delta; | 319 Memory::Address_at(pc_) += delta; |
320 } | 320 } |
321 } | 321 } |
322 | 322 |
323 | 323 |
324 Address RelocInfo::target_address() { | 324 Address RelocInfo::target_address() { |
325 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)); | 325 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || |
| 326 IsWasmCodeEntry(rmode_)); |
326 return Assembler::target_address_at(pc_, host_); | 327 return Assembler::target_address_at(pc_, host_); |
327 } | 328 } |
328 | 329 |
329 | 330 |
330 Address RelocInfo::target_address_address() { | 331 Address RelocInfo::target_address_address() { |
331 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) | 332 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) |
332 || rmode_ == EMBEDDED_OBJECT | 333 || rmode_ == EMBEDDED_OBJECT |
333 || rmode_ == EXTERNAL_REFERENCE); | 334 || rmode_ == EXTERNAL_REFERENCE); |
334 return reinterpret_cast<Address>(pc_); | 335 return reinterpret_cast<Address>(pc_); |
335 } | 336 } |
(...skipping 10 matching lines...) Expand all Loading... |
346 return Assembler::kSpecialTargetSize; | 347 return Assembler::kSpecialTargetSize; |
347 } else { | 348 } else { |
348 return kPointerSize; | 349 return kPointerSize; |
349 } | 350 } |
350 } | 351 } |
351 | 352 |
352 | 353 |
353 void RelocInfo::set_target_address(Address target, | 354 void RelocInfo::set_target_address(Address target, |
354 WriteBarrierMode write_barrier_mode, | 355 WriteBarrierMode write_barrier_mode, |
355 ICacheFlushMode icache_flush_mode) { | 356 ICacheFlushMode icache_flush_mode) { |
356 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)); | 357 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || |
| 358 IsWasmCodeEntry(rmode_)); |
357 Assembler::set_target_address_at(isolate_, pc_, host_, target, | 359 Assembler::set_target_address_at(isolate_, pc_, host_, target, |
358 icache_flush_mode); | 360 icache_flush_mode); |
359 if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL && | 361 if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL && |
360 IsCodeTarget(rmode_)) { | 362 IsCodeTarget(rmode_)) { |
361 Object* target_code = Code::GetCodeFromTargetAddress(target); | 363 Object* target_code = Code::GetCodeFromTargetAddress(target); |
362 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( | 364 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( |
363 host(), this, HeapObject::cast(target_code)); | 365 host(), this, HeapObject::cast(target_code)); |
364 } | 366 } |
365 } | 367 } |
366 | 368 |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 void Operand::set_disp64(int64_t disp) { | 612 void Operand::set_disp64(int64_t disp) { |
611 DCHECK_EQ(1, len_); | 613 DCHECK_EQ(1, len_); |
612 int64_t* p = reinterpret_cast<int64_t*>(&buf_[len_]); | 614 int64_t* p = reinterpret_cast<int64_t*>(&buf_[len_]); |
613 *p = disp; | 615 *p = disp; |
614 len_ += sizeof(disp); | 616 len_ += sizeof(disp); |
615 } | 617 } |
616 } // namespace internal | 618 } // namespace internal |
617 } // namespace v8 | 619 } // namespace v8 |
618 | 620 |
619 #endif // V8_X64_ASSEMBLER_X64_INL_H_ | 621 #endif // V8_X64_ASSEMBLER_X64_INL_H_ |
OLD | NEW |