| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 V(InstanceSize) \ | 128 V(InstanceSize) \ |
| 129 V(InvokeFunction) \ | 129 V(InvokeFunction) \ |
| 130 V(IsConstructCallAndBranch) \ | 130 V(IsConstructCallAndBranch) \ |
| 131 V(IsNilAndBranch) \ | 131 V(IsNilAndBranch) \ |
| 132 V(IsObjectAndBranch) \ | 132 V(IsObjectAndBranch) \ |
| 133 V(IsStringAndBranch) \ | 133 V(IsStringAndBranch) \ |
| 134 V(IsSmiAndBranch) \ | 134 V(IsSmiAndBranch) \ |
| 135 V(IsUndetectableAndBranch) \ | 135 V(IsUndetectableAndBranch) \ |
| 136 V(LeaveInlined) \ | 136 V(LeaveInlined) \ |
| 137 V(LoadContextSlot) \ | 137 V(LoadContextSlot) \ |
| 138 V(LoadElements) \ | |
| 139 V(LoadExternalArrayPointer) \ | 138 V(LoadExternalArrayPointer) \ |
| 140 V(LoadFunctionPrototype) \ | 139 V(LoadFunctionPrototype) \ |
| 141 V(LoadGlobalCell) \ | 140 V(LoadGlobalCell) \ |
| 142 V(LoadGlobalGeneric) \ | 141 V(LoadGlobalGeneric) \ |
| 143 V(LoadKeyed) \ | 142 V(LoadKeyed) \ |
| 144 V(LoadKeyedGeneric) \ | 143 V(LoadKeyedGeneric) \ |
| 145 V(LoadNamedField) \ | 144 V(LoadNamedField) \ |
| 146 V(LoadNamedFieldPolymorphic) \ | 145 V(LoadNamedFieldPolymorphic) \ |
| 147 V(LoadNamedGeneric) \ | 146 V(LoadNamedGeneric) \ |
| 148 V(MapEnumLength) \ | 147 V(MapEnumLength) \ |
| (...skipping 2429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2578 } | 2577 } |
| 2579 SetFlag(kUseGVN); | 2578 SetFlag(kUseGVN); |
| 2580 } | 2579 } |
| 2581 | 2580 |
| 2582 virtual bool IsDeletable() const { return true; } | 2581 virtual bool IsDeletable() const { return true; } |
| 2583 | 2582 |
| 2584 BuiltinFunctionId op_; | 2583 BuiltinFunctionId op_; |
| 2585 }; | 2584 }; |
| 2586 | 2585 |
| 2587 | 2586 |
| 2588 class HLoadElements: public HTemplateInstruction<2> { | |
| 2589 public: | |
| 2590 HLoadElements(HValue* value, HValue* typecheck) { | |
| 2591 SetOperandAt(0, value); | |
| 2592 SetOperandAt(1, typecheck != NULL ? typecheck : value); | |
| 2593 set_representation(Representation::Tagged()); | |
| 2594 SetFlag(kUseGVN); | |
| 2595 SetGVNFlag(kDependsOnElementsPointer); | |
| 2596 } | |
| 2597 | |
| 2598 HValue* value() { return OperandAt(0); } | |
| 2599 HValue* typecheck() { | |
| 2600 ASSERT(HasTypeCheck()); | |
| 2601 return OperandAt(1); | |
| 2602 } | |
| 2603 bool HasTypeCheck() const { return OperandAt(0) != OperandAt(1); } | |
| 2604 | |
| 2605 virtual void PrintDataTo(StringStream* stream); | |
| 2606 | |
| 2607 virtual Representation RequiredInputRepresentation(int index) { | |
| 2608 return Representation::Tagged(); | |
| 2609 } | |
| 2610 | |
| 2611 DECLARE_CONCRETE_INSTRUCTION(LoadElements) | |
| 2612 | |
| 2613 protected: | |
| 2614 virtual bool DataEquals(HValue* other) { return true; } | |
| 2615 | |
| 2616 private: | |
| 2617 virtual bool IsDeletable() const { return true; } | |
| 2618 }; | |
| 2619 | |
| 2620 | |
| 2621 class HLoadExternalArrayPointer: public HUnaryOperation { | 2587 class HLoadExternalArrayPointer: public HUnaryOperation { |
| 2622 public: | 2588 public: |
| 2623 explicit HLoadExternalArrayPointer(HValue* value) | 2589 explicit HLoadExternalArrayPointer(HValue* value) |
| 2624 : HUnaryOperation(value) { | 2590 : HUnaryOperation(value) { |
| 2625 set_representation(Representation::External()); | 2591 set_representation(Representation::External()); |
| 2626 // The result of this instruction is idempotent as long as its inputs don't | 2592 // The result of this instruction is idempotent as long as its inputs don't |
| 2627 // change. The external array of a specialized array elements object cannot | 2593 // change. The external array of a specialized array elements object cannot |
| 2628 // change once set, so it's no necessary to introduce any additional | 2594 // change once set, so it's no necessary to introduce any additional |
| 2629 // dependencies on top of the inputs. | 2595 // dependencies on top of the inputs. |
| 2630 SetFlag(kUseGVN); | 2596 SetFlag(kUseGVN); |
| (...skipping 3926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6557 virtual bool IsDeletable() const { return true; } | 6523 virtual bool IsDeletable() const { return true; } |
| 6558 }; | 6524 }; |
| 6559 | 6525 |
| 6560 | 6526 |
| 6561 #undef DECLARE_INSTRUCTION | 6527 #undef DECLARE_INSTRUCTION |
| 6562 #undef DECLARE_CONCRETE_INSTRUCTION | 6528 #undef DECLARE_CONCRETE_INSTRUCTION |
| 6563 | 6529 |
| 6564 } } // namespace v8::internal | 6530 } } // namespace v8::internal |
| 6565 | 6531 |
| 6566 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6532 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |