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

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

Issue 747463002: Fix allocation stats bug on ARM; add unit test. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/heap_test.cc ('k') | no next file » | 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" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 R1); 683 R1);
684 684
685 // Set the length field. 685 // Set the length field.
686 __ StoreIntoObjectNoBarrier(R0, 686 __ StoreIntoObjectNoBarrier(R0,
687 FieldAddress(R0, Array::length_offset()), 687 FieldAddress(R0, Array::length_offset()),
688 R2); 688 R2);
689 689
690 // Initialize all array elements to raw_null. 690 // Initialize all array elements to raw_null.
691 // R0: new object start as a tagged pointer. 691 // R0: new object start as a tagged pointer.
692 // R3: allocation stats address. 692 // R3: allocation stats address.
693 // R4, R5: null
694 // R6: iterator which initially points to the start of the variable
695 // data area to be initialized.
693 // R7: new object end address. 696 // R7: new object end address.
694 // R8: iterator which initially points to the start of the variable 697 // R8: allocation size.
695 // data area to be initialized. 698
696 // R4, R5: null
697 __ LoadImmediate(R4, reinterpret_cast<intptr_t>(Object::null())); 699 __ LoadImmediate(R4, reinterpret_cast<intptr_t>(Object::null()));
698 __ mov(R5, Operand(R4)); 700 __ mov(R5, Operand(R4));
699 __ AddImmediate(R8, R0, sizeof(RawArray) - kHeapObjectTag); 701 __ AddImmediate(R6, R0, sizeof(RawArray) - kHeapObjectTag);
700 702
701 Label init_loop; 703 Label init_loop;
702 __ Bind(&init_loop); 704 __ Bind(&init_loop);
703 __ AddImmediate(R8, 2 * kWordSize); 705 __ AddImmediate(R6, 2 * kWordSize);
704 __ cmp(R8, Operand(R7)); 706 __ cmp(R6, Operand(R7));
705 __ strd(R4, Address(R8, -2 * kWordSize), LS); 707 __ strd(R4, Address(R6, -2 * kWordSize), LS);
706 __ b(&init_loop, CC); 708 __ b(&init_loop, CC);
707 __ str(R4, Address(R8, -2 * kWordSize), HI); 709 __ str(R4, Address(R6, -2 * kWordSize), HI);
708 710
709 __ IncrementAllocationStatsWithSize(R3, R8, cid, space); 711 __ IncrementAllocationStatsWithSize(R3, R8, cid, space);
710 __ Ret(); // Returns the newly allocated object in R0. 712 __ Ret(); // Returns the newly allocated object in R0.
711 // Unable to allocate the array using the fast inline code, just call 713 // Unable to allocate the array using the fast inline code, just call
712 // into the runtime. 714 // into the runtime.
713 __ Bind(&slow_case); 715 __ Bind(&slow_case);
714 716
715 // Create a stub frame as we are pushing some objects on the stack before 717 // Create a stub frame as we are pushing some objects on the stack before
716 // calling into the runtime. 718 // calling into the runtime.
717 __ EnterStubFrame(); 719 __ EnterStubFrame();
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after
1987 const Register right = R0; 1989 const Register right = R0;
1988 __ ldr(left, Address(SP, 1 * kWordSize)); 1990 __ ldr(left, Address(SP, 1 * kWordSize));
1989 __ ldr(right, Address(SP, 0 * kWordSize)); 1991 __ ldr(right, Address(SP, 0 * kWordSize));
1990 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); 1992 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
1991 __ Ret(); 1993 __ Ret();
1992 } 1994 }
1993 1995
1994 } // namespace dart 1996 } // namespace dart
1995 1997
1996 #endif // defined TARGET_ARCH_ARM 1998 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/heap_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698