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

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

Issue 2889723005: Revert "More compact string representation on 64 bit." (Closed)
Patch Set: 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_plus_alignment_padding = \ 215 const intptr_t fixed_size = sizeof(Raw##type_name) + kObjectAlignment - 1; \
216 sizeof(Raw##type_name) + kObjectAlignment - 1; \ 216 __ leal(EDI, Address(EDI, scale_factor, fixed_size)); \
217 __ leal(EDI, Address(EDI, scale_factor, fixed_size_plus_alignment_padding)); \
218 __ andl(EDI, Immediate(-kObjectAlignment)); \ 217 __ andl(EDI, Immediate(-kObjectAlignment)); \
219 Heap::Space space = Heap::kNew; \ 218 Heap::Space space = Heap::kNew; \
220 __ movl(ECX, Address(THR, Thread::heap_offset())); \ 219 __ movl(ECX, Address(THR, Thread::heap_offset())); \
221 __ movl(EAX, Address(ECX, Heap::TopOffset(space))); \ 220 __ movl(EAX, Address(ECX, Heap::TopOffset(space))); \
222 __ movl(EBX, EAX); \ 221 __ movl(EBX, EAX); \
223 \ 222 \
224 /* EDI: allocation size. */ \ 223 /* EDI: allocation size. */ \
225 __ addl(EBX, EDI); \ 224 __ addl(EBX, EDI); \
226 __ j(CARRY, &fall_through); \ 225 __ j(CARRY, &fall_through); \
227 \ 226 \
(...skipping 1793 matching lines...) Expand 10 before | Expand all | Expand 10 after
2021 Label* failure, 2020 Label* failure,
2022 Register length_reg) { 2021 Register length_reg) {
2023 NOT_IN_PRODUCT( 2022 NOT_IN_PRODUCT(
2024 __ MaybeTraceAllocation(kOneByteStringCid, EAX, failure, false)); 2023 __ MaybeTraceAllocation(kOneByteStringCid, EAX, failure, false));
2025 if (length_reg != EDI) { 2024 if (length_reg != EDI) {
2026 __ movl(EDI, length_reg); 2025 __ movl(EDI, length_reg);
2027 } 2026 }
2028 Label pop_and_fail; 2027 Label pop_and_fail;
2029 __ pushl(EDI); // Preserve length. 2028 __ pushl(EDI); // Preserve length.
2030 __ SmiUntag(EDI); 2029 __ SmiUntag(EDI);
2031 const intptr_t fixed_size_plus_alignment_padding = 2030 const intptr_t fixed_size = sizeof(RawString) + kObjectAlignment - 1;
2032 sizeof(RawString) + kObjectAlignment - 1; 2031 __ leal(EDI, Address(EDI, TIMES_1, fixed_size)); // EDI is untagged.
2033 __ leal(EDI, Address(EDI, TIMES_1,
2034 fixed_size_plus_alignment_padding)); // EDI is untagged.
2035 __ andl(EDI, Immediate(-kObjectAlignment)); 2032 __ andl(EDI, Immediate(-kObjectAlignment));
2036 2033
2037 const intptr_t cid = kOneByteStringCid; 2034 const intptr_t cid = kOneByteStringCid;
2038 Heap::Space space = Heap::kNew; 2035 Heap::Space space = Heap::kNew;
2039 __ movl(ECX, Address(THR, Thread::heap_offset())); 2036 __ movl(ECX, Address(THR, Thread::heap_offset()));
2040 __ movl(EAX, Address(ECX, Heap::TopOffset(space))); 2037 __ movl(EAX, Address(ECX, Heap::TopOffset(space)));
2041 __ movl(EBX, EAX); 2038 __ movl(EBX, EAX);
2042 2039
2043 // EDI: allocation size. 2040 // EDI: allocation size.
2044 __ addl(EBX, EDI); 2041 __ addl(EBX, EDI);
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
2331 __ movl(Address(THR, Thread::async_stack_trace_offset()), EAX); 2328 __ movl(Address(THR, Thread::async_stack_trace_offset()), EAX);
2332 __ LoadObject(EAX, Object::null_object()); 2329 __ LoadObject(EAX, Object::null_object());
2333 __ ret(); 2330 __ ret();
2334 } 2331 }
2335 2332
2336 #undef __ 2333 #undef __
2337 2334
2338 } // namespace dart 2335 } // namespace dart
2339 2336
2340 #endif // defined TARGET_ARCH_IA32 2337 #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