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

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

Issue 259393002: Enums cleanup. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | runtime/vm/stub_code_x64.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_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
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 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 __ StoreIntoObjectNoBarrier( 755 __ StoreIntoObjectNoBarrier(
756 V0, 756 V0,
757 FieldAddress(V0, Array::length_offset()), 757 FieldAddress(V0, Array::length_offset()),
758 A1); 758 A1);
759 759
760 // Calculate the size tag. 760 // Calculate the size tag.
761 // V0: new object start as a tagged pointer. 761 // V0: new object start as a tagged pointer.
762 // A1: Array length as Smi. 762 // A1: Array length as Smi.
763 // T2: new object end address. 763 // T2: new object end address.
764 // T3: array size. 764 // T3: array size.
765 const intptr_t shift = RawObject::kSizeTagBit - kObjectAlignmentLog2; 765 const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2;
766 // If no size tag overflow, shift T3 left, else set T3 to zero. 766 // If no size tag overflow, shift T3 left, else set T3 to zero.
767 __ LoadImmediate(T4, RawObject::SizeTag::kMaxSizeTag); 767 __ LoadImmediate(T4, RawObject::SizeTag::kMaxSizeTag);
768 __ sltu(CMPRES1, T4, T3); // CMPRES1 = T4 < T3 ? 1 : 0 768 __ sltu(CMPRES1, T4, T3); // CMPRES1 = T4 < T3 ? 1 : 0
769 __ sll(TMP, T3, shift); // TMP = T3 << shift; 769 __ sll(TMP, T3, shift); // TMP = T3 << shift;
770 __ movz(T3, TMP, CMPRES1); // T3 = T4 >= T3 ? 0 : T3 770 __ movz(T3, TMP, CMPRES1); // T3 = T4 >= T3 ? 0 : T3
771 __ movn(T3, ZR, CMPRES1); // T3 = T4 < T3 ? TMP : T3 771 __ movn(T3, ZR, CMPRES1); // T3 = T4 < T3 ? TMP : T3
772 772
773 // Get the class index and insert it into the tags. 773 // Get the class index and insert it into the tags.
774 __ LoadImmediate(TMP, RawObject::ClassIdTag::encode(kArrayCid)); 774 __ LoadImmediate(TMP, RawObject::ClassIdTag::encode(kArrayCid));
775 __ or_(T3, T3, TMP); 775 __ or_(T3, T3, TMP);
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1038 // T2: object size. 1038 // T2: object size.
1039 // T3: next object start. 1039 // T3: next object start.
1040 __ sw(T3, Address(T5, 0)); 1040 __ sw(T3, Address(T5, 0));
1041 __ addiu(V0, V0, Immediate(kHeapObjectTag)); 1041 __ addiu(V0, V0, Immediate(kHeapObjectTag));
1042 __ UpdateAllocationStatsWithSize(context_class.id(), T2, T5); 1042 __ UpdateAllocationStatsWithSize(context_class.id(), T2, T5);
1043 1043
1044 // Calculate the size tag. 1044 // Calculate the size tag.
1045 // V0: new object. 1045 // V0: new object.
1046 // T1: number of context variables. 1046 // T1: number of context variables.
1047 // T2: object size. 1047 // T2: object size.
1048 const intptr_t shift = RawObject::kSizeTagBit - kObjectAlignmentLog2; 1048 const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2;
1049 __ LoadImmediate(TMP, RawObject::SizeTag::kMaxSizeTag); 1049 __ LoadImmediate(TMP, RawObject::SizeTag::kMaxSizeTag);
1050 __ sltu(CMPRES1, TMP, T2); // CMPRES1 = T2 > TMP ? 1 : 0. 1050 __ sltu(CMPRES1, TMP, T2); // CMPRES1 = T2 > TMP ? 1 : 0.
1051 __ movn(T2, ZR, CMPRES1); // T2 = CMPRES1 != 0 ? 0 : T2. 1051 __ movn(T2, ZR, CMPRES1); // T2 = CMPRES1 != 0 ? 0 : T2.
1052 __ sll(TMP, T2, shift); // TMP = T2 << shift. 1052 __ sll(TMP, T2, shift); // TMP = T2 << shift.
1053 __ movz(T2, TMP, CMPRES1); // T2 = CMPRES1 == 0 ? TMP : T2. 1053 __ movz(T2, TMP, CMPRES1); // T2 = CMPRES1 == 0 ? TMP : T2.
1054 1054
1055 // Get the class index and insert it into the tags. 1055 // Get the class index and insert it into the tags.
1056 // T2: size and bit tags. 1056 // T2: size and bit tags.
1057 __ LoadImmediate(TMP, RawObject::ClassIdTag::encode(context_class.id())); 1057 __ LoadImmediate(TMP, RawObject::ClassIdTag::encode(context_class.id()));
1058 __ or_(T2, T2, TMP); 1058 __ or_(T2, T2, TMP);
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after
2101 const Register right = T0; 2101 const Register right = T0;
2102 __ lw(left, Address(SP, 1 * kWordSize)); 2102 __ lw(left, Address(SP, 1 * kWordSize));
2103 __ lw(right, Address(SP, 0 * kWordSize)); 2103 __ lw(right, Address(SP, 0 * kWordSize));
2104 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2); 2104 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2);
2105 __ Ret(); 2105 __ Ret();
2106 } 2106 }
2107 2107
2108 } // namespace dart 2108 } // namespace dart
2109 2109
2110 #endif // defined TARGET_ARCH_MIPS 2110 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698