| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/assembler_macros.h" | 9 #include "vm/assembler_macros.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 OS::Print("Stop message: %s\n", message); | 95 OS::Print("Stop message: %s\n", message); |
| 96 } | 96 } |
| 97 END_LEAF_RUNTIME_ENTRY | 97 END_LEAF_RUNTIME_ENTRY |
| 98 | 98 |
| 99 | 99 |
| 100 // Input parameters: | 100 // Input parameters: |
| 101 // RSP : points to return address. | 101 // RSP : points to return address. |
| 102 // RDI : stop message (const char*). | 102 // RDI : stop message (const char*). |
| 103 // Must preserve all registers. | 103 // Must preserve all registers. |
| 104 void StubCode::GeneratePrintStopMessageStub(Assembler* assembler) { | 104 void StubCode::GeneratePrintStopMessageStub(Assembler* assembler) { |
| 105 __ enter(Immediate(0)); | 105 __ EnterCallRuntimeFrame(0); |
| 106 __ PreserveCallerSavedRegisters(); | |
| 107 | |
| 108 // Call the runtime leaf function. RDI already contains the parameter. | 106 // Call the runtime leaf function. RDI already contains the parameter. |
| 109 __ ReserveAlignedFrameSpace(0); | |
| 110 __ CallRuntime(kPrintStopMessageRuntimeEntry); | 107 __ CallRuntime(kPrintStopMessageRuntimeEntry); |
| 111 | 108 __ LeaveCallRuntimeFrame(); |
| 112 __ RestoreCallerSavedRegisters(); | |
| 113 __ leave(); | |
| 114 __ ret(); | 109 __ ret(); |
| 115 } | 110 } |
| 116 | 111 |
| 117 | 112 |
| 118 // Input parameters: | 113 // Input parameters: |
| 119 // RSP : points to return address. | 114 // RSP : points to return address. |
| 120 // RSP + 8 : address of return value. | 115 // RSP + 8 : address of return value. |
| 121 // RAX : address of first argument in argument array. | 116 // RAX : address of first argument in argument array. |
| 122 // RAX - 8*R10 + 8 : address of last argument in argument array. | 117 // RAX - 8*R10 + 8 : address of last argument in argument array. |
| 123 // RBX : address of the native function to call. | 118 // RBX : address of the native function to call. |
| (...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1080 __ cmpl(RCX, Immediate(StoreBufferBlock::kSize)); | 1075 __ cmpl(RCX, Immediate(StoreBufferBlock::kSize)); |
| 1081 // Restore values. | 1076 // Restore values. |
| 1082 __ popq(RCX); | 1077 __ popq(RCX); |
| 1083 __ popq(RDX); | 1078 __ popq(RDX); |
| 1084 __ j(EQUAL, &L, Assembler::kNearJump); | 1079 __ j(EQUAL, &L, Assembler::kNearJump); |
| 1085 __ ret(); | 1080 __ ret(); |
| 1086 | 1081 |
| 1087 // Handle overflow: Call the runtime leaf function. | 1082 // Handle overflow: Call the runtime leaf function. |
| 1088 __ Bind(&L); | 1083 __ Bind(&L); |
| 1089 // Setup frame, push callee-saved registers. | 1084 // Setup frame, push callee-saved registers. |
| 1090 __ enter(Immediate(0)); | 1085 __ EnterCallRuntimeFrame(0); |
| 1091 __ PreserveCallerSavedRegisters(); | |
| 1092 __ ReserveAlignedFrameSpace(0); | |
| 1093 __ movq(RDI, FieldAddress(CTX, Context::isolate_offset())); | 1086 __ movq(RDI, FieldAddress(CTX, Context::isolate_offset())); |
| 1094 __ CallRuntime(kStoreBufferBlockProcessRuntimeEntry); | 1087 __ CallRuntime(kStoreBufferBlockProcessRuntimeEntry); |
| 1095 // Restore callee-saved registers, tear down frame. | 1088 __ LeaveCallRuntimeFrame(); |
| 1096 __ RestoreCallerSavedRegisters(); | |
| 1097 __ leave(); | |
| 1098 __ ret(); | 1089 __ ret(); |
| 1099 } | 1090 } |
| 1100 | 1091 |
| 1101 | 1092 |
| 1102 // Called for inline allocation of objects. | 1093 // Called for inline allocation of objects. |
| 1103 // Input parameters: | 1094 // Input parameters: |
| 1104 // RSP + 16 : type arguments object (only if class is parameterized). | 1095 // RSP + 16 : type arguments object (only if class is parameterized). |
| 1105 // RSP + 8 : type arguments of instantiator (only if class is parameterized). | 1096 // RSP + 8 : type arguments of instantiator (only if class is parameterized). |
| 1106 // RSP : points to return address. | 1097 // RSP : points to return address. |
| 1107 void StubCode::GenerateAllocationStubForClass(Assembler* assembler, | 1098 void StubCode::GenerateAllocationStubForClass(Assembler* assembler, |
| (...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1903 void StubCode::GenerateJumpToErrorHandlerStub(Assembler* assembler) { | 1894 void StubCode::GenerateJumpToErrorHandlerStub(Assembler* assembler) { |
| 1904 __ movq(RAX, RCX); // error object. | 1895 __ movq(RAX, RCX); // error object. |
| 1905 __ movq(RBP, RDX); // target frame_pointer. | 1896 __ movq(RBP, RDX); // target frame_pointer. |
| 1906 __ movq(RSP, RSI); // target stack_pointer. | 1897 __ movq(RSP, RSI); // target stack_pointer. |
| 1907 __ jmp(RDI); // Jump to the exception handler code. | 1898 __ jmp(RDI); // Jump to the exception handler code. |
| 1908 } | 1899 } |
| 1909 | 1900 |
| 1910 } // namespace dart | 1901 } // namespace dart |
| 1911 | 1902 |
| 1912 #endif // defined TARGET_ARCH_X64 | 1903 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |