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

Side by Side Diff: runtime/vm/stub_code_arm.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/intrinsifier_x64.cc ('k') | runtime/vm/stub_code_arm64.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_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 __ cmp(R3, Operand(0)); 618 __ cmp(R3, Operand(0));
619 __ b(&slow_case, LT); 619 __ b(&slow_case, LT);
620 620
621 // Check for maximum allowed length. 621 // Check for maximum allowed length.
622 const intptr_t max_len = 622 const intptr_t max_len =
623 reinterpret_cast<int32_t>(Smi::New(Array::kMaxElements)); 623 reinterpret_cast<int32_t>(Smi::New(Array::kMaxElements));
624 __ CompareImmediate(R3, max_len); 624 __ CompareImmediate(R3, max_len);
625 __ b(&slow_case, GT); 625 __ b(&slow_case, GT);
626 626
627 const intptr_t cid = kArrayCid; 627 const intptr_t cid = kArrayCid;
628 __ MaybeTraceAllocation(cid, R4, &slow_case, 628 __ MaybeTraceAllocation(cid, R4, &slow_case);
629 /* inline_isolate = */ false);
630 629
631 const intptr_t fixed_size = sizeof(RawArray) + kObjectAlignment - 1; 630 const intptr_t fixed_size = sizeof(RawArray) + kObjectAlignment - 1;
632 __ LoadImmediate(R9, fixed_size); 631 __ LoadImmediate(R9, fixed_size);
633 __ add(R9, R9, Operand(R3, LSL, 1)); // R3 is a Smi. 632 __ add(R9, R9, Operand(R3, LSL, 1)); // R3 is a Smi.
634 ASSERT(kSmiTagShift == 1); 633 ASSERT(kSmiTagShift == 1);
635 __ bic(R9, R9, Operand(kObjectAlignment - 1)); 634 __ bic(R9, R9, Operand(kObjectAlignment - 1));
636 635
637 // R9: Allocation size. 636 // R9: Allocation size.
638 Heap::Space space = Heap::SpaceForAllocation(cid); 637 Heap::Space space = Heap::SpaceForAllocation(cid);
639 __ LoadIsolate(R8); 638 __ LoadIsolate(R8);
640 __ ldr(R8, Address(R8, Isolate::heap_offset())); 639 __ ldr(R8, Address(R8, Isolate::heap_offset()));
641 // Potential new object start. 640 // Potential new object start.
642 __ ldr(R0, Address(R8, Heap::TopOffset(space))); 641 __ ldr(R0, Address(R8, Heap::TopOffset(space)));
643 __ adds(NOTFP, R0, Operand(R9)); // Potential next object start. 642 __ adds(NOTFP, R0, Operand(R9)); // Potential next object start.
644 __ b(&slow_case, CS); // Branch if unsigned overflow. 643 __ b(&slow_case, CS); // Branch if unsigned overflow.
645 644
646 // Check if the allocation fits into the remaining space. 645 // Check if the allocation fits into the remaining space.
647 // R0: potential new object start. 646 // R0: potential new object start.
648 // NOTFP: potential next object start. 647 // NOTFP: potential next object start.
649 // R9: allocation size. 648 // R9: allocation size.
650 __ ldr(R3, Address(R8, Heap::EndOffset(space))); 649 __ ldr(R3, Address(R8, Heap::EndOffset(space)));
651 __ cmp(NOTFP, Operand(R3)); 650 __ cmp(NOTFP, Operand(R3));
652 __ b(&slow_case, CS); 651 __ b(&slow_case, CS);
653 652
654 // Successfully allocated the object(s), now update top to point to 653 // Successfully allocated the object(s), now update top to point to
655 // next object start and initialize the object. 654 // next object start and initialize the object.
656 __ LoadAllocationStatsAddress(R3, cid, /* inline_isolate = */ false); 655 __ LoadAllocationStatsAddress(R3, cid);
657 __ str(NOTFP, Address(R8, Heap::TopOffset(space))); 656 __ str(NOTFP, Address(R8, Heap::TopOffset(space)));
658 __ add(R0, R0, Operand(kHeapObjectTag)); 657 __ add(R0, R0, Operand(kHeapObjectTag));
659 658
660 // Initialize the tags. 659 // Initialize the tags.
661 // R0: new object start as a tagged pointer. 660 // R0: new object start as a tagged pointer.
662 // R3: allocation stats address. 661 // R3: allocation stats address.
663 // NOTFP: new object end address. 662 // NOTFP: new object end address.
664 // R9: allocation size. 663 // R9: allocation size.
665 { 664 {
666 const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2; 665 const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2;
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 if (FLAG_inline_alloc) { 851 if (FLAG_inline_alloc) {
853 Label slow_case; 852 Label slow_case;
854 // First compute the rounded instance size. 853 // First compute the rounded instance size.
855 // R1: number of context variables. 854 // R1: number of context variables.
856 intptr_t fixed_size = sizeof(RawContext) + kObjectAlignment - 1; 855 intptr_t fixed_size = sizeof(RawContext) + kObjectAlignment - 1;
857 __ LoadImmediate(R2, fixed_size); 856 __ LoadImmediate(R2, fixed_size);
858 __ add(R2, R2, Operand(R1, LSL, 2)); 857 __ add(R2, R2, Operand(R1, LSL, 2));
859 ASSERT(kSmiTagShift == 1); 858 ASSERT(kSmiTagShift == 1);
860 __ bic(R2, R2, Operand(kObjectAlignment - 1)); 859 __ bic(R2, R2, Operand(kObjectAlignment - 1));
861 860
862 __ MaybeTraceAllocation(kContextCid, R8, &slow_case, 861 __ MaybeTraceAllocation(kContextCid, R8, &slow_case);
863 /* inline_isolate = */ false);
864 // Now allocate the object. 862 // Now allocate the object.
865 // R1: number of context variables. 863 // R1: number of context variables.
866 // R2: object size. 864 // R2: object size.
867 const intptr_t cid = kContextCid; 865 const intptr_t cid = kContextCid;
868 Heap::Space space = Heap::SpaceForAllocation(cid); 866 Heap::Space space = Heap::SpaceForAllocation(cid);
869 __ LoadIsolate(R9); 867 __ LoadIsolate(R9);
870 __ ldr(R9, Address(R9, Isolate::heap_offset())); 868 __ ldr(R9, Address(R9, Isolate::heap_offset()));
871 __ ldr(R0, Address(R9, Heap::TopOffset(space))); 869 __ ldr(R0, Address(R9, Heap::TopOffset(space)));
872 __ add(R3, R2, Operand(R0)); 870 __ add(R3, R2, Operand(R0));
873 // Check if the allocation fits into the remaining space. 871 // Check if the allocation fits into the remaining space.
(...skipping 10 matching lines...) Expand all
884 __ b(&slow_case, CS); // Branch if unsigned higher or equal. 882 __ b(&slow_case, CS); // Branch if unsigned higher or equal.
885 } 883 }
886 884
887 // Successfully allocated the object, now update top to point to 885 // Successfully allocated the object, now update top to point to
888 // next object start and initialize the object. 886 // next object start and initialize the object.
889 // R0: new object start (untagged). 887 // R0: new object start (untagged).
890 // R1: number of context variables. 888 // R1: number of context variables.
891 // R2: object size. 889 // R2: object size.
892 // R3: next object start. 890 // R3: next object start.
893 // R9: heap. 891 // R9: heap.
894 __ LoadAllocationStatsAddress(R4, cid, /* inline_isolate = */ false); 892 __ LoadAllocationStatsAddress(R4, cid);
895 __ str(R3, Address(R9, Heap::TopOffset(space))); 893 __ str(R3, Address(R9, Heap::TopOffset(space)));
896 __ add(R0, R0, Operand(kHeapObjectTag)); 894 __ add(R0, R0, Operand(kHeapObjectTag));
897 895
898 // Calculate the size tag. 896 // Calculate the size tag.
899 // R0: new object (tagged). 897 // R0: new object (tagged).
900 // R1: number of context variables. 898 // R1: number of context variables.
901 // R2: object size. 899 // R2: object size.
902 // R3: next object start. 900 // R3: next object start.
903 // R4: allocation stats address. 901 // R4: allocation stats address.
904 const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2; 902 const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2;
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 __ cmp(R1, Operand(IP)); 1074 __ cmp(R1, Operand(IP));
1077 if (FLAG_use_slow_path) { 1075 if (FLAG_use_slow_path) {
1078 __ b(&slow_case); 1076 __ b(&slow_case);
1079 } else { 1077 } else {
1080 __ b(&slow_case, CS); // Unsigned higher or equal. 1078 __ b(&slow_case, CS); // Unsigned higher or equal.
1081 } 1079 }
1082 __ str(R1, Address(R9, Heap::TopOffset(space))); 1080 __ str(R1, Address(R9, Heap::TopOffset(space)));
1083 1081
1084 // Load the address of the allocation stats table. We split up the load 1082 // Load the address of the allocation stats table. We split up the load
1085 // and the increment so that the dependent load is not too nearby. 1083 // and the increment so that the dependent load is not too nearby.
1086 __ LoadAllocationStatsAddress(R9, cls.id(), /* inline_isolate = */ false); 1084 __ LoadAllocationStatsAddress(R9, cls.id());
1087 1085
1088 // R0: new object start. 1086 // R0: new object start.
1089 // R1: next object start. 1087 // R1: next object start.
1090 // R9: allocation stats table. 1088 // R9: allocation stats table.
1091 // Set the tags. 1089 // Set the tags.
1092 uword tags = 0; 1090 uword tags = 0;
1093 tags = RawObject::SizeTag::update(instance_size, tags); 1091 tags = RawObject::SizeTag::update(instance_size, tags);
1094 ASSERT(cls.id() != kIllegalCid); 1092 ASSERT(cls.id() != kIllegalCid);
1095 tags = RawObject::ClassIdTag::update(cls.id(), tags); 1093 tags = RawObject::ClassIdTag::update(cls.id(), tags);
1096 __ LoadImmediate(R2, tags); 1094 __ LoadImmediate(R2, tags);
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after
2180 } 2178 }
2181 2179
2182 2180
2183 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { 2181 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) {
2184 __ bkpt(0); 2182 __ bkpt(0);
2185 } 2183 }
2186 2184
2187 } // namespace dart 2185 } // namespace dart
2188 2186
2189 #endif // defined TARGET_ARCH_ARM 2187 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_x64.cc ('k') | runtime/vm/stub_code_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698