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

Side by Side Diff: runtime/vm/stub_code_mips.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_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 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 __ lw(T1, Address(SP, 0 * kWordSize)); 1091 __ lw(T1, Address(SP, 0 * kWordSize));
1092 __ lw(T2, Address(SP, 1 * kWordSize)); 1092 __ lw(T2, Address(SP, 1 * kWordSize));
1093 __ lw(T3, Address(SP, 2 * kWordSize)); 1093 __ lw(T3, Address(SP, 2 * kWordSize));
1094 __ addiu(SP, SP, Immediate(3 * kWordSize)); 1094 __ addiu(SP, SP, Immediate(3 * kWordSize));
1095 __ Ret(); 1095 __ Ret();
1096 1096
1097 __ Bind(&add_to_buffer); 1097 __ Bind(&add_to_buffer);
1098 __ ori(T2, T2, Immediate(1 << RawObject::kRememberedBit)); 1098 __ ori(T2, T2, Immediate(1 << RawObject::kRememberedBit));
1099 __ sw(T2, FieldAddress(T0, Object::tags_offset())); 1099 __ sw(T2, FieldAddress(T0, Object::tags_offset()));
1100 1100
1101 // Load the isolate. 1101 // Load the StoreBuffer block out of the thread. Then load top_ out of the
1102 // Spilled: T1, T2, T3.
1103 // T0: Address being stored.
1104 __ LoadIsolate(T1);
1105
1106 // Load the StoreBuffer block out of the isolate. Then load top_ out of the
1107 // StoreBufferBlock and add the address to the pointers_. 1102 // StoreBufferBlock and add the address to the pointers_.
1108 // T1: Isolate. 1103 __ lw(T1, Address(THR, Thread::store_buffer_block_offset()));
1109 __ lw(T1, Address(T1, Isolate::store_buffer_offset()));
1110 __ lw(T2, Address(T1, StoreBufferBlock::top_offset())); 1104 __ lw(T2, Address(T1, StoreBufferBlock::top_offset()));
1111 __ sll(T3, T2, 2); 1105 __ sll(T3, T2, 2);
1112 __ addu(T3, T1, T3); 1106 __ addu(T3, T1, T3);
1113 __ sw(T0, Address(T3, StoreBufferBlock::pointers_offset())); 1107 __ sw(T0, Address(T3, StoreBufferBlock::pointers_offset()));
1114 1108
1115 // Increment top_ and check for overflow. 1109 // Increment top_ and check for overflow.
1116 // T2: top_ 1110 // T2: top_
1117 // T1: StoreBufferBlock 1111 // T1: StoreBufferBlock
1118 Label L; 1112 Label L;
1119 __ addiu(T2, T2, Immediate(1)); 1113 __ addiu(T2, T2, Immediate(1));
1120 __ sw(T2, Address(T1, StoreBufferBlock::top_offset())); 1114 __ sw(T2, Address(T1, StoreBufferBlock::top_offset()));
1121 __ addiu(CMPRES1, T2, Immediate(-StoreBufferBlock::kSize)); 1115 __ addiu(CMPRES1, T2, Immediate(-StoreBufferBlock::kSize));
1122 // Restore values. 1116 // Restore values.
1123 __ lw(T1, Address(SP, 0 * kWordSize)); 1117 __ lw(T1, Address(SP, 0 * kWordSize));
1124 __ lw(T2, Address(SP, 1 * kWordSize)); 1118 __ lw(T2, Address(SP, 1 * kWordSize));
1125 __ lw(T3, Address(SP, 2 * kWordSize)); 1119 __ lw(T3, Address(SP, 2 * kWordSize));
1126 __ beq(CMPRES1, ZR, &L); 1120 __ beq(CMPRES1, ZR, &L);
1127 __ delay_slot()->addiu(SP, SP, Immediate(3 * kWordSize)); 1121 __ delay_slot()->addiu(SP, SP, Immediate(3 * kWordSize));
1128 __ Ret(); 1122 __ Ret();
1129 1123
1130 // Handle overflow: Call the runtime leaf function. 1124 // Handle overflow: Call the runtime leaf function.
1131 __ Bind(&L); 1125 __ Bind(&L);
1132 // Setup frame, push callee-saved registers. 1126 // Setup frame, push callee-saved registers.
1133 1127
1134 __ EnterCallRuntimeFrame(1 * kWordSize); 1128 __ EnterCallRuntimeFrame(1 * kWordSize);
1135 __ LoadIsolate(A0); 1129 __ mov(A0, THR);
1136 __ CallRuntime(kStoreBufferBlockProcessRuntimeEntry, 1); 1130 __ CallRuntime(kStoreBufferBlockProcessRuntimeEntry, 1);
1137 __ Comment("UpdateStoreBufferStub return"); 1131 __ Comment("UpdateStoreBufferStub return");
1138 // Restore callee-saved registers, tear down frame. 1132 // Restore callee-saved registers, tear down frame.
1139 __ LeaveCallRuntimeFrame(); 1133 __ LeaveCallRuntimeFrame();
1140 __ Ret(); 1134 __ Ret();
1141 } 1135 }
1142 1136
1143 1137
1144 // Called for inline allocation of objects. 1138 // Called for inline allocation of objects.
1145 // Input parameters: 1139 // Input parameters:
(...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after
2295 // Result: 2289 // Result:
2296 // T1: entry point. 2290 // T1: entry point.
2297 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { 2291 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) {
2298 EmitMegamorphicLookup(assembler, T0, T1, T1); 2292 EmitMegamorphicLookup(assembler, T0, T1, T1);
2299 __ Ret(); 2293 __ Ret();
2300 } 2294 }
2301 2295
2302 } // namespace dart 2296 } // namespace dart
2303 2297
2304 #endif // defined TARGET_ARCH_MIPS 2298 #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