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

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

Issue 619863002: Introduce flag --allocation-site-transitioning Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Removed extra work happening when !transitioning && pretenuring. Created 6 years, 2 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/objects.cc ('k') | src/runtime/runtime.h » ('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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Review notes: 5 // Review notes:
6 // 6 //
7 // - The use of macros in these inline functions may seem superfluous 7 // - The use of macros in these inline functions may seem superfluous
8 // but it is absolutely needed to make sure gcc generates optimal 8 // but it is absolutely needed to make sure gcc generates optimal
9 // code. gcc is not happy when attempting to inline too deep. 9 // code. gcc is not happy when attempting to inline too deep.
10 // 10 //
(...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after
1597 Initialize(); 1597 Initialize();
1598 set_pretenure_decision(kZombie); 1598 set_pretenure_decision(kZombie);
1599 } 1599 }
1600 1600
1601 1601
1602 // Heuristic: We only need to create allocation site info if the boilerplate 1602 // Heuristic: We only need to create allocation site info if the boilerplate
1603 // elements kind is the initial elements kind. 1603 // elements kind is the initial elements kind.
1604 AllocationSiteMode AllocationSite::GetMode( 1604 AllocationSiteMode AllocationSite::GetMode(
1605 ElementsKind boilerplate_elements_kind) { 1605 ElementsKind boilerplate_elements_kind) {
1606 if (FLAG_pretenuring_call_new || 1606 if (FLAG_pretenuring_call_new ||
1607 IsFastSmiElementsKind(boilerplate_elements_kind)) { 1607 (FLAG_allocation_site_transitioning &&
1608 IsFastSmiElementsKind(boilerplate_elements_kind))) {
1608 return TRACK_ALLOCATION_SITE; 1609 return TRACK_ALLOCATION_SITE;
1609 } 1610 }
1610 1611
1611 return DONT_TRACK_ALLOCATION_SITE; 1612 return DONT_TRACK_ALLOCATION_SITE;
1612 } 1613 }
1613 1614
1614 1615
1615 AllocationSiteMode AllocationSite::GetMode(ElementsKind from, 1616 AllocationSiteMode AllocationSite::GetMode(ElementsKind from,
1616 ElementsKind to) { 1617 ElementsKind to) {
1617 if (FLAG_pretenuring_call_new || 1618 if (FLAG_pretenuring_call_new ||
1618 (IsFastSmiElementsKind(from) && 1619 (FLAG_allocation_site_transitioning && IsFastSmiElementsKind(from) &&
1619 IsMoreGeneralElementsKindTransition(from, to))) { 1620 IsMoreGeneralElementsKindTransition(from, to))) {
1620 return TRACK_ALLOCATION_SITE; 1621 return TRACK_ALLOCATION_SITE;
1621 } 1622 }
1622 1623
1623 return DONT_TRACK_ALLOCATION_SITE; 1624 return DONT_TRACK_ALLOCATION_SITE;
1624 } 1625 }
1625 1626
1626 1627
1627 inline bool AllocationSite::CanTrack(InstanceType type) { 1628 inline bool AllocationSite::CanTrack(InstanceType type) {
1628 if (FLAG_allocation_site_pretenuring) { 1629 if (FLAG_allocation_site_pretenuring) {
1629 return type == JS_ARRAY_TYPE || 1630 return type == JS_ARRAY_TYPE ||
1630 type == JS_OBJECT_TYPE || 1631 type == JS_OBJECT_TYPE ||
1631 type < FIRST_NONSTRING_TYPE; 1632 type < FIRST_NONSTRING_TYPE;
1632 } 1633 }
1633 return type == JS_ARRAY_TYPE; 1634 return FLAG_allocation_site_transitioning && type == JS_ARRAY_TYPE;
1634 } 1635 }
1635 1636
1636 1637
1637 inline DependentCode::DependencyGroup AllocationSite::ToDependencyGroup( 1638 inline DependentCode::DependencyGroup AllocationSite::ToDependencyGroup(
1638 Reason reason) { 1639 Reason reason) {
1639 switch (reason) { 1640 switch (reason) {
1640 case TENURING: 1641 case TENURING:
1641 return DependentCode::kAllocationSiteTenuringChangedGroup; 1642 return DependentCode::kAllocationSiteTenuringChangedGroup;
1642 break; 1643 break;
1643 case TRANSITIONS: 1644 case TRANSITIONS:
(...skipping 5604 matching lines...) Expand 10 before | Expand all | Expand 10 after
7248 #undef READ_SHORT_FIELD 7249 #undef READ_SHORT_FIELD
7249 #undef WRITE_SHORT_FIELD 7250 #undef WRITE_SHORT_FIELD
7250 #undef READ_BYTE_FIELD 7251 #undef READ_BYTE_FIELD
7251 #undef WRITE_BYTE_FIELD 7252 #undef WRITE_BYTE_FIELD
7252 #undef NOBARRIER_READ_BYTE_FIELD 7253 #undef NOBARRIER_READ_BYTE_FIELD
7253 #undef NOBARRIER_WRITE_BYTE_FIELD 7254 #undef NOBARRIER_WRITE_BYTE_FIELD
7254 7255
7255 } } // namespace v8::internal 7256 } } // namespace v8::internal
7256 7257
7257 #endif // V8_OBJECTS_INL_H_ 7258 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698