Index: src/x64/assembler-x64.cc |
diff --git a/src/x64/assembler-x64.cc b/src/x64/assembler-x64.cc |
index 999306e37892a434ec19b4e7efb343922d1bb132..d2e4fa8bf9a19a4f3726494dcfcdbf372276f1ac 100644 |
--- a/src/x64/assembler-x64.cc |
+++ b/src/x64/assembler-x64.cc |
@@ -916,6 +916,23 @@ void Assembler::call(const Operand& op) { |
} |
+// Calls directly to the given address using a relative offset. |
+// Should only ever be used in Code objects for calls within the |
+// same Code object. Should not be used when generating new code (use labels), |
+// but only when patching existing code. |
+void Assembler::call(Address target) { |
+ positions_recorder()->WriteRecordedPositions(); |
+ EnsureSpace ensure_space(this); |
+ last_pc_ = pc_; |
+ // 1110 1000 #32-bit disp. |
+ emit(0xE8); |
+ Address source = pc_ + 4; |
+ intptr_t displacement = target - source; |
+ ASSERT(is_int32(displacement)); |
+ emitl(static_cast<int32_t>(displacement)); |
+} |
+ |
+ |
void Assembler::clc() { |
EnsureSpace ensure_space(this); |
last_pc_ = pc_; |