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

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

Issue 13638019: Implement write barrier on ARM. (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') | runtime/vm/unit_test.h » ('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_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/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 __ LeaveStubFrame(); 349 __ LeaveStubFrame();
350 __ Ret(); 350 __ Ret();
351 } 351 }
352 352
353 353
354 void StubCode::GenerateAllocateContextStub(Assembler* assembler) { 354 void StubCode::GenerateAllocateContextStub(Assembler* assembler) {
355 __ Unimplemented("AllocateContext stub"); 355 __ Unimplemented("AllocateContext stub");
356 } 356 }
357 357
358 358
359 DECLARE_LEAF_RUNTIME_ENTRY(void, StoreBufferBlockProcess, Isolate* isolate);
360
361 // Helper stub to implement Assembler::StoreIntoObject.
362 // Input parameters:
363 // R0: Address (i.e. object) being stored into.
359 void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) { 364 void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) {
360 __ Unimplemented("UpdateStoreBuffer stub"); 365 // Save values being destroyed.
366 __ PushList((1 << R1) | (1 << R2) | (1 << R3));
367
368 // Load the isolate out of the context.
369 // Spilled: R1, R2, R3.
370 // R0: Address being stored.
371 __ ldr(R1, FieldAddress(CTX, Context::isolate_offset()));
372
373 // Load top_ out of the StoreBufferBlock and add the address to the pointers_.
374 // R1: Isolate.
375 intptr_t store_buffer_offset = Isolate::store_buffer_block_offset();
376 __ LoadFromOffset(kLoadWord, R2, R1,
377 store_buffer_offset + StoreBufferBlock::top_offset());
378 __ add(R3, R1, ShifterOperand(R2, LSL, 2));
379 __ StoreToOffset(kStoreWord, R0, R3,
380 store_buffer_offset + StoreBufferBlock::pointers_offset());
381
382 // Increment top_ and check for overflow.
383 // R2: top_
384 // R1: Isolate
385 Label L;
386 __ add(R2, R2, ShifterOperand(1));
387 __ StoreToOffset(kStoreWord, R2, R1,
388 store_buffer_offset + StoreBufferBlock::top_offset());
389 __ CompareImmediate(R2, StoreBufferBlock::kSize);
390 // Restore values.
391 __ PopList((1 << R1) | (1 << R2) | (1 << R3));
392 __ b(&L, EQ);
393 __ Ret();
394
395 // Handle overflow: Call the runtime leaf function.
396 __ Bind(&L);
397 // Setup frame, push callee-saved registers.
398
399 __ EnterCallRuntimeFrame(0 * kWordSize);
400 __ ldr(R0, FieldAddress(CTX, Context::isolate_offset()));
401 __ CallRuntime(kStoreBufferBlockProcessRuntimeEntry);
402 // Restore callee-saved registers, tear down frame.
403 __ LeaveCallRuntimeFrame();
404 __ Ret();
361 } 405 }
362 406
363 407
364 // Called for inline allocation of objects. 408 // Called for inline allocation of objects.
365 // Input parameters: 409 // Input parameters:
366 // LR : return address. 410 // LR : return address.
367 // SP + 4 : type arguments object (only if class is parameterized). 411 // SP + 4 : type arguments object (only if class is parameterized).
368 // SP + 0 : type arguments of instantiator (only if class is parameterized). 412 // SP + 0 : type arguments of instantiator (only if class is parameterized).
369 void StubCode::GenerateAllocationStubForClass(Assembler* assembler, 413 void StubCode::GenerateAllocationStubForClass(Assembler* assembler,
370 const Class& cls) { 414 const Class& cls) {
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
1039 __ Bind(&reference_compare); 1083 __ Bind(&reference_compare);
1040 __ cmp(left, ShifterOperand(right)); 1084 __ cmp(left, ShifterOperand(right));
1041 __ Bind(&done); 1085 __ Bind(&done);
1042 __ PopList((1 << R0) | (1 << R1) | (1 << R2)); 1086 __ PopList((1 << R0) | (1 << R1) | (1 << R2));
1043 __ Ret(); 1087 __ Ret();
1044 } 1088 }
1045 1089
1046 } // namespace dart 1090 } // namespace dart
1047 1091
1048 #endif // defined TARGET_ARCH_ARM 1092 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/dart_entry_test.cc ('k') | runtime/vm/unit_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698