Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: runtime/vm/stub_code_ia32.cc

Issue 1911253002: Never include_isolate or allow_embedded_addresses. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/stub_code_arm64.cc ('k') | runtime/vm/stub_code_mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 557
558 // Check for maximum allowed length. 558 // Check for maximum allowed length.
559 const Immediate& max_len = 559 const Immediate& max_len =
560 Immediate(reinterpret_cast<int32_t>(Smi::New(Array::kMaxElements))); 560 Immediate(reinterpret_cast<int32_t>(Smi::New(Array::kMaxElements)));
561 __ cmpl(EDX, max_len); 561 __ cmpl(EDX, max_len);
562 __ j(GREATER, &slow_case); 562 __ j(GREATER, &slow_case);
563 563
564 __ MaybeTraceAllocation(kArrayCid, 564 __ MaybeTraceAllocation(kArrayCid,
565 EAX, 565 EAX,
566 &slow_case, 566 &slow_case,
567 Assembler::kFarJump, 567 Assembler::kFarJump);
568 /* inline_isolate = */ false);
569 568
570 const intptr_t fixed_size = sizeof(RawArray) + kObjectAlignment - 1; 569 const intptr_t fixed_size = sizeof(RawArray) + kObjectAlignment - 1;
571 __ leal(EBX, Address(EDX, TIMES_2, fixed_size)); // EDX is Smi. 570 __ leal(EBX, Address(EDX, TIMES_2, fixed_size)); // EDX is Smi.
572 ASSERT(kSmiTagShift == 1); 571 ASSERT(kSmiTagShift == 1);
573 __ andl(EBX, Immediate(-kObjectAlignment)); 572 __ andl(EBX, Immediate(-kObjectAlignment));
574 573
575 // ECX: array element type. 574 // ECX: array element type.
576 // EDX: array length as Smi. 575 // EDX: array length as Smi.
577 // EBX: allocation size. 576 // EBX: allocation size.
578 577
(...skipping 11 matching lines...) Expand all
590 // ECX: array element type. 589 // ECX: array element type.
591 // EDX: array length as Smi). 590 // EDX: array length as Smi).
592 __ cmpl(EBX, Address(EDI, Heap::EndOffset(space))); 591 __ cmpl(EBX, Address(EDI, Heap::EndOffset(space)));
593 __ j(ABOVE_EQUAL, &slow_case); 592 __ j(ABOVE_EQUAL, &slow_case);
594 593
595 // Successfully allocated the object(s), now update top to point to 594 // Successfully allocated the object(s), now update top to point to
596 // next object start and initialize the object. 595 // next object start and initialize the object.
597 __ movl(Address(EDI, Heap::TopOffset(space)), EBX); 596 __ movl(Address(EDI, Heap::TopOffset(space)), EBX);
598 __ subl(EBX, EAX); 597 __ subl(EBX, EAX);
599 __ addl(EAX, Immediate(kHeapObjectTag)); 598 __ addl(EAX, Immediate(kHeapObjectTag));
600 __ UpdateAllocationStatsWithSize(cid, EBX, EDI, space, 599 __ UpdateAllocationStatsWithSize(cid, EBX, EDI, space);
601 /* inline_isolate = */ false);
602 600
603 // Initialize the tags. 601 // Initialize the tags.
604 // EAX: new object start as a tagged pointer. 602 // EAX: new object start as a tagged pointer.
605 // EBX: allocation size. 603 // EBX: allocation size.
606 // ECX: array element type. 604 // ECX: array element type.
607 // EDX: array length as Smi. 605 // EDX: array length as Smi.
608 { 606 {
609 Label size_tag_overflow, done; 607 Label size_tag_overflow, done;
610 __ movl(EDI, EBX); 608 __ movl(EDI, EBX);
611 __ cmpl(EDI, Immediate(RawObject::SizeTag::kMaxSizeTag)); 609 __ cmpl(EDI, Immediate(RawObject::SizeTag::kMaxSizeTag));
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 Label slow_case; 794 Label slow_case;
797 // First compute the rounded instance size. 795 // First compute the rounded instance size.
798 // EDX: number of context variables. 796 // EDX: number of context variables.
799 intptr_t fixed_size = (sizeof(RawContext) + kObjectAlignment - 1); 797 intptr_t fixed_size = (sizeof(RawContext) + kObjectAlignment - 1);
800 __ leal(EBX, Address(EDX, TIMES_4, fixed_size)); 798 __ leal(EBX, Address(EDX, TIMES_4, fixed_size));
801 __ andl(EBX, Immediate(-kObjectAlignment)); 799 __ andl(EBX, Immediate(-kObjectAlignment));
802 800
803 __ MaybeTraceAllocation(kContextCid, 801 __ MaybeTraceAllocation(kContextCid,
804 EAX, 802 EAX,
805 &slow_case, 803 &slow_case,
806 Assembler::kFarJump, 804 Assembler::kFarJump);
807 /* inline_isolate = */ false);
808 805
809 // Now allocate the object. 806 // Now allocate the object.
810 // EDX: number of context variables. 807 // EDX: number of context variables.
811 const intptr_t cid = kContextCid; 808 const intptr_t cid = kContextCid;
812 Heap::Space space = Heap::SpaceForAllocation(cid); 809 Heap::Space space = Heap::SpaceForAllocation(cid);
813 __ movl(ECX, Address(THR, Thread::heap_offset())); 810 __ movl(ECX, Address(THR, Thread::heap_offset()));
814 __ movl(EAX, Address(ECX, Heap::TopOffset(space))); 811 __ movl(EAX, Address(ECX, Heap::TopOffset(space)));
815 __ addl(EBX, EAX); 812 __ addl(EBX, EAX);
816 // Check if the allocation fits into the remaining space. 813 // Check if the allocation fits into the remaining space.
817 // EAX: potential new object. 814 // EAX: potential new object.
(...skipping 14 matching lines...) Expand all
832 // Successfully allocated the object, now update top to point to 829 // Successfully allocated the object, now update top to point to
833 // next object start and initialize the object. 830 // next object start and initialize the object.
834 // EAX: new object. 831 // EAX: new object.
835 // EBX: next object start. 832 // EBX: next object start.
836 // EDX: number of context variables. 833 // EDX: number of context variables.
837 __ movl(Address(ECX, Heap::TopOffset(space)), EBX); 834 __ movl(Address(ECX, Heap::TopOffset(space)), EBX);
838 // EBX: Size of allocation in bytes. 835 // EBX: Size of allocation in bytes.
839 __ subl(EBX, EAX); 836 __ subl(EBX, EAX);
840 __ addl(EAX, Immediate(kHeapObjectTag)); 837 __ addl(EAX, Immediate(kHeapObjectTag));
841 // Generate isolate-independent code to allow sharing between isolates. 838 // Generate isolate-independent code to allow sharing between isolates.
842 __ UpdateAllocationStatsWithSize(cid, EBX, EDI, space, 839 __ UpdateAllocationStatsWithSize(cid, EBX, EDI, space);
843 /* inline_isolate = */ false);
844 840
845 // Calculate the size tag. 841 // Calculate the size tag.
846 // EAX: new object. 842 // EAX: new object.
847 // EDX: number of context variables. 843 // EDX: number of context variables.
848 { 844 {
849 Label size_tag_overflow, done; 845 Label size_tag_overflow, done;
850 __ leal(EBX, Address(EDX, TIMES_4, fixed_size)); 846 __ leal(EBX, Address(EDX, TIMES_4, fixed_size));
851 __ andl(EBX, Immediate(-kObjectAlignment)); 847 __ andl(EBX, Immediate(-kObjectAlignment));
852 __ cmpl(EBX, Immediate(RawObject::SizeTag::kMaxSizeTag)); 848 __ cmpl(EBX, Immediate(RawObject::SizeTag::kMaxSizeTag));
853 __ j(ABOVE, &size_tag_overflow, Assembler::kNearJump); 849 __ j(ABOVE, &size_tag_overflow, Assembler::kNearJump);
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 // EAX: potential new object start. 1026 // EAX: potential new object start.
1031 // EBX: potential next object start. 1027 // EBX: potential next object start.
1032 // EDI: heap. 1028 // EDI: heap.
1033 __ cmpl(EBX, Address(EDI, Heap::EndOffset(space))); 1029 __ cmpl(EBX, Address(EDI, Heap::EndOffset(space)));
1034 if (FLAG_use_slow_path) { 1030 if (FLAG_use_slow_path) {
1035 __ jmp(&slow_case); 1031 __ jmp(&slow_case);
1036 } else { 1032 } else {
1037 __ j(ABOVE_EQUAL, &slow_case); 1033 __ j(ABOVE_EQUAL, &slow_case);
1038 } 1034 }
1039 __ movl(Address(EDI, Heap::TopOffset(space)), EBX); 1035 __ movl(Address(EDI, Heap::TopOffset(space)), EBX);
1040 __ UpdateAllocationStats(cls.id(), ECX, space, 1036 __ UpdateAllocationStats(cls.id(), ECX, space);
1041 /* inline_isolate = */ false);
1042 1037
1043 // EAX: new object start (untagged). 1038 // EAX: new object start (untagged).
1044 // EBX: next object start. 1039 // EBX: next object start.
1045 // EDX: new object type arguments (if is_cls_parameterized). 1040 // EDX: new object type arguments (if is_cls_parameterized).
1046 // Set the tags. 1041 // Set the tags.
1047 uword tags = 0; 1042 uword tags = 0;
1048 tags = RawObject::SizeTag::update(instance_size, tags); 1043 tags = RawObject::SizeTag::update(instance_size, tags);
1049 ASSERT(cls.id() != kIllegalCid); 1044 ASSERT(cls.id() != kIllegalCid);
1050 tags = RawObject::ClassIdTag::update(cls.id(), tags); 1045 tags = RawObject::ClassIdTag::update(cls.id(), tags);
1051 __ movl(Address(EAX, Instance::tags_offset()), Immediate(tags)); 1046 __ movl(Address(EAX, Instance::tags_offset()), Immediate(tags));
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after
2095 2090
2096 2091
2097 2092
2098 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { 2093 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) {
2099 __ int3(); 2094 __ int3();
2100 } 2095 }
2101 2096
2102 } // namespace dart 2097 } // namespace dart
2103 2098
2104 #endif // defined TARGET_ARCH_IA32 2099 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_arm64.cc ('k') | runtime/vm/stub_code_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698