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

Side by Side Diff: src/heap.h

Issue 14451003: Pretenure ASCII cons string in high promotion mode. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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/assembler.cc ('k') | src/heap.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 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 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after
1524 MUST_USE_RESULT MaybeObject* AllocateRawFixedArray(int length); 1524 MUST_USE_RESULT MaybeObject* AllocateRawFixedArray(int length);
1525 MUST_USE_RESULT MaybeObject* AllocateRawFixedArray(int length, 1525 MUST_USE_RESULT MaybeObject* AllocateRawFixedArray(int length,
1526 PretenureFlag pretenure); 1526 PretenureFlag pretenure);
1527 1527
1528 // Predicate that governs global pre-tenuring decisions based on observed 1528 // Predicate that governs global pre-tenuring decisions based on observed
1529 // promotion rates of previous collections. 1529 // promotion rates of previous collections.
1530 inline bool ShouldGloballyPretenure() { 1530 inline bool ShouldGloballyPretenure() {
1531 return new_space_high_promotion_mode_active_; 1531 return new_space_high_promotion_mode_active_;
1532 } 1532 }
1533 1533
1534 inline PretenureFlag GetPretenureMode() {
1535 return new_space_high_promotion_mode_active_ ? TENURED : NOT_TENURED;
1536 }
1537
1538 inline Address* NewSpaceHighPromotionModeActiveAddress() {
1539 return reinterpret_cast<Address*>(&new_space_high_promotion_mode_active_);
1540 }
1541
1534 inline intptr_t PromotedTotalSize() { 1542 inline intptr_t PromotedTotalSize() {
1535 return PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize(); 1543 return PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize();
1536 } 1544 }
1537 1545
1538 // True if we have reached the allocation limit in the old generation that 1546 // True if we have reached the allocation limit in the old generation that
1539 // should force the next GC (caused normally) to be a full one. 1547 // should force the next GC (caused normally) to be a full one.
1540 inline bool OldGenerationPromotionLimitReached() { 1548 inline bool OldGenerationPromotionLimitReached() {
1541 return PromotedTotalSize() > old_gen_promotion_limit_; 1549 return PromotedTotalSize() > old_gen_promotion_limit_;
1542 } 1550 }
1543 1551
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1602 STATIC_CHECK(kNullValueRootIndex == Internals::kNullValueRootIndex); 1610 STATIC_CHECK(kNullValueRootIndex == Internals::kNullValueRootIndex);
1603 STATIC_CHECK(kTrueValueRootIndex == Internals::kTrueValueRootIndex); 1611 STATIC_CHECK(kTrueValueRootIndex == Internals::kTrueValueRootIndex);
1604 STATIC_CHECK(kFalseValueRootIndex == Internals::kFalseValueRootIndex); 1612 STATIC_CHECK(kFalseValueRootIndex == Internals::kFalseValueRootIndex);
1605 STATIC_CHECK(kempty_stringRootIndex == Internals::kEmptyStringRootIndex); 1613 STATIC_CHECK(kempty_stringRootIndex == Internals::kEmptyStringRootIndex);
1606 1614
1607 // Generated code can embed direct references to non-writable roots if 1615 // Generated code can embed direct references to non-writable roots if
1608 // they are in new space. 1616 // they are in new space.
1609 static bool RootCanBeWrittenAfterInitialization(RootListIndex root_index); 1617 static bool RootCanBeWrittenAfterInitialization(RootListIndex root_index);
1610 1618
1611 MUST_USE_RESULT MaybeObject* NumberToString( 1619 MUST_USE_RESULT MaybeObject* NumberToString(
1612 Object* number, bool check_number_string_cache = true); 1620 Object* number, bool check_number_string_cache = true,
1621 PretenureFlag pretenure = NOT_TENURED);
1613 MUST_USE_RESULT MaybeObject* Uint32ToString( 1622 MUST_USE_RESULT MaybeObject* Uint32ToString(
1614 uint32_t value, bool check_number_string_cache = true); 1623 uint32_t value, bool check_number_string_cache = true);
1615 1624
1616 Map* MapForExternalArrayType(ExternalArrayType array_type); 1625 Map* MapForExternalArrayType(ExternalArrayType array_type);
1617 RootListIndex RootIndexForExternalArrayType( 1626 RootListIndex RootIndexForExternalArrayType(
1618 ExternalArrayType array_type); 1627 ExternalArrayType array_type);
1619 1628
1620 void RecordStats(HeapStats* stats, bool take_snapshot = false); 1629 void RecordStats(HeapStats* stats, bool take_snapshot = false);
1621 1630
1622 // Copy block of memory from src to dst. Size of block should be aligned 1631 // Copy block of memory from src to dst. Size of block should be aligned
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
1969 // remain until the next failure and garbage collection. 1978 // remain until the next failure and garbage collection.
1970 int allocation_timeout_; 1979 int allocation_timeout_;
1971 1980
1972 // Do we expect to be able to handle allocation failure at this 1981 // Do we expect to be able to handle allocation failure at this
1973 // time? 1982 // time?
1974 bool disallow_allocation_failure_; 1983 bool disallow_allocation_failure_;
1975 #endif // DEBUG 1984 #endif // DEBUG
1976 1985
1977 // Indicates that the new space should be kept small due to high promotion 1986 // Indicates that the new space should be kept small due to high promotion
1978 // rates caused by the mutator allocating a lot of long-lived objects. 1987 // rates caused by the mutator allocating a lot of long-lived objects.
1979 bool new_space_high_promotion_mode_active_; 1988 // TODO(hpayer): change to bool if no longer accessed from generated code
1989 intptr_t new_space_high_promotion_mode_active_;
1980 1990
1981 // Limit that triggers a global GC on the next (normally caused) GC. This 1991 // Limit that triggers a global GC on the next (normally caused) GC. This
1982 // is checked when we have already decided to do a GC to help determine 1992 // is checked when we have already decided to do a GC to help determine
1983 // which collector to invoke. 1993 // which collector to invoke.
1984 intptr_t old_gen_promotion_limit_; 1994 intptr_t old_gen_promotion_limit_;
1985 1995
1986 // Limit that triggers a global GC as soon as is reasonable. This is 1996 // Limit that triggers a global GC as soon as is reasonable. This is
1987 // checked before expanding a paged space in the old generation and on 1997 // checked before expanding a paged space in the old generation and on
1988 // every allocation in large object space. 1998 // every allocation in large object space.
1989 intptr_t old_gen_allocation_limit_; 1999 intptr_t old_gen_allocation_limit_;
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after
3068 AssertNoAllocation no_alloc; // i.e. no gc allowed. 3078 AssertNoAllocation no_alloc; // i.e. no gc allowed.
3069 3079
3070 private: 3080 private:
3071 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 3081 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
3072 }; 3082 };
3073 #endif // DEBUG 3083 #endif // DEBUG
3074 3084
3075 } } // namespace v8::internal 3085 } } // namespace v8::internal
3076 3086
3077 #endif // V8_HEAP_H_ 3087 #endif // V8_HEAP_H_
OLDNEW
« no previous file with comments | « src/assembler.cc ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698