| 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" // Needed here to get TARGET_ARCH_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/intrinsifier.h" | 8 #include "vm/intrinsifier.h" |
| 9 | 9 |
| 10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 __ movq(RDI, Address(RSP, kArrayLengthOffset)); // Array Length. | 110 __ movq(RDI, Address(RSP, kArrayLengthOffset)); // Array Length. |
| 111 __ StoreIntoObjectNoBarrier(RAX, | 111 __ StoreIntoObjectNoBarrier(RAX, |
| 112 FieldAddress(RAX, Array::length_offset()), | 112 FieldAddress(RAX, Array::length_offset()), |
| 113 RDI); | 113 RDI); |
| 114 | 114 |
| 115 // Initialize all array elements to raw_null. | 115 // Initialize all array elements to raw_null. |
| 116 // RAX: new object start as a tagged pointer. | 116 // RAX: new object start as a tagged pointer. |
| 117 // RCX: new object end address. | 117 // RCX: new object end address. |
| 118 // RDI: iterator which initially points to the start of the variable | 118 // RDI: iterator which initially points to the start of the variable |
| 119 // data area to be initialized. | 119 // data area to be initialized. |
| 120 __ LoadObject(R12, Object::Handle(), PP); | 120 __ LoadObject(R12, Object::null_object(), PP); |
| 121 __ leaq(RDI, FieldAddress(RAX, sizeof(RawArray))); | 121 __ leaq(RDI, FieldAddress(RAX, sizeof(RawArray))); |
| 122 Label done; | 122 Label done; |
| 123 Label init_loop; | 123 Label init_loop; |
| 124 __ Bind(&init_loop); | 124 __ Bind(&init_loop); |
| 125 __ cmpq(RDI, RCX); | 125 __ cmpq(RDI, RCX); |
| 126 __ j(ABOVE_EQUAL, &done, Assembler::kNearJump); | 126 __ j(ABOVE_EQUAL, &done, Assembler::kNearJump); |
| 127 __ movq(Address(RDI, 0), R12); | 127 __ movq(Address(RDI, 0), R12); |
| 128 __ addq(RDI, Immediate(kWordSize)); | 128 __ addq(RDI, Immediate(kWordSize)); |
| 129 __ jmp(&init_loop, Assembler::kNearJump); | 129 __ jmp(&init_loop, Assembler::kNearJump); |
| 130 __ Bind(&done); | 130 __ Bind(&done); |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 __ j(EQUAL, &fall_through); // Must grow data. | 384 __ j(EQUAL, &fall_through); // Must grow data. |
| 385 const Immediate& value_one = | 385 const Immediate& value_one = |
| 386 Immediate(reinterpret_cast<int64_t>(Smi::New(1))); | 386 Immediate(reinterpret_cast<int64_t>(Smi::New(1))); |
| 387 // len = len + 1; | 387 // len = len + 1; |
| 388 __ addq(FieldAddress(RAX, GrowableObjectArray::length_offset()), value_one); | 388 __ addq(FieldAddress(RAX, GrowableObjectArray::length_offset()), value_one); |
| 389 __ movq(RAX, Address(RSP, + 1 * kWordSize)); // Value | 389 __ movq(RAX, Address(RSP, + 1 * kWordSize)); // Value |
| 390 ASSERT(kSmiTagShift == 1); | 390 ASSERT(kSmiTagShift == 1); |
| 391 __ StoreIntoObject(RDX, | 391 __ StoreIntoObject(RDX, |
| 392 FieldAddress(RDX, RCX, TIMES_4, Array::data_offset()), | 392 FieldAddress(RDX, RCX, TIMES_4, Array::data_offset()), |
| 393 RAX); | 393 RAX); |
| 394 __ LoadObject(RAX, Object::Handle(), PP); | 394 __ LoadObject(RAX, Object::null_object(), PP); |
| 395 __ ret(); | 395 __ ret(); |
| 396 __ Bind(&fall_through); | 396 __ Bind(&fall_through); |
| 397 } | 397 } |
| 398 | 398 |
| 399 | 399 |
| 400 #define TYPED_ARRAY_ALLOCATION(type_name, cid, max_len, scale_factor) \ | 400 #define TYPED_ARRAY_ALLOCATION(type_name, cid, max_len, scale_factor) \ |
| 401 Label fall_through; \ | 401 Label fall_through; \ |
| 402 const intptr_t kArrayLengthStackOffset = 1 * kWordSize; \ | 402 const intptr_t kArrayLengthStackOffset = 1 * kWordSize; \ |
| 403 __ movq(RDI, Address(RSP, kArrayLengthStackOffset)); /* Array length. */ \ | 403 __ movq(RDI, Address(RSP, kArrayLengthStackOffset)); /* Array length. */ \ |
| 404 /* Check that length is a positive Smi. */ \ | 404 /* Check that length is a positive Smi. */ \ |
| (...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1649 | 1649 |
| 1650 __ Bind(&fall_through); | 1650 __ Bind(&fall_through); |
| 1651 } | 1651 } |
| 1652 | 1652 |
| 1653 | 1653 |
| 1654 #undef __ | 1654 #undef __ |
| 1655 | 1655 |
| 1656 } // namespace dart | 1656 } // namespace dart |
| 1657 | 1657 |
| 1658 #endif // defined TARGET_ARCH_X64 | 1658 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |