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

Side by Side 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, 4 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
« src/heap.h ('K') | « src/hydrogen.cc ('k') | no next file » | 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 5214 matching lines...) Expand 10 before | Expand all | Expand 10 after
5225 Handle<Object> name_; 5225 Handle<Object> name_;
5226 bool for_typeof_; 5226 bool for_typeof_;
5227 }; 5227 };
5228 5228
5229 5229
5230 class HAllocate: public HTemplateInstruction<2> { 5230 class HAllocate: public HTemplateInstruction<2> {
5231 public: 5231 public:
5232 HAllocate(HValue* context, 5232 HAllocate(HValue* context,
5233 HValue* size, 5233 HValue* size,
5234 HType type, 5234 HType type,
5235 bool pretenure, 5235 AllocationMode allocation_mode,
5236 ElementsKind kind = FAST_ELEMENTS) 5236 InstanceType instance_type)
5237 : HTemplateInstruction<2>(type) { 5237 : HTemplateInstruction<2>(type) {
5238 SetOperandAt(0, context); 5238 SetOperandAt(0, context);
5239 SetOperandAt(1, size); 5239 SetOperandAt(1, size);
5240 set_representation(Representation::Tagged()); 5240 set_representation(Representation::Tagged());
5241 SetFlag(kTrackSideEffectDominators); 5241 SetFlag(kTrackSideEffectDominators);
5242 SetGVNFlag(kChangesNewSpacePromotion); 5242 SetGVNFlag(kChangesNewSpacePromotion);
5243 SetGVNFlag(kDependsOnNewSpacePromotion); 5243 SetGVNFlag(kDependsOnNewSpacePromotion);
5244 if (pretenure) { 5244 flags_ = allocation_mode == OLD_SPACE_ALLOCATION ?
5245 if (IsFastDoubleElementsKind(kind)) { 5245 (Heap::TargetSpaceId(instance_type) == OLD_POINTER_SPACE ?
5246 flags_ = static_cast<HAllocate::Flags>(ALLOCATE_IN_OLD_DATA_SPACE | 5246 ALLOCATE_IN_OLD_POINTER_SPACE : ALLOCATE_IN_OLD_DATA_SPACE)
5247 ALLOCATE_DOUBLE_ALIGNED); 5247 : ALLOCATE_IN_NEW_SPACE;
5248 } else { 5248 if (instance_type == FIXED_DOUBLE_ARRAY_TYPE) {
5249 flags_ = ALLOCATE_IN_OLD_POINTER_SPACE; 5249 flags_ = static_cast<HAllocate::Flags>(flags_ |
5250 } 5250 ALLOCATE_DOUBLE_ALIGNED);
5251 } else {
5252 flags_ = ALLOCATE_IN_NEW_SPACE;
5253 if (IsFastDoubleElementsKind(kind)) {
5254 flags_ = static_cast<HAllocate::Flags>(flags_ |
5255 ALLOCATE_DOUBLE_ALIGNED);
5256 }
5257 } 5251 }
5258 } 5252 }
5259 5253
5260 // Maximum instance size for which allocations will be inlined. 5254 // Maximum instance size for which allocations will be inlined.
5261 static const int kMaxInlineSize = 64 * kPointerSize; 5255 static const int kMaxInlineSize = 64 * kPointerSize;
5262 5256
5263 HValue* context() { return OperandAt(0); } 5257 HValue* context() { return OperandAt(0); }
5264 HValue* size() { return OperandAt(1); } 5258 HValue* size() { return OperandAt(1); }
5265 5259
5266 virtual Representation RequiredInputRepresentation(int index) { 5260 virtual Representation RequiredInputRepresentation(int index) {
(...skipping 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after
6958 virtual bool IsDeletable() const { return true; } 6952 virtual bool IsDeletable() const { return true; }
6959 }; 6953 };
6960 6954
6961 6955
6962 #undef DECLARE_INSTRUCTION 6956 #undef DECLARE_INSTRUCTION
6963 #undef DECLARE_CONCRETE_INSTRUCTION 6957 #undef DECLARE_CONCRETE_INSTRUCTION
6964 6958
6965 } } // namespace v8::internal 6959 } } // namespace v8::internal
6966 6960
6967 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 6961 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« 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