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

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

Issue 1096063002: Fix array allocation overflow check on arm/arm64/mips. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/object_test.cc ('k') | runtime/vm/stub_code_arm64.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 #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 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 634
635 // R8: Allocation size. 635 // R8: Allocation size.
636 636
637 Isolate* isolate = Isolate::Current(); 637 Isolate* isolate = Isolate::Current();
638 Heap* heap = isolate->heap(); 638 Heap* heap = isolate->heap();
639 const intptr_t cid = kArrayCid; 639 const intptr_t cid = kArrayCid;
640 Heap::Space space = heap->SpaceForAllocation(cid); 640 Heap::Space space = heap->SpaceForAllocation(cid);
641 __ LoadImmediate(R6, heap->TopAddress(space)); 641 __ LoadImmediate(R6, heap->TopAddress(space));
642 __ ldr(R0, Address(R6, 0)); // Potential new object start. 642 __ ldr(R0, Address(R6, 0)); // Potential new object start.
643 __ adds(R7, R0, Operand(R8)); // Potential next object start. 643 __ adds(R7, R0, Operand(R8)); // Potential next object start.
644 __ b(&slow_case, VS); 644 __ b(&slow_case, CS); // Branch if unsigned overflow.
645 645
646 // Check if the allocation fits into the remaining space. 646 // Check if the allocation fits into the remaining space.
647 // R0: potential new object start. 647 // R0: potential new object start.
648 // R7: potential next object start. 648 // R7: potential next object start.
649 // R8: allocation size. 649 // R8: allocation size.
650 __ LoadImmediate(R3, heap->EndAddress(space)); 650 __ LoadImmediate(R3, heap->EndAddress(space));
651 __ ldr(R3, Address(R3, 0)); 651 __ ldr(R3, Address(R3, 0));
652 __ cmp(R7, Operand(R3)); 652 __ cmp(R7, Operand(R3));
653 __ b(&slow_case, CS); 653 __ b(&slow_case, CS);
654 654
(...skipping 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after
2055 const Register right = R0; 2055 const Register right = R0;
2056 __ ldr(left, Address(SP, 1 * kWordSize)); 2056 __ ldr(left, Address(SP, 1 * kWordSize));
2057 __ ldr(right, Address(SP, 0 * kWordSize)); 2057 __ ldr(right, Address(SP, 0 * kWordSize));
2058 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); 2058 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
2059 __ Ret(); 2059 __ Ret();
2060 } 2060 }
2061 2061
2062 } // namespace dart 2062 } // namespace dart
2063 2063
2064 #endif // defined TARGET_ARCH_ARM 2064 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/object_test.cc ('k') | runtime/vm/stub_code_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698