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

Side by Side Diff: runtime/vm/intrinsifier_ia32.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_arm64.cc ('k') | runtime/vm/intrinsifier_x64.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 // The intrinsic code below is executed before a method has built its frame. 5 // The intrinsic code below is executed before a method has built its frame.
6 // The return address is on the stack and the arguments below it. 6 // The return address is on the stack and the arguments below it.
7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved. 7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved.
8 // Each intrinsification method returns true if the corresponding 8 // Each intrinsification method returns true if the corresponding
9 // Dart method was intrinsified. 9 // Dart method was intrinsified.
10 10
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 if (scale_factor == TIMES_16) { \ 209 if (scale_factor == TIMES_16) { \
210 /* double length of array. */ \ 210 /* double length of array. */ \
211 __ addl(EDI, EDI); \ 211 __ addl(EDI, EDI); \
212 /* only scale by 8. */ \ 212 /* only scale by 8. */ \
213 scale_factor = TIMES_8; \ 213 scale_factor = TIMES_8; \
214 } \ 214 } \
215 const intptr_t fixed_size_plus_alignment_padding = \ 215 const intptr_t fixed_size_plus_alignment_padding = \
216 sizeof(Raw##type_name) + kObjectAlignment - 1; \ 216 sizeof(Raw##type_name) + kObjectAlignment - 1; \
217 __ leal(EDI, Address(EDI, scale_factor, fixed_size_plus_alignment_padding)); \ 217 __ leal(EDI, Address(EDI, scale_factor, fixed_size_plus_alignment_padding)); \
218 __ andl(EDI, Immediate(-kObjectAlignment)); \ 218 __ andl(EDI, Immediate(-kObjectAlignment)); \
219 NOT_IN_PRODUCT(Heap::Space space = Heap::kNew); \ 219 Heap::Space space = Heap::kNew; \
220 __ movl(EAX, Address(THR, Thread::top_offset())); \ 220 __ movl(ECX, Address(THR, Thread::heap_offset())); \
221 __ movl(EAX, Address(ECX, Heap::TopOffset(space))); \
221 __ movl(EBX, EAX); \ 222 __ movl(EBX, EAX); \
222 \ 223 \
223 /* EDI: allocation size. */ \ 224 /* EDI: allocation size. */ \
224 __ addl(EBX, EDI); \ 225 __ addl(EBX, EDI); \
225 __ j(CARRY, &fall_through); \ 226 __ j(CARRY, &fall_through); \
226 \ 227 \
227 /* Check if the allocation fits into the remaining space. */ \ 228 /* Check if the allocation fits into the remaining space. */ \
228 /* EAX: potential new object start. */ \ 229 /* EAX: potential new object start. */ \
229 /* EBX: potential next object start. */ \ 230 /* EBX: potential next object start. */ \
230 /* EDI: allocation size. */ \ 231 /* EDI: allocation size. */ \
231 __ cmpl(EBX, Address(THR, Thread::end_offset())); \ 232 /* ECX: heap. */ \
233 __ cmpl(EBX, Address(ECX, Heap::EndOffset(space))); \
232 __ j(ABOVE_EQUAL, &fall_through); \ 234 __ j(ABOVE_EQUAL, &fall_through); \
233 \ 235 \
234 /* Successfully allocated the object(s), now update top to point to */ \ 236 /* Successfully allocated the object(s), now update top to point to */ \
235 /* next object start and initialize the object. */ \ 237 /* next object start and initialize the object. */ \
236 __ movl(Address(THR, Thread::top_offset()), EBX); \ 238 __ movl(Address(ECX, Heap::TopOffset(space)), EBX); \
237 __ addl(EAX, Immediate(kHeapObjectTag)); \ 239 __ addl(EAX, Immediate(kHeapObjectTag)); \
238 NOT_IN_PRODUCT(__ UpdateAllocationStatsWithSize(cid, EDI, ECX, space)); \ 240 NOT_IN_PRODUCT(__ UpdateAllocationStatsWithSize(cid, EDI, ECX, space)); \
239 \ 241 \
240 /* Initialize the tags. */ \ 242 /* Initialize the tags. */ \
241 /* EAX: new object start as a tagged pointer. */ \ 243 /* EAX: new object start as a tagged pointer. */ \
242 /* EBX: new object end address. */ \ 244 /* EBX: new object end address. */ \
243 /* EDI: allocation size. */ \ 245 /* EDI: allocation size. */ \
244 { \ 246 { \
245 Label size_tag_overflow, done; \ 247 Label size_tag_overflow, done; \
246 __ cmpl(EDI, Immediate(RawObject::SizeTag::kMaxSizeTag)); \ 248 __ cmpl(EDI, Immediate(RawObject::SizeTag::kMaxSizeTag)); \
(...skipping 1789 matching lines...) Expand 10 before | Expand all | Expand 10 after
2036 Label pop_and_fail; 2038 Label pop_and_fail;
2037 __ pushl(EDI); // Preserve length. 2039 __ pushl(EDI); // Preserve length.
2038 __ SmiUntag(EDI); 2040 __ SmiUntag(EDI);
2039 const intptr_t fixed_size_plus_alignment_padding = 2041 const intptr_t fixed_size_plus_alignment_padding =
2040 sizeof(RawString) + kObjectAlignment - 1; 2042 sizeof(RawString) + kObjectAlignment - 1;
2041 __ leal(EDI, Address(EDI, TIMES_1, 2043 __ leal(EDI, Address(EDI, TIMES_1,
2042 fixed_size_plus_alignment_padding)); // EDI is untagged. 2044 fixed_size_plus_alignment_padding)); // EDI is untagged.
2043 __ andl(EDI, Immediate(-kObjectAlignment)); 2045 __ andl(EDI, Immediate(-kObjectAlignment));
2044 2046
2045 const intptr_t cid = kOneByteStringCid; 2047 const intptr_t cid = kOneByteStringCid;
2046 NOT_IN_PRODUCT(Heap::Space space = Heap::kNew); 2048 Heap::Space space = Heap::kNew;
2047 __ movl(EAX, Address(THR, Thread::top_offset())); 2049 __ movl(ECX, Address(THR, Thread::heap_offset()));
2050 __ movl(EAX, Address(ECX, Heap::TopOffset(space)));
2048 __ movl(EBX, EAX); 2051 __ movl(EBX, EAX);
2049 2052
2050 // EDI: allocation size. 2053 // EDI: allocation size.
2051 __ addl(EBX, EDI); 2054 __ addl(EBX, EDI);
2052 __ j(CARRY, &pop_and_fail); 2055 __ j(CARRY, &pop_and_fail);
2053 2056
2054 // Check if the allocation fits into the remaining space. 2057 // Check if the allocation fits into the remaining space.
2055 // EAX: potential new object start. 2058 // EAX: potential new object start.
2056 // EBX: potential next object start. 2059 // EBX: potential next object start.
2057 // EDI: allocation size. 2060 // EDI: allocation size.
2058 __ cmpl(EBX, Address(THR, Thread::end_offset())); 2061 // ECX: heap.
2062 __ cmpl(EBX, Address(ECX, Heap::EndOffset(space)));
2059 __ j(ABOVE_EQUAL, &pop_and_fail); 2063 __ j(ABOVE_EQUAL, &pop_and_fail);
2060 2064
2061 // Successfully allocated the object(s), now update top to point to 2065 // Successfully allocated the object(s), now update top to point to
2062 // next object start and initialize the object. 2066 // next object start and initialize the object.
2063 __ movl(Address(THR, Thread::top_offset()), EBX); 2067 __ movl(Address(ECX, Heap::TopOffset(space)), EBX);
2064 __ addl(EAX, Immediate(kHeapObjectTag)); 2068 __ addl(EAX, Immediate(kHeapObjectTag));
2065 2069
2066 NOT_IN_PRODUCT(__ UpdateAllocationStatsWithSize(cid, EDI, ECX, space)); 2070 NOT_IN_PRODUCT(__ UpdateAllocationStatsWithSize(cid, EDI, ECX, space));
2067 2071
2068 // Initialize the tags. 2072 // Initialize the tags.
2069 // EAX: new object start as a tagged pointer. 2073 // EAX: new object start as a tagged pointer.
2070 // EBX: new object end address. 2074 // EBX: new object end address.
2071 // EDI: allocation size. 2075 // EDI: allocation size.
2072 { 2076 {
2073 Label size_tag_overflow, done; 2077 Label size_tag_overflow, done;
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
2337 __ movl(Address(THR, Thread::async_stack_trace_offset()), EAX); 2341 __ movl(Address(THR, Thread::async_stack_trace_offset()), EAX);
2338 __ LoadObject(EAX, Object::null_object()); 2342 __ LoadObject(EAX, Object::null_object());
2339 __ ret(); 2343 __ ret();
2340 } 2344 }
2341 2345
2342 #undef __ 2346 #undef __
2343 2347
2344 } // namespace dart 2348 } // namespace dart
2345 2349
2346 #endif // defined TARGET_ARCH_IA32 2350 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_arm64.cc ('k') | runtime/vm/intrinsifier_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698