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

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

Issue 2974403002: Revert "Moves the top_ and end_ words of the Scavenger into mutator thread." (Closed)
Patch Set: Created 3 years, 5 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/heap.cc ('k') | runtime/vm/intrinsifier_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" // Needed here to get TARGET_ARCH_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/intrinsifier.h" 8 #include "vm/intrinsifier.h"
9 9
10 #include "vm/assembler.h" 10 #include "vm/assembler.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 __ SmiUntag(R2); \ 173 __ SmiUntag(R2); \
174 /* Check for maximum allowed length. */ \ 174 /* Check for maximum allowed length. */ \
175 /* R2: untagged array length. */ \ 175 /* R2: untagged array length. */ \
176 __ CompareImmediate(R2, max_len); \ 176 __ CompareImmediate(R2, max_len); \
177 __ b(&fall_through, GT); \ 177 __ b(&fall_through, GT); \
178 __ mov(R2, Operand(R2, LSL, scale_shift)); \ 178 __ mov(R2, Operand(R2, LSL, scale_shift)); \
179 const intptr_t fixed_size_plus_alignment_padding = \ 179 const intptr_t fixed_size_plus_alignment_padding = \
180 sizeof(Raw##type_name) + kObjectAlignment - 1; \ 180 sizeof(Raw##type_name) + kObjectAlignment - 1; \
181 __ AddImmediate(R2, fixed_size_plus_alignment_padding); \ 181 __ AddImmediate(R2, fixed_size_plus_alignment_padding); \
182 __ bic(R2, R2, Operand(kObjectAlignment - 1)); \ 182 __ bic(R2, R2, Operand(kObjectAlignment - 1)); \
183 NOT_IN_PRODUCT(Heap::Space space = Heap::kNew); \ 183 Heap::Space space = Heap::kNew; \
184 __ ldr(R0, Address(THR, Thread::top_offset())); \ 184 __ ldr(R3, Address(THR, Thread::heap_offset())); \
185 __ ldr(R0, Address(R3, Heap::TopOffset(space))); \
185 \ 186 \
186 /* R2: allocation size. */ \ 187 /* R2: allocation size. */ \
187 __ adds(R1, R0, Operand(R2)); \ 188 __ adds(R1, R0, Operand(R2)); \
188 __ b(&fall_through, CS); /* Fail on unsigned overflow. */ \ 189 __ b(&fall_through, CS); /* Fail on unsigned overflow. */ \
189 \ 190 \
190 /* Check if the allocation fits into the remaining space. */ \ 191 /* Check if the allocation fits into the remaining space. */ \
191 /* R0: potential new object start. */ \ 192 /* R0: potential new object start. */ \
192 /* R1: potential next object start. */ \ 193 /* R1: potential next object start. */ \
193 /* R2: allocation size. */ \ 194 /* R2: allocation size. */ \
194 __ ldr(IP, Address(THR, Thread::end_offset())); \ 195 /* R3: heap. */ \
196 __ ldr(IP, Address(R3, Heap::EndOffset(space))); \
195 __ cmp(R1, Operand(IP)); \ 197 __ cmp(R1, Operand(IP)); \
196 __ b(&fall_through, CS); \ 198 __ b(&fall_through, CS); \
197 \ 199 \
198 /* Successfully allocated the object(s), now update top to point to */ \ 200 /* Successfully allocated the object(s), now update top to point to */ \
199 /* next object start and initialize the object. */ \ 201 /* next object start and initialize the object. */ \
200 NOT_IN_PRODUCT(__ LoadAllocationStatsAddress(R4, cid)); \ 202 NOT_IN_PRODUCT(__ LoadAllocationStatsAddress(R4, cid)); \
201 __ str(R1, Address(THR, Thread::top_offset())); \ 203 __ str(R1, Address(R3, Heap::TopOffset(space))); \
202 __ AddImmediate(R0, kHeapObjectTag); \ 204 __ AddImmediate(R0, kHeapObjectTag); \
203 /* Initialize the tags. */ \ 205 /* Initialize the tags. */ \
204 /* R0: new object start as a tagged pointer. */ \ 206 /* R0: new object start as a tagged pointer. */ \
205 /* R1: new object end address. */ \ 207 /* R1: new object end address. */ \
206 /* R2: allocation size. */ \ 208 /* R2: allocation size. */ \
207 /* R4: allocation stats address */ \ 209 /* R4: allocation stats address */ \
208 { \ 210 { \
209 __ CompareImmediate(R2, RawObject::SizeTag::kMaxSizeTag); \ 211 __ CompareImmediate(R2, RawObject::SizeTag::kMaxSizeTag); \
210 __ mov(R3, \ 212 __ mov(R3, \
211 Operand(R2, LSL, RawObject::kSizeTagPos - kObjectAlignmentLog2), \ 213 Operand(R2, LSL, RawObject::kSizeTagPos - kObjectAlignmentLog2), \
(...skipping 1793 matching lines...) Expand 10 before | Expand all | Expand 10 after
2005 NOT_IN_PRODUCT(__ MaybeTraceAllocation(kOneByteStringCid, R0, failure)); 2007 NOT_IN_PRODUCT(__ MaybeTraceAllocation(kOneByteStringCid, R0, failure));
2006 __ mov(R8, Operand(length_reg)); // Save the length register. 2008 __ mov(R8, Operand(length_reg)); // Save the length register.
2007 // TODO(koda): Protect against negative length and overflow here. 2009 // TODO(koda): Protect against negative length and overflow here.
2008 __ SmiUntag(length_reg); 2010 __ SmiUntag(length_reg);
2009 const intptr_t fixed_size_plus_alignment_padding = 2011 const intptr_t fixed_size_plus_alignment_padding =
2010 sizeof(RawString) + kObjectAlignment - 1; 2012 sizeof(RawString) + kObjectAlignment - 1;
2011 __ AddImmediate(length_reg, fixed_size_plus_alignment_padding); 2013 __ AddImmediate(length_reg, fixed_size_plus_alignment_padding);
2012 __ bic(length_reg, length_reg, Operand(kObjectAlignment - 1)); 2014 __ bic(length_reg, length_reg, Operand(kObjectAlignment - 1));
2013 2015
2014 const intptr_t cid = kOneByteStringCid; 2016 const intptr_t cid = kOneByteStringCid;
2015 NOT_IN_PRODUCT(Heap::Space space = Heap::kNew); 2017 Heap::Space space = Heap::kNew;
2016 __ ldr(R0, Address(THR, Thread::top_offset())); 2018 __ ldr(R3, Address(THR, Thread::heap_offset()));
2019 __ ldr(R0, Address(R3, Heap::TopOffset(space)));
2017 2020
2018 // length_reg: allocation size. 2021 // length_reg: allocation size.
2019 __ adds(R1, R0, Operand(length_reg)); 2022 __ adds(R1, R0, Operand(length_reg));
2020 __ b(&fail, CS); // Fail on unsigned overflow. 2023 __ b(&fail, CS); // Fail on unsigned overflow.
2021 2024
2022 // Check if the allocation fits into the remaining space. 2025 // Check if the allocation fits into the remaining space.
2023 // R0: potential new object start. 2026 // R0: potential new object start.
2024 // R1: potential next object start. 2027 // R1: potential next object start.
2025 // R2: allocation size. 2028 // R2: allocation size.
2026 __ ldr(NOTFP, Address(THR, Thread::end_offset())); 2029 // R3: heap.
2030 __ ldr(NOTFP, Address(R3, Heap::EndOffset(space)));
2027 __ cmp(R1, Operand(NOTFP)); 2031 __ cmp(R1, Operand(NOTFP));
2028 __ b(&fail, CS); 2032 __ b(&fail, CS);
2029 2033
2030 // Successfully allocated the object(s), now update top to point to 2034 // Successfully allocated the object(s), now update top to point to
2031 // next object start and initialize the object. 2035 // next object start and initialize the object.
2032 NOT_IN_PRODUCT(__ LoadAllocationStatsAddress(R4, cid)); 2036 NOT_IN_PRODUCT(__ LoadAllocationStatsAddress(R4, cid));
2033 __ str(R1, Address(THR, Thread::top_offset())); 2037 __ str(R1, Address(R3, Heap::TopOffset(space)));
2034 __ AddImmediate(R0, kHeapObjectTag); 2038 __ AddImmediate(R0, kHeapObjectTag);
2035 2039
2036 // Initialize the tags. 2040 // Initialize the tags.
2037 // R0: new object start as a tagged pointer. 2041 // R0: new object start as a tagged pointer.
2038 // R1: new object end address. 2042 // R1: new object end address.
2039 // R2: allocation size. 2043 // R2: allocation size.
2040 // R4: allocation stats address. 2044 // R4: allocation stats address.
2041 { 2045 {
2042 const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2; 2046 const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2;
2043 2047
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
2318 2322
2319 void Intrinsifier::SetAsyncThreadStackTrace(Assembler* assembler) { 2323 void Intrinsifier::SetAsyncThreadStackTrace(Assembler* assembler) {
2320 __ ldr(R0, Address(THR, Thread::async_stack_trace_offset())); 2324 __ ldr(R0, Address(THR, Thread::async_stack_trace_offset()));
2321 __ LoadObject(R0, Object::null_object()); 2325 __ LoadObject(R0, Object::null_object());
2322 __ Ret(); 2326 __ Ret();
2323 } 2327 }
2324 2328
2325 } // namespace dart 2329 } // namespace dart
2326 2330
2327 #endif // defined TARGET_ARCH_ARM 2331 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/heap.cc ('k') | runtime/vm/intrinsifier_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698