| OLD | NEW |
| 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 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 // R3: Untagged address of header word (ldrex/strex do not support offsets). | 1002 // R3: Untagged address of header word (ldrex/strex do not support offsets). |
| 1003 Label retry; | 1003 Label retry; |
| 1004 __ Bind(&retry); | 1004 __ Bind(&retry); |
| 1005 __ ldrex(R2, R3); | 1005 __ ldrex(R2, R3); |
| 1006 __ orr(R2, R2, Operand(1 << RawObject::kRememberedBit)); | 1006 __ orr(R2, R2, Operand(1 << RawObject::kRememberedBit)); |
| 1007 __ strex(R1, R2, R3); | 1007 __ strex(R1, R2, R3); |
| 1008 __ cmp(R1, Operand(1)); | 1008 __ cmp(R1, Operand(1)); |
| 1009 __ b(&retry, EQ); | 1009 __ b(&retry, EQ); |
| 1010 } | 1010 } |
| 1011 | 1011 |
| 1012 // Load the isolate. | 1012 // Load the StoreBuffer block out of the thread. Then load top_ out of the |
| 1013 // Spilled: R1, R2, R3. | |
| 1014 // R0: address being stored. | |
| 1015 __ LoadIsolate(R1); | |
| 1016 | |
| 1017 // Load the StoreBuffer block out of the isolate. Then load top_ out of the | |
| 1018 // StoreBufferBlock and add the address to the pointers_. | 1013 // StoreBufferBlock and add the address to the pointers_. |
| 1019 // R1: isolate. | 1014 __ ldr(R1, Address(THR, Thread::store_buffer_block_offset())); |
| 1020 __ ldr(R1, Address(R1, Isolate::store_buffer_offset())); | |
| 1021 __ ldr(R2, Address(R1, StoreBufferBlock::top_offset())); | 1015 __ ldr(R2, Address(R1, StoreBufferBlock::top_offset())); |
| 1022 __ add(R3, R1, Operand(R2, LSL, 2)); | 1016 __ add(R3, R1, Operand(R2, LSL, 2)); |
| 1023 __ str(R0, Address(R3, StoreBufferBlock::pointers_offset())); | 1017 __ str(R0, Address(R3, StoreBufferBlock::pointers_offset())); |
| 1024 | 1018 |
| 1025 // Increment top_ and check for overflow. | 1019 // Increment top_ and check for overflow. |
| 1026 // R2: top_. | 1020 // R2: top_. |
| 1027 // R1: StoreBufferBlock. | 1021 // R1: StoreBufferBlock. |
| 1028 Label L; | 1022 Label L; |
| 1029 __ add(R2, R2, Operand(1)); | 1023 __ add(R2, R2, Operand(1)); |
| 1030 __ str(R2, Address(R1, StoreBufferBlock::top_offset())); | 1024 __ str(R2, Address(R1, StoreBufferBlock::top_offset())); |
| 1031 __ CompareImmediate(R2, StoreBufferBlock::kSize); | 1025 __ CompareImmediate(R2, StoreBufferBlock::kSize); |
| 1032 // Restore values. | 1026 // Restore values. |
| 1033 __ PopList((1 << R1) | (1 << R2) | (1 << R3)); | 1027 __ PopList((1 << R1) | (1 << R2) | (1 << R3)); |
| 1034 __ b(&L, EQ); | 1028 __ b(&L, EQ); |
| 1035 __ Ret(); | 1029 __ Ret(); |
| 1036 | 1030 |
| 1037 // Handle overflow: Call the runtime leaf function. | 1031 // Handle overflow: Call the runtime leaf function. |
| 1038 __ Bind(&L); | 1032 __ Bind(&L); |
| 1039 // Setup frame, push callee-saved registers. | 1033 // Setup frame, push callee-saved registers. |
| 1040 | 1034 |
| 1041 __ EnterCallRuntimeFrame(0 * kWordSize); | 1035 __ EnterCallRuntimeFrame(0 * kWordSize); |
| 1042 __ LoadIsolate(R0); | 1036 __ mov(R0, Operand(THR)); |
| 1043 __ CallRuntime(kStoreBufferBlockProcessRuntimeEntry, 1); | 1037 __ CallRuntime(kStoreBufferBlockProcessRuntimeEntry, 1); |
| 1044 // Restore callee-saved registers, tear down frame. | 1038 // Restore callee-saved registers, tear down frame. |
| 1045 __ LeaveCallRuntimeFrame(); | 1039 __ LeaveCallRuntimeFrame(); |
| 1046 __ Ret(); | 1040 __ Ret(); |
| 1047 } | 1041 } |
| 1048 | 1042 |
| 1049 | 1043 |
| 1050 // Called for inline allocation of objects. | 1044 // Called for inline allocation of objects. |
| 1051 // Input parameters: | 1045 // Input parameters: |
| 1052 // LR : return address. | 1046 // LR : return address. |
| (...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2102 // Result: | 2096 // Result: |
| 2103 // R1: entry point. | 2097 // R1: entry point. |
| 2104 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { | 2098 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
| 2105 EmitMegamorphicLookup(assembler, R0, R1, R1); | 2099 EmitMegamorphicLookup(assembler, R0, R1, R1); |
| 2106 __ Ret(); | 2100 __ Ret(); |
| 2107 } | 2101 } |
| 2108 | 2102 |
| 2109 } // namespace dart | 2103 } // namespace dart |
| 2110 | 2104 |
| 2111 #endif // defined TARGET_ARCH_ARM | 2105 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |