| Index: src/hydrogen-instructions.h
|
| diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
|
| index 72b02a68950923cb6be491bcb9c0d5df1fe493c9..f2ea7b0cf4b409ab41f453f87420a2491f0c6bed 100644
|
| --- a/src/hydrogen-instructions.h
|
| +++ b/src/hydrogen-instructions.h
|
| @@ -49,11 +49,11 @@ class HEnvironment;
|
| class HInferRepresentationPhase;
|
| class HInstruction;
|
| class HLoopInformation;
|
| +class HStoreNamedField;
|
| class HValue;
|
| class LInstruction;
|
| class LChunkBuilder;
|
|
|
| -
|
| #define HYDROGEN_ABSTRACT_INSTRUCTION_LIST(V) \
|
| V(ArithmeticBinaryOperation) \
|
| V(BinaryOperation) \
|
| @@ -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<Map>, 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();
|
| @@ -3408,6 +3427,8 @@ class HConstant: public HTemplateInstruction<0> {
|
| bool is_not_in_new_space,
|
| bool is_cell,
|
| bool boolean_value);
|
| + HConstant(Handle<Map> handle,
|
| + UniqueValueId unique_id);
|
| explicit HConstant(ExternalReference reference);
|
|
|
| void Initialize(Representation r);
|
| @@ -5098,7 +5119,10 @@ 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),
|
| + clear_next_map_word_(false) {
|
| SetOperandAt(0, context);
|
| SetOperandAt(1, size);
|
| set_representation(Representation::Tagged());
|
| @@ -5110,13 +5134,40 @@ class HAllocate: public HTemplateInstruction<2> {
|
| ? ALLOCATE_IN_OLD_POINTER_SPACE : ALLOCATE_IN_OLD_DATA_SPACE)
|
| : ALLOCATE_IN_NEW_SPACE;
|
| if (instance_type == FIXED_DOUBLE_ARRAY_TYPE) {
|
| - flags_ = static_cast<HAllocate::Flags>(flags_ |
|
| - ALLOCATE_DOUBLE_ALIGNED);
|
| + flags_ = static_cast<HAllocate::Flags>(flags_ | ALLOCATE_DOUBLE_ALIGNED);
|
| }
|
| + // We have to fill the allocated object with one word fillers if we do
|
| + // not use allocation folding since some allocations may depend on each
|
| + // other, i.e., have a pointer to each other. A GC in between these
|
| + // allocations may leave such objects behind in a not completely initialized
|
| + // state.
|
| + if (!FLAG_use_gvn || !FLAG_use_allocation_folding) {
|
| + flags_ = static_cast<HAllocate::Flags>(flags_ | PREFILL_WITH_FILLER);
|
| + }
|
| + clear_next_map_word_ = pretenure_flag == NOT_TENURED &&
|
| + AllocationSite::CanTrack(instance_type);
|
| + }
|
| +
|
| + HAllocate* GetFoldableDominator(HAllocate* dominator);
|
| +
|
| + void UpdateFreeSpaceFiller(int32_t filler_size);
|
| +
|
| + void CreateFreeSpaceFiller(int32_t filler_size);
|
| +
|
| + bool IsFoldable(HAllocate* allocate) {
|
| + return (IsNewSpaceAllocation() && allocate->IsNewSpaceAllocation()) ||
|
| + (IsOldDataSpaceAllocation() && allocate->IsOldDataSpaceAllocation()) ||
|
| + (IsOldPointerSpaceAllocation() &&
|
| + allocate->IsOldPointerSpaceAllocation());
|
| }
|
|
|
| + void ClearNextMapWord(int offset);
|
| +
|
| Flags flags_;
|
| Handle<Map> known_initial_map_;
|
| + HAllocate* dominating_allocate_;
|
| + HStoreNamedField* filler_free_space_size_;
|
| + bool clear_next_map_word_;
|
| };
|
|
|
|
|
| @@ -5973,6 +6024,10 @@ class HStoreNamedField: public HTemplateInstruction<3> {
|
| return access_.representation();
|
| }
|
|
|
| + void UpdateValue(HValue* value) {
|
| + SetOperandAt(1, value);
|
| + }
|
| +
|
| private:
|
| HStoreNamedField(HValue* obj,
|
| HObjectAccess access,
|
|
|