Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 // HCall | 85 // HCall |
| 86 // HCallConstantFunction | 86 // HCallConstantFunction |
| 87 // HCallFunction | 87 // HCallFunction |
| 88 // HCallGlobal | 88 // HCallGlobal |
| 89 // HCallKeyed | 89 // HCallKeyed |
| 90 // HCallKnownGlobal | 90 // HCallKnownGlobal |
| 91 // HCallNamed | 91 // HCallNamed |
| 92 // HCallNew | 92 // HCallNew |
| 93 // HCallRuntime | 93 // HCallRuntime |
| 94 // HCallStub | 94 // HCallStub |
| 95 // HCheckPrototypeMaps | |
| 95 // HConstant | 96 // HConstant |
| 96 // HControlInstruction | 97 // HControlInstruction |
| 97 // HDeoptimize | 98 // HDeoptimize |
| 98 // HGoto | 99 // HGoto |
| 99 // HUnaryControlInstruction | 100 // HUnaryControlInstruction |
| 100 // HBranch | 101 // HBranch |
| 101 // HCompareMapAndBranch | 102 // HCompareMapAndBranch |
| 102 // HReturn | 103 // HReturn |
| 103 // HThrow | 104 // HThrow |
| 104 // HEnterInlined | 105 // HEnterInlined |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 118 // HStoreKeyed | 119 // HStoreKeyed |
| 119 // HStoreKeyedFastElement | 120 // HStoreKeyedFastElement |
| 120 // HStoreKeyedGeneric | 121 // HStoreKeyedGeneric |
| 121 // HUnaryOperation | 122 // HUnaryOperation |
| 122 // HBitNot | 123 // HBitNot |
| 123 // HChange | 124 // HChange |
| 124 // HCheckFunction | 125 // HCheckFunction |
| 125 // HCheckInstanceType | 126 // HCheckInstanceType |
| 126 // HCheckMap | 127 // HCheckMap |
| 127 // HCheckNonSmi | 128 // HCheckNonSmi |
| 128 // HCheckPrototypeMaps | |
| 129 // HCheckSmi | 129 // HCheckSmi |
| 130 // HDeleteProperty | 130 // HDeleteProperty |
| 131 // HFixedArrayLength | 131 // HFixedArrayLength |
| 132 // HJSArrayLength | 132 // HJSArrayLength |
| 133 // HLoadElements | 133 // HLoadElements |
| 134 // HTypeofIs | 134 // HTypeofIs |
| 135 // HLoadNamedField | 135 // HLoadNamedField |
| 136 // HLoadNamedGeneric | 136 // HLoadNamedGeneric |
| 137 // HLoadFunctionPrototype | 137 // HLoadFunctionPrototype |
| 138 // HPushArgument | 138 // HPushArgument |
| (...skipping 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1615 virtual HType CalculateInferredType() const; | 1615 virtual HType CalculateInferredType() const; |
| 1616 | 1616 |
| 1617 #ifdef DEBUG | 1617 #ifdef DEBUG |
| 1618 virtual void Verify() const; | 1618 virtual void Verify() const; |
| 1619 #endif | 1619 #endif |
| 1620 | 1620 |
| 1621 DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check_non_smi") | 1621 DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check_non_smi") |
| 1622 }; | 1622 }; |
| 1623 | 1623 |
| 1624 | 1624 |
| 1625 class HCheckPrototypeMaps: public HUnaryOperation { | 1625 class HCheckPrototypeMaps: public HInstruction { |
| 1626 public: | 1626 public: |
| 1627 HCheckPrototypeMaps(HValue* value, | 1627 HCheckPrototypeMaps(Handle<JSObject> prototype, Handle<JSObject> holder) |
| 1628 Handle<JSObject> holder, | 1628 : prototype_(prototype), holder_(holder) { |
| 1629 Handle<Map> receiver_map) | |
| 1630 : HUnaryOperation(value), | |
| 1631 holder_(holder), | |
| 1632 receiver_map_(receiver_map) { | |
| 1633 set_representation(Representation::Tagged()); | |
| 1634 SetFlag(kUseGVN); | 1629 SetFlag(kUseGVN); |
| 1635 SetFlag(kDependsOnMaps); | 1630 SetFlag(kDependsOnMaps); |
| 1636 } | 1631 } |
| 1637 | 1632 |
| 1638 virtual Representation RequiredInputRepresentation(int index) const { | |
| 1639 return Representation::Tagged(); | |
| 1640 } | |
| 1641 | |
| 1642 #ifdef DEBUG | 1633 #ifdef DEBUG |
| 1643 virtual void Verify() const; | 1634 virtual void Verify() const; |
| 1644 #endif | 1635 #endif |
| 1645 | 1636 |
| 1637 Handle<JSObject> prototype() const { return prototype_; } | |
| 1646 Handle<JSObject> holder() const { return holder_; } | 1638 Handle<JSObject> holder() const { return holder_; } |
| 1647 Handle<Map> receiver_map() const { return receiver_map_; } | |
| 1648 | 1639 |
| 1649 DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check_prototype_maps") | 1640 DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check_prototype_maps") |
| 1650 | 1641 |
| 1642 virtual intptr_t Hashcode() const { | |
| 1643 ASSERT(!Heap::allow_allocation(false)); | |
|
fschneider
2011/01/12 22:45:01
I think
ASSERT(!Heap::IsAllocationAllowed());
w
| |
| 1644 intptr_t hash = reinterpret_cast<intptr_t>(*prototype()); | |
| 1645 hash = 17 * hash + reinterpret_cast<intptr_t>(*holder()); | |
| 1646 return hash; | |
| 1647 } | |
| 1648 | |
| 1651 protected: | 1649 protected: |
| 1652 virtual bool DataEquals(HValue* other) const { | 1650 virtual bool DataEquals(HValue* other) const { |
| 1653 HCheckPrototypeMaps* b = HCheckPrototypeMaps::cast(other); | 1651 HCheckPrototypeMaps* b = HCheckPrototypeMaps::cast(other); |
| 1654 return holder_.is_identical_to(b->holder()) && | 1652 return prototype_.is_identical_to(b->prototype()) && |
| 1655 receiver_map_.is_identical_to(b->receiver_map()); | 1653 holder_.is_identical_to(b->holder()); |
| 1656 } | 1654 } |
| 1657 | 1655 |
| 1658 private: | 1656 private: |
| 1657 Handle<JSObject> prototype_; | |
| 1659 Handle<JSObject> holder_; | 1658 Handle<JSObject> holder_; |
| 1660 Handle<Map> receiver_map_; | |
| 1661 }; | 1659 }; |
| 1662 | 1660 |
| 1663 | 1661 |
| 1664 class HCheckSmi: public HUnaryOperation { | 1662 class HCheckSmi: public HUnaryOperation { |
| 1665 public: | 1663 public: |
| 1666 explicit HCheckSmi(HValue* value) : HUnaryOperation(value) { | 1664 explicit HCheckSmi(HValue* value) : HUnaryOperation(value) { |
| 1667 set_representation(Representation::Tagged()); | 1665 set_representation(Representation::Tagged()); |
| 1668 SetFlag(kUseGVN); | 1666 SetFlag(kUseGVN); |
| 1669 } | 1667 } |
| 1670 | 1668 |
| (...skipping 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3025 HValue* object() const { return left(); } | 3023 HValue* object() const { return left(); } |
| 3026 HValue* key() const { return right(); } | 3024 HValue* key() const { return right(); } |
| 3027 }; | 3025 }; |
| 3028 | 3026 |
| 3029 #undef DECLARE_INSTRUCTION | 3027 #undef DECLARE_INSTRUCTION |
| 3030 #undef DECLARE_CONCRETE_INSTRUCTION | 3028 #undef DECLARE_CONCRETE_INSTRUCTION |
| 3031 | 3029 |
| 3032 } } // namespace v8::internal | 3030 } } // namespace v8::internal |
| 3033 | 3031 |
| 3034 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 3032 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |