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

Side by Side Diff: src/heap.cc

Issue 1765012: Add a single-element global positive and negative cache to... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 7 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/ia32/codegen-ia32.cc » ('j') | no next file with comments »
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 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 // maps. 644 // maps.
645 KeyedLookupCache::Clear(); 645 KeyedLookupCache::Clear();
646 ContextSlotCache::Clear(); 646 ContextSlotCache::Clear();
647 DescriptorLookupCache::Clear(); 647 DescriptorLookupCache::Clear();
648 648
649 CompilationCache::MarkCompactPrologue(); 649 CompilationCache::MarkCompactPrologue();
650 650
651 Top::MarkCompactPrologue(is_compacting); 651 Top::MarkCompactPrologue(is_compacting);
652 ThreadManager::MarkCompactPrologue(is_compacting); 652 ThreadManager::MarkCompactPrologue(is_compacting);
653 653
654 CompletelyClearInstanceofCache();
655
654 if (is_compacting) FlushNumberStringCache(); 656 if (is_compacting) FlushNumberStringCache();
655 } 657 }
656 658
657 659
658 void Heap::MarkCompactEpilogue(bool is_compacting) { 660 void Heap::MarkCompactEpilogue(bool is_compacting) {
659 Top::MarkCompactEpilogue(is_compacting); 661 Top::MarkCompactEpilogue(is_compacting);
660 ThreadManager::MarkCompactEpilogue(is_compacting); 662 ThreadManager::MarkCompactEpilogue(is_compacting);
661 } 663 }
662 664
663 665
(...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after
1655 obj = NumberDictionary::Allocate(128); 1657 obj = NumberDictionary::Allocate(128);
1656 if (obj->IsFailure()) return false; 1658 if (obj->IsFailure()) return false;
1657 set_code_stubs(NumberDictionary::cast(obj)); 1659 set_code_stubs(NumberDictionary::cast(obj));
1658 1660
1659 // Allocate the non_monomorphic_cache used in stub-cache.cc. The initial size 1661 // Allocate the non_monomorphic_cache used in stub-cache.cc. The initial size
1660 // is set to avoid expanding the dictionary during bootstrapping. 1662 // is set to avoid expanding the dictionary during bootstrapping.
1661 obj = NumberDictionary::Allocate(64); 1663 obj = NumberDictionary::Allocate(64);
1662 if (obj->IsFailure()) return false; 1664 if (obj->IsFailure()) return false;
1663 set_non_monomorphic_cache(NumberDictionary::cast(obj)); 1665 set_non_monomorphic_cache(NumberDictionary::cast(obj));
1664 1666
1667 set_instanceof_cache_function(Smi::FromInt(0));
1668 set_instanceof_cache_map(Smi::FromInt(0));
1669 set_instanceof_cache_answer(Smi::FromInt(0));
1670
1665 CreateFixedStubs(); 1671 CreateFixedStubs();
1666 1672
1667 if (InitializeNumberStringCache()->IsFailure()) return false; 1673 if (InitializeNumberStringCache()->IsFailure()) return false;
1668 1674
1669 // Allocate cache for single character ASCII strings. 1675 // Allocate cache for single character ASCII strings.
1670 obj = AllocateFixedArray(String::kMaxAsciiCharCode + 1, TENURED); 1676 obj = AllocateFixedArray(String::kMaxAsciiCharCode + 1, TENURED);
1671 if (obj->IsFailure()) return false; 1677 if (obj->IsFailure()) return false;
1672 set_single_character_string_cache(FixedArray::cast(obj)); 1678 set_single_character_string_cache(FixedArray::cast(obj));
1673 1679
1674 // Allocate cache for external strings pointing to native source code. 1680 // Allocate cache for external strings pointing to native source code.
(...skipping 2689 matching lines...) Expand 10 before | Expand all | Expand 10 after
4364 void ExternalStringTable::TearDown() { 4370 void ExternalStringTable::TearDown() {
4365 new_space_strings_.Free(); 4371 new_space_strings_.Free();
4366 old_space_strings_.Free(); 4372 old_space_strings_.Free();
4367 } 4373 }
4368 4374
4369 4375
4370 List<Object*> ExternalStringTable::new_space_strings_; 4376 List<Object*> ExternalStringTable::new_space_strings_;
4371 List<Object*> ExternalStringTable::old_space_strings_; 4377 List<Object*> ExternalStringTable::old_space_strings_;
4372 4378
4373 } } // namespace v8::internal 4379 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/ia32/codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698