OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 V(Change) \ | 84 V(Change) \ |
85 V(CheckFunction) \ | 85 V(CheckFunction) \ |
86 V(CheckInstanceType) \ | 86 V(CheckInstanceType) \ |
87 V(CheckMap) \ | 87 V(CheckMap) \ |
88 V(CheckNonSmi) \ | 88 V(CheckNonSmi) \ |
89 V(CheckPrototypeMaps) \ | 89 V(CheckPrototypeMaps) \ |
90 V(CheckSmi) \ | 90 V(CheckSmi) \ |
91 V(ClampToUint8) \ | 91 V(ClampToUint8) \ |
92 V(ClassOfTest) \ | 92 V(ClassOfTest) \ |
93 V(Compare) \ | 93 V(Compare) \ |
94 V(CompareJSObjectEq) \ | 94 V(CompareObjectEq) \ |
95 V(CompareMap) \ | 95 V(CompareMap) \ |
96 V(CompareSymbolEq) \ | |
97 V(CompareConstantEq) \ | 96 V(CompareConstantEq) \ |
98 V(Constant) \ | 97 V(Constant) \ |
99 V(Context) \ | 98 V(Context) \ |
100 V(DeleteProperty) \ | 99 V(DeleteProperty) \ |
101 V(Deoptimize) \ | 100 V(Deoptimize) \ |
102 V(Div) \ | 101 V(Div) \ |
103 V(ElementsKind) \ | 102 V(ElementsKind) \ |
104 V(EnterInlined) \ | 103 V(EnterInlined) \ |
105 V(ExternalArrayLength) \ | 104 V(ExternalArrayLength) \ |
106 V(FixedArrayLength) \ | 105 V(FixedArrayLength) \ |
(...skipping 2441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2548 HCompare* comp = HCompare::cast(other); | 2547 HCompare* comp = HCompare::cast(other); |
2549 return token_ == comp->token(); | 2548 return token_ == comp->token(); |
2550 } | 2549 } |
2551 | 2550 |
2552 private: | 2551 private: |
2553 Representation input_representation_; | 2552 Representation input_representation_; |
2554 Token::Value token_; | 2553 Token::Value token_; |
2555 }; | 2554 }; |
2556 | 2555 |
2557 | 2556 |
2558 class HCompareJSObjectEq: public HBinaryOperation { | 2557 class HCompareObjectEq: public HBinaryOperation { |
2559 public: | 2558 public: |
2560 HCompareJSObjectEq(HValue* left, HValue* right) | 2559 HCompareObjectEq(HValue* left, HValue* right) |
2561 : HBinaryOperation(left, right) { | 2560 : HBinaryOperation(left, right) { |
2562 set_representation(Representation::Tagged()); | 2561 set_representation(Representation::Tagged()); |
2563 SetFlag(kUseGVN); | 2562 SetFlag(kUseGVN); |
2564 SetFlag(kDependsOnMaps); | 2563 SetFlag(kDependsOnMaps); |
2565 } | 2564 } |
2566 | 2565 |
2567 virtual bool EmitAtUses() { | 2566 virtual bool EmitAtUses() { |
2568 return !HasSideEffects() && !HasMultipleUses(); | 2567 return !HasSideEffects() && !HasMultipleUses(); |
2569 } | 2568 } |
2570 | 2569 |
2571 virtual Representation RequiredInputRepresentation(int index) const { | 2570 virtual Representation RequiredInputRepresentation(int index) const { |
2572 return Representation::Tagged(); | 2571 return Representation::Tagged(); |
2573 } | 2572 } |
2574 virtual HType CalculateInferredType(); | 2573 virtual HType CalculateInferredType(); |
2575 | 2574 |
2576 DECLARE_CONCRETE_INSTRUCTION(CompareJSObjectEq) | 2575 DECLARE_CONCRETE_INSTRUCTION(CompareObjectEq) |
2577 | 2576 |
2578 protected: | 2577 protected: |
2579 virtual bool DataEquals(HValue* other) { return true; } | 2578 virtual bool DataEquals(HValue* other) { return true; } |
2580 }; | 2579 }; |
2581 | 2580 |
2582 | 2581 |
2583 class HCompareSymbolEq: public HBinaryOperation { | |
2584 public: | |
2585 HCompareSymbolEq(HValue* left, HValue* right, Token::Value op) | |
2586 : HBinaryOperation(left, right), op_(op) { | |
2587 ASSERT(op == Token::EQ || op == Token::EQ_STRICT); | |
2588 set_representation(Representation::Tagged()); | |
2589 SetFlag(kUseGVN); | |
2590 SetFlag(kDependsOnMaps); | |
2591 } | |
2592 | |
2593 Token::Value op() const { return op_; } | |
2594 | |
2595 virtual bool EmitAtUses() { | |
2596 return !HasSideEffects() && !HasMultipleUses(); | |
2597 } | |
2598 | |
2599 virtual Representation RequiredInputRepresentation(int index) const { | |
2600 return Representation::Tagged(); | |
2601 } | |
2602 | |
2603 virtual HType CalculateInferredType() { return HType::Boolean(); } | |
2604 | |
2605 DECLARE_CONCRETE_INSTRUCTION(CompareSymbolEq); | |
2606 | |
2607 protected: | |
2608 virtual bool DataEquals(HValue* other) { | |
2609 return op_ == HCompareSymbolEq::cast(other)->op_; | |
2610 } | |
2611 | |
2612 private: | |
2613 const Token::Value op_; | |
2614 }; | |
2615 | |
2616 | |
2617 class HCompareConstantEq: public HUnaryOperation { | 2582 class HCompareConstantEq: public HUnaryOperation { |
2618 public: | 2583 public: |
2619 HCompareConstantEq(HValue* left, int right, Token::Value op) | 2584 HCompareConstantEq(HValue* left, int right, Token::Value op) |
2620 : HUnaryOperation(left), op_(op), right_(right) { | 2585 : HUnaryOperation(left), op_(op), right_(right) { |
2621 ASSERT(op == Token::EQ_STRICT); | 2586 ASSERT(op == Token::EQ_STRICT); |
2622 set_representation(Representation::Tagged()); | 2587 set_representation(Representation::Tagged()); |
2623 SetFlag(kUseGVN); | 2588 SetFlag(kUseGVN); |
2624 } | 2589 } |
2625 | 2590 |
2626 Token::Value op() const { return op_; } | 2591 Token::Value op() const { return op_; } |
(...skipping 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4104 | 4069 |
4105 DECLARE_CONCRETE_INSTRUCTION(In) | 4070 DECLARE_CONCRETE_INSTRUCTION(In) |
4106 }; | 4071 }; |
4107 | 4072 |
4108 #undef DECLARE_INSTRUCTION | 4073 #undef DECLARE_INSTRUCTION |
4109 #undef DECLARE_CONCRETE_INSTRUCTION | 4074 #undef DECLARE_CONCRETE_INSTRUCTION |
4110 | 4075 |
4111 } } // namespace v8::internal | 4076 } } // namespace v8::internal |
4112 | 4077 |
4113 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 4078 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |