| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 OS::Print("Stop message: %s\n", message); | 93 OS::Print("Stop message: %s\n", message); |
| 94 } | 94 } |
| 95 END_LEAF_RUNTIME_ENTRY | 95 END_LEAF_RUNTIME_ENTRY |
| 96 | 96 |
| 97 | 97 |
| 98 // Input parameters: | 98 // Input parameters: |
| 99 // ESP : points to return address. | 99 // ESP : points to return address. |
| 100 // EAX : stop message (const char*). | 100 // EAX : stop message (const char*). |
| 101 // Must preserve all registers, except EAX. | 101 // Must preserve all registers, except EAX. |
| 102 void StubCode::GeneratePrintStopMessageStub(Assembler* assembler) { | 102 void StubCode::GeneratePrintStopMessageStub(Assembler* assembler) { |
| 103 __ enter(Immediate(0)); | 103 __ EnterCallRuntimeFrame(1 * kWordSize); |
| 104 __ PreserveCallerSavedRegisters(); | |
| 105 | |
| 106 // Call the runtime leaf function. | |
| 107 __ ReserveAlignedFrameSpace(1 * kWordSize); | |
| 108 __ movl(Address(ESP, 0), EAX); | 104 __ movl(Address(ESP, 0), EAX); |
| 109 __ CallRuntime(kPrintStopMessageRuntimeEntry); | 105 __ CallRuntime(kPrintStopMessageRuntimeEntry); |
| 110 | 106 __ LeaveCallRuntimeFrame(); |
| 111 __ RestoreCallerSavedRegisters(); | |
| 112 __ leave(); | |
| 113 __ ret(); | 107 __ ret(); |
| 114 } | 108 } |
| 115 | 109 |
| 116 | 110 |
| 117 // Input parameters: | 111 // Input parameters: |
| 118 // ESP : points to return address. | 112 // ESP : points to return address. |
| 119 // ESP + 4 : address of return value. | 113 // ESP + 4 : address of return value. |
| 120 // EAX : address of first argument in argument array. | 114 // EAX : address of first argument in argument array. |
| 121 // EAX - 4*EDX + 4 : address of last argument in argument array. | 115 // EAX - 4*EDX + 4 : address of last argument in argument array. |
| 122 // ECX : address of the native function to call. | 116 // ECX : address of the native function to call. |
| (...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1102 // Restore values. | 1096 // Restore values. |
| 1103 // Spilled: EDX, ECX | 1097 // Spilled: EDX, ECX |
| 1104 __ popl(ECX); | 1098 __ popl(ECX); |
| 1105 __ popl(EDX); | 1099 __ popl(EDX); |
| 1106 __ j(EQUAL, &L, Assembler::kNearJump); | 1100 __ j(EQUAL, &L, Assembler::kNearJump); |
| 1107 __ ret(); | 1101 __ ret(); |
| 1108 | 1102 |
| 1109 // Handle overflow: Call the runtime leaf function. | 1103 // Handle overflow: Call the runtime leaf function. |
| 1110 __ Bind(&L); | 1104 __ Bind(&L); |
| 1111 // Setup frame, push callee-saved registers. | 1105 // Setup frame, push callee-saved registers. |
| 1112 __ enter(Immediate(0)); | 1106 |
| 1113 __ PreserveCallerSavedRegisters(); | 1107 __ EnterCallRuntimeFrame(1 * kWordSize); |
| 1114 __ movl(EAX, FieldAddress(CTX, Context::isolate_offset())); | 1108 __ movl(EAX, FieldAddress(CTX, Context::isolate_offset())); |
| 1115 __ ReserveAlignedFrameSpace(1 * kWordSize); | |
| 1116 __ movl(Address(ESP, 0), EAX); // Push the isolate as the only argument. | 1109 __ movl(Address(ESP, 0), EAX); // Push the isolate as the only argument. |
| 1117 __ CallRuntime(kStoreBufferBlockProcessRuntimeEntry); | 1110 __ CallRuntime(kStoreBufferBlockProcessRuntimeEntry); |
| 1118 // Restore callee-saved registers, tear down frame. | 1111 // Restore callee-saved registers, tear down frame. |
| 1119 __ RestoreCallerSavedRegisters(); | 1112 __ LeaveCallRuntimeFrame(); |
| 1120 __ leave(); | |
| 1121 __ ret(); | 1113 __ ret(); |
| 1122 } | 1114 } |
| 1123 | 1115 |
| 1124 | 1116 |
| 1125 // Called for inline allocation of objects. | 1117 // Called for inline allocation of objects. |
| 1126 // Input parameters: | 1118 // Input parameters: |
| 1127 // ESP + 8 : type arguments object (only if class is parameterized). | 1119 // ESP + 8 : type arguments object (only if class is parameterized). |
| 1128 // ESP + 4 : type arguments of instantiator (only if class is parameterized). | 1120 // ESP + 4 : type arguments of instantiator (only if class is parameterized). |
| 1129 // ESP : points to return address. | 1121 // ESP : points to return address. |
| 1130 // Uses EAX, EBX, ECX, EDX, EDI as temporary registers. | 1122 // Uses EAX, EBX, ECX, EDX, EDI as temporary registers. |
| (...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1945 __ movl(EAX, Address(ESP, 4 * kWordSize)); // Load error object. | 1937 __ movl(EAX, Address(ESP, 4 * kWordSize)); // Load error object. |
| 1946 __ movl(EBP, Address(ESP, 3 * kWordSize)); // Load target frame_pointer. | 1938 __ movl(EBP, Address(ESP, 3 * kWordSize)); // Load target frame_pointer. |
| 1947 __ movl(EBX, Address(ESP, 1 * kWordSize)); // Load target PC into EBX. | 1939 __ movl(EBX, Address(ESP, 1 * kWordSize)); // Load target PC into EBX. |
| 1948 __ movl(ESP, Address(ESP, 2 * kWordSize)); // Load target stack_pointer. | 1940 __ movl(ESP, Address(ESP, 2 * kWordSize)); // Load target stack_pointer. |
| 1949 __ jmp(EBX); // Jump to the exception handler code. | 1941 __ jmp(EBX); // Jump to the exception handler code. |
| 1950 } | 1942 } |
| 1951 | 1943 |
| 1952 } // namespace dart | 1944 } // namespace dart |
| 1953 | 1945 |
| 1954 #endif // defined TARGET_ARCH_IA32 | 1946 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |