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

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

Issue 1241863002: VM: Refactor allocation stats code and remove duplicate code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comments Created 5 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/pages.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_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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 __ mov(R7, Operand(R6)); \ 267 __ mov(R7, Operand(R6)); \
268 __ AddImmediate(R3, R0, sizeof(Raw##type_name) - 1); \ 268 __ AddImmediate(R3, R0, sizeof(Raw##type_name) - 1); \
269 Label init_loop; \ 269 Label init_loop; \
270 __ Bind(&init_loop); \ 270 __ Bind(&init_loop); \
271 __ AddImmediate(R3, 2 * kWordSize); \ 271 __ AddImmediate(R3, 2 * kWordSize); \
272 __ cmp(R3, Operand(R1)); \ 272 __ cmp(R3, Operand(R1)); \
273 __ strd(R6, R3, -2 * kWordSize, LS); \ 273 __ strd(R6, R3, -2 * kWordSize, LS); \
274 __ b(&init_loop, CC); \ 274 __ b(&init_loop, CC); \
275 __ str(R6, Address(R3, -2 * kWordSize), HI); \ 275 __ str(R6, Address(R3, -2 * kWordSize), HI); \
276 \ 276 \
277 __ IncrementAllocationStatsWithSize(R4, R2, cid, space); \ 277 __ IncrementAllocationStatsWithSize(R4, R2, space); \
278 __ Ret(); \ 278 __ Ret(); \
279 __ Bind(&fall_through); \ 279 __ Bind(&fall_through); \
280 280
281 281
282 static int GetScaleFactor(intptr_t size) { 282 static int GetScaleFactor(intptr_t size) {
283 switch (size) { 283 switch (size) {
284 case 1: return 0; 284 case 1: return 0;
285 case 2: return 1; 285 case 2: return 1;
286 case 4: return 2; 286 case 4: return 2;
287 case 8: return 3; 287 case 8: return 3;
(...skipping 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after
1820 // Set the length field using the saved length (R6). 1820 // Set the length field using the saved length (R6).
1821 __ InitializeFieldNoBarrier(R0, 1821 __ InitializeFieldNoBarrier(R0,
1822 FieldAddress(R0, String::length_offset()), 1822 FieldAddress(R0, String::length_offset()),
1823 R6); 1823 R6);
1824 // Clear hash. 1824 // Clear hash.
1825 __ LoadImmediate(TMP, 0); 1825 __ LoadImmediate(TMP, 0);
1826 __ InitializeFieldNoBarrier(R0, 1826 __ InitializeFieldNoBarrier(R0,
1827 FieldAddress(R0, String::hash_offset()), 1827 FieldAddress(R0, String::hash_offset()),
1828 TMP); 1828 TMP);
1829 1829
1830 __ IncrementAllocationStatsWithSize(R4, R2, cid, space); 1830 __ IncrementAllocationStatsWithSize(R4, R2, space);
1831 __ b(ok); 1831 __ b(ok);
1832 1832
1833 __ Bind(&fail); 1833 __ Bind(&fail);
1834 __ b(failure); 1834 __ b(failure);
1835 } 1835 }
1836 1836
1837 1837
1838 // Arg0: OneByteString (receiver). 1838 // Arg0: OneByteString (receiver).
1839 // Arg1: Start index as Smi. 1839 // Arg1: Start index as Smi.
1840 // Arg2: End index as Smi. 1840 // Arg2: End index as Smi.
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
2061 Isolate* isolate = Isolate::Current(); 2061 Isolate* isolate = Isolate::Current();
2062 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); 2062 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate));
2063 // Set return value to Isolate::current_tag_. 2063 // Set return value to Isolate::current_tag_.
2064 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); 2064 __ ldr(R0, Address(R1, Isolate::current_tag_offset()));
2065 __ Ret(); 2065 __ Ret();
2066 } 2066 }
2067 2067
2068 } // namespace dart 2068 } // namespace dart
2069 2069
2070 #endif // defined TARGET_ARCH_ARM 2070 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/heap.cc ('k') | runtime/vm/pages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698