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

Side by Side Diff: runtime/vm/intrinsifier_x64.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/intrinsifier_ia32.cc ('k') | runtime/vm/isolate.h » ('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_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 if (scale_factor == TIMES_16) { \ 167 if (scale_factor == TIMES_16) { \
168 /* double length of array. */ \ 168 /* double length of array. */ \
169 __ addq(RDI, RDI); \ 169 __ addq(RDI, RDI); \
170 /* only scale by 8. */ \ 170 /* only scale by 8. */ \
171 scale_factor = TIMES_8; \ 171 scale_factor = TIMES_8; \
172 } \ 172 } \
173 const intptr_t fixed_size_plus_alignment_padding = \ 173 const intptr_t fixed_size_plus_alignment_padding = \
174 sizeof(Raw##type_name) + kObjectAlignment - 1; \ 174 sizeof(Raw##type_name) + kObjectAlignment - 1; \
175 __ leaq(RDI, Address(RDI, scale_factor, fixed_size_plus_alignment_padding)); \ 175 __ leaq(RDI, Address(RDI, scale_factor, fixed_size_plus_alignment_padding)); \
176 __ andq(RDI, Immediate(-kObjectAlignment)); \ 176 __ andq(RDI, Immediate(-kObjectAlignment)); \
177 NOT_IN_PRODUCT(Heap::Space space = Heap::kNew); \ 177 Heap::Space space = Heap::kNew; \
178 __ movq(RAX, Address(THR, Thread::top_offset())); \ 178 __ movq(R13, Address(THR, Thread::heap_offset())); \
179 __ movq(RAX, Address(R13, Heap::TopOffset(space))); \
179 __ movq(RCX, RAX); \ 180 __ movq(RCX, RAX); \
180 \ 181 \
181 /* RDI: allocation size. */ \ 182 /* RDI: allocation size. */ \
182 __ addq(RCX, RDI); \ 183 __ addq(RCX, RDI); \
183 __ j(CARRY, &fall_through); \ 184 __ j(CARRY, &fall_through); \
184 \ 185 \
185 /* Check if the allocation fits into the remaining space. */ \ 186 /* Check if the allocation fits into the remaining space. */ \
186 /* RAX: potential new object start. */ \ 187 /* RAX: potential new object start. */ \
187 /* RCX: potential next object start. */ \ 188 /* RCX: potential next object start. */ \
188 /* RDI: allocation size. */ \ 189 /* RDI: allocation size. */ \
189 __ cmpq(RCX, Address(THR, Thread::end_offset())); \ 190 /* R13: heap. */ \
191 __ cmpq(RCX, Address(R13, Heap::EndOffset(space))); \
190 __ j(ABOVE_EQUAL, &fall_through); \ 192 __ j(ABOVE_EQUAL, &fall_through); \
191 \ 193 \
192 /* Successfully allocated the object(s), now update top to point to */ \ 194 /* Successfully allocated the object(s), now update top to point to */ \
193 /* next object start and initialize the object. */ \ 195 /* next object start and initialize the object. */ \
194 __ movq(Address(THR, Thread::top_offset()), RCX); \ 196 __ movq(Address(R13, Heap::TopOffset(space)), RCX); \
195 __ addq(RAX, Immediate(kHeapObjectTag)); \ 197 __ addq(RAX, Immediate(kHeapObjectTag)); \
196 NOT_IN_PRODUCT(__ UpdateAllocationStatsWithSize(cid, RDI, space)); \ 198 NOT_IN_PRODUCT(__ UpdateAllocationStatsWithSize(cid, RDI, space)); \
197 /* Initialize the tags. */ \ 199 /* Initialize the tags. */ \
198 /* RAX: new object start as a tagged pointer. */ \ 200 /* RAX: new object start as a tagged pointer. */ \
199 /* RCX: new object end address. */ \ 201 /* RCX: new object end address. */ \
200 /* RDI: allocation size. */ \ 202 /* RDI: allocation size. */ \
201 /* R13: scratch register. */ \ 203 /* R13: scratch register. */ \
202 { \ 204 { \
203 Label size_tag_overflow, done; \ 205 Label size_tag_overflow, done; \
204 __ cmpq(RDI, Immediate(RawObject::SizeTag::kMaxSizeTag)); \ 206 __ cmpq(RDI, Immediate(RawObject::SizeTag::kMaxSizeTag)); \
(...skipping 1811 matching lines...) Expand 10 before | Expand all | Expand 10 after
2016 // return a static zero length string here instead. 2018 // return a static zero length string here instead.
2017 __ j(NOT_ZERO, &not_zero_length); 2019 __ j(NOT_ZERO, &not_zero_length);
2018 __ addq(RDI, Immediate(1)); 2020 __ addq(RDI, Immediate(1));
2019 __ Bind(&not_zero_length); 2021 __ Bind(&not_zero_length);
2020 const intptr_t fixed_size_plus_alignment_padding = 2022 const intptr_t fixed_size_plus_alignment_padding =
2021 sizeof(RawString) + kObjectAlignment - 1; 2023 sizeof(RawString) + kObjectAlignment - 1;
2022 __ addq(RDI, Immediate(fixed_size_plus_alignment_padding)); 2024 __ addq(RDI, Immediate(fixed_size_plus_alignment_padding));
2023 __ andq(RDI, Immediate(-kObjectAlignment)); 2025 __ andq(RDI, Immediate(-kObjectAlignment));
2024 2026
2025 const intptr_t cid = kOneByteStringCid; 2027 const intptr_t cid = kOneByteStringCid;
2026 NOT_IN_PRODUCT(Heap::Space space = Heap::kNew); 2028 Heap::Space space = Heap::kNew;
2027 __ movq(RAX, Address(THR, Thread::top_offset())); 2029 __ movq(R13, Address(THR, Thread::heap_offset()));
2030 __ movq(RAX, Address(R13, Heap::TopOffset(space)));
2028 2031
2029 // RDI: allocation size. 2032 // RDI: allocation size.
2030 __ movq(RCX, RAX); 2033 __ movq(RCX, RAX);
2031 __ addq(RCX, RDI); 2034 __ addq(RCX, RDI);
2032 __ j(CARRY, &pop_and_fail); 2035 __ j(CARRY, &pop_and_fail);
2033 2036
2034 // Check if the allocation fits into the remaining space. 2037 // Check if the allocation fits into the remaining space.
2035 // RAX: potential new object start. 2038 // RAX: potential new object start.
2036 // RCX: potential next object start. 2039 // RCX: potential next object start.
2037 // RDI: allocation size. 2040 // RDI: allocation size.
2038 __ cmpq(RCX, Address(THR, Thread::end_offset())); 2041 // R13: heap.
2042 __ cmpq(RCX, Address(R13, Heap::EndOffset(space)));
2039 __ j(ABOVE_EQUAL, &pop_and_fail); 2043 __ j(ABOVE_EQUAL, &pop_and_fail);
2040 2044
2041 // Successfully allocated the object(s), now update top to point to 2045 // Successfully allocated the object(s), now update top to point to
2042 // next object start and initialize the object. 2046 // next object start and initialize the object.
2043 __ movq(Address(THR, Thread::top_offset()), RCX); 2047 __ movq(Address(R13, Heap::TopOffset(space)), RCX);
2044 __ addq(RAX, Immediate(kHeapObjectTag)); 2048 __ addq(RAX, Immediate(kHeapObjectTag));
2045 NOT_IN_PRODUCT(__ UpdateAllocationStatsWithSize(cid, RDI, space)); 2049 NOT_IN_PRODUCT(__ UpdateAllocationStatsWithSize(cid, RDI, space));
2046 2050
2047 // Initialize the tags. 2051 // Initialize the tags.
2048 // RAX: new object start as a tagged pointer. 2052 // RAX: new object start as a tagged pointer.
2049 // RDI: allocation size. 2053 // RDI: allocation size.
2050 { 2054 {
2051 Label size_tag_overflow, done; 2055 Label size_tag_overflow, done;
2052 __ cmpq(RDI, Immediate(RawObject::SizeTag::kMaxSizeTag)); 2056 __ cmpq(RDI, Immediate(RawObject::SizeTag::kMaxSizeTag));
2053 __ j(ABOVE, &size_tag_overflow, Assembler::kNearJump); 2057 __ j(ABOVE, &size_tag_overflow, Assembler::kNearJump);
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
2315 __ movq(Address(THR, Thread::async_stack_trace_offset()), RAX); 2319 __ movq(Address(THR, Thread::async_stack_trace_offset()), RAX);
2316 __ LoadObject(RAX, Object::null_object()); 2320 __ LoadObject(RAX, Object::null_object());
2317 __ ret(); 2321 __ ret();
2318 } 2322 }
2319 2323
2320 #undef __ 2324 #undef __
2321 2325
2322 } // namespace dart 2326 } // namespace dart
2323 2327
2324 #endif // defined TARGET_ARCH_X64 2328 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_ia32.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698