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

Side by Side Diff: src/heap.cc

Issue 3032028: Cache maps for slow case objects. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 4 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
« no previous file with comments | « src/heap.h ('k') | src/objects.h » ('j') | src/objects.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 }; 563 };
564 564
565 565
566 void Heap::ClearJSFunctionResultCaches() { 566 void Heap::ClearJSFunctionResultCaches() {
567 if (Bootstrapper::IsActive()) return; 567 if (Bootstrapper::IsActive()) return;
568 ClearThreadJSFunctionResultCachesVisitor visitor; 568 ClearThreadJSFunctionResultCachesVisitor visitor;
569 ThreadManager::IterateArchivedThreads(&visitor); 569 ThreadManager::IterateArchivedThreads(&visitor);
570 } 570 }
571 571
572 572
573 class ClearThreadNormalizedMapCachesVisitor: public ThreadVisitor {
574 virtual void VisitThread(ThreadLocalTop* top) {
575 Context* context = top->context_;
576 if (context == NULL) return;
577 context->global()->global_context()->normalized_map_cache()->Clear();
578 }
579 };
580
581
582 void Heap::ClearNormalizedMapCaches() {
583 if (Bootstrapper::IsActive()) return;
584 ClearThreadNormalizedMapCachesVisitor visitor;
585 ThreadManager::IterateArchivedThreads(&visitor);
586 }
587
588
573 #ifdef DEBUG 589 #ifdef DEBUG
574 590
575 enum PageWatermarkValidity { 591 enum PageWatermarkValidity {
576 ALL_VALID, 592 ALL_VALID,
577 ALL_INVALID 593 ALL_INVALID
578 }; 594 };
579 595
580 static void VerifyPageWatermarkValidity(PagedSpace* space, 596 static void VerifyPageWatermarkValidity(PagedSpace* space,
581 PageWatermarkValidity validity) { 597 PageWatermarkValidity validity) {
582 PageIterator it(space, PageIterator::PAGES_IN_USE); 598 PageIterator it(space, PageIterator::PAGES_IN_USE);
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 DescriptorLookupCache::Clear(); 769 DescriptorLookupCache::Clear();
754 770
755 CompilationCache::MarkCompactPrologue(); 771 CompilationCache::MarkCompactPrologue();
756 772
757 Top::MarkCompactPrologue(is_compacting); 773 Top::MarkCompactPrologue(is_compacting);
758 ThreadManager::MarkCompactPrologue(is_compacting); 774 ThreadManager::MarkCompactPrologue(is_compacting);
759 775
760 CompletelyClearInstanceofCache(); 776 CompletelyClearInstanceofCache();
761 777
762 if (is_compacting) FlushNumberStringCache(); 778 if (is_compacting) FlushNumberStringCache();
779
780 ClearNormalizedMapCaches();
763 } 781 }
764 782
765 783
766 void Heap::MarkCompactEpilogue(bool is_compacting) { 784 void Heap::MarkCompactEpilogue(bool is_compacting) {
767 Top::MarkCompactEpilogue(is_compacting); 785 Top::MarkCompactEpilogue(is_compacting);
768 ThreadManager::MarkCompactEpilogue(is_compacting); 786 ThreadManager::MarkCompactEpilogue(is_compacting);
769 } 787 }
770 788
771 789
772 Object* Heap::FindCodeObject(Address a) { 790 Object* Heap::FindCodeObject(Address a) {
(...skipping 4212 matching lines...) Expand 10 before | Expand all | Expand 10 after
4985 void ExternalStringTable::TearDown() { 5003 void ExternalStringTable::TearDown() {
4986 new_space_strings_.Free(); 5004 new_space_strings_.Free();
4987 old_space_strings_.Free(); 5005 old_space_strings_.Free();
4988 } 5006 }
4989 5007
4990 5008
4991 List<Object*> ExternalStringTable::new_space_strings_; 5009 List<Object*> ExternalStringTable::new_space_strings_;
4992 List<Object*> ExternalStringTable::old_space_strings_; 5010 List<Object*> ExternalStringTable::old_space_strings_;
4993 5011
4994 } } // namespace v8::internal 5012 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/objects.h » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698