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

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

Issue 2893553002: More compact string representation on 64 bit. (Closed)
Patch Set: Slava feedback Created 3 years, 7 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_mips.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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 /* EDI: untagged array length. */ \ 205 /* EDI: untagged array length. */ \
206 __ cmpl(EDI, Immediate(max_len)); \ 206 __ cmpl(EDI, Immediate(max_len)); \
207 __ j(GREATER, &fall_through); \ 207 __ j(GREATER, &fall_through); \
208 /* Special case for scaling by 16. */ \ 208 /* Special case for scaling by 16. */ \
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 = sizeof(Raw##type_name) + kObjectAlignment - 1; \ 215 const intptr_t fixed_size_plus_alignment_padding = \
216 __ leal(EDI, Address(EDI, scale_factor, fixed_size)); \ 216 sizeof(Raw##type_name) + kObjectAlignment - 1; \
217 __ leal(EDI, Address(EDI, scale_factor, fixed_size_plus_alignment_padding)); \
217 __ andl(EDI, Immediate(-kObjectAlignment)); \ 218 __ andl(EDI, Immediate(-kObjectAlignment)); \
218 Heap::Space space = Heap::kNew; \ 219 Heap::Space space = Heap::kNew; \
219 __ movl(ECX, Address(THR, Thread::heap_offset())); \ 220 __ movl(ECX, Address(THR, Thread::heap_offset())); \
220 __ movl(EAX, Address(ECX, Heap::TopOffset(space))); \ 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 \
(...skipping 1793 matching lines...) Expand 10 before | Expand all | Expand 10 after
2020 Label* failure, 2021 Label* failure,
2021 Register length_reg) { 2022 Register length_reg) {
2022 NOT_IN_PRODUCT( 2023 NOT_IN_PRODUCT(
2023 __ MaybeTraceAllocation(kOneByteStringCid, EAX, failure, false)); 2024 __ MaybeTraceAllocation(kOneByteStringCid, EAX, failure, false));
2024 if (length_reg != EDI) { 2025 if (length_reg != EDI) {
2025 __ movl(EDI, length_reg); 2026 __ movl(EDI, length_reg);
2026 } 2027 }
2027 Label pop_and_fail; 2028 Label pop_and_fail;
2028 __ pushl(EDI); // Preserve length. 2029 __ pushl(EDI); // Preserve length.
2029 __ SmiUntag(EDI); 2030 __ SmiUntag(EDI);
2030 const intptr_t fixed_size = sizeof(RawString) + kObjectAlignment - 1; 2031 const intptr_t fixed_size_plus_alignment_padding =
2031 __ leal(EDI, Address(EDI, TIMES_1, fixed_size)); // EDI is untagged. 2032 sizeof(RawString) + kObjectAlignment - 1;
2033 __ leal(EDI, Address(EDI, TIMES_1,
2034 fixed_size_plus_alignment_padding)); // EDI is untagged.
2032 __ andl(EDI, Immediate(-kObjectAlignment)); 2035 __ andl(EDI, Immediate(-kObjectAlignment));
2033 2036
2034 const intptr_t cid = kOneByteStringCid; 2037 const intptr_t cid = kOneByteStringCid;
2035 Heap::Space space = Heap::kNew; 2038 Heap::Space space = Heap::kNew;
2036 __ movl(ECX, Address(THR, Thread::heap_offset())); 2039 __ movl(ECX, Address(THR, Thread::heap_offset()));
2037 __ movl(EAX, Address(ECX, Heap::TopOffset(space))); 2040 __ movl(EAX, Address(ECX, Heap::TopOffset(space)));
2038 __ movl(EBX, EAX); 2041 __ movl(EBX, EAX);
2039 2042
2040 // EDI: allocation size. 2043 // EDI: allocation size.
2041 __ addl(EBX, EDI); 2044 __ addl(EBX, EDI);
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
2328 __ movl(Address(THR, Thread::async_stack_trace_offset()), EAX); 2331 __ movl(Address(THR, Thread::async_stack_trace_offset()), EAX);
2329 __ LoadObject(EAX, Object::null_object()); 2332 __ LoadObject(EAX, Object::null_object());
2330 __ ret(); 2333 __ ret();
2331 } 2334 }
2332 2335
2333 #undef __ 2336 #undef __
2334 2337
2335 } // namespace dart 2338 } // namespace dart
2336 2339
2337 #endif // defined TARGET_ARCH_IA32 2340 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_arm64.cc ('k') | runtime/vm/intrinsifier_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698