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

Side by Side Diff: src/mark-compact.h

Issue 7983045: Notify collector about lazily deoptimized code objects. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: clear lo from rescan flag, avoid ShouldSweepLazily predicate in preparation Created 9 years, 3 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 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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 RELOCATED_CODE_OBJECT, 317 RELOCATED_CODE_OBJECT,
318 CODE_TARGET_SLOT, 318 CODE_TARGET_SLOT,
319 CODE_ENTRY_SLOT, 319 CODE_ENTRY_SLOT,
320 DEBUG_TARGET_SLOT, 320 DEBUG_TARGET_SLOT,
321 JS_RETURN_SLOT, 321 JS_RETURN_SLOT,
322 NUMBER_OF_SLOT_TYPES 322 NUMBER_OF_SLOT_TYPES
323 }; 323 };
324 324
325 void UpdateSlots(Heap* heap); 325 void UpdateSlots(Heap* heap);
326 326
327 void UpdateSlotsWithFilter(Heap* heap);
328
327 SlotsBuffer* next() { return next_; } 329 SlotsBuffer* next() { return next_; }
328 330
329 static int SizeOfChain(SlotsBuffer* buffer) { 331 static int SizeOfChain(SlotsBuffer* buffer) {
330 if (buffer == NULL) return 0; 332 if (buffer == NULL) return 0;
331 return static_cast<int>(buffer->idx_ + 333 return static_cast<int>(buffer->idx_ +
332 (buffer->chain_length_ - 1) * kNumberOfElements); 334 (buffer->chain_length_ - 1) * kNumberOfElements);
333 } 335 }
334 336
335 inline bool IsFull() { 337 inline bool IsFull() {
336 return idx_ == kNumberOfElements; 338 return idx_ == kNumberOfElements;
337 } 339 }
338 340
339 inline bool HasSpaceForTypedSlot() { 341 inline bool HasSpaceForTypedSlot() {
340 return idx_ < kNumberOfElements - 1; 342 return idx_ < kNumberOfElements - 1;
341 } 343 }
342 344
343 static void UpdateSlotsRecordedIn(Heap* heap, SlotsBuffer* buffer) { 345 static void UpdateSlotsRecordedIn(Heap* heap,
346 SlotsBuffer* buffer,
347 bool code_slots_filtering_required) {
344 while (buffer != NULL) { 348 while (buffer != NULL) {
345 buffer->UpdateSlots(heap); 349 if (code_slots_filtering_required) {
350 buffer->UpdateSlotsWithFilter(heap);
351 } else {
352 buffer->UpdateSlots(heap);
353 }
346 buffer = buffer->next(); 354 buffer = buffer->next();
347 } 355 }
348 } 356 }
349 357
350 enum AdditionMode { 358 enum AdditionMode {
351 FAIL_ON_OVERFLOW, 359 FAIL_ON_OVERFLOW,
352 IGNORE_OVERFLOW 360 IGNORE_OVERFLOW
353 }; 361 };
354 362
355 static bool ChainLengthThresholdReached(SlotsBuffer* buffer) { 363 static bool ChainLengthThresholdReached(SlotsBuffer* buffer) {
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 int size, 547 int size,
540 AllocationSpace to_old_space); 548 AllocationSpace to_old_space);
541 549
542 bool TryPromoteObject(HeapObject* object, int object_size); 550 bool TryPromoteObject(HeapObject* object, int object_size);
543 551
544 inline Object* encountered_weak_maps() { return encountered_weak_maps_; } 552 inline Object* encountered_weak_maps() { return encountered_weak_maps_; }
545 inline void set_encountered_weak_maps(Object* weak_map) { 553 inline void set_encountered_weak_maps(Object* weak_map) {
546 encountered_weak_maps_ = weak_map; 554 encountered_weak_maps_ = weak_map;
547 } 555 }
548 556
557 void InvalidateCode(Code* code);
558
549 private: 559 private:
550 MarkCompactCollector(); 560 MarkCompactCollector();
551 ~MarkCompactCollector(); 561 ~MarkCompactCollector();
552 562
563 bool MarkInvalidatedCode();
564 void RemoveDeadInvalidatedCode();
565 void ProcessInvalidatedCode(ObjectVisitor* visitor);
566
567
553 #ifdef DEBUG 568 #ifdef DEBUG
554 enum CollectorState { 569 enum CollectorState {
555 IDLE, 570 IDLE,
556 PREPARE_GC, 571 PREPARE_GC,
557 MARK_LIVE_OBJECTS, 572 MARK_LIVE_OBJECTS,
558 SWEEP_SPACES, 573 SWEEP_SPACES,
559 ENCODE_FORWARDING_ADDRESSES, 574 ENCODE_FORWARDING_ADDRESSES,
560 UPDATE_POINTERS, 575 UPDATE_POINTERS,
561 RELOCATE_OBJECTS 576 RELOCATE_OBJECTS
562 }; 577 };
563 578
564 // The current stage of the collector. 579 // The current stage of the collector.
565 CollectorState state_; 580 CollectorState state_;
566 #endif 581 #endif
567 582
568 // Global flag that forces sweeping to be precise, so we can traverse the 583 // Global flag that forces sweeping to be precise, so we can traverse the
569 // heap. 584 // heap.
570 bool sweep_precisely_; 585 bool sweep_precisely_;
571 586
572 // True if we are collecting slots to perform evacuation from evacuation 587 // True if we are collecting slots to perform evacuation from evacuation
573 // candidates. 588 // candidates.
574 bool compacting_; 589 bool compacting_;
575 590
591 bool was_marked_incrementally_;
592
576 bool collect_maps_; 593 bool collect_maps_;
577 594
578 // A pointer to the current stack-allocated GC tracer object during a full 595 // A pointer to the current stack-allocated GC tracer object during a full
579 // collection (NULL before and after). 596 // collection (NULL before and after).
580 GCTracer* tracer_; 597 GCTracer* tracer_;
581 598
582 SlotsBufferAllocator slots_buffer_allocator_; 599 SlotsBufferAllocator slots_buffer_allocator_;
583 600
584 SlotsBuffer* migration_slots_buffer_; 601 SlotsBuffer* migration_slots_buffer_;
585 602
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 friend class UnmarkObjectVisitor; 772 friend class UnmarkObjectVisitor;
756 static void UnmarkObject(HeapObject* obj); 773 static void UnmarkObject(HeapObject* obj);
757 #endif 774 #endif
758 775
759 Heap* heap_; 776 Heap* heap_;
760 MarkingDeque marking_deque_; 777 MarkingDeque marking_deque_;
761 CodeFlusher* code_flusher_; 778 CodeFlusher* code_flusher_;
762 Object* encountered_weak_maps_; 779 Object* encountered_weak_maps_;
763 780
764 List<Page*> evacuation_candidates_; 781 List<Page*> evacuation_candidates_;
782 List<Code*> invalidated_code_;
765 783
766 friend class Heap; 784 friend class Heap;
767 }; 785 };
768 786
769 787
770 const char* AllocationSpaceName(AllocationSpace space); 788 const char* AllocationSpaceName(AllocationSpace space);
771 789
772 } } // namespace v8::internal 790 } } // namespace v8::internal
773 791
774 #endif // V8_MARK_COMPACT_H_ 792 #endif // V8_MARK_COMPACT_H_
OLDNEW
« no previous file with comments | « src/incremental-marking.cc ('k') | src/mark-compact.cc » ('j') | src/spaces.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698