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

Side by Side Diff: runtime/vm/stub_code_arm64.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_arm.cc ('k') | runtime/vm/stub_code_ia32.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
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/compiler.h" 10 #include "vm/compiler.h"
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 __ cmp(R2, Operand(0)); 645 __ cmp(R2, Operand(0));
646 __ b(&slow_case, LT); 646 __ b(&slow_case, LT);
647 647
648 // Check for maximum allowed length. 648 // Check for maximum allowed length.
649 const intptr_t max_len = 649 const intptr_t max_len =
650 reinterpret_cast<intptr_t>(Smi::New(Array::kMaxElements)); 650 reinterpret_cast<intptr_t>(Smi::New(Array::kMaxElements));
651 __ CompareImmediate(R2, max_len); 651 __ CompareImmediate(R2, max_len);
652 __ b(&slow_case, GT); 652 __ b(&slow_case, GT);
653 653
654 const intptr_t cid = kArrayCid; 654 const intptr_t cid = kArrayCid;
655 __ MaybeTraceAllocation(kArrayCid, R4, &slow_case, 655 __ MaybeTraceAllocation(kArrayCid, R4, &slow_case);
656 /* inline_isolate = */ false);
657 656
658 Heap::Space space = Heap::SpaceForAllocation(cid); 657 Heap::Space space = Heap::SpaceForAllocation(cid);
659 __ LoadIsolate(R8); 658 __ LoadIsolate(R8);
660 __ ldr(R8, Address(R8, Isolate::heap_offset())); 659 __ ldr(R8, Address(R8, Isolate::heap_offset()));
661 660
662 // Calculate and align allocation size. 661 // Calculate and align allocation size.
663 // Load new object start and calculate next object start. 662 // Load new object start and calculate next object start.
664 // R1: array element type. 663 // R1: array element type.
665 // R2: array length as Smi. 664 // R2: array length as Smi.
666 // R8: heap. 665 // R8: heap.
(...skipping 20 matching lines...) Expand all
687 __ b(&slow_case, CS); // Branch if unsigned higher or equal. 686 __ b(&slow_case, CS); // Branch if unsigned higher or equal.
688 687
689 // Successfully allocated the object(s), now update top to point to 688 // Successfully allocated the object(s), now update top to point to
690 // next object start and initialize the object. 689 // next object start and initialize the object.
691 // R0: potential new object start. 690 // R0: potential new object start.
692 // R3: array size. 691 // R3: array size.
693 // R7: potential next object start. 692 // R7: potential next object start.
694 // R8: heap. 693 // R8: heap.
695 __ StoreToOffset(R7, R8, Heap::TopOffset(space)); 694 __ StoreToOffset(R7, R8, Heap::TopOffset(space));
696 __ add(R0, R0, Operand(kHeapObjectTag)); 695 __ add(R0, R0, Operand(kHeapObjectTag));
697 __ UpdateAllocationStatsWithSize(cid, R3, space, 696 __ UpdateAllocationStatsWithSize(cid, R3, space);
698 /* inline_isolate = */ false);
699 697
700 // R0: new object start as a tagged pointer. 698 // R0: new object start as a tagged pointer.
701 // R1: array element type. 699 // R1: array element type.
702 // R2: array length as Smi. 700 // R2: array length as Smi.
703 // R3: array size. 701 // R3: array size.
704 // R7: new object end address. 702 // R7: new object end address.
705 703
706 // Store the type argument field. 704 // Store the type argument field.
707 __ StoreIntoObjectOffsetNoBarrier( 705 __ StoreIntoObjectOffsetNoBarrier(
708 R0, Array::type_arguments_offset(), R1); 706 R0, Array::type_arguments_offset(), R1);
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 if (FLAG_inline_alloc) { 910 if (FLAG_inline_alloc) {
913 Label slow_case; 911 Label slow_case;
914 // First compute the rounded instance size. 912 // First compute the rounded instance size.
915 // R1: number of context variables. 913 // R1: number of context variables.
916 intptr_t fixed_size = sizeof(RawContext) + kObjectAlignment - 1; 914 intptr_t fixed_size = sizeof(RawContext) + kObjectAlignment - 1;
917 __ LoadImmediate(R2, fixed_size); 915 __ LoadImmediate(R2, fixed_size);
918 __ add(R2, R2, Operand(R1, LSL, 3)); 916 __ add(R2, R2, Operand(R1, LSL, 3));
919 ASSERT(kSmiTagShift == 1); 917 ASSERT(kSmiTagShift == 1);
920 __ andi(R2, R2, Immediate(~(kObjectAlignment - 1))); 918 __ andi(R2, R2, Immediate(~(kObjectAlignment - 1)));
921 919
922 __ MaybeTraceAllocation(kContextCid, R4, &slow_case, 920 __ MaybeTraceAllocation(kContextCid, R4, &slow_case);
923 /* inline_isolate = */ false);
924 // Now allocate the object. 921 // Now allocate the object.
925 // R1: number of context variables. 922 // R1: number of context variables.
926 // R2: object size. 923 // R2: object size.
927 const intptr_t cid = kContextCid; 924 const intptr_t cid = kContextCid;
928 Heap::Space space = Heap::SpaceForAllocation(cid); 925 Heap::Space space = Heap::SpaceForAllocation(cid);
929 __ LoadIsolate(R5); 926 __ LoadIsolate(R5);
930 __ ldr(R5, Address(R5, Isolate::heap_offset())); 927 __ ldr(R5, Address(R5, Isolate::heap_offset()));
931 __ ldr(R0, Address(R5, Heap::TopOffset(space))); 928 __ ldr(R0, Address(R5, Heap::TopOffset(space)));
932 __ add(R3, R2, Operand(R0)); 929 __ add(R3, R2, Operand(R0));
933 // Check if the allocation fits into the remaining space. 930 // Check if the allocation fits into the remaining space.
(...skipping 12 matching lines...) Expand all
946 943
947 // Successfully allocated the object, now update top to point to 944 // Successfully allocated the object, now update top to point to
948 // next object start and initialize the object. 945 // next object start and initialize the object.
949 // R0: new object. 946 // R0: new object.
950 // R1: number of context variables. 947 // R1: number of context variables.
951 // R2: object size. 948 // R2: object size.
952 // R3: next object start. 949 // R3: next object start.
953 // R5: heap. 950 // R5: heap.
954 __ str(R3, Address(R5, Heap::TopOffset(space))); 951 __ str(R3, Address(R5, Heap::TopOffset(space)));
955 __ add(R0, R0, Operand(kHeapObjectTag)); 952 __ add(R0, R0, Operand(kHeapObjectTag));
956 __ UpdateAllocationStatsWithSize(cid, R2, space, 953 __ UpdateAllocationStatsWithSize(cid, R2, space);
957 /* inline_isolate = */ false);
958 954
959 // Calculate the size tag. 955 // Calculate the size tag.
960 // R0: new object. 956 // R0: new object.
961 // R1: number of context variables. 957 // R1: number of context variables.
962 // R2: object size. 958 // R2: object size.
963 const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2; 959 const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2;
964 __ CompareImmediate(R2, RawObject::SizeTag::kMaxSizeTag); 960 __ CompareImmediate(R2, RawObject::SizeTag::kMaxSizeTag);
965 // If no size tag overflow, shift R2 left, else set R2 to zero. 961 // If no size tag overflow, shift R2 left, else set R2 to zero.
966 __ LslImmediate(TMP, R2, shift); 962 __ LslImmediate(TMP, R2, shift);
967 __ csel(R2, TMP, R2, LS); 963 __ csel(R2, TMP, R2, LS);
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 // R3: potential next object start. 1117 // R3: potential next object start.
1122 // R5: heap. 1118 // R5: heap.
1123 __ ldr(TMP, Address(R5, Heap::EndOffset(space))); 1119 __ ldr(TMP, Address(R5, Heap::EndOffset(space)));
1124 __ CompareRegisters(R3, TMP); 1120 __ CompareRegisters(R3, TMP);
1125 if (FLAG_use_slow_path) { 1121 if (FLAG_use_slow_path) {
1126 __ b(&slow_case); 1122 __ b(&slow_case);
1127 } else { 1123 } else {
1128 __ b(&slow_case, CS); // Unsigned higher or equal. 1124 __ b(&slow_case, CS); // Unsigned higher or equal.
1129 } 1125 }
1130 __ str(R3, Address(R5, Heap::TopOffset(space))); 1126 __ str(R3, Address(R5, Heap::TopOffset(space)));
1131 __ UpdateAllocationStats(cls.id(), space, /* inline_isolate = */ false); 1127 __ UpdateAllocationStats(cls.id(), space);
1132 1128
1133 // R2: new object start. 1129 // R2: new object start.
1134 // R3: next object start. 1130 // R3: next object start.
1135 // R1: new object type arguments (if is_cls_parameterized). 1131 // R1: new object type arguments (if is_cls_parameterized).
1136 // Set the tags. 1132 // Set the tags.
1137 uword tags = 0; 1133 uword tags = 0;
1138 tags = RawObject::SizeTag::update(instance_size, tags); 1134 tags = RawObject::SizeTag::update(instance_size, tags);
1139 ASSERT(cls.id() != kIllegalCid); 1135 ASSERT(cls.id() != kIllegalCid);
1140 tags = RawObject::ClassIdTag::update(cls.id(), tags); 1136 tags = RawObject::ClassIdTag::update(cls.id(), tags);
1141 __ LoadImmediate(R0, tags); 1137 __ LoadImmediate(R0, tags);
(...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after
2233 } 2229 }
2234 2230
2235 2231
2236 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { 2232 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) {
2237 __ brk(0); 2233 __ brk(0);
2238 } 2234 }
2239 2235
2240 } // namespace dart 2236 } // namespace dart
2241 2237
2242 #endif // defined TARGET_ARCH_ARM64 2238 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698