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

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

Issue 579243003: Fixes a bug in CheckClassInstr on arm64. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 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/intrinsifier_arm64.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
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/compiler.h" 10 #include "vm/compiler.h"
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 __ StoreIntoObjectOffsetNoBarrier(R0, Array::length_offset(), R2, PP); 710 __ StoreIntoObjectOffsetNoBarrier(R0, Array::length_offset(), R2, PP);
711 711
712 // Calculate the size tag. 712 // Calculate the size tag.
713 // R0: new object start as a tagged pointer. 713 // R0: new object start as a tagged pointer.
714 // R2: array length as Smi. 714 // R2: array length as Smi.
715 // R3: array size. 715 // R3: array size.
716 // R7: new object end address. 716 // R7: new object end address.
717 const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2; 717 const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2;
718 __ CompareImmediate(R3, RawObject::SizeTag::kMaxSizeTag, kNoPP); 718 __ CompareImmediate(R3, RawObject::SizeTag::kMaxSizeTag, kNoPP);
719 // If no size tag overflow, shift R1 left, else set R1 to zero. 719 // If no size tag overflow, shift R1 left, else set R1 to zero.
720 __ Lsl(TMP, R3, shift); 720 __ LslImmediate(TMP, R3, shift);
721 __ csel(R1, TMP, R1, LS); 721 __ csel(R1, TMP, R1, LS);
722 __ csel(R1, ZR, R1, HI); 722 __ csel(R1, ZR, R1, HI);
723 723
724 // Get the class index and insert it into the tags. 724 // Get the class index and insert it into the tags.
725 __ LoadImmediate(TMP, RawObject::ClassIdTag::encode(kArrayCid), kNoPP); 725 __ LoadImmediate(TMP, RawObject::ClassIdTag::encode(kArrayCid), kNoPP);
726 __ orr(R1, R1, Operand(TMP)); 726 __ orr(R1, R1, Operand(TMP));
727 __ StoreFieldToOffset(R1, R0, Array::tags_offset(), kNoPP); 727 __ StoreFieldToOffset(R1, R0, Array::tags_offset(), kNoPP);
728 728
729 // Initialize all array elements to raw_null. 729 // Initialize all array elements to raw_null.
730 // R0: new object start as a tagged pointer. 730 // R0: new object start as a tagged pointer.
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
991 __ add(R0, R0, Operand(kHeapObjectTag)); 991 __ add(R0, R0, Operand(kHeapObjectTag));
992 __ UpdateAllocationStatsWithSize(context_class.id(), R2, kNoPP); 992 __ UpdateAllocationStatsWithSize(context_class.id(), R2, kNoPP);
993 993
994 // Calculate the size tag. 994 // Calculate the size tag.
995 // R0: new object. 995 // R0: new object.
996 // R1: number of context variables. 996 // R1: number of context variables.
997 // R2: object size. 997 // R2: object size.
998 const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2; 998 const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2;
999 __ CompareImmediate(R2, RawObject::SizeTag::kMaxSizeTag, kNoPP); 999 __ CompareImmediate(R2, RawObject::SizeTag::kMaxSizeTag, kNoPP);
1000 // If no size tag overflow, shift R2 left, else set R2 to zero. 1000 // If no size tag overflow, shift R2 left, else set R2 to zero.
1001 __ Lsl(TMP, R2, shift); 1001 __ LslImmediate(TMP, R2, shift);
1002 __ csel(R2, TMP, R2, LS); 1002 __ csel(R2, TMP, R2, LS);
1003 __ csel(R2, ZR, R2, HI); 1003 __ csel(R2, ZR, R2, HI);
1004 1004
1005 // Get the class index and insert it into the tags. 1005 // Get the class index and insert it into the tags.
1006 // R2: size and bit tags. 1006 // R2: size and bit tags.
1007 __ LoadImmediate( 1007 __ LoadImmediate(
1008 TMP, RawObject::ClassIdTag::encode(context_class.id()), kNoPP); 1008 TMP, RawObject::ClassIdTag::encode(context_class.id()), kNoPP);
1009 __ orr(R2, R2, Operand(TMP)); 1009 __ orr(R2, R2, Operand(TMP));
1010 __ StoreFieldToOffset(R2, R0, Context::tags_offset(), kNoPP); 1010 __ StoreFieldToOffset(R2, R0, Context::tags_offset(), kNoPP);
1011 1011
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after
2081 const Register right = R0; 2081 const Register right = R0;
2082 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP); 2082 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP);
2083 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP); 2083 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP);
2084 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); 2084 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
2085 __ ret(); 2085 __ ret();
2086 } 2086 }
2087 2087
2088 } // namespace dart 2088 } // namespace dart
2089 2089
2090 #endif // defined TARGET_ARCH_ARM64 2090 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_arm64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698