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

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
« src/heap.h ('K') | « 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 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);
}
}
« src/heap.h ('K') | « src/hydrogen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698