| 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 // 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 __ UpdateAllocationStatsWithSize(kArrayCid, EDI, kNoRegister); | 79 __ UpdateAllocationStatsWithSize(kArrayCid, EDI, kNoRegister); |
| 80 | 80 |
| 81 // Initialize the tags. | 81 // Initialize the tags. |
| 82 // EAX: new object start as a tagged pointer. | 82 // EAX: new object start as a tagged pointer. |
| 83 // EBX: new object end address. | 83 // EBX: new object end address. |
| 84 // EDI: allocation size. | 84 // EDI: allocation size. |
| 85 { | 85 { |
| 86 Label size_tag_overflow, done; | 86 Label size_tag_overflow, done; |
| 87 __ cmpl(EDI, Immediate(RawObject::SizeTag::kMaxSizeTag)); | 87 __ cmpl(EDI, Immediate(RawObject::SizeTag::kMaxSizeTag)); |
| 88 __ j(ABOVE, &size_tag_overflow, Assembler::kNearJump); | 88 __ j(ABOVE, &size_tag_overflow, Assembler::kNearJump); |
| 89 __ shll(EDI, Immediate(RawObject::kSizeTagBit - kObjectAlignmentLog2)); | 89 __ shll(EDI, Immediate(RawObject::kSizeTagPos - kObjectAlignmentLog2)); |
| 90 __ jmp(&done, Assembler::kNearJump); | 90 __ jmp(&done, Assembler::kNearJump); |
| 91 | 91 |
| 92 __ Bind(&size_tag_overflow); | 92 __ Bind(&size_tag_overflow); |
| 93 __ movl(EDI, Immediate(0)); | 93 __ movl(EDI, Immediate(0)); |
| 94 __ Bind(&done); | 94 __ Bind(&done); |
| 95 | 95 |
| 96 // Get the class index and insert it into the tags. | 96 // Get the class index and insert it into the tags. |
| 97 const Class& cls = Class::Handle(isolate->object_store()->array_class()); | 97 const Class& cls = Class::Handle(isolate->object_store()->array_class()); |
| 98 __ orl(EDI, Immediate(RawObject::ClassIdTag::encode(cls.id()))); | 98 __ orl(EDI, Immediate(RawObject::ClassIdTag::encode(cls.id()))); |
| 99 __ movl(FieldAddress(EAX, Array::tags_offset()), EDI); // Tags. | 99 __ movl(FieldAddress(EAX, Array::tags_offset()), EDI); // Tags. |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 __ UpdateAllocationStatsWithSize(cid, EDI, kNoRegister); \ | 494 __ UpdateAllocationStatsWithSize(cid, EDI, kNoRegister); \ |
| 495 \ | 495 \ |
| 496 /* Initialize the tags. */ \ | 496 /* Initialize the tags. */ \ |
| 497 /* EAX: new object start as a tagged pointer. */ \ | 497 /* EAX: new object start as a tagged pointer. */ \ |
| 498 /* EBX: new object end address. */ \ | 498 /* EBX: new object end address. */ \ |
| 499 /* EDI: allocation size. */ \ | 499 /* EDI: allocation size. */ \ |
| 500 { \ | 500 { \ |
| 501 Label size_tag_overflow, done; \ | 501 Label size_tag_overflow, done; \ |
| 502 __ cmpl(EDI, Immediate(RawObject::SizeTag::kMaxSizeTag)); \ | 502 __ cmpl(EDI, Immediate(RawObject::SizeTag::kMaxSizeTag)); \ |
| 503 __ j(ABOVE, &size_tag_overflow, Assembler::kNearJump); \ | 503 __ j(ABOVE, &size_tag_overflow, Assembler::kNearJump); \ |
| 504 __ shll(EDI, Immediate(RawObject::kSizeTagBit - kObjectAlignmentLog2)); \ | 504 __ shll(EDI, Immediate(RawObject::kSizeTagPos - kObjectAlignmentLog2)); \ |
| 505 __ jmp(&done, Assembler::kNearJump); \ | 505 __ jmp(&done, Assembler::kNearJump); \ |
| 506 \ | 506 \ |
| 507 __ Bind(&size_tag_overflow); \ | 507 __ Bind(&size_tag_overflow); \ |
| 508 __ movl(EDI, Immediate(0)); \ | 508 __ movl(EDI, Immediate(0)); \ |
| 509 __ Bind(&done); \ | 509 __ Bind(&done); \ |
| 510 \ | 510 \ |
| 511 /* Get the class index and insert it into the tags. */ \ | 511 /* Get the class index and insert it into the tags. */ \ |
| 512 __ orl(EDI, Immediate(RawObject::ClassIdTag::encode(cid))); \ | 512 __ orl(EDI, Immediate(RawObject::ClassIdTag::encode(cid))); \ |
| 513 __ movl(FieldAddress(EAX, type_name::tags_offset()), EDI); /* Tags. */ \ | 513 __ movl(FieldAddress(EAX, type_name::tags_offset()), EDI); /* Tags. */ \ |
| 514 } \ | 514 } \ |
| (...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1564 __ UpdateAllocationStatsWithSize(kOneByteStringCid, EDI, kNoRegister); | 1564 __ UpdateAllocationStatsWithSize(kOneByteStringCid, EDI, kNoRegister); |
| 1565 | 1565 |
| 1566 // Initialize the tags. | 1566 // Initialize the tags. |
| 1567 // EAX: new object start as a tagged pointer. | 1567 // EAX: new object start as a tagged pointer. |
| 1568 // EBX: new object end address. | 1568 // EBX: new object end address. |
| 1569 // EDI: allocation size. | 1569 // EDI: allocation size. |
| 1570 { | 1570 { |
| 1571 Label size_tag_overflow, done; | 1571 Label size_tag_overflow, done; |
| 1572 __ cmpl(EDI, Immediate(RawObject::SizeTag::kMaxSizeTag)); | 1572 __ cmpl(EDI, Immediate(RawObject::SizeTag::kMaxSizeTag)); |
| 1573 __ j(ABOVE, &size_tag_overflow, Assembler::kNearJump); | 1573 __ j(ABOVE, &size_tag_overflow, Assembler::kNearJump); |
| 1574 __ shll(EDI, Immediate(RawObject::kSizeTagBit - kObjectAlignmentLog2)); | 1574 __ shll(EDI, Immediate(RawObject::kSizeTagPos - kObjectAlignmentLog2)); |
| 1575 __ jmp(&done, Assembler::kNearJump); | 1575 __ jmp(&done, Assembler::kNearJump); |
| 1576 | 1576 |
| 1577 __ Bind(&size_tag_overflow); | 1577 __ Bind(&size_tag_overflow); |
| 1578 __ xorl(EDI, EDI); | 1578 __ xorl(EDI, EDI); |
| 1579 __ Bind(&done); | 1579 __ Bind(&done); |
| 1580 | 1580 |
| 1581 // Get the class index and insert it into the tags. | 1581 // Get the class index and insert it into the tags. |
| 1582 const Class& cls = | 1582 const Class& cls = |
| 1583 Class::Handle(isolate->object_store()->one_byte_string_class()); | 1583 Class::Handle(isolate->object_store()->one_byte_string_class()); |
| 1584 __ orl(EDI, Immediate(RawObject::ClassIdTag::encode(cls.id()))); | 1584 __ orl(EDI, Immediate(RawObject::ClassIdTag::encode(cls.id()))); |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1792 __ movl(current_tag_addr, raw_null); | 1792 __ movl(current_tag_addr, raw_null); |
| 1793 // Clear Isolate::user_tag_. | 1793 // Clear Isolate::user_tag_. |
| 1794 __ movl(user_tag_addr, Immediate(0)); | 1794 __ movl(user_tag_addr, Immediate(0)); |
| 1795 __ ret(); | 1795 __ ret(); |
| 1796 } | 1796 } |
| 1797 | 1797 |
| 1798 #undef __ | 1798 #undef __ |
| 1799 } // namespace dart | 1799 } // namespace dart |
| 1800 | 1800 |
| 1801 #endif // defined TARGET_ARCH_IA32 | 1801 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |