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

Side by Side Diff: src/heap-inl.h

Issue 143153008: The allocation sites scratchpad becomes a heap data structure. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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
« src/heap.cc ('K') | « src/heap.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 last_memento_word_address)) { 510 last_memento_word_address)) {
511 return; 511 return;
512 } 512 }
513 513
514 HeapObject* candidate = HeapObject::FromAddress(memento_address); 514 HeapObject* candidate = HeapObject::FromAddress(memento_address);
515 if (candidate->map() != heap->allocation_memento_map()) return; 515 if (candidate->map() != heap->allocation_memento_map()) return;
516 516
517 AllocationMemento* memento = AllocationMemento::cast(candidate); 517 AllocationMemento* memento = AllocationMemento::cast(candidate);
518 if (!memento->IsValid()) return; 518 if (!memento->IsValid()) return;
519 519
520 if (memento->GetAllocationSite()->IncrementMementoFoundCount() && 520 if (memento->GetAllocationSite()->IncrementMementoFoundCount()) {
521 heap->allocation_sites_scratchpad_length < 521 heap->AddAllocationSiteToScratchpad(memento->GetAllocationSite());
522 kAllocationSiteScratchpadSize) {
523 heap->allocation_sites_scratchpad[
524 heap->allocation_sites_scratchpad_length++] =
525 memento->GetAllocationSite();
526 } 522 }
527 } 523 }
528 524
529 525
530 void Heap::ScavengeObject(HeapObject** p, HeapObject* object) { 526 void Heap::ScavengeObject(HeapObject** p, HeapObject* object) {
531 ASSERT(object->GetIsolate()->heap()->InFromSpace(object)); 527 ASSERT(object->GetIsolate()->heap()->InFromSpace(object));
532 528
533 // We use the first word (where the map pointer usually is) of a heap 529 // We use the first word (where the map pointer usually is) of a heap
534 // object to record the forwarding pointer. A forwarding pointer can 530 // object to record the forwarding pointer. A forwarding pointer can
535 // point to an old space, the code space, or the to space of the new 531 // point to an old space, the code space, or the to space of the new
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 #ifdef DEBUG 838 #ifdef DEBUG
843 Isolate* isolate = Isolate::Current(); 839 Isolate* isolate = Isolate::Current();
844 isolate->heap()->disallow_allocation_failure_ = old_state_; 840 isolate->heap()->disallow_allocation_failure_ = old_state_;
845 #endif 841 #endif
846 } 842 }
847 843
848 844
849 } } // namespace v8::internal 845 } } // namespace v8::internal
850 846
851 #endif // V8_HEAP_INL_H_ 847 #endif // V8_HEAP_INL_H_
OLDNEW
« src/heap.cc ('K') | « src/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698