OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 | 582 |
583 ASSERT(!object.is(value)); | 583 ASSERT(!object.is(value)); |
584 ASSERT(!object.is(address)); | 584 ASSERT(!object.is(address)); |
585 ASSERT(!value.is(address)); | 585 ASSERT(!value.is(address)); |
586 AssertNotSmi(object); | 586 AssertNotSmi(object); |
587 | 587 |
588 if (!FLAG_incremental_marking) { | 588 if (!FLAG_incremental_marking) { |
589 return; | 589 return; |
590 } | 590 } |
591 | 591 |
| 592 // Count number of write barriers in generated code. |
| 593 isolate()->counters()->write_barriers_static()->Increment(); |
| 594 IncrementCounter(isolate()->counters()->write_barriers_dynamic(), 1); |
| 595 |
592 // A single check of the map's pages interesting flag suffices, since it is | 596 // A single check of the map's pages interesting flag suffices, since it is |
593 // only set during incremental collection, and then it's also guaranteed that | 597 // only set during incremental collection, and then it's also guaranteed that |
594 // the from object's page's interesting flag is also set. This optimization | 598 // the from object's page's interesting flag is also set. This optimization |
595 // relies on the fact that maps can never be in new space. | 599 // relies on the fact that maps can never be in new space. |
596 ASSERT(!isolate()->heap()->InNewSpace(*map)); | 600 ASSERT(!isolate()->heap()->InNewSpace(*map)); |
597 CheckPageFlagForMap(map, | 601 CheckPageFlagForMap(map, |
598 MemoryChunk::kPointersToHereAreInterestingMask, | 602 MemoryChunk::kPointersToHereAreInterestingMask, |
599 zero, | 603 zero, |
600 &done, | 604 &done, |
601 Label::kNear); | 605 Label::kNear); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 } | 642 } |
639 | 643 |
640 if (emit_debug_code()) { | 644 if (emit_debug_code()) { |
641 Label ok; | 645 Label ok; |
642 cmp(value, Operand(address, 0)); | 646 cmp(value, Operand(address, 0)); |
643 j(equal, &ok, Label::kNear); | 647 j(equal, &ok, Label::kNear); |
644 int3(); | 648 int3(); |
645 bind(&ok); | 649 bind(&ok); |
646 } | 650 } |
647 | 651 |
| 652 // Count number of write barriers in generated code. |
| 653 isolate()->counters()->write_barriers_static()->Increment(); |
| 654 IncrementCounter(isolate()->counters()->write_barriers_dynamic(), 1); |
| 655 |
648 // First, check if a write barrier is even needed. The tests below | 656 // First, check if a write barrier is even needed. The tests below |
649 // catch stores of Smis and stores into young gen. | 657 // catch stores of Smis and stores into young gen. |
650 Label done; | 658 Label done; |
651 | 659 |
652 if (smi_check == INLINE_SMI_CHECK) { | 660 if (smi_check == INLINE_SMI_CHECK) { |
653 // Skip barrier if writing a smi. | 661 // Skip barrier if writing a smi. |
654 JumpIfSmi(value, &done, Label::kNear); | 662 JumpIfSmi(value, &done, Label::kNear); |
655 } | 663 } |
656 | 664 |
657 CheckPageFlag(value, | 665 CheckPageFlag(value, |
(...skipping 2870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3528 j(greater, &no_memento_available); | 3536 j(greater, &no_memento_available); |
3529 cmp(MemOperand(scratch_reg, -AllocationMemento::kSize), | 3537 cmp(MemOperand(scratch_reg, -AllocationMemento::kSize), |
3530 Immediate(isolate()->factory()->allocation_memento_map())); | 3538 Immediate(isolate()->factory()->allocation_memento_map())); |
3531 bind(&no_memento_available); | 3539 bind(&no_memento_available); |
3532 } | 3540 } |
3533 | 3541 |
3534 | 3542 |
3535 } } // namespace v8::internal | 3543 } } // namespace v8::internal |
3536 | 3544 |
3537 #endif // V8_TARGET_ARCH_IA32 | 3545 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |