Index: src/hydrogen-instructions.h |
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
index 6e7435af0627fc68d384fe81f37e80d2b6262a78..6448a08236556360ca18fcf6a6b937d4ab0914b1 100644 |
--- a/src/hydrogen-instructions.h |
+++ b/src/hydrogen-instructions.h |
@@ -5232,8 +5232,8 @@ class HAllocate: public HTemplateInstruction<2> { |
HAllocate(HValue* context, |
HValue* size, |
HType type, |
- bool pretenure, |
- ElementsKind kind = FAST_ELEMENTS) |
+ AllocationMode allocation_mode, |
+ InstanceType instance_type) |
: HTemplateInstruction<2>(type) { |
SetOperandAt(0, context); |
SetOperandAt(1, size); |
@@ -5241,19 +5241,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_ = allocation_mode == OLD_SPACE_ALLOCATION ? |
+ (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); |
} |
} |