Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: src/hydrogen-instructions.h

Issue 8373029: [hydrogen] optimize switch with string clauses (Closed) Base URL: gh:v8/v8@master
Patch Set: mips: CompareGenericAndBranch Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 V(Goto) \ 113 V(Goto) \
114 V(HasCachedArrayIndexAndBranch) \ 114 V(HasCachedArrayIndexAndBranch) \
115 V(HasInstanceTypeAndBranch) \ 115 V(HasInstanceTypeAndBranch) \
116 V(In) \ 116 V(In) \
117 V(InstanceOf) \ 117 V(InstanceOf) \
118 V(InstanceOfKnownGlobal) \ 118 V(InstanceOfKnownGlobal) \
119 V(InvokeFunction) \ 119 V(InvokeFunction) \
120 V(IsConstructCallAndBranch) \ 120 V(IsConstructCallAndBranch) \
121 V(IsNilAndBranch) \ 121 V(IsNilAndBranch) \
122 V(IsObjectAndBranch) \ 122 V(IsObjectAndBranch) \
123 V(IsStringAndBranch) \
123 V(IsSmiAndBranch) \ 124 V(IsSmiAndBranch) \
124 V(IsUndetectableAndBranch) \ 125 V(IsUndetectableAndBranch) \
126 V(CompareGenericAndBranch) \
125 V(JSArrayLength) \ 127 V(JSArrayLength) \
126 V(LeaveInlined) \ 128 V(LeaveInlined) \
127 V(LoadContextSlot) \ 129 V(LoadContextSlot) \
128 V(LoadElements) \ 130 V(LoadElements) \
129 V(LoadExternalArrayPointer) \ 131 V(LoadExternalArrayPointer) \
130 V(LoadFunctionPrototype) \ 132 V(LoadFunctionPrototype) \
131 V(LoadGlobalCell) \ 133 V(LoadGlobalCell) \
132 V(LoadGlobalGeneric) \ 134 V(LoadGlobalGeneric) \
133 V(LoadKeyedFastDoubleElement) \ 135 V(LoadKeyedFastDoubleElement) \
134 V(LoadKeyedFastElement) \ 136 V(LoadKeyedFastElement) \
(...skipping 2560 matching lines...) Expand 10 before | Expand all | Expand 10 after
2695 explicit HIsObjectAndBranch(HValue* value) 2697 explicit HIsObjectAndBranch(HValue* value)
2696 : HUnaryControlInstruction(value, NULL, NULL) { } 2698 : HUnaryControlInstruction(value, NULL, NULL) { }
2697 2699
2698 virtual Representation RequiredInputRepresentation(int index) { 2700 virtual Representation RequiredInputRepresentation(int index) {
2699 return Representation::Tagged(); 2701 return Representation::Tagged();
2700 } 2702 }
2701 2703
2702 DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch) 2704 DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch)
2703 }; 2705 };
2704 2706
2707 class HIsStringAndBranch: public HUnaryControlInstruction {
2708 public:
2709 explicit HIsStringAndBranch(HValue* value)
2710 : HUnaryControlInstruction(value, NULL, NULL) { }
2711
2712 virtual Representation RequiredInputRepresentation(int index) {
2713 return Representation::Tagged();
2714 }
2715
2716 DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch)
2717 };
2718
2705 2719
2706 class HIsSmiAndBranch: public HUnaryControlInstruction { 2720 class HIsSmiAndBranch: public HUnaryControlInstruction {
2707 public: 2721 public:
2708 explicit HIsSmiAndBranch(HValue* value) 2722 explicit HIsSmiAndBranch(HValue* value)
2709 : HUnaryControlInstruction(value, NULL, NULL) { } 2723 : HUnaryControlInstruction(value, NULL, NULL) { }
2710 2724
2711 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch) 2725 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch)
2712 2726
2713 virtual Representation RequiredInputRepresentation(int index) { 2727 virtual Representation RequiredInputRepresentation(int index) {
2714 return Representation::Tagged(); 2728 return Representation::Tagged();
(...skipping 10 matching lines...) Expand all
2725 : HUnaryControlInstruction(value, NULL, NULL) { } 2739 : HUnaryControlInstruction(value, NULL, NULL) { }
2726 2740
2727 virtual Representation RequiredInputRepresentation(int index) { 2741 virtual Representation RequiredInputRepresentation(int index) {
2728 return Representation::Tagged(); 2742 return Representation::Tagged();
2729 } 2743 }
2730 2744
2731 DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch) 2745 DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch)
2732 }; 2746 };
2733 2747
2734 2748
2749 class HCompareGenericAndBranch: public HTemplateControlInstruction<2, 3> {
2750 public:
2751 HCompareGenericAndBranch(HValue* context,
2752 HValue* left,
2753 HValue* right,
2754 Token::Value token)
2755 : token_(token) {
2756 ASSERT(Token::IsCompareOp(token));
2757 SetOperandAt(0, context);
2758 SetOperandAt(1, left);
2759 SetOperandAt(2, right);
2760 set_representation(Representation::Tagged());
2761 }
2762
2763 HValue* context() { return OperandAt(0); }
2764 HValue* left() { return OperandAt(1); }
2765 HValue* right() { return OperandAt(2); }
2766 Token::Value token() const { return token_; }
2767
2768 virtual void PrintDataTo(StringStream* stream);
2769
2770 virtual Representation RequiredInputRepresentation(int index) {
2771 return Representation::Tagged();
2772 }
2773
2774 Representation GetInputRepresentation() const {
2775 return Representation::Tagged();
2776 }
2777
2778 DECLARE_CONCRETE_INSTRUCTION(CompareGenericAndBranch)
2779
2780 private:
2781 Token::Value token_;
2782 };
2783
2784
2735 class HIsConstructCallAndBranch: public HTemplateControlInstruction<2, 0> { 2785 class HIsConstructCallAndBranch: public HTemplateControlInstruction<2, 0> {
2736 public: 2786 public:
2737 virtual Representation RequiredInputRepresentation(int index) { 2787 virtual Representation RequiredInputRepresentation(int index) {
2738 return Representation::None(); 2788 return Representation::None();
2739 } 2789 }
2740 2790
2741 DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch) 2791 DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch)
2742 }; 2792 };
2743 2793
2744 2794
(...skipping 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after
4297 4347
4298 DECLARE_CONCRETE_INSTRUCTION(In) 4348 DECLARE_CONCRETE_INSTRUCTION(In)
4299 }; 4349 };
4300 4350
4301 #undef DECLARE_INSTRUCTION 4351 #undef DECLARE_INSTRUCTION
4302 #undef DECLARE_CONCRETE_INSTRUCTION 4352 #undef DECLARE_CONCRETE_INSTRUCTION
4303 4353
4304 } } // namespace v8::internal 4354 } } // namespace v8::internal
4305 4355
4306 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 4356 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698