| OLD | NEW |
| 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 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1033 __ tsti(TMP, Immediate(1 << RawObject::kRememberedBit)); | 1033 __ tsti(TMP, Immediate(1 << RawObject::kRememberedBit)); |
| 1034 __ b(&add_to_buffer, EQ); | 1034 __ b(&add_to_buffer, EQ); |
| 1035 __ ret(); | 1035 __ ret(); |
| 1036 | 1036 |
| 1037 __ Bind(&add_to_buffer); | 1037 __ Bind(&add_to_buffer); |
| 1038 // Save values being destroyed. | 1038 // Save values being destroyed. |
| 1039 __ Push(R1); | 1039 __ Push(R1); |
| 1040 __ Push(R2); | 1040 __ Push(R2); |
| 1041 __ Push(R3); | 1041 __ Push(R3); |
| 1042 | 1042 |
| 1043 __ orri(R2, TMP, Immediate(1 << RawObject::kRememberedBit)); | 1043 // Atomically set the remembered bit of the object header. |
| 1044 __ StoreFieldToOffset(R2, R0, Object::tags_offset()); | 1044 ASSERT(Object::tags_offset() == 0); |
| 1045 __ sub(R3, R0, Operand(kHeapObjectTag)); |
| 1046 // R3: Untagged address of header word (ldxr/stxr do not support offsets). |
| 1047 Label retry; |
| 1048 __ Bind(&retry); |
| 1049 __ ldxr(R2, R3); |
| 1050 __ orri(R2, R2, Immediate(1 << RawObject::kRememberedBit)); |
| 1051 __ stxr(R1, R2, R3); |
| 1052 __ cmp(R1, Operand(1)); |
| 1053 __ b(&retry, EQ); |
| 1045 | 1054 |
| 1046 // Load the StoreBuffer block out of the thread. Then load top_ out of the | 1055 // Load the StoreBuffer block out of the thread. Then load top_ out of the |
| 1047 // StoreBufferBlock and add the address to the pointers_. | 1056 // StoreBufferBlock and add the address to the pointers_. |
| 1048 __ LoadFromOffset(R1, THR, Thread::store_buffer_block_offset()); | 1057 __ LoadFromOffset(R1, THR, Thread::store_buffer_block_offset()); |
| 1049 __ LoadFromOffset(R2, R1, StoreBufferBlock::top_offset(), kUnsignedWord); | 1058 __ LoadFromOffset(R2, R1, StoreBufferBlock::top_offset(), kUnsignedWord); |
| 1050 __ add(R3, R1, Operand(R2, LSL, 3)); | 1059 __ add(R3, R1, Operand(R2, LSL, 3)); |
| 1051 __ StoreToOffset(R0, R3, StoreBufferBlock::pointers_offset()); | 1060 __ StoreToOffset(R0, R3, StoreBufferBlock::pointers_offset()); |
| 1052 | 1061 |
| 1053 // Increment top_ and check for overflow. | 1062 // Increment top_ and check for overflow. |
| 1054 // R2: top_. | 1063 // R2: top_. |
| (...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2185 __ Bind(&miss); | 2194 __ Bind(&miss); |
| 2186 __ LoadIsolate(R2); | 2195 __ LoadIsolate(R2); |
| 2187 __ ldr(CODE_REG, Address(R2, Isolate::ic_miss_code_offset())); | 2196 __ ldr(CODE_REG, Address(R2, Isolate::ic_miss_code_offset())); |
| 2188 __ ldr(R1, FieldAddress(CODE_REG, Code::entry_point_offset())); | 2197 __ ldr(R1, FieldAddress(CODE_REG, Code::entry_point_offset())); |
| 2189 __ ret(); | 2198 __ ret(); |
| 2190 } | 2199 } |
| 2191 | 2200 |
| 2192 } // namespace dart | 2201 } // namespace dart |
| 2193 | 2202 |
| 2194 #endif // defined TARGET_ARCH_ARM64 | 2203 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |