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

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

Issue 8426005: Merge IR classes for different bitwise operations AND, OR and XOR into one class. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' 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 | Annotate | Revision Log
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \ 61 #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \
62 V(AbnormalExit) \ 62 V(AbnormalExit) \
63 V(AccessArgumentsAt) \ 63 V(AccessArgumentsAt) \
64 V(Add) \ 64 V(Add) \
65 V(ApplyArguments) \ 65 V(ApplyArguments) \
66 V(ArgumentsElements) \ 66 V(ArgumentsElements) \
67 V(ArgumentsLength) \ 67 V(ArgumentsLength) \
68 V(ArgumentsObject) \ 68 V(ArgumentsObject) \
69 V(ArrayLiteral) \ 69 V(ArrayLiteral) \
70 V(BitAnd) \ 70 V(Bitwise) \
71 V(BitNot) \ 71 V(BitNot) \
72 V(BitOr) \
73 V(BitXor) \
74 V(BlockEntry) \ 72 V(BlockEntry) \
75 V(BoundsCheck) \ 73 V(BoundsCheck) \
76 V(Branch) \ 74 V(Branch) \
77 V(CallConstantFunction) \ 75 V(CallConstantFunction) \
78 V(CallFunction) \ 76 V(CallFunction) \
79 V(CallGlobal) \ 77 V(CallGlobal) \
80 V(CallKeyed) \ 78 V(CallKeyed) \
81 V(CallKnownGlobal) \ 79 V(CallKnownGlobal) \
82 V(CallNamed) \ 80 V(CallNamed) \
83 V(CallNew) \ 81 V(CallNew) \
(...skipping 2937 matching lines...) Expand 10 before | Expand all | Expand 10 after
3021 3019
3022 DECLARE_CONCRETE_INSTRUCTION(Div) 3020 DECLARE_CONCRETE_INSTRUCTION(Div)
3023 3021
3024 protected: 3022 protected:
3025 virtual bool DataEquals(HValue* other) { return true; } 3023 virtual bool DataEquals(HValue* other) { return true; }
3026 3024
3027 virtual Range* InferRange(); 3025 virtual Range* InferRange();
3028 }; 3026 };
3029 3027
3030 3028
3031 class HBitAnd: public HBitwiseBinaryOperation { 3029 class HBitwise: public HBitwiseBinaryOperation {
3032 public: 3030 public:
3033 HBitAnd(HValue* context, HValue* left, HValue* right) 3031 HBitwise(Token::Value op, HValue* context, HValue* left, HValue* right)
3034 : HBitwiseBinaryOperation(context, left, right) { } 3032 : HBitwiseBinaryOperation(context, left, right), op_(op) {
3033 ASSERT(op == Token::BIT_AND ||
3034 op == Token::BIT_OR ||
3035 op == Token::BIT_XOR);
3036 }
3037
3038 Token::Value op() const { return op_; }
3035 3039
3036 virtual bool IsCommutative() const { return true; } 3040 virtual bool IsCommutative() const { return true; }
3037 virtual HType CalculateInferredType();
3038 3041
3039 DECLARE_CONCRETE_INSTRUCTION(BitAnd) 3042 DECLARE_CONCRETE_INSTRUCTION(Bitwise)
3040 3043
3041 protected: 3044 protected:
3042 virtual bool DataEquals(HValue* other) { return true; } 3045 virtual bool DataEquals(HValue* other) { return true; }
3043 3046
3044 virtual Range* InferRange(); 3047 virtual Range* InferRange();
3045 };
3046 3048
3047 3049 private:
3048 class HBitXor: public HBitwiseBinaryOperation { 3050 Token::Value op_;
3049 public:
3050 HBitXor(HValue* context, HValue* left, HValue* right)
3051 : HBitwiseBinaryOperation(context, left, right) { }
3052
3053 virtual bool IsCommutative() const { return true; }
3054 virtual HType CalculateInferredType();
3055
3056 DECLARE_CONCRETE_INSTRUCTION(BitXor)
3057
3058 protected:
3059 virtual bool DataEquals(HValue* other) { return true; }
3060 };
3061
3062
3063 class HBitOr: public HBitwiseBinaryOperation {
3064 public:
3065 HBitOr(HValue* context, HValue* left, HValue* right)
3066 : HBitwiseBinaryOperation(context, left, right) { }
3067
3068 virtual bool IsCommutative() const { return true; }
3069 virtual HType CalculateInferredType();
3070
3071 DECLARE_CONCRETE_INSTRUCTION(BitOr)
3072
3073 protected:
3074 virtual bool DataEquals(HValue* other) { return true; }
3075
3076 virtual Range* InferRange();
3077 }; 3051 };
3078 3052
3079 3053
3080 class HShl: public HBitwiseBinaryOperation { 3054 class HShl: public HBitwiseBinaryOperation {
3081 public: 3055 public:
3082 HShl(HValue* context, HValue* left, HValue* right) 3056 HShl(HValue* context, HValue* left, HValue* right)
3083 : HBitwiseBinaryOperation(context, left, right) { } 3057 : HBitwiseBinaryOperation(context, left, right) { }
3084 3058
3085 virtual Range* InferRange(); 3059 virtual Range* InferRange();
3086 virtual HType CalculateInferredType();
3087 3060
3088 DECLARE_CONCRETE_INSTRUCTION(Shl) 3061 DECLARE_CONCRETE_INSTRUCTION(Shl)
3089 3062
3090 protected: 3063 protected:
3091 virtual bool DataEquals(HValue* other) { return true; } 3064 virtual bool DataEquals(HValue* other) { return true; }
3092 }; 3065 };
3093 3066
3094 3067
3095 class HShr: public HBitwiseBinaryOperation { 3068 class HShr: public HBitwiseBinaryOperation {
3096 public: 3069 public:
3097 HShr(HValue* context, HValue* left, HValue* right) 3070 HShr(HValue* context, HValue* left, HValue* right)
3098 : HBitwiseBinaryOperation(context, left, right) { } 3071 : HBitwiseBinaryOperation(context, left, right) { }
3099 3072
3100 virtual Range* InferRange(); 3073 virtual Range* InferRange();
3101 virtual HType CalculateInferredType();
3102 3074
3103 DECLARE_CONCRETE_INSTRUCTION(Shr) 3075 DECLARE_CONCRETE_INSTRUCTION(Shr)
3104 3076
3105 protected: 3077 protected:
3106 virtual bool DataEquals(HValue* other) { return true; } 3078 virtual bool DataEquals(HValue* other) { return true; }
3107 }; 3079 };
3108 3080
3109 3081
3110 class HSar: public HBitwiseBinaryOperation { 3082 class HSar: public HBitwiseBinaryOperation {
3111 public: 3083 public:
3112 HSar(HValue* context, HValue* left, HValue* right) 3084 HSar(HValue* context, HValue* left, HValue* right)
3113 : HBitwiseBinaryOperation(context, left, right) { } 3085 : HBitwiseBinaryOperation(context, left, right) { }
3114 3086
3115 virtual Range* InferRange(); 3087 virtual Range* InferRange();
3116 virtual HType CalculateInferredType();
3117 3088
3118 DECLARE_CONCRETE_INSTRUCTION(Sar) 3089 DECLARE_CONCRETE_INSTRUCTION(Sar)
3119 3090
3120 protected: 3091 protected:
3121 virtual bool DataEquals(HValue* other) { return true; } 3092 virtual bool DataEquals(HValue* other) { return true; }
3122 }; 3093 };
3123 3094
3124 3095
3125 class HOsrEntry: public HTemplateInstruction<0> { 3096 class HOsrEntry: public HTemplateInstruction<0> {
3126 public: 3097 public:
(...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after
4297 4268
4298 DECLARE_CONCRETE_INSTRUCTION(In) 4269 DECLARE_CONCRETE_INSTRUCTION(In)
4299 }; 4270 };
4300 4271
4301 #undef DECLARE_INSTRUCTION 4272 #undef DECLARE_INSTRUCTION
4302 #undef DECLARE_CONCRETE_INSTRUCTION 4273 #undef DECLARE_CONCRETE_INSTRUCTION
4303 4274
4304 } } // namespace v8::internal 4275 } } // namespace v8::internal
4305 4276
4306 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 4277 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698