| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 | 323 |
| 324 // Input parameters: | 324 // Input parameters: |
| 325 // EDX: smi-tagged argument count, may be zero. | 325 // EDX: smi-tagged argument count, may be zero. |
| 326 // EBP[kParamEndSlotFromFp + 1]: last argument. | 326 // EBP[kParamEndSlotFromFp + 1]: last argument. |
| 327 // Uses EAX, EBX, ECX, EDX, EDI. | 327 // Uses EAX, EBX, ECX, EDX, EDI. |
| 328 static void PushArgumentsArray(Assembler* assembler) { | 328 static void PushArgumentsArray(Assembler* assembler) { |
| 329 // Allocate array to store arguments of caller. | 329 // Allocate array to store arguments of caller. |
| 330 const Immediate& raw_null = | 330 const Immediate& raw_null = |
| 331 Immediate(reinterpret_cast<intptr_t>(Object::null())); | 331 Immediate(reinterpret_cast<intptr_t>(Object::null())); |
| 332 __ movl(ECX, raw_null); // Null element type for raw Array. | 332 __ movl(ECX, raw_null); // Null element type for raw Array. |
| 333 const ExternalLabel array_label(StubCode::AllocateArrayEntryPoint()); | 333 __ Call(*StubCode::AllocateArray_entry()); |
| 334 __ call(&array_label); | |
| 335 __ SmiUntag(EDX); | 334 __ SmiUntag(EDX); |
| 336 // EAX: newly allocated array. | 335 // EAX: newly allocated array. |
| 337 // EDX: length of the array (was preserved by the stub). | 336 // EDX: length of the array (was preserved by the stub). |
| 338 __ pushl(EAX); // Array is in EAX and on top of stack. | 337 __ pushl(EAX); // Array is in EAX and on top of stack. |
| 339 __ leal(EBX, Address(EBP, EDX, TIMES_4, kParamEndSlotFromFp * kWordSize)); | 338 __ leal(EBX, Address(EBP, EDX, TIMES_4, kParamEndSlotFromFp * kWordSize)); |
| 340 __ leal(ECX, FieldAddress(EAX, Array::data_offset())); | 339 __ leal(ECX, FieldAddress(EAX, Array::data_offset())); |
| 341 // EBX: address of first argument on stack. | 340 // EBX: address of first argument on stack. |
| 342 // ECX: address of first argument in array. | 341 // ECX: address of first argument in array. |
| 343 Label loop, loop_condition; | 342 Label loop, loop_condition; |
| 344 __ jmp(&loop_condition, Assembler::kNearJump); | 343 __ jmp(&loop_condition, Assembler::kNearJump); |
| (...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1127 __ popl(EAX); // Pop argument (type arguments of object). | 1126 __ popl(EAX); // Pop argument (type arguments of object). |
| 1128 __ popl(EAX); // Pop argument (class of object). | 1127 __ popl(EAX); // Pop argument (class of object). |
| 1129 __ popl(EAX); // Pop result (newly allocated object). | 1128 __ popl(EAX); // Pop result (newly allocated object). |
| 1130 // EAX: new object | 1129 // EAX: new object |
| 1131 // Restore the frame pointer. | 1130 // Restore the frame pointer. |
| 1132 __ LeaveFrame(); | 1131 __ LeaveFrame(); |
| 1133 __ ret(); | 1132 __ ret(); |
| 1134 // Emit function patching code. This will be swapped with the first 5 bytes | 1133 // Emit function patching code. This will be swapped with the first 5 bytes |
| 1135 // at entry point. | 1134 // at entry point. |
| 1136 *patch_code_pc_offset = assembler->CodeSize(); | 1135 *patch_code_pc_offset = assembler->CodeSize(); |
| 1137 __ jmp(&StubCode::FixAllocationStubTargetLabel()); | 1136 __ Jmp(*StubCode::FixAllocationStubTarget_entry()); |
| 1138 } | 1137 } |
| 1139 | 1138 |
| 1140 | 1139 |
| 1141 // Called for invoking "dynamic noSuchMethod(Invocation invocation)" function | 1140 // Called for invoking "dynamic noSuchMethod(Invocation invocation)" function |
| 1142 // from the entry code of a dart function after an error in passed argument | 1141 // from the entry code of a dart function after an error in passed argument |
| 1143 // name or number is detected. | 1142 // name or number is detected. |
| 1144 // Input parameters: | 1143 // Input parameters: |
| 1145 // ESP : points to return address. | 1144 // ESP : points to return address. |
| 1146 // ESP + 4 : address of last argument. | 1145 // ESP + 4 : address of last argument. |
| 1147 // EDX : arguments descriptor array. | 1146 // EDX : arguments descriptor array. |
| (...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2095 // EBX: entry point. | 2094 // EBX: entry point. |
| 2096 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { | 2095 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
| 2097 EmitMegamorphicLookup(assembler, EDI, EBX, EBX); | 2096 EmitMegamorphicLookup(assembler, EDI, EBX, EBX); |
| 2098 __ ret(); | 2097 __ ret(); |
| 2099 } | 2098 } |
| 2100 | 2099 |
| 2101 | 2100 |
| 2102 } // namespace dart | 2101 } // namespace dart |
| 2103 | 2102 |
| 2104 #endif // defined TARGET_ARCH_IA32 | 2103 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |