Anonymous avatar Anonymous committed cd77f89

Merge commit 12664 from 4.00 on trunk/

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12665 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02

Comments (0)

Files changed (3)

asmcomp/amd64/emit.mlp

         if alloc then begin
           `	{load_symbol_addr s}, %rax\n`;
           `	{emit_call "caml_c_call"}\n`;
-          record_frame i.live i.dbg
+          record_frame i.live i.dbg;
+          `	{load_symbol_addr "caml_young_ptr"}, %r11\n`;
+          `	movq    (%r11), %r15\n`;
         end else begin
           `	{emit_call s}\n`
         end

asmcomp/emitaux.ml

 (* CFI directives *)
 
 let is_cfi_enabled () =
-  !Clflags.debug && Config.asm_cfi_supported
+  Config.asm_cfi_supported
 
 let cfi_startproc () =
   if is_cfi_enabled () then
   begin
     emit_string "	.cfi_adjust_cfa_offset	"; emit_int n; emit_string "\n";
   end
- 
+
 
 #if defined(SYS_macosx)
 
-#define LBL(x) L##x	
+#define LBL(x) L##x
 #define G(r) _##r
 #define GREL(r) _##r@GOTPCREL
 #define GCALL(r) _##r
         name:
 
 #elif defined(SYS_mingw64)
-	
-#define LBL(x) .L##x	
+
+#define LBL(x) .L##x
 #define G(r) r
 #undef  GREL
 #define GCALL(r) r
 
 #else
 
-#define LBL(x) .L##x	
+#define LBL(x) .L##x
 #define G(r) r
 #define GREL(r) r@GOTPCREL
 #define GCALL(r) r@PLT
 #define CFI_ENDPROC
 #define CFI_ADJUST(n)
 #endif
-        
+
 #if defined(__PIC__) && !defined(SYS_mingw64)
 
 /* Position-independent operations on global variables. */
 	popq    %r11
 
 #else
-        
+
 /* Non-PIC operations on global variables.  Slightly faster. */
 
 #define STORE_VAR(srcreg,dstlabel) \
 
 #endif
 
-/* Save and restore all callee-save registers on stack.  
+/* Save and restore all callee-save registers on stack.
    Keep the stack 16-aligned. */
 
-#if defined(SYS_mingw64)	
+#if defined(SYS_mingw64)
 
 /* Win64 API: callee-save regs are rbx, rbp, rsi, rdi, r12-r15, xmm6-xmm15 */
 
         popq    %rbp; \
         popq    %rbx
 
-#endif	
+#endif
 
 #ifdef SYS_mingw64
    /* Calls from OCaml to C must reserve 32 bytes of extra stack space */
-#  define PREPARE_FOR_C_CALL subq $32, %rsp	
+#  define PREPARE_FOR_C_CALL subq $32, %rsp
 #  define CLEANUP_AFTER_C_CALL addq $32, %rsp
 #else
 #  define PREPARE_FOR_C_CALL
         popq    %r12
         STORE_VAR(%r12, caml_last_return_address)
         STORE_VAR(%rsp, caml_bottom_of_stack)
+        pushq    %r12
 #ifndef SYS_mingw64
     /* Touch the stack to trigger a recoverable segfault
        if insufficient space remains */
     /* Call the function (address in %rax) */
     /* No need to PREPARE_FOR_C_CALL since the caller already
        reserved the stack space if needed (cf. amd64/proc.ml) */
-        call    *%rax
-    /* Reload alloc ptr */
-	LOAD_VAR(caml_young_ptr, %r15)
-    /* Return to caller */
-	pushq	%r12
-	ret
+        jmp    *%rax
 
 /* Start the OCaml program */
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.