| Index: src/hydrogen-instructions.h
|
| diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
|
| index f1720f444247d83635c84d00a99cf2457ee0022e..a92c32e80d8878a7eb2dcd3195f569f9a4767eb6 100644
|
| --- a/src/hydrogen-instructions.h
|
| +++ b/src/hydrogen-instructions.h
|
| @@ -83,6 +83,7 @@ class LChunkBuilder;
|
| V(Constant) \
|
| V(ConstructDouble) \
|
| V(Context) \
|
| + V(CopyElements) \
|
| V(DateField) \
|
| V(DebugBreak) \
|
| V(DeclareGlobals) \
|
| @@ -92,6 +93,7 @@ class LChunkBuilder;
|
| V(DummyUse) \
|
| V(EnterInlined) \
|
| V(EnvironmentMarker) \
|
| + V(FillElements) \
|
| V(ForceRepresentation) \
|
| V(ForInCacheArray) \
|
| V(ForInPrepareMap) \
|
| @@ -5713,19 +5715,21 @@ inline bool ReceiverObjectNeedsWriteBarrier(HValue* object,
|
| if (HAllocate::cast(object)->IsNewSpaceAllocation()) {
|
| return false;
|
| }
|
| - // Stores to old space allocations require no write barriers if the value is
|
| - // a constant provably not in new space.
|
| - if (value->IsConstant() && HConstant::cast(value)->NotInNewSpace()) {
|
| - return false;
|
| - }
|
| - // Stores to old space allocations require no write barriers if the value is
|
| - // an old space allocation.
|
| - while (value->IsInnerAllocatedObject()) {
|
| - value = HInnerAllocatedObject::cast(value)->base_object();
|
| - }
|
| - if (value->IsAllocate() &&
|
| - !HAllocate::cast(value)->IsNewSpaceAllocation()) {
|
| - return false;
|
| + if (value != NULL) {
|
| + // Stores to old space allocations require no write barriers if the value
|
| + // is a constant provably not in new space.
|
| + if (value->IsConstant() && HConstant::cast(value)->NotInNewSpace()) {
|
| + return false;
|
| + }
|
| + // Stores to old space allocations require no write barriers if the value
|
| + // is an old space allocation.
|
| + while (value->IsInnerAllocatedObject()) {
|
| + value = HInnerAllocatedObject::cast(value)->base_object();
|
| + }
|
| + if (value->IsAllocate() &&
|
| + !HAllocate::cast(value)->IsNewSpaceAllocation()) {
|
| + return false;
|
| + }
|
| }
|
| }
|
| return true;
|
| @@ -6881,6 +6885,65 @@ class HStoreNamedGeneric V8_FINAL : public HTemplateInstruction<3> {
|
| };
|
|
|
|
|
| +class HFillElements V8_FINAL : public HTemplateInstruction<4> {
|
| + public:
|
| + DECLARE_INSTRUCTION_FACTORY_P4(HFillElements, HValue*, HValue*,
|
| + HValue*, HValue*);
|
| +
|
| + HValue* elements() { return OperandAt(0); }
|
| + HValue* from() { return OperandAt(1); }
|
| + HValue* to() { return OperandAt(2); }
|
| + HValue* value() { return OperandAt(3); }
|
| +
|
| + virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
|
| +
|
| + DECLARE_CONCRETE_INSTRUCTION(FillElements)
|
| +
|
| + virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
|
| + return OperandAt(index)->representation();
|
| + }
|
| +
|
| + private:
|
| + HFillElements(HValue* obj, HValue* from, HValue* to, HValue* val) {
|
| + SetOperandAt(0, obj);
|
| + SetOperandAt(1, from);
|
| + SetOperandAt(2, to);
|
| + SetOperandAt(3, val);
|
| + }
|
| +};
|
| +
|
| +
|
| +class HCopyElements V8_FINAL : public HTemplateInstruction<3> {
|
| + public:
|
| + DECLARE_INSTRUCTION_FACTORY_P4(HCopyElements, HValue*, HValue*, HValue*,
|
| + ElementsKind);
|
| +
|
| + HValue* src() { return OperandAt(0); }
|
| + HValue* dst() { return OperandAt(1); }
|
| + HValue* length() { return OperandAt(2); }
|
| + ElementsKind elements_kind() const { return elements_kind_; }
|
| +
|
| + virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
|
| +
|
| + DECLARE_CONCRETE_INSTRUCTION(CopyElements)
|
| +
|
| + virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
|
| + return OperandAt(index)->representation();
|
| + }
|
| +
|
| + private:
|
| + HCopyElements(HValue* src, HValue* dst, HValue* length,
|
| + ElementsKind elements_kind)
|
| + : elements_kind_(elements_kind) {
|
| + SetOperandAt(0, src);
|
| + SetOperandAt(1, dst);
|
| + SetOperandAt(2, length);
|
| + }
|
| +
|
| + ElementsKind elements_kind_;
|
| +};
|
| +
|
| +
|
| class HStoreKeyed V8_FINAL
|
| : public HTemplateInstruction<3>, public ArrayInstructionInterface {
|
| public:
|
|
|