Chromium Code Reviews| Index: src/hydrogen-instructions.h |
| diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
| index 9f52569ccf60fa1a03a7a6aafc178f991a22b6d6..82b3c7623f7b205e57c816380929ffef457d0654 100644 |
| --- a/src/hydrogen-instructions.h |
| +++ b/src/hydrogen-instructions.h |
| @@ -65,7 +65,6 @@ class LChunkBuilder; |
| V(AccessArgumentsAt) \ |
| V(Add) \ |
| V(Allocate) \ |
| - V(AllocateObject) \ |
| V(ApplyArguments) \ |
| V(ArgumentsElements) \ |
| V(ArgumentsLength) \ |
| @@ -4799,48 +4798,6 @@ class HLoadGlobalGeneric: public HTemplateInstruction<2> { |
| }; |
| -class HAllocateObject: public HTemplateInstruction<1> { |
| - public: |
| - HAllocateObject(HValue* context, Handle<JSFunction> constructor) |
| - : constructor_(constructor) { |
| - SetOperandAt(0, context); |
| - set_representation(Representation::Tagged()); |
| - SetGVNFlag(kChangesNewSpacePromotion); |
| - constructor_initial_map_ = constructor->has_initial_map() |
| - ? Handle<Map>(constructor->initial_map()) |
| - : Handle<Map>::null(); |
| - // If slack tracking finished, the instance size and property counts |
| - // remain unchanged so that we can allocate memory for the object. |
| - ASSERT(!constructor->shared()->IsInobjectSlackTrackingInProgress()); |
| - } |
| - |
| - // Maximum instance size for which allocations will be inlined. |
| - static const int kMaxSize = 64 * kPointerSize; |
| - |
| - HValue* context() { return OperandAt(0); } |
| - Handle<JSFunction> constructor() { return constructor_; } |
| - Handle<Map> constructor_initial_map() { return constructor_initial_map_; } |
| - |
| - virtual Representation RequiredInputRepresentation(int index) { |
| - return Representation::Tagged(); |
| - } |
| - virtual Handle<Map> GetMonomorphicJSObjectMap() { |
| - ASSERT(!constructor_initial_map_.is_null()); |
| - return constructor_initial_map_; |
| - } |
| - virtual HType CalculateInferredType(); |
| - |
| - DECLARE_CONCRETE_INSTRUCTION(AllocateObject) |
| - |
| - private: |
| - // TODO(svenpanne) Might be safe, but leave it out until we know for sure. |
| - // virtual bool IsDeletable() const { return true; } |
| - |
| - Handle<JSFunction> constructor_; |
| - Handle<Map> constructor_initial_map_; |
| -}; |
| - |
| - |
| class HAllocate: public HTemplateInstruction<2> { |
| public: |
| enum Flags { |
| @@ -4859,6 +4816,9 @@ class HAllocate: public HTemplateInstruction<2> { |
| SetGVNFlag(kChangesNewSpacePromotion); |
| } |
| + // Maximum instance size for which allocations will be inlined. |
| + static const int kMaxInlineSize = 64 * kPointerSize; |
| + |
| static Flags DefaultFlags() { |
| return CAN_ALLOCATE_IN_NEW_SPACE; |
| } |
| @@ -4883,6 +4843,13 @@ class HAllocate: public HTemplateInstruction<2> { |
| } |
| } |
| + virtual Handle<Map> GetMonomorphicJSObjectMap() { |
| + return known_initial_map_; |
| + } |
|
Hannes Payer (out of office)
2013/06/04 07:44:19
add newline
Michael Starzinger
2013/06/04 08:17:33
Done.
|
| + void set_known_initial_map(Handle<Map> known_initial_map) { |
| + known_initial_map_ = known_initial_map; |
| + } |
| + |
| virtual HType CalculateInferredType(); |
| bool CanAllocateInNewSpace() const { |
| @@ -4917,6 +4884,7 @@ class HAllocate: public HTemplateInstruction<2> { |
| private: |
| HType type_; |
| Flags flags_; |
| + Handle<Map> known_initial_map_; |
| }; |
| @@ -4960,7 +4928,6 @@ inline bool ReceiverObjectNeedsWriteBarrier(HValue* object, |
| new_space_dominator); |
| } |
| if (object != new_space_dominator) return true; |
| - if (object->IsAllocateObject()) return false; |
| if (object->IsAllocate()) { |
| return !HAllocate::cast(object)->GuaranteedInNewSpace(); |
| } |