OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 // TODO(gc) switch to static visitor instead of normal visitor. | 823 // TODO(gc) switch to static visitor instead of normal visitor. |
824 if (map == global_context_map) { | 824 if (map == global_context_map) { |
825 // Global contexts have weak fields. | 825 // Global contexts have weak fields. |
826 Context* ctx = Context::cast(obj); | 826 Context* ctx = Context::cast(obj); |
827 | 827 |
828 // We will mark cache black with a separate pass | 828 // We will mark cache black with a separate pass |
829 // when we finish marking. | 829 // when we finish marking. |
830 MarkObjectGreyDoNotEnqueue(ctx->normalized_map_cache()); | 830 MarkObjectGreyDoNotEnqueue(ctx->normalized_map_cache()); |
831 | 831 |
832 VisitGlobalContext(ctx, &marking_visitor); | 832 VisitGlobalContext(ctx, &marking_visitor); |
| 833 } else if (map->instance_type() == JS_FUNCTION_TYPE) { |
| 834 marking_visitor.VisitPointers( |
| 835 HeapObject::RawField(obj, JSFunction::kPropertiesOffset), |
| 836 HeapObject::RawField(obj, JSFunction::kCodeEntryOffset)); |
| 837 |
| 838 marking_visitor.VisitCodeEntry( |
| 839 obj->address() + JSFunction::kCodeEntryOffset); |
| 840 |
| 841 marking_visitor.VisitPointers( |
| 842 HeapObject::RawField(obj, |
| 843 JSFunction::kCodeEntryOffset + kPointerSize), |
| 844 HeapObject::RawField(obj, |
| 845 JSFunction::kNonWeakFieldsEndOffset)); |
833 } else { | 846 } else { |
834 obj->IterateBody(map->instance_type(), size, &marking_visitor); | 847 obj->IterateBody(map->instance_type(), size, &marking_visitor); |
835 } | 848 } |
836 | 849 |
837 MarkBit obj_mark_bit = Marking::MarkBitFrom(obj); | 850 MarkBit obj_mark_bit = Marking::MarkBitFrom(obj); |
838 SLOW_ASSERT(Marking::IsGrey(obj_mark_bit) || | 851 SLOW_ASSERT(Marking::IsGrey(obj_mark_bit) || |
839 (obj->IsFiller() && Marking::IsWhite(obj_mark_bit))); | 852 (obj->IsFiller() && Marking::IsWhite(obj_mark_bit))); |
840 Marking::MarkBlack(obj_mark_bit); | 853 Marking::MarkBlack(obj_mark_bit); |
841 MemoryChunk::IncrementLiveBytesFromGC(obj->address(), size); | 854 MemoryChunk::IncrementLiveBytesFromGC(obj->address(), size); |
842 } | 855 } |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 allocation_marking_factor_ = kInitialAllocationMarkingFactor; | 948 allocation_marking_factor_ = kInitialAllocationMarkingFactor; |
936 bytes_scanned_ = 0; | 949 bytes_scanned_ = 0; |
937 } | 950 } |
938 | 951 |
939 | 952 |
940 int64_t IncrementalMarking::SpaceLeftInOldSpace() { | 953 int64_t IncrementalMarking::SpaceLeftInOldSpace() { |
941 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSize(); | 954 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSize(); |
942 } | 955 } |
943 | 956 |
944 } } // namespace v8::internal | 957 } } // namespace v8::internal |
OLD | NEW |