| Index: src/hydrogen-instructions.h
|
| diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
|
| index 7554fd85bad5a136e387698eb704159008be7bdd..fe725eee2acbdb7f3751a7755d6eae07f0b06649 100644
|
| --- a/src/hydrogen-instructions.h
|
| +++ b/src/hydrogen-instructions.h
|
| @@ -66,6 +66,7 @@ class LChunkBuilder;
|
| V(AccessArgumentsAt) \
|
| V(Add) \
|
| V(Allocate) \
|
| + V(AllocateObject) \
|
| V(ApplyArguments) \
|
| V(ArgumentsElements) \
|
| V(ArgumentsLength) \
|
| @@ -4927,6 +4928,48 @@ 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 {
|
| @@ -4945,9 +4988,6 @@ 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;
|
| }
|
| @@ -4972,14 +5012,6 @@ 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 {
|
| @@ -5014,7 +5046,6 @@ class HAllocate: public HTemplateInstruction<2> {
|
| private:
|
| HType type_;
|
| Flags flags_;
|
| - Handle<Map> known_initial_map_;
|
| };
|
|
|
|
|
| @@ -5058,6 +5089,7 @@ 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();
|
| }
|
|
|