Index: src/hydrogen-instructions.h |
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
index 9f52569ccf60fa1a03a7a6aafc178f991a22b6d6..481dc5f4fc5520d07deaa06720b4b6fab7979d92 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,14 @@ class HAllocate: public HTemplateInstruction<2> { |
} |
} |
+ virtual Handle<Map> GetMonomorphicJSObjectMap() { |
+ return known_initial_map_; |
+ } |
+ |
+ void set_known_initial_map(Handle<Map> known_initial_map) { |
+ known_initial_map_ = known_initial_map; |
+ } |
+ |
virtual HType CalculateInferredType(); |
bool CanAllocateInNewSpace() const { |
@@ -4917,6 +4885,7 @@ class HAllocate: public HTemplateInstruction<2> { |
private: |
HType type_; |
Flags flags_; |
+ Handle<Map> known_initial_map_; |
}; |
@@ -4960,7 +4929,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(); |
} |