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

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

Issue 19956002: Support double allocations when folding allocation. (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 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 5052 matching lines...) Expand 10 before | Expand all | Expand 10 after
5063 5063
5064 private: 5064 private:
5065 HType type_; 5065 HType type_;
5066 Flags flags_; 5066 Flags flags_;
5067 Handle<Map> known_initial_map_; 5067 Handle<Map> known_initial_map_;
5068 }; 5068 };
5069 5069
5070 5070
5071 class HInnerAllocatedObject: public HTemplateInstruction<1> { 5071 class HInnerAllocatedObject: public HTemplateInstruction<1> {
5072 public: 5072 public:
5073 HInnerAllocatedObject(HValue* value, int offset, HType type = HType::Tagged()) 5073 HInnerAllocatedObject(HValue* value,
5074 int offset,
5075 HType type = HType::Tagged(),
5076 bool double_alignment = false)
5074 : offset_(offset), 5077 : offset_(offset),
5075 type_(type) { 5078 type_(type),
5079 double_alignment_(double_alignment) {
5076 ASSERT(value->IsAllocate()); 5080 ASSERT(value->IsAllocate());
5077 SetOperandAt(0, value); 5081 SetOperandAt(0, value);
5078 set_representation(Representation::Tagged()); 5082 set_representation(Representation::Tagged());
5079 } 5083 }
5080 5084
5081 HValue* base_object() { return OperandAt(0); } 5085 HValue* base_object() { return OperandAt(0); }
5082 int offset() { return offset_; } 5086 int offset() { return offset_; }
5083 5087
5084 virtual Representation RequiredInputRepresentation(int index) { 5088 virtual Representation RequiredInputRepresentation(int index) {
5085 return Representation::Tagged(); 5089 return Representation::Tagged();
5086 } 5090 }
5087 5091
5088 virtual HType CalculateInferredType() { return type_; } 5092 virtual HType CalculateInferredType() { return type_; }
5089 5093
5090 virtual void PrintDataTo(StringStream* stream); 5094 virtual void PrintDataTo(StringStream* stream);
5091 5095
5096 bool MustAllocateDoubleAligned() {
5097 return double_alignment_;
5098 }
5099
5092 DECLARE_CONCRETE_INSTRUCTION(InnerAllocatedObject) 5100 DECLARE_CONCRETE_INSTRUCTION(InnerAllocatedObject)
5093 5101
5094 private: 5102 private:
5095 int offset_; 5103 int offset_;
5096 HType type_; 5104 HType type_;
5105 bool double_alignment_;
5097 }; 5106 };
5098 5107
5099 5108
5100 inline bool StoringValueNeedsWriteBarrier(HValue* value) { 5109 inline bool StoringValueNeedsWriteBarrier(HValue* value) {
5101 return !value->type().IsBoolean() 5110 return !value->type().IsBoolean()
5102 && !value->type().IsSmi() 5111 && !value->type().IsSmi()
5103 && !(value->IsConstant() && HConstant::cast(value)->ImmortalImmovable()); 5112 && !(value->IsConstant() && HConstant::cast(value)->ImmortalImmovable());
5104 } 5113 }
5105 5114
5106 5115
(...skipping 1587 matching lines...) Expand 10 before | Expand all | Expand 10 after
6694 virtual bool IsDeletable() const { return true; } 6703 virtual bool IsDeletable() const { return true; }
6695 }; 6704 };
6696 6705
6697 6706
6698 #undef DECLARE_INSTRUCTION 6707 #undef DECLARE_INSTRUCTION
6699 #undef DECLARE_CONCRETE_INSTRUCTION 6708 #undef DECLARE_CONCRETE_INSTRUCTION
6700 6709
6701 } } // namespace v8::internal 6710 } } // namespace v8::internal
6702 6711
6703 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 6712 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698