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/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 1981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1992 // RCX: new object end address. | 1992 // RCX: new object end address. |
1993 // RDI: iterator which initially points to the start of the variable | 1993 // RDI: iterator which initially points to the start of the variable |
1994 // data area to be initialized. | 1994 // data area to be initialized. |
1995 if (num_elements > 0) { | 1995 if (num_elements > 0) { |
1996 const intptr_t array_size = instance_size - sizeof(RawArray); | 1996 const intptr_t array_size = instance_size - sizeof(RawArray); |
1997 __ LoadObject(R12, Object::null_object(), PP); | 1997 __ LoadObject(R12, Object::null_object(), PP); |
1998 __ leaq(RDI, FieldAddress(RAX, sizeof(RawArray))); | 1998 __ leaq(RDI, FieldAddress(RAX, sizeof(RawArray))); |
1999 if (array_size < (kInlineArraySize * kWordSize)) { | 1999 if (array_size < (kInlineArraySize * kWordSize)) { |
2000 intptr_t current_offset = 0; | 2000 intptr_t current_offset = 0; |
2001 while (current_offset < array_size) { | 2001 while (current_offset < array_size) { |
2002 __ movq(Address(RDI, current_offset), R12); | 2002 __ StoreIntoObjectNoBarrier(RAX, Address(RDI, current_offset), R12); |
2003 current_offset += kWordSize; | 2003 current_offset += kWordSize; |
2004 } | 2004 } |
2005 } else { | 2005 } else { |
2006 Label init_loop; | 2006 Label init_loop; |
2007 __ Bind(&init_loop); | 2007 __ Bind(&init_loop); |
2008 __ movq(Address(RDI, 0), R12); | 2008 __ StoreIntoObjectNoBarrier(RAX, Address(RDI, 0), R12); |
2009 __ addq(RDI, Immediate(kWordSize)); | 2009 __ addq(RDI, Immediate(kWordSize)); |
2010 __ cmpq(RDI, RCX); | 2010 __ cmpq(RDI, RCX); |
2011 __ j(BELOW, &init_loop, Assembler::kNearJump); | 2011 __ j(BELOW, &init_loop, Assembler::kNearJump); |
2012 } | 2012 } |
2013 } | 2013 } |
2014 __ jmp(done, Assembler::kNearJump); | 2014 __ jmp(done, Assembler::kNearJump); |
2015 } | 2015 } |
2016 | 2016 |
2017 | 2017 |
2018 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2018 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
(...skipping 4249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6268 __ movq(R10, Immediate(kInvalidObjectPointer)); | 6268 __ movq(R10, Immediate(kInvalidObjectPointer)); |
6269 __ movq(RBX, Immediate(kInvalidObjectPointer)); | 6269 __ movq(RBX, Immediate(kInvalidObjectPointer)); |
6270 #endif | 6270 #endif |
6271 } | 6271 } |
6272 | 6272 |
6273 } // namespace dart | 6273 } // namespace dart |
6274 | 6274 |
6275 #undef __ | 6275 #undef __ |
6276 | 6276 |
6277 #endif // defined TARGET_ARCH_X64 | 6277 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |