Index: src/hydrogen-instructions.h |
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
index 17222d40419575db3188bbc0aa37db7cb8ebb494..294524cc56844366f89f4a8a2a9c23441169ec95 100644 |
--- a/src/hydrogen-instructions.h |
+++ b/src/hydrogen-instructions.h |
@@ -3204,8 +3204,23 @@ class HConstant: public HTemplateInstruction<0> { |
DECLARE_INSTRUCTION_FACTORY_P2(HConstant, int32_t, Representation); |
DECLARE_INSTRUCTION_FACTORY_P1(HConstant, double); |
DECLARE_INSTRUCTION_FACTORY_P1(HConstant, Handle<Object>); |
+ DECLARE_INSTRUCTION_FACTORY_P2(HConstant, Handle<Object>, UniqueValueId); |
DECLARE_INSTRUCTION_FACTORY_P1(HConstant, ExternalReference); |
+ static HConstant* CreateAndInsert(Zone* zone, |
+ HValue* context, |
+ int32_t value, |
+ HInstruction* instruction, |
+ bool before) { |
+ HConstant* new_constant = HConstant::New(zone, context, value); |
+ if (before) { |
+ new_constant->InsertBefore(instruction); |
+ } else { |
+ new_constant->InsertAfter(instruction); |
+ } |
+ return new_constant; |
+ } |
+ |
Handle<Object> handle() { |
if (handle_.is_null()) { |
Factory* factory = Isolate::Current()->factory(); |
@@ -3397,12 +3412,12 @@ class HConstant: public HTemplateInstruction<0> { |
Handle<Object> optional_handle = Handle<Object>::null()); |
HConstant(Handle<Object> handle, |
UniqueValueId unique_id, |
- Representation r, |
- HType type, |
- bool is_internalized_string, |
- bool is_not_in_new_space, |
- bool is_cell, |
- bool boolean_value); |
+ Representation r = Representation::Tagged(), |
+ HType type = HType::Tagged(), |
+ bool is_internalized_string = false, |
+ bool is_not_in_new_space = true, |
+ bool is_cell = false, |
+ bool boolean_value = false); |
explicit HConstant(ExternalReference reference); |
void Initialize(Representation r); |
@@ -5036,10 +5051,6 @@ class HAllocate: public HTemplateInstruction<2> { |
flags_ = static_cast<HAllocate::Flags>(flags_ | ALLOCATE_DOUBLE_ALIGNED); |
} |
- void UpdateSize(HValue* size) { |
- SetOperandAt(1, size); |
- } |
- |
virtual void HandleSideEffectDominator(GVNFlag side_effect, |
HValue* dominator); |
@@ -5061,7 +5072,9 @@ class HAllocate: public HTemplateInstruction<2> { |
HType type, |
PretenureFlag pretenure_flag, |
InstanceType instance_type) |
- : HTemplateInstruction<2>(type) { |
+ : HTemplateInstruction<2>(type), |
+ dominating_allocate_(NULL), |
+ filler_free_space_size_(NULL) { |
SetOperandAt(0, context); |
SetOperandAt(1, size); |
set_representation(Representation::Tagged()); |
@@ -5078,8 +5091,46 @@ class HAllocate: public HTemplateInstruction<2> { |
} |
} |
+ void UpdateSize(HValue* size) { |
+ SetOperandAt(1, size); |
+ } |
+ |
+ HAllocate* GetFoldableDominator(HAllocate* dominator); |
+ |
+ void UpdateFreeSpaceFiller(HConstant* old_filler_size, int32_t filler_size); |
+ |
+ void CreateFreeSpaceFiller(HAllocate* dominator, |
+ int32_t dominator_size, |
+ int32_t filler_size); |
+ |
+ bool IsFoldable(HAllocate* allocate) { |
+ return (IsNewSpaceAllocation() && allocate->IsNewSpaceAllocation()) || |
+ (IsOldDataSpaceAllocation() && allocate->IsOldDataSpaceAllocation()) || |
+ (IsOldPointerSpaceAllocation() && |
+ allocate->IsOldPointerSpaceAllocation()); |
+ } |
+ |
+ HAllocate* dominating_allocate() const { |
titzer
2013/08/07 11:53:44
Private getters and setters for the fields are alt
Hannes Payer (out of office)
2013/08/07 12:47:55
Done.
|
+ return dominating_allocate_; |
+ } |
+ |
+ void set_dominating_allocate(HAllocate* allocate) { |
+ dominating_allocate_ = allocate; |
+ } |
+ |
+ HConstant* filler_free_space_size() const { |
+ return filler_free_space_size_; |
+ } |
+ |
+ void set_filler_free_space_size(HConstant* filler_free_space_size) { |
+ filler_free_space_size_ = filler_free_space_size; |
+ } |
+ |
+ |
Flags flags_; |
Handle<Map> known_initial_map_; |
+ HAllocate* dominating_allocate_; |
+ HConstant* filler_free_space_size_; |
}; |