Reviewers: kasperl_google.com, Description: - Increased size of number string cache. - Change the instruction order for inlined allocation.
Please review this at http://codereview.chromium.org/501170 SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ Affected files: M src/heap.h M src/heap.cc M src/ia32/macro-assembler-ia32.cc Index: src/heap.cc =================================================================== --- src/heap.cc (revision 3513) +++ src/heap.cc (working copy) @@ -1612,17 +1612,18 @@ static inline int double_get_hash(double d) { DoubleRepresentation rep(d); - return ((static_cast<int>(rep.bits) ^ static_cast<int>(rep.bits >> 32)) & - (Heap::kNumberStringCacheSize - 1)); + int value = (static_cast<int>(rep.bits) ^ static_cast<int>(rep.bits >> 32)); + return (((value >> 16) ^ value)) + & (Heap::kNumberStringCacheSize - 1); } static inline int smi_get_hash(Smi* smi) { - return (smi->value() & (Heap::kNumberStringCacheSize - 1)); + return ((smi->value() >> 16) ^ smi->value()) + & (Heap::kNumberStringCacheSize - 1); } - Object* Heap::GetNumberStringCache(Object* number) { int hash; if (number->IsSmi()) { Index: src/ia32/macro-assembler-ia32.cc =================================================================== --- src/ia32/macro-assembler-ia32.cc (revision 3513) +++ src/ia32/macro-assembler-ia32.cc (working copy) @@ -729,13 +729,13 @@ cmp(result_end, Operand::StaticVariable(new_space_allocation_limit)); j(above, gc_required, not_taken); - // Update allocation top. - UpdateAllocationTopHelper(result_end, scratch); - // Tag result if requested. if ((flags & TAG_OBJECT) != 0) { or_(Operand(result), Immediate(kHeapObjectTag)); } + + // Update allocation top. + UpdateAllocationTopHelper(result_end, scratch); } @@ -759,13 +759,14 @@ cmp(result_end, Operand::StaticVariable(new_space_allocation_limit)); j(above, gc_required); - // Update allocation top. - UpdateAllocationTopHelper(result_end, scratch); - // Tag result if requested. if ((flags & TAG_OBJECT) != 0) { or_(Operand(result), Immediate(kHeapObjectTag)); } + + // Update allocation top. + UpdateAllocationTopHelper(result_end, scratch); + } @@ -790,13 +791,13 @@ cmp(result_end, Operand::StaticVariable(new_space_allocation_limit)); j(above, gc_required, not_taken); - // Update allocation top. - UpdateAllocationTopHelper(result_end, scratch); - // Tag result if requested. if ((flags & TAG_OBJECT) != 0) { or_(Operand(result), Immediate(kHeapObjectTag)); } + + // Update allocation top. + UpdateAllocationTopHelper(result_end, scratch); } Index: src/heap.h =================================================================== --- src/heap.h (revision 3513) +++ src/heap.h (working copy) @@ -821,7 +821,7 @@ static void SetNumberStringCache(Object* number, String* str); // Entries in the cache. Must be a power of 2. - static const int kNumberStringCacheSize = 64; + static const int kNumberStringCacheSize = 16384; // Adjusts the amount of registered external memory. // Returns the adjusted value. -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
