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

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
« no previous file with comments | « 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 5439 matching lines...) Expand 10 before | Expand all | Expand 10 after
5450 bool for_typeof_; 5450 bool for_typeof_;
5451 }; 5451 };
5452 5452
5453 5453
5454 class HAllocate: public HTemplateInstruction<2> { 5454 class HAllocate: public HTemplateInstruction<2> {
5455 public: 5455 public:
5456 static HAllocate* New(Zone* zone, 5456 static HAllocate* New(Zone* zone,
5457 HValue* context, 5457 HValue* context,
5458 HValue* size, 5458 HValue* size,
5459 HType type, 5459 HType type,
5460 bool pretenure, 5460 PretenureFlag pretenure_flag,
5461 ElementsKind kind = FAST_ELEMENTS) { 5461 InstanceType instance_type) {
5462 return new(zone) HAllocate(context, size, type, pretenure, kind); 5462 return new(zone) HAllocate(context, size, type, pretenure_flag,
5463 instance_type);
5463 } 5464 }
5464 5465
5465 // Maximum instance size for which allocations will be inlined. 5466 // Maximum instance size for which allocations will be inlined.
5466 static const int kMaxInlineSize = 64 * kPointerSize; 5467 static const int kMaxInlineSize = 64 * kPointerSize;
5467 5468
5468 HValue* context() { return OperandAt(0); } 5469 HValue* context() { return OperandAt(0); }
5469 HValue* size() { return OperandAt(1); } 5470 HValue* size() { return OperandAt(1); }
5470 5471
5471 virtual Representation RequiredInputRepresentation(int index) { 5472 virtual Representation RequiredInputRepresentation(int index) {
5472 if (index == 0) { 5473 if (index == 0) {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
5528 ALLOCATE_IN_NEW_SPACE = 1 << 0, 5529 ALLOCATE_IN_NEW_SPACE = 1 << 0,
5529 ALLOCATE_IN_OLD_DATA_SPACE = 1 << 1, 5530 ALLOCATE_IN_OLD_DATA_SPACE = 1 << 1,
5530 ALLOCATE_IN_OLD_POINTER_SPACE = 1 << 2, 5531 ALLOCATE_IN_OLD_POINTER_SPACE = 1 << 2,
5531 ALLOCATE_DOUBLE_ALIGNED = 1 << 3, 5532 ALLOCATE_DOUBLE_ALIGNED = 1 << 3,
5532 PREFILL_WITH_FILLER = 1 << 4 5533 PREFILL_WITH_FILLER = 1 << 4
5533 }; 5534 };
5534 5535
5535 HAllocate(HValue* context, 5536 HAllocate(HValue* context,
5536 HValue* size, 5537 HValue* size,
5537 HType type, 5538 HType type,
5538 bool pretenure, 5539 PretenureFlag pretenure_flag,
5539 ElementsKind kind) 5540 InstanceType instance_type)
5540 : HTemplateInstruction<2>(type) { 5541 : HTemplateInstruction<2>(type) {
5541 SetOperandAt(0, context); 5542 SetOperandAt(0, context);
5542 SetOperandAt(1, size); 5543 SetOperandAt(1, size);
5543 set_representation(Representation::Tagged()); 5544 set_representation(Representation::Tagged());
5544 SetFlag(kTrackSideEffectDominators); 5545 SetFlag(kTrackSideEffectDominators);
5545 SetGVNFlag(kChangesNewSpacePromotion); 5546 SetGVNFlag(kChangesNewSpacePromotion);
5546 SetGVNFlag(kDependsOnNewSpacePromotion); 5547 SetGVNFlag(kDependsOnNewSpacePromotion);
5547 if (pretenure) { 5548 flags_ = pretenure_flag == TENURED
5548 if (IsFastDoubleElementsKind(kind)) { 5549 ? (Heap::TargetSpaceId(instance_type) == OLD_POINTER_SPACE
5549 flags_ = static_cast<HAllocate::Flags>(ALLOCATE_IN_OLD_DATA_SPACE | 5550 ? ALLOCATE_IN_OLD_POINTER_SPACE : ALLOCATE_IN_OLD_DATA_SPACE)
5550 ALLOCATE_DOUBLE_ALIGNED); 5551 : ALLOCATE_IN_NEW_SPACE;
5551 } else { 5552 if (instance_type == FIXED_DOUBLE_ARRAY_TYPE) {
5552 flags_ = ALLOCATE_IN_OLD_POINTER_SPACE; 5553 flags_ = static_cast<HAllocate::Flags>(flags_ |
5553 } 5554 ALLOCATE_DOUBLE_ALIGNED);
5554 } else {
5555 flags_ = ALLOCATE_IN_NEW_SPACE;
5556 if (IsFastDoubleElementsKind(kind)) {
5557 flags_ = static_cast<HAllocate::Flags>(flags_ |
5558 ALLOCATE_DOUBLE_ALIGNED);
5559 }
5560 } 5555 }
5561 } 5556 }
5562 5557
5563 Flags flags_; 5558 Flags flags_;
5564 Handle<Map> known_initial_map_; 5559 Handle<Map> known_initial_map_;
5565 }; 5560 };
5566 5561
5567 5562
5568 class HInnerAllocatedObject: public HTemplateInstruction<1> { 5563 class HInnerAllocatedObject: public HTemplateInstruction<1> {
5569 public: 5564 public:
(...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after
7270 virtual bool IsDeletable() const { return true; } 7265 virtual bool IsDeletable() const { return true; }
7271 }; 7266 };
7272 7267
7273 7268
7274 #undef DECLARE_INSTRUCTION 7269 #undef DECLARE_INSTRUCTION
7275 #undef DECLARE_CONCRETE_INSTRUCTION 7270 #undef DECLARE_CONCRETE_INSTRUCTION
7276 7271
7277 } } // namespace v8::internal 7272 } } // namespace v8::internal
7278 7273
7279 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7274 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« 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