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

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

Issue 10581049: - Implement the filtering store barrier on x64. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/heap.h" 9 #include "vm/heap.h"
10 #include "vm/memory_region.h" 10 #include "vm/memory_region.h"
(...skipping 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after
1377 buffer_.EmitObject(object); 1377 buffer_.EmitObject(object);
1378 } else { 1378 } else {
1379 EmitUint8(0x81); 1379 EmitUint8(0x81);
1380 EmitOperand(7, Operand(reg)); 1380 EmitOperand(7, Operand(reg));
1381 buffer_.EmitObject(object); 1381 buffer_.EmitObject(object);
1382 } 1382 }
1383 } 1383 }
1384 } 1384 }
1385 1385
1386 1386
1387 void Assembler::StoreIntoObjectFilter(Register object,
1388 Register value,
1389 Label* no_update) {
1390 // Check that 'value' is a new object. Store buffer updates are not
1391 // required when storing a smi or an old object.
1392 testl(value, Immediate(kNewObjectAlignmentOffset | kHeapObjectTag));
1393 j(PARITY_ODD, no_update, Assembler::kNearJump);
1394 j(ZERO, no_update, Assembler::kNearJump);
1395 // Check that 'object' is an old object. A store buffer update is
1396 // not required when storing into a new object.
1397 testl(object, Immediate(kNewObjectAlignmentOffset));
1398 j(NOT_ZERO, no_update, Assembler::kNearJump);
1399 }
1400
1401
1387 void Assembler::StoreIntoObject(Register object, 1402 void Assembler::StoreIntoObject(Register object,
1388 const FieldAddress& dest, 1403 const FieldAddress& dest,
1389 Register value) { 1404 Register value) {
1390 movl(dest, value); 1405 movl(dest, value);
1391 Label done; 1406 Label done;
1392 // Check that 'value' is a new object. Store buffer updates are not 1407 StoreIntoObjectFilter(object, value, &done);
1393 // required when storing a smi or an old object.
1394 testl(value, Immediate(kNewObjectAlignmentOffset | kHeapObjectTag));
1395 j(PARITY_ODD, &done, Assembler::kNearJump);
1396 j(ZERO, &done, Assembler::kNearJump);
1397 // Check that 'object' is an old object. A store buffer update is
1398 // not required when storing into a new object.
1399 testl(object, Immediate(kNewObjectAlignmentOffset));
1400 j(NOT_ZERO, &done, Assembler::kNearJump);
1401 // A store buffer update is required. 1408 // A store buffer update is required.
1402 pushl(EAX); // Preserve EAX. 1409 pushl(EAX); // Preserve EAX.
1403 leal(EAX, dest); 1410 leal(EAX, dest);
1404 call(&StubCode::UpdateStoreBufferLabel()); 1411 call(&StubCode::UpdateStoreBufferLabel());
1405 popl(EAX); // Restore EAX. 1412 popl(EAX); // Restore EAX.
1406 Bind(&done); 1413 Bind(&done);
1407 } 1414 }
1408 1415
1409 1416
1410 void Assembler::StoreIntoObjectNoBarrier(Register object, 1417 void Assembler::StoreIntoObjectNoBarrier(Register object,
1411 const FieldAddress& dest, 1418 const FieldAddress& dest,
1412 Register value) { 1419 Register value) {
1413 movl(dest, value); 1420 movl(dest, value);
1414 #if 0 // TODO(cshapiro) Turn this back on after it is fixed defined(DEBUG). 1421 #if defined(DEBUG)
1415 Label done; 1422 Label done;
1416 testl(value, Immediate(kNewObjectAlignmentOffset | kHeapObjectTag)); 1423 StoreIntoObjectFilter(object, value, &done);
1417 j(PARITY_ODD, &done, Assembler::kNearJump);
1418 testl(object, Immediate(kNewObjectAlignmentOffset));
1419 j(NOT_ZERO, &done, Assembler::kNearJump);
1420 Stop("Store buffer update is required"); 1424 Stop("Store buffer update is required");
1421 Bind(&done); 1425 Bind(&done);
1422 #endif 1426 #endif // defined(DEBUG)
1423 // No store buffer update. 1427 // No store buffer update.
1424 } 1428 }
1425 1429
1426 1430
1427 void Assembler::StoreIntoObjectNoBarrier(Register object, 1431 void Assembler::StoreIntoObjectNoBarrier(Register object,
1428 const FieldAddress& dest, 1432 const FieldAddress& dest,
1429 const Object& value) { 1433 const Object& value) {
1430 if (value.IsSmi()) { 1434 if (value.IsSmi()) {
1431 movl(dest, Immediate(reinterpret_cast<int32_t>(value.raw()))); 1435 movl(dest, Immediate(reinterpret_cast<int32_t>(value.raw())));
1432 } else { 1436 } else {
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
1726 comments.SetCommentAt(i, comments_[i]->comment()); 1730 comments.SetCommentAt(i, comments_[i]->comment());
1727 } 1731 }
1728 1732
1729 return comments; 1733 return comments;
1730 } 1734 }
1731 1735
1732 1736
1733 } // namespace dart 1737 } // namespace dart
1734 1738
1735 #endif // defined TARGET_ARCH_IA32 1739 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698