Index: src/hydrogen-instructions.h |
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
index 17222d40419575db3188bbc0aa37db7cb8ebb494..76935e2f3d7a11ef7b836141154c6f980c969d5a 100644 |
--- a/src/hydrogen-instructions.h |
+++ b/src/hydrogen-instructions.h |
@@ -3204,8 +3204,27 @@ 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* CreateAndInsertAfter(Zone* zone, |
+ HValue* context, |
+ int32_t value, |
+ HInstruction* instruction) { |
+ HConstant* new_constant = HConstant::New(zone, context, value); |
+ new_constant->InsertAfter(instruction); |
+ return new_constant; |
+ } |
+ |
+ static HConstant* CreateAndInsertBefore(Zone* zone, |
+ HValue* context, |
+ int32_t value, |
+ HInstruction* instruction) { |
+ HConstant* new_constant = HConstant::New(zone, context, value); |
+ new_constant->InsertBefore(instruction); |
+ return new_constant; |
+ } |
+ |
Handle<Object> handle() { |
if (handle_.is_null()) { |
Factory* factory = Isolate::Current()->factory(); |
@@ -3397,12 +3416,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(), |
Michael Starzinger
2013/08/09 09:22:58
As discussed offline: Please don't add default par
Hannes Payer (out of office)
2013/08/09 11:10:43
Done.
|
+ 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 +5055,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 +5076,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 +5095,29 @@ 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()); |
+ } |
+ |
Flags flags_; |
Handle<Map> known_initial_map_; |
+ HAllocate* dominating_allocate_; |
+ HConstant* filler_free_space_size_; |
}; |