| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 // The intrinsic code below is executed before a method has built its frame. | 5 // The intrinsic code below is executed before a method has built its frame. |
| 6 // The return address is on the stack and the arguments below it. | 6 // The return address is on the stack and the arguments below it. |
| 7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved. | 7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved. |
| 8 // Each intrinsification method returns true if the corresponding | 8 // Each intrinsification method returns true if the corresponding |
| 9 // Dart method was intrinsified. | 9 // Dart method was intrinsified. |
| 10 | 10 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 __ j(ABOVE, &size_tag_overflow, Assembler::kNearJump); | 78 __ j(ABOVE, &size_tag_overflow, Assembler::kNearJump); |
| 79 __ shll(EDI, Immediate(RawObject::kSizeTagBit - kObjectAlignmentLog2)); | 79 __ shll(EDI, Immediate(RawObject::kSizeTagBit - kObjectAlignmentLog2)); |
| 80 __ jmp(&done, Assembler::kNearJump); | 80 __ jmp(&done, Assembler::kNearJump); |
| 81 | 81 |
| 82 __ Bind(&size_tag_overflow); | 82 __ Bind(&size_tag_overflow); |
| 83 __ movl(EDI, Immediate(0)); | 83 __ movl(EDI, Immediate(0)); |
| 84 __ Bind(&done); | 84 __ Bind(&done); |
| 85 | 85 |
| 86 // Get the class index and insert it into the tags. | 86 // Get the class index and insert it into the tags. |
| 87 const Class& cls = Class::Handle(isolate->object_store()->array_class()); | 87 const Class& cls = Class::Handle(isolate->object_store()->array_class()); |
| 88 __ orl(EDI, Immediate(RawObject::ClassTag::encode(cls.index()))); | 88 __ orl(EDI, Immediate(RawObject::ClassIdTag::encode(cls.id()))); |
| 89 __ movl(FieldAddress(EAX, Array::tags_offset()), EDI); // Tags. | 89 __ movl(FieldAddress(EAX, Array::tags_offset()), EDI); // Tags. |
| 90 } | 90 } |
| 91 | 91 |
| 92 // Store class value for array. | 92 // Store class value for array. |
| 93 // EAX: new object start as a tagged pointer. | 93 // EAX: new object start as a tagged pointer. |
| 94 // EBX: new object end address. | 94 // EBX: new object end address. |
| 95 __ movl(EDI, FieldAddress(CTX, Context::isolate_offset())); | 95 __ movl(EDI, FieldAddress(CTX, Context::isolate_offset())); |
| 96 __ movl(EDI, Address(EDI, Isolate::object_store_offset())); | 96 __ movl(EDI, Address(EDI, Isolate::object_store_offset())); |
| 97 __ movl(EDI, Address(EDI, ObjectStore::array_class_offset())); | 97 __ movl(EDI, Address(EDI, ObjectStore::array_class_offset())); |
| 98 __ StoreIntoObject(EAX, FieldAddress(EAX, Array::class_offset()), EDI); | 98 __ StoreIntoObject(EAX, FieldAddress(EAX, Array::class_offset()), EDI); |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 // next object start and initialize the object. | 288 // next object start and initialize the object. |
| 289 __ movl(Address::Absolute(heap->TopAddress()), EBX); | 289 __ movl(Address::Absolute(heap->TopAddress()), EBX); |
| 290 __ addl(EAX, Immediate(kHeapObjectTag)); | 290 __ addl(EAX, Immediate(kHeapObjectTag)); |
| 291 | 291 |
| 292 // Initialize the tags. | 292 // Initialize the tags. |
| 293 // EAX: new growable array object start as a tagged pointer. | 293 // EAX: new growable array object start as a tagged pointer. |
| 294 const Class& cls = Class::Handle( | 294 const Class& cls = Class::Handle( |
| 295 isolate->object_store()->growable_object_array_class()); | 295 isolate->object_store()->growable_object_array_class()); |
| 296 uword tags = 0; | 296 uword tags = 0; |
| 297 tags = RawObject::SizeTag::update(fixed_size, tags); | 297 tags = RawObject::SizeTag::update(fixed_size, tags); |
| 298 tags = RawObject::ClassTag::update(cls.index(), tags); | 298 tags = RawObject::ClassIdTag::update(cls.id(), tags); |
| 299 __ movl(FieldAddress(EAX, GrowableObjectArray::tags_offset()), | 299 __ movl(FieldAddress(EAX, GrowableObjectArray::tags_offset()), |
| 300 Immediate(tags)); | 300 Immediate(tags)); |
| 301 | 301 |
| 302 // Store backing array object in growable array object. | 302 // Store backing array object in growable array object. |
| 303 __ movl(EBX, Address(ESP, kArrayOffset)); // data argument. | 303 __ movl(EBX, Address(ESP, kArrayOffset)); // data argument. |
| 304 __ StoreIntoObject(EAX, | 304 __ StoreIntoObject(EAX, |
| 305 FieldAddress(EAX, GrowableObjectArray::data_offset()), | 305 FieldAddress(EAX, GrowableObjectArray::data_offset()), |
| 306 EBX); | 306 EBX); |
| 307 | 307 |
| 308 // Store class value for the growable array object. | 308 // Store class value for the growable array object. |
| (...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1291 __ Bind(&is_true); | 1291 __ Bind(&is_true); |
| 1292 __ LoadObject(EAX, bool_true); | 1292 __ LoadObject(EAX, bool_true); |
| 1293 __ ret(); | 1293 __ ret(); |
| 1294 return true; | 1294 return true; |
| 1295 } | 1295 } |
| 1296 | 1296 |
| 1297 #undef __ | 1297 #undef __ |
| 1298 } // namespace dart | 1298 } // namespace dart |
| 1299 | 1299 |
| 1300 #endif // defined TARGET_ARCH_IA32 | 1300 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |