| 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 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 | 607 |
| 608 ASSERT(!object.is(value)); | 608 ASSERT(!object.is(value)); |
| 609 ASSERT(!object.is(address)); | 609 ASSERT(!object.is(address)); |
| 610 ASSERT(!value.is(address)); | 610 ASSERT(!value.is(address)); |
| 611 AssertNotSmi(object); | 611 AssertNotSmi(object); |
| 612 | 612 |
| 613 if (!FLAG_incremental_marking) { | 613 if (!FLAG_incremental_marking) { |
| 614 return; | 614 return; |
| 615 } | 615 } |
| 616 | 616 |
| 617 // Count number of write barriers in generated code. |
| 618 isolate()->counters()->write_barriers_static()->Increment(); |
| 619 IncrementCounter(isolate()->counters()->write_barriers_dynamic(), 1); |
| 620 |
| 617 // A single check of the map's pages interesting flag suffices, since it is | 621 // A single check of the map's pages interesting flag suffices, since it is |
| 618 // only set during incremental collection, and then it's also guaranteed that | 622 // only set during incremental collection, and then it's also guaranteed that |
| 619 // the from object's page's interesting flag is also set. This optimization | 623 // the from object's page's interesting flag is also set. This optimization |
| 620 // relies on the fact that maps can never be in new space. | 624 // relies on the fact that maps can never be in new space. |
| 621 ASSERT(!isolate()->heap()->InNewSpace(*map)); | 625 ASSERT(!isolate()->heap()->InNewSpace(*map)); |
| 622 CheckPageFlagForMap(map, | 626 CheckPageFlagForMap(map, |
| 623 MemoryChunk::kPointersToHereAreInterestingMask, | 627 MemoryChunk::kPointersToHereAreInterestingMask, |
| 624 zero, | 628 zero, |
| 625 &done, | 629 &done, |
| 626 Label::kNear); | 630 Label::kNear); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 } | 667 } |
| 664 | 668 |
| 665 if (emit_debug_code()) { | 669 if (emit_debug_code()) { |
| 666 Label ok; | 670 Label ok; |
| 667 cmp(value, Operand(address, 0)); | 671 cmp(value, Operand(address, 0)); |
| 668 j(equal, &ok, Label::kNear); | 672 j(equal, &ok, Label::kNear); |
| 669 int3(); | 673 int3(); |
| 670 bind(&ok); | 674 bind(&ok); |
| 671 } | 675 } |
| 672 | 676 |
| 677 // Count number of write barriers in generated code. |
| 678 isolate()->counters()->write_barriers_static()->Increment(); |
| 679 IncrementCounter(isolate()->counters()->write_barriers_dynamic(), 1); |
| 680 |
| 673 // First, check if a write barrier is even needed. The tests below | 681 // First, check if a write barrier is even needed. The tests below |
| 674 // catch stores of Smis and stores into young gen. | 682 // catch stores of Smis and stores into young gen. |
| 675 Label done; | 683 Label done; |
| 676 | 684 |
| 677 if (smi_check == INLINE_SMI_CHECK) { | 685 if (smi_check == INLINE_SMI_CHECK) { |
| 678 // Skip barrier if writing a smi. | 686 // Skip barrier if writing a smi. |
| 679 JumpIfSmi(value, &done, Label::kNear); | 687 JumpIfSmi(value, &done, Label::kNear); |
| 680 } | 688 } |
| 681 | 689 |
| 682 CheckPageFlag(value, | 690 CheckPageFlag(value, |
| (...skipping 3002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3685 cmp(scratch1, Immediate(DICTIONARY_ELEMENTS)); | 3693 cmp(scratch1, Immediate(DICTIONARY_ELEMENTS)); |
| 3686 j(equal, found); | 3694 j(equal, found); |
| 3687 mov(current, FieldOperand(current, Map::kPrototypeOffset)); | 3695 mov(current, FieldOperand(current, Map::kPrototypeOffset)); |
| 3688 cmp(current, Immediate(factory->null_value())); | 3696 cmp(current, Immediate(factory->null_value())); |
| 3689 j(not_equal, &loop_again); | 3697 j(not_equal, &loop_again); |
| 3690 } | 3698 } |
| 3691 | 3699 |
| 3692 } } // namespace v8::internal | 3700 } } // namespace v8::internal |
| 3693 | 3701 |
| 3694 #endif // V8_TARGET_ARCH_IA32 | 3702 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |