Chromium Code Reviews| 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_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/code_generator.h" | 8 #include "vm/code_generator.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/ic_data.h" | 10 #include "vm/ic_data.h" |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 607 // R13: Points to new space object. | 607 // R13: Points to new space object. |
| 608 __ movq(Address(R13, Scavenger::top_offset()), R12); | 608 __ movq(Address(R13, Scavenger::top_offset()), R12); |
| 609 __ addq(RAX, Immediate(kHeapObjectTag)); | 609 __ addq(RAX, Immediate(kHeapObjectTag)); |
| 610 | 610 |
| 611 // RAX: new object start as a tagged pointer. | 611 // RAX: new object start as a tagged pointer. |
| 612 // R12: new object end address. | 612 // R12: new object end address. |
| 613 // RBX: array element type. | 613 // RBX: array element type. |
| 614 // R10: Array length as Smi. | 614 // R10: Array length as Smi. |
| 615 | 615 |
| 616 // Store the type argument field. | 616 // Store the type argument field. |
| 617 __ movq(FieldAddress(RAX, Array::type_arguments_offset()), RBX); | 617 __ StoreIntoObject(RAX, |
| 618 FieldAddress(RAX, Array::type_arguments_offset()), | |
| 619 RBX); | |
| 618 | 620 |
| 619 // Set the length field. | 621 // Set the length field. |
| 620 __ movq(FieldAddress(RAX, Array::length_offset()), R10); | 622 __ StoreIntoObject(RAX, FieldAddress(RAX, Array::length_offset()), R10); |
|
cshapiro
2011/12/21 19:45:06
This should always be a SMI so a store check would
srdjan
2011/12/21 21:29:12
I am concerned to add here an implicit knwoledge t
| |
| 621 | 623 |
| 622 // Store class value for array. | 624 // Store class value for array. |
| 623 __ movq(RBX, FieldAddress(CTX, Context::isolate_offset())); | 625 __ movq(RBX, FieldAddress(CTX, Context::isolate_offset())); |
| 624 __ movq(RBX, Address(RBX, Isolate::object_store_offset())); | 626 __ movq(RBX, Address(RBX, Isolate::object_store_offset())); |
| 625 __ movq(RBX, Address(RBX, ObjectStore::array_class_offset())); | 627 __ movq(RBX, Address(RBX, ObjectStore::array_class_offset())); |
| 626 __ movq(FieldAddress(RAX, Array::class_offset()), RBX); | 628 __ StoreIntoObject(RAX, FieldAddress(RAX, Array::class_offset()), RBX); |
| 627 __ movq(FieldAddress(RAX, Array::tags_offset()), Immediate(0)); // Tags. | 629 __ movq(FieldAddress(RAX, Array::tags_offset()), Immediate(0)); // Tags. |
| 628 | 630 |
| 629 // Initialize all array elements to raw_null. | 631 // Initialize all array elements to raw_null. |
| 630 // RAX: new object start as a tagged pointer. | 632 // RAX: new object start as a tagged pointer. |
| 631 // R12: new object end address. | 633 // R12: new object end address. |
| 632 // RBX: iterator which initially points to the start of the variable | 634 // RBX: iterator which initially points to the start of the variable |
| 633 // data area to be initialized. | 635 // data area to be initialized. |
| 634 __ leaq(RBX, FieldAddress(RAX, Array::data_offset())); | 636 __ leaq(RBX, FieldAddress(RAX, Array::data_offset())); |
| 635 Label done; | 637 Label done; |
| 636 Label init_loop; | 638 Label init_loop; |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1163 } | 1165 } |
| 1164 | 1166 |
| 1165 | 1167 |
| 1166 void StubCode::GenerateBreakpointDynamicStub(Assembler* assembler) { | 1168 void StubCode::GenerateBreakpointDynamicStub(Assembler* assembler) { |
| 1167 __ Unimplemented("BreakpointDynamic stub"); | 1169 __ Unimplemented("BreakpointDynamic stub"); |
| 1168 } | 1170 } |
| 1169 | 1171 |
| 1170 } // namespace dart | 1172 } // namespace dart |
| 1171 | 1173 |
| 1172 #endif // defined TARGET_ARCH_X64 | 1174 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |