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

Side by Side Diff: src/hydrogen-instructions.h

Issue 22915007: Clear next map word when folding allocations into js arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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
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 5087 matching lines...) Expand 10 before | Expand all | Expand 10 after
5098 } 5098 }
5099 5099
5100 void MakeDoubleAligned() { 5100 void MakeDoubleAligned() {
5101 flags_ = static_cast<HAllocate::Flags>(flags_ | ALLOCATE_DOUBLE_ALIGNED); 5101 flags_ = static_cast<HAllocate::Flags>(flags_ | ALLOCATE_DOUBLE_ALIGNED);
5102 } 5102 }
5103 5103
5104 void UpdateSize(HValue* size) { 5104 void UpdateSize(HValue* size) {
5105 SetOperandAt(1, size); 5105 SetOperandAt(1, size);
5106 } 5106 }
5107 5107
5108 InstanceType instance_type() const {
5109 return instance_type_;
5110 }
5111
5108 virtual void HandleSideEffectDominator(GVNFlag side_effect, 5112 virtual void HandleSideEffectDominator(GVNFlag side_effect,
5109 HValue* dominator) V8_OVERRIDE; 5113 HValue* dominator) V8_OVERRIDE;
5110 5114
5111 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; 5115 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
5112 5116
5113 DECLARE_CONCRETE_INSTRUCTION(Allocate) 5117 DECLARE_CONCRETE_INSTRUCTION(Allocate)
5114 5118
5115 private: 5119 private:
5116 enum Flags { 5120 enum Flags {
5117 ALLOCATE_IN_NEW_SPACE = 1 << 0, 5121 ALLOCATE_IN_NEW_SPACE = 1 << 0,
5118 ALLOCATE_IN_OLD_DATA_SPACE = 1 << 1, 5122 ALLOCATE_IN_OLD_DATA_SPACE = 1 << 1,
5119 ALLOCATE_IN_OLD_POINTER_SPACE = 1 << 2, 5123 ALLOCATE_IN_OLD_POINTER_SPACE = 1 << 2,
5120 ALLOCATE_DOUBLE_ALIGNED = 1 << 3, 5124 ALLOCATE_DOUBLE_ALIGNED = 1 << 3,
5121 PREFILL_WITH_FILLER = 1 << 4 5125 PREFILL_WITH_FILLER = 1 << 4
5122 }; 5126 };
5123 5127
5124 HAllocate(HValue* context, 5128 HAllocate(HValue* context,
5125 HValue* size, 5129 HValue* size,
5126 HType type, 5130 HType type,
5127 PretenureFlag pretenure_flag, 5131 PretenureFlag pretenure_flag,
5128 InstanceType instance_type) 5132 InstanceType instance_type)
5129 : HTemplateInstruction<2>(type) { 5133 : HTemplateInstruction<2>(type),
5134 instance_type_(instance_type),
5135 clear_next_map_word_(false) {
5130 SetOperandAt(0, context); 5136 SetOperandAt(0, context);
5131 SetOperandAt(1, size); 5137 SetOperandAt(1, size);
5132 set_representation(Representation::Tagged()); 5138 set_representation(Representation::Tagged());
5133 SetFlag(kTrackSideEffectDominators); 5139 SetFlag(kTrackSideEffectDominators);
5134 SetGVNFlag(kChangesNewSpacePromotion); 5140 SetGVNFlag(kChangesNewSpacePromotion);
5135 SetGVNFlag(kDependsOnNewSpacePromotion); 5141 SetGVNFlag(kDependsOnNewSpacePromotion);
5136 flags_ = pretenure_flag == TENURED 5142 flags_ = pretenure_flag == TENURED
5137 ? (Heap::TargetSpaceId(instance_type) == OLD_POINTER_SPACE 5143 ? (Heap::TargetSpaceId(instance_type_) == OLD_POINTER_SPACE
5138 ? ALLOCATE_IN_OLD_POINTER_SPACE : ALLOCATE_IN_OLD_DATA_SPACE) 5144 ? ALLOCATE_IN_OLD_POINTER_SPACE : ALLOCATE_IN_OLD_DATA_SPACE)
5139 : ALLOCATE_IN_NEW_SPACE; 5145 : ALLOCATE_IN_NEW_SPACE;
5140 if (instance_type == FIXED_DOUBLE_ARRAY_TYPE) { 5146 if (instance_type_ == FIXED_DOUBLE_ARRAY_TYPE) {
5141 flags_ = static_cast<HAllocate::Flags>(flags_ | 5147 flags_ = static_cast<HAllocate::Flags>(flags_ |
5142 ALLOCATE_DOUBLE_ALIGNED); 5148 ALLOCATE_DOUBLE_ALIGNED);
5143 } 5149 }
5144 } 5150 }
5145 5151
5146 Flags flags_; 5152 Flags flags_;
5147 Handle<Map> known_initial_map_; 5153 Handle<Map> known_initial_map_;
5154 InstanceType instance_type_;
5155 bool clear_next_map_word_;
5148 }; 5156 };
5149 5157
5150 5158
5151 class HInnerAllocatedObject V8_FINAL : public HTemplateInstruction<1> { 5159 class HInnerAllocatedObject V8_FINAL : public HTemplateInstruction<1> {
5152 public: 5160 public:
5153 static HInnerAllocatedObject* New(Zone* zone, 5161 static HInnerAllocatedObject* New(Zone* zone,
5154 HValue* context, 5162 HValue* context,
5155 HValue* value, 5163 HValue* value,
5156 int offset, 5164 int offset,
5157 HType type = HType::Tagged()) { 5165 HType type = HType::Tagged()) {
(...skipping 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after
6793 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 6801 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
6794 }; 6802 };
6795 6803
6796 6804
6797 #undef DECLARE_INSTRUCTION 6805 #undef DECLARE_INSTRUCTION
6798 #undef DECLARE_CONCRETE_INSTRUCTION 6806 #undef DECLARE_CONCRETE_INSTRUCTION
6799 6807
6800 } } // namespace v8::internal 6808 } } // namespace v8::internal
6801 6809
6802 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 6810 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | src/hydrogen-instructions.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698