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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 // RAX: new growable array object start as a tagged pointer. | 84 // RAX: new growable array object start as a tagged pointer. |
85 // Store the type argument field in the growable array object. | 85 // Store the type argument field in the growable array object. |
86 __ movq(RCX, Address(RSP, kTypeArgumentsOffset)); // type argument. | 86 __ movq(RCX, Address(RSP, kTypeArgumentsOffset)); // type argument. |
87 __ StoreIntoObjectNoBarrier( | 87 __ StoreIntoObjectNoBarrier( |
88 RAX, | 88 RAX, |
89 FieldAddress(RAX, GrowableObjectArray::type_arguments_offset()), | 89 FieldAddress(RAX, GrowableObjectArray::type_arguments_offset()), |
90 RCX); | 90 RCX); |
91 | 91 |
92 // Set the length field in the growable array object to 0. | 92 // Set the length field in the growable array object to 0. |
93 __ ZeroSmiField(FieldAddress(RAX, GrowableObjectArray::length_offset())); | 93 __ ZeroInitSmiField(FieldAddress(RAX, GrowableObjectArray::length_offset())); |
94 __ ret(); // returns the newly allocated object in RAX. | 94 __ ret(); // returns the newly allocated object in RAX. |
95 | 95 |
96 __ Bind(&fall_through); | 96 __ Bind(&fall_through); |
97 } | 97 } |
98 | 98 |
99 | 99 |
100 // Access growable object array at specified index. | 100 // Access growable object array at specified index. |
101 // On stack: growable array (+2), index (+1), return-address (+0). | 101 // On stack: growable array (+2), index (+1), return-address (+0). |
102 void Intrinsifier::GrowableArrayGetIndexed(Assembler* assembler) { | 102 void Intrinsifier::GrowableArrayGetIndexed(Assembler* assembler) { |
103 Label fall_through; | 103 Label fall_through; |
(...skipping 1671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1775 __ orq(RDI, Immediate(RawObject::ClassIdTag::encode(cid))); | 1775 __ orq(RDI, Immediate(RawObject::ClassIdTag::encode(cid))); |
1776 __ movq(FieldAddress(RAX, String::tags_offset()), RDI); // Tags. | 1776 __ movq(FieldAddress(RAX, String::tags_offset()), RDI); // Tags. |
1777 } | 1777 } |
1778 | 1778 |
1779 // Set the length field. | 1779 // Set the length field. |
1780 __ popq(RDI); | 1780 __ popq(RDI); |
1781 __ StoreIntoObjectNoBarrier(RAX, | 1781 __ StoreIntoObjectNoBarrier(RAX, |
1782 FieldAddress(RAX, String::length_offset()), | 1782 FieldAddress(RAX, String::length_offset()), |
1783 RDI); | 1783 RDI); |
1784 // Clear hash. | 1784 // Clear hash. |
1785 __ ZeroSmiField(FieldAddress(RAX, String::hash_offset())); | 1785 __ ZeroInitSmiField(FieldAddress(RAX, String::hash_offset())); |
1786 __ jmp(ok, Assembler::kNearJump); | 1786 __ jmp(ok, Assembler::kNearJump); |
1787 | 1787 |
1788 __ Bind(&pop_and_fail); | 1788 __ Bind(&pop_and_fail); |
1789 __ popq(RDI); | 1789 __ popq(RDI); |
1790 __ jmp(failure); | 1790 __ jmp(failure); |
1791 } | 1791 } |
1792 | 1792 |
1793 | 1793 |
1794 // Arg0: OneByteString (receiver). | 1794 // Arg0: OneByteString (receiver). |
1795 // Arg1: Start index as Smi. | 1795 // Arg1: Start index as Smi. |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2009 // Set return value to Isolate::current_tag_. | 2009 // Set return value to Isolate::current_tag_. |
2010 __ movq(RAX, Address(RBX, Isolate::current_tag_offset())); | 2010 __ movq(RAX, Address(RBX, Isolate::current_tag_offset())); |
2011 __ ret(); | 2011 __ ret(); |
2012 } | 2012 } |
2013 | 2013 |
2014 #undef __ | 2014 #undef __ |
2015 | 2015 |
2016 } // namespace dart | 2016 } // namespace dart |
2017 | 2017 |
2018 #endif // defined TARGET_ARCH_X64 | 2018 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |