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

Unified Diff: src/hydrogen-instructions.h

Issue 21074004: Cleaning up HAllocate space and double alignment selection. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 5ba7fb19e0e364a3c30e570cf0c911812e01ae75..5565e25131d29b2a192dd32663a35d4b13b63d41 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -5457,9 +5457,10 @@ class HAllocate: public HTemplateInstruction<2> {
HValue* context,
HValue* size,
HType type,
- bool pretenure,
- ElementsKind kind = FAST_ELEMENTS) {
- return new(zone) HAllocate(context, size, type, pretenure, kind);
+ PretenureFlag pretenure_flag,
+ InstanceType instance_type) {
+ return new(zone) HAllocate(context, size, type, pretenure_flag,
+ instance_type);
}
// Maximum instance size for which allocations will be inlined.
@@ -5535,8 +5536,8 @@ class HAllocate: public HTemplateInstruction<2> {
HAllocate(HValue* context,
HValue* size,
HType type,
- bool pretenure,
- ElementsKind kind)
+ PretenureFlag pretenure_flag,
+ InstanceType instance_type)
: HTemplateInstruction<2>(type) {
SetOperandAt(0, context);
SetOperandAt(1, size);
@@ -5544,19 +5545,13 @@ class HAllocate: public HTemplateInstruction<2> {
SetFlag(kTrackSideEffectDominators);
SetGVNFlag(kChangesNewSpacePromotion);
SetGVNFlag(kDependsOnNewSpacePromotion);
- if (pretenure) {
- if (IsFastDoubleElementsKind(kind)) {
- flags_ = static_cast<HAllocate::Flags>(ALLOCATE_IN_OLD_DATA_SPACE |
- ALLOCATE_DOUBLE_ALIGNED);
- } else {
- flags_ = ALLOCATE_IN_OLD_POINTER_SPACE;
- }
- } else {
- flags_ = ALLOCATE_IN_NEW_SPACE;
- if (IsFastDoubleElementsKind(kind)) {
- flags_ = static_cast<HAllocate::Flags>(flags_ |
- ALLOCATE_DOUBLE_ALIGNED);
- }
+ flags_ = pretenure_flag == TENURED
+ ? (Heap::TargetSpaceId(instance_type) == OLD_POINTER_SPACE
+ ? ALLOCATE_IN_OLD_POINTER_SPACE : ALLOCATE_IN_OLD_DATA_SPACE)
+ : ALLOCATE_IN_NEW_SPACE;
+ if (instance_type == FIXED_DOUBLE_ARRAY_TYPE) {
+ flags_ = static_cast<HAllocate::Flags>(flags_ |
+ ALLOCATE_DOUBLE_ALIGNED);
}
}
« no previous file with comments | « src/hydrogen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698