| Index: src/hydrogen-instructions.h
|
| ===================================================================
|
| --- src/hydrogen-instructions.h (revision 7006)
|
| +++ src/hydrogen-instructions.h (working copy)
|
| @@ -64,6 +64,7 @@
|
|
|
|
|
| #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \
|
| + V(AbnormalExit) \
|
| V(AccessArgumentsAt) \
|
| V(Add) \
|
| V(ApplyArguments) \
|
| @@ -97,6 +98,7 @@
|
| V(CompareJSObjectEq) \
|
| V(CompareMap) \
|
| V(Constant) \
|
| + V(Context) \
|
| V(DeleteProperty) \
|
| V(Deoptimize) \
|
| V(Div) \
|
| @@ -111,6 +113,7 @@
|
| V(IsNull) \
|
| V(IsObject) \
|
| V(IsSmi) \
|
| + V(IsConstructCall) \
|
| V(HasInstanceType) \
|
| V(HasCachedArrayIndex) \
|
| V(JSArrayLength) \
|
| @@ -128,6 +131,7 @@
|
| V(Mul) \
|
| V(ObjectLiteral) \
|
| V(OsrEntry) \
|
| + V(OuterContext) \
|
| V(Parameter) \
|
| V(Power) \
|
| V(PushArgument) \
|
| @@ -138,6 +142,7 @@
|
| V(Shr) \
|
| V(Simulate) \
|
| V(StackCheck) \
|
| + V(StoreContextSlot) \
|
| V(StoreGlobal) \
|
| V(StoreKeyedFastElement) \
|
| V(StoreKeyedGeneric) \
|
| @@ -162,6 +167,7 @@
|
| V(GlobalVars) \
|
| V(Maps) \
|
| V(ArrayLengths) \
|
| + V(ContextSlots) \
|
| V(OsrEntries)
|
|
|
| #define DECLARE_INSTRUCTION(type) \
|
| @@ -834,12 +840,11 @@
|
| };
|
|
|
|
|
| -class HThrow: public HUnaryControlInstruction {
|
| +class HAbnormalExit: public HControlInstruction {
|
| public:
|
| - explicit HThrow(HValue* value)
|
| - : HUnaryControlInstruction(value, NULL, NULL) { }
|
| + HAbnormalExit() : HControlInstruction(NULL, NULL) { }
|
|
|
| - DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
|
| + DECLARE_CONCRETE_INSTRUCTION(AbnormalExit, "abnormal_exit")
|
| };
|
|
|
|
|
| @@ -866,6 +871,20 @@
|
| };
|
|
|
|
|
| +class HThrow: public HUnaryOperation {
|
| + public:
|
| + explicit HThrow(HValue* value) : HUnaryOperation(value) {
|
| + SetAllSideEffects();
|
| + }
|
| +
|
| + virtual Representation RequiredInputRepresentation(int index) const {
|
| + return Representation::Tagged();
|
| + }
|
| +
|
| + DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
|
| +};
|
| +
|
| +
|
| class HChange: public HUnaryOperation {
|
| public:
|
| HChange(HValue* value,
|
| @@ -989,7 +1008,7 @@
|
| public:
|
| HStackCheck() { }
|
|
|
| - DECLARE_CONCRETE_INSTRUCTION(Throw, "stack_check")
|
| + DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack_check")
|
| };
|
|
|
|
|
| @@ -1046,14 +1065,41 @@
|
| };
|
|
|
|
|
| -class HGlobalObject: public HInstruction {
|
| +class HContext: public HInstruction {
|
| public:
|
| - HGlobalObject() {
|
| + HContext() {
|
| set_representation(Representation::Tagged());
|
| SetFlag(kUseGVN);
|
| - SetFlag(kDependsOnCalls);
|
| }
|
|
|
| + DECLARE_CONCRETE_INSTRUCTION(Context, "context");
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| +};
|
| +
|
| +
|
| +class HOuterContext: public HUnaryOperation {
|
| + public:
|
| + explicit HOuterContext(HValue* inner) : HUnaryOperation(inner) {
|
| + set_representation(Representation::Tagged());
|
| + SetFlag(kUseGVN);
|
| + }
|
| +
|
| + DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer_context");
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| +};
|
| +
|
| +
|
| +class HGlobalObject: public HUnaryOperation {
|
| + public:
|
| + explicit HGlobalObject(HValue* context) : HUnaryOperation(context) {
|
| + set_representation(Representation::Tagged());
|
| + SetFlag(kUseGVN);
|
| + }
|
| +
|
| DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global_object")
|
|
|
| protected:
|
| @@ -1061,12 +1107,12 @@
|
| };
|
|
|
|
|
| -class HGlobalReceiver: public HInstruction {
|
| +class HGlobalReceiver: public HUnaryOperation {
|
| public:
|
| - HGlobalReceiver() {
|
| + explicit HGlobalReceiver(HValue* global_object)
|
| + : HUnaryOperation(global_object) {
|
| set_representation(Representation::Tagged());
|
| SetFlag(kUseGVN);
|
| - SetFlag(kDependsOnCalls);
|
| }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global_receiver")
|
| @@ -1657,7 +1703,7 @@
|
| HValue* GetRedundantReplacement() const;
|
| void AddInput(HValue* value);
|
|
|
| - bool HasReceiverOperand();
|
| + bool IsReceiver() { return merged_index_ == 0; }
|
|
|
| int merged_index() const { return merged_index_; }
|
|
|
| @@ -1832,6 +1878,7 @@
|
| SetOperandAt(1, receiver);
|
| SetOperandAt(2, length);
|
| SetOperandAt(3, elements);
|
| + SetAllSideEffects();
|
| }
|
|
|
| virtual Representation RequiredInputRepresentation(int index) const {
|
| @@ -1851,8 +1898,6 @@
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply_arguments")
|
|
|
| -
|
| -
|
| protected:
|
| virtual void InternalSetOperandAt(int index, HValue* value) {
|
| operands_[index] = value;
|
| @@ -2136,6 +2181,22 @@
|
| };
|
|
|
|
|
| +class HIsConstructCall: public HInstruction {
|
| + public:
|
| + HIsConstructCall() {
|
| + set_representation(Representation::Tagged());
|
| + SetFlag(kUseGVN);
|
| + }
|
| +
|
| + virtual bool EmitAtUses() const { return uses()->length() <= 1; }
|
| +
|
| + DECLARE_CONCRETE_INSTRUCTION(IsConstructCall, "is_construct_call")
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| +};
|
| +
|
| +
|
| class HHasInstanceType: public HUnaryPredicate {
|
| public:
|
| HHasInstanceType(HValue* value, InstanceType type)
|
| @@ -2576,12 +2637,17 @@
|
|
|
| class HStoreGlobal: public HUnaryOperation {
|
| public:
|
| - HStoreGlobal(HValue* value, Handle<JSGlobalPropertyCell> cell)
|
| - : HUnaryOperation(value), cell_(cell) {
|
| + HStoreGlobal(HValue* value,
|
| + Handle<JSGlobalPropertyCell> cell,
|
| + bool check_hole_value)
|
| + : HUnaryOperation(value),
|
| + cell_(cell),
|
| + check_hole_value_(check_hole_value) {
|
| SetFlag(kChangesGlobalVars);
|
| }
|
|
|
| Handle<JSGlobalPropertyCell> cell() const { return cell_; }
|
| + bool check_hole_value() const { return check_hole_value_; }
|
|
|
| virtual Representation RequiredInputRepresentation(int index) const {
|
| return Representation::Tagged();
|
| @@ -2592,42 +2658,74 @@
|
|
|
| private:
|
| Handle<JSGlobalPropertyCell> cell_;
|
| + bool check_hole_value_;
|
| };
|
|
|
|
|
| -class HLoadContextSlot: public HInstruction {
|
| +class HLoadContextSlot: public HUnaryOperation {
|
| public:
|
| - HLoadContextSlot(int context_chain_length , int slot_index)
|
| - : context_chain_length_(context_chain_length), slot_index_(slot_index) {
|
| + HLoadContextSlot(HValue* context , int slot_index)
|
| + : HUnaryOperation(context), slot_index_(slot_index) {
|
| set_representation(Representation::Tagged());
|
| SetFlag(kUseGVN);
|
| - SetFlag(kDependsOnCalls);
|
| + SetFlag(kDependsOnContextSlots);
|
| }
|
|
|
| - int context_chain_length() const { return context_chain_length_; }
|
| int slot_index() const { return slot_index_; }
|
|
|
| + virtual Representation RequiredInputRepresentation(int index) const {
|
| + return Representation::Tagged();
|
| + }
|
| +
|
| virtual void PrintDataTo(StringStream* stream) const;
|
|
|
| - virtual intptr_t Hashcode() const {
|
| - return context_chain_length() * 29 + slot_index();
|
| - }
|
| -
|
| DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load_context_slot")
|
|
|
| protected:
|
| virtual bool DataEquals(HValue* other) const {
|
| HLoadContextSlot* b = HLoadContextSlot::cast(other);
|
| - return (context_chain_length() == b->context_chain_length())
|
| - && (slot_index() == b->slot_index());
|
| + return (slot_index() == b->slot_index());
|
| }
|
|
|
| private:
|
| - int context_chain_length_;
|
| int slot_index_;
|
| };
|
|
|
|
|
| +static inline bool StoringValueNeedsWriteBarrier(HValue* value) {
|
| + return !value->type().IsSmi() &&
|
| + !(value->IsConstant() && HConstant::cast(value)->InOldSpace());
|
| +}
|
| +
|
| +
|
| +class HStoreContextSlot: public HBinaryOperation {
|
| + public:
|
| + HStoreContextSlot(HValue* context, int slot_index, HValue* value)
|
| + : HBinaryOperation(context, value), slot_index_(slot_index) {
|
| + SetFlag(kChangesContextSlots);
|
| + }
|
| +
|
| + HValue* context() const { return OperandAt(0); }
|
| + HValue* value() const { return OperandAt(1); }
|
| + int slot_index() const { return slot_index_; }
|
| +
|
| + bool NeedsWriteBarrier() const {
|
| + return StoringValueNeedsWriteBarrier(value());
|
| + }
|
| +
|
| + virtual Representation RequiredInputRepresentation(int index) const {
|
| + return Representation::Tagged();
|
| + }
|
| +
|
| + virtual void PrintDataTo(StringStream* stream) const;
|
| +
|
| + DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store_context_slot")
|
| +
|
| + private:
|
| + int slot_index_;
|
| +};
|
| +
|
| +
|
| class HLoadNamedField: public HUnaryOperation {
|
| public:
|
| HLoadNamedField(HValue* object, bool is_in_object, int offset)
|
| @@ -2759,12 +2857,6 @@
|
| };
|
|
|
|
|
| -static inline bool StoringValueNeedsWriteBarrier(HValue* value) {
|
| - return !value->type().IsSmi() &&
|
| - !(value->IsConstant() && HConstant::cast(value)->InOldSpace());
|
| -}
|
| -
|
| -
|
| class HStoreNamed: public HBinaryOperation {
|
| public:
|
| HStoreNamed(HValue* obj, Handle<Object> name, HValue* val)
|
| @@ -2782,10 +2874,6 @@
|
| HValue* value() const { return OperandAt(1); }
|
| void set_value(HValue* value) { SetOperandAt(1, value); }
|
|
|
| - bool NeedsWriteBarrier() const {
|
| - return StoringValueNeedsWriteBarrier(value());
|
| - }
|
| -
|
| DECLARE_INSTRUCTION(StoreNamed)
|
|
|
| private:
|
| @@ -2813,7 +2901,7 @@
|
| DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store_named_field")
|
|
|
| virtual Representation RequiredInputRepresentation(int index) const {
|
| - return Representation::Tagged();
|
| + return Representation::Tagged();
|
| }
|
| virtual void PrintDataTo(StringStream* stream) const;
|
|
|
| @@ -2822,6 +2910,10 @@
|
| Handle<Map> transition() const { return transition_; }
|
| void set_transition(Handle<Map> map) { transition_ = map; }
|
|
|
| + bool NeedsWriteBarrier() const {
|
| + return StoringValueNeedsWriteBarrier(value());
|
| + }
|
| +
|
| private:
|
| bool is_in_object_;
|
| int offset_;
|
| @@ -3068,6 +3160,10 @@
|
| set_representation(Representation::Tagged());
|
| }
|
|
|
| + virtual Representation RequiredInputRepresentation(int index) const {
|
| + return Representation::Tagged();
|
| + }
|
| +
|
| DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
|
| };
|
|
|
|
|