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

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

Issue 1168483003: Thread-local store buffers, v2 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address review comments. Created 5 years, 6 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
« no previous file with comments | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_ia32.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) 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 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after
1028 1028
1029 __ Bind(&add_to_buffer); 1029 __ Bind(&add_to_buffer);
1030 // Save values being destroyed. 1030 // Save values being destroyed.
1031 __ Push(R1); 1031 __ Push(R1);
1032 __ Push(R2); 1032 __ Push(R2);
1033 __ Push(R3); 1033 __ Push(R3);
1034 1034
1035 __ orri(R2, TMP, Immediate(1 << RawObject::kRememberedBit)); 1035 __ orri(R2, TMP, Immediate(1 << RawObject::kRememberedBit));
1036 __ StoreFieldToOffset(R2, R0, Object::tags_offset(), kNoPP); 1036 __ StoreFieldToOffset(R2, R0, Object::tags_offset(), kNoPP);
1037 1037
1038 // Load the isolate. 1038 // Load the StoreBuffer block out of the thread. Then load top_ out of the
1039 // Spilled: R1, R2, R3.
1040 // R0: address being stored.
1041 __ LoadIsolate(R1, kNoPP);
1042
1043 // Load the StoreBuffer block out of the isolate. Then load top_ out of the
1044 // StoreBufferBlock and add the address to the pointers_. 1039 // StoreBufferBlock and add the address to the pointers_.
1045 // R1: isolate. 1040 __ LoadFromOffset(R1, THR, Thread::store_buffer_block_offset(), kNoPP);
1046 __ LoadFromOffset(R1, R1, Isolate::store_buffer_offset(), kNoPP);
1047 __ LoadFromOffset(R2, R1, StoreBufferBlock::top_offset(), 1041 __ LoadFromOffset(R2, R1, StoreBufferBlock::top_offset(),
1048 kNoPP, kUnsignedWord); 1042 kNoPP, kUnsignedWord);
1049 __ add(R3, R1, Operand(R2, LSL, 3)); 1043 __ add(R3, R1, Operand(R2, LSL, 3));
1050 __ StoreToOffset(R0, R3, StoreBufferBlock::pointers_offset(), kNoPP); 1044 __ StoreToOffset(R0, R3, StoreBufferBlock::pointers_offset(), kNoPP);
1051 1045
1052 // Increment top_ and check for overflow. 1046 // Increment top_ and check for overflow.
1053 // R2: top_. 1047 // R2: top_.
1054 // R1: StoreBufferBlock. 1048 // R1: StoreBufferBlock.
1055 Label L; 1049 Label L;
1056 __ add(R2, R2, Operand(1)); 1050 __ add(R2, R2, Operand(1));
1057 __ StoreToOffset(R2, R1, StoreBufferBlock::top_offset(), 1051 __ StoreToOffset(R2, R1, StoreBufferBlock::top_offset(),
1058 kNoPP, kUnsignedWord); 1052 kNoPP, kUnsignedWord);
1059 __ CompareImmediate(R2, StoreBufferBlock::kSize, kNoPP); 1053 __ CompareImmediate(R2, StoreBufferBlock::kSize, kNoPP);
1060 // Restore values. 1054 // Restore values.
1061 __ Pop(R3); 1055 __ Pop(R3);
1062 __ Pop(R2); 1056 __ Pop(R2);
1063 __ Pop(R1); 1057 __ Pop(R1);
1064 __ b(&L, EQ); 1058 __ b(&L, EQ);
1065 __ ret(); 1059 __ ret();
1066 1060
1067 // Handle overflow: Call the runtime leaf function. 1061 // Handle overflow: Call the runtime leaf function.
1068 __ Bind(&L); 1062 __ Bind(&L);
1069 // Setup frame, push callee-saved registers. 1063 // Setup frame, push callee-saved registers.
1070 1064
1071 __ EnterCallRuntimeFrame(0 * kWordSize); 1065 __ EnterCallRuntimeFrame(0 * kWordSize);
1072 __ LoadIsolate(R0, kNoPP); 1066 __ mov(R0, THR);
1073 __ CallRuntime(kStoreBufferBlockProcessRuntimeEntry, 1); 1067 __ CallRuntime(kStoreBufferBlockProcessRuntimeEntry, 1);
1074 // Restore callee-saved registers, tear down frame. 1068 // Restore callee-saved registers, tear down frame.
1075 __ LeaveCallRuntimeFrame(); 1069 __ LeaveCallRuntimeFrame();
1076 __ ret(); 1070 __ ret();
1077 } 1071 }
1078 1072
1079 1073
1080 // Called for inline allocation of objects. 1074 // Called for inline allocation of objects.
1081 // Input parameters: 1075 // Input parameters:
1082 // LR : return address. 1076 // LR : return address.
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
2153 // Result: 2147 // Result:
2154 // R1: entry point. 2148 // R1: entry point.
2155 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { 2149 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) {
2156 EmitMegamorphicLookup(assembler, R0, R1, R1); 2150 EmitMegamorphicLookup(assembler, R0, R1, R1);
2157 __ ret(); 2151 __ ret();
2158 } 2152 }
2159 2153
2160 } // namespace dart 2154 } // namespace dart
2161 2155
2162 #endif // defined TARGET_ARCH_ARM64 2156 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698