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

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

Issue 13925024: Implements write barrier on MIPS. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/dart_entry_test.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_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/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 __ LeaveStubFrame(); 371 __ LeaveStubFrame();
372 __ Ret(); 372 __ Ret();
373 } 373 }
374 374
375 375
376 void StubCode::GenerateAllocateContextStub(Assembler* assembler) { 376 void StubCode::GenerateAllocateContextStub(Assembler* assembler) {
377 __ Unimplemented("AllocateContext stub"); 377 __ Unimplemented("AllocateContext stub");
378 } 378 }
379 379
380 380
381 DECLARE_LEAF_RUNTIME_ENTRY(void, StoreBufferBlockProcess, Isolate* isolate);
382
383
384 // Helper stub to implement Assembler::StoreIntoObject.
385 // Input parameters:
386 // T0: Address (i.e. object) being stored into.
381 void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) { 387 void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) {
382 __ Unimplemented("UpdateStoreBuffer stub"); 388 // Save values being destroyed.
389 __ addiu(SP, SP, Immediate(-3 * kWordSize));
390 __ sw(T3, Address(SP, 2 * kWordSize));
391 __ sw(T2, Address(SP, 1 * kWordSize));
392 __ sw(T1, Address(SP, 0 * kWordSize));
393
394 // Load the isolate out of the context.
395 // Spilled: T1, T2, T3.
396 // T0: Address being stored.
397 __ lw(T1, FieldAddress(CTX, Context::isolate_offset()));
398
399 // Load top_ out of the StoreBufferBlock and add the address to the pointers_.
400 // T1: Isolate.
401 intptr_t store_buffer_offset = Isolate::store_buffer_block_offset();
402 __ lw(T2, Address(T1, store_buffer_offset + StoreBufferBlock::top_offset()));
403 __ sll(T3, T2, 1);
404 __ addu(T3, T1, T3);
405 __ sw(T0,
406 Address(T3, store_buffer_offset + StoreBufferBlock::pointers_offset()));
407
408 // Increment top_ and check for overflow.
409 // T2: top_
410 // T1: Isolate
411 Label L;
412 __ AddImmediate(T2, 1);
413 __ sw(T2, Address(T1, store_buffer_offset + StoreBufferBlock::top_offset()));
414 __ addiu(CMPRES, T2, Immediate(-StoreBufferBlock::kSize));
415 // Restore values.
416 __ lw(T1, Address(SP, 0 * kWordSize));
417 __ lw(T2, Address(SP, 1 * kWordSize));
418 __ lw(T3, Address(SP, 2 * kWordSize));
419 __ beq(CMPRES, ZR, &L);
420 __ delay_slot()->addiu(SP, SP, Immediate(3 * kWordSize));
421 __ Ret();
422
423 // Handle overflow: Call the runtime leaf function.
424 __ Bind(&L);
425 // Setup frame, push callee-saved registers.
426
427 __ EnterCallRuntimeFrame(0 * kWordSize);
428 __ lw(T0, FieldAddress(CTX, Context::isolate_offset()));
429 __ CallRuntime(kStoreBufferBlockProcessRuntimeEntry);
430 // Restore callee-saved registers, tear down frame.
431 __ LeaveCallRuntimeFrame();
432 __ Ret();
383 } 433 }
384 434
385 435
386 // Called for inline allocation of objects. 436 // Called for inline allocation of objects.
387 // Input parameters: 437 // Input parameters:
388 // RA : return address. 438 // RA : return address.
389 // SP + 4 : type arguments object (only if class is parameterized). 439 // SP + 4 : type arguments object (only if class is parameterized).
390 // SP + 0 : type arguments of instantiator (only if class is parameterized). 440 // SP + 0 : type arguments of instantiator (only if class is parameterized).
391 void StubCode::GenerateAllocationStubForClass(Assembler* assembler, 441 void StubCode::GenerateAllocationStubForClass(Assembler* assembler,
392 const Class& cls) { 442 const Class& cls) {
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
1101 __ Bind(&done); 1151 __ Bind(&done);
1102 __ lw(T0, Address(SP, 0 * kWordSize)); 1152 __ lw(T0, Address(SP, 0 * kWordSize));
1103 __ lw(T1, Address(SP, 1 * kWordSize)); 1153 __ lw(T1, Address(SP, 1 * kWordSize));
1104 __ Ret(); 1154 __ Ret();
1105 __ delay_slot()->addiu(SP, SP, Immediate(2 * kWordSize)); 1155 __ delay_slot()->addiu(SP, SP, Immediate(2 * kWordSize));
1106 } 1156 }
1107 1157
1108 } // namespace dart 1158 } // namespace dart
1109 1159
1110 #endif // defined TARGET_ARCH_MIPS 1160 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/dart_entry_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698