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

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

Issue 636983003: Atomic update of header word on ARM. (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/pages.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 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after
1038 // store buffer if the object is in the store buffer already. 1038 // store buffer if the object is in the store buffer already.
1039 // Spilled: R1, R2, R3 1039 // Spilled: R1, R2, R3
1040 // R0: Address being stored 1040 // R0: Address being stored
1041 __ ldr(R2, FieldAddress(R0, Object::tags_offset())); 1041 __ ldr(R2, FieldAddress(R0, Object::tags_offset()));
1042 __ tst(R2, Operand(1 << RawObject::kRememberedBit)); 1042 __ tst(R2, Operand(1 << RawObject::kRememberedBit));
1043 __ b(&add_to_buffer, EQ); 1043 __ b(&add_to_buffer, EQ);
1044 __ PopList((1 << R1) | (1 << R2) | (1 << R3)); 1044 __ PopList((1 << R1) | (1 << R2) | (1 << R3));
1045 __ Ret(); 1045 __ Ret();
1046 1046
1047 __ Bind(&add_to_buffer); 1047 __ Bind(&add_to_buffer);
1048 __ orr(R2, R2, Operand(1 << RawObject::kRememberedBit)); 1048 // R2: Header word.
1049 __ str(R2, FieldAddress(R0, Object::tags_offset())); 1049 if (TargetCPUFeatures::arm_version() == ARMv5TE) {
1050 // TODO(21263): Implement 'swp' and use it below.
1051 ASSERT(OS::NumberOfAvailableProcessors() <= 1);
1052 __ orr(R2, R2, Operand(1 << RawObject::kRememberedBit));
1053 __ str(R2, FieldAddress(R0, Object::tags_offset()));
1054 } else {
1055 // Atomically set the remembered bit of the object header.
1056 ASSERT(Object::tags_offset() == 0);
1057 __ sub(R3, R0, Operand(kHeapObjectTag));
1058 // R3: Untagged address of header word (ldrex/strex do not support offsets).
1059 Label retry;
1060 __ Bind(&retry);
1061 __ ldrex(R2, R3);
1062 __ orr(R2, R2, Operand(1 << RawObject::kRememberedBit));
1063 __ strex(R1, R2, R3);
1064 __ cmp(R1, Operand(1));
1065 __ b(&retry, EQ);
1066 }
1050 1067
1051 // Load the isolate. 1068 // Load the isolate.
1052 // Spilled: R1, R2, R3. 1069 // Spilled: R1, R2, R3.
1053 // R0: address being stored. 1070 // R0: address being stored.
1054 __ LoadIsolate(R1); 1071 __ LoadIsolate(R1);
1055 1072
1056 // Load the StoreBuffer block out of the isolate. Then load top_ out of the 1073 // Load the StoreBuffer block out of the isolate. Then load top_ out of the
1057 // StoreBufferBlock and add the address to the pointers_. 1074 // StoreBufferBlock and add the address to the pointers_.
1058 // R1: isolate. 1075 // R1: isolate.
1059 __ ldr(R1, Address(R1, Isolate::store_buffer_offset())); 1076 __ ldr(R1, Address(R1, Isolate::store_buffer_offset()));
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after
2035 const Register right = R0; 2052 const Register right = R0;
2036 __ ldr(left, Address(SP, 1 * kWordSize)); 2053 __ ldr(left, Address(SP, 1 * kWordSize));
2037 __ ldr(right, Address(SP, 0 * kWordSize)); 2054 __ ldr(right, Address(SP, 0 * kWordSize));
2038 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); 2055 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
2039 __ Ret(); 2056 __ Ret();
2040 } 2057 }
2041 2058
2042 } // namespace dart 2059 } // namespace dart
2043 2060
2044 #endif // defined TARGET_ARCH_ARM 2061 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/pages.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698