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

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

Issue 24366004: Split HCompareGeneric in a test and a branch part. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 months 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
OLDNEW
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 V(BinaryOperation) \ 60 V(BinaryOperation) \
61 V(BitwiseBinaryOperation) \ 61 V(BitwiseBinaryOperation) \
62 V(ControlInstruction) \ 62 V(ControlInstruction) \
63 V(Instruction) \ 63 V(Instruction) \
64 64
65 65
66 #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \ 66 #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \
67 V(AccessArgumentsAt) \ 67 V(AccessArgumentsAt) \
68 V(Add) \ 68 V(Add) \
69 V(Allocate) \ 69 V(Allocate) \
70 V(AndBranch) \
70 V(ApplyArguments) \ 71 V(ApplyArguments) \
71 V(ArgumentsElements) \ 72 V(ArgumentsElements) \
72 V(ArgumentsLength) \ 73 V(ArgumentsLength) \
73 V(ArgumentsObject) \ 74 V(ArgumentsObject) \
74 V(Bitwise) \ 75 V(Bitwise) \
75 V(BlockEntry) \ 76 V(BlockEntry) \
76 V(BoundsCheck) \ 77 V(BoundsCheck) \
77 V(BoundsCheckBaseIndexInformation) \ 78 V(BoundsCheckBaseIndexInformation) \
78 V(Branch) \ 79 V(Branch) \
79 V(CallConstantFunction) \ 80 V(CallConstantFunction) \
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 void InternalSetOperandAt(int i, HValue* value) V8_OVERRIDE { 1191 void InternalSetOperandAt(int i, HValue* value) V8_OVERRIDE {
1191 inputs_[i] = value; 1192 inputs_[i] = value;
1192 } 1193 }
1193 1194
1194 private: 1195 private:
1195 EmbeddedContainer<HBasicBlock*, S> successors_; 1196 EmbeddedContainer<HBasicBlock*, S> successors_;
1196 EmbeddedContainer<HValue*, V> inputs_; 1197 EmbeddedContainer<HValue*, V> inputs_;
1197 }; 1198 };
1198 1199
1199 1200
1201 class HConstant;
1202
1203
1204 class HAndBranch V8_FINAL : public HTemplateControlInstruction<2, 1> {
1205 public:
1206 DECLARE_INSTRUCTION_FACTORY_P2(HAndBranch,
1207 HValue*,
1208 Token::Value);
1209
1210 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
1211 return Representation::Smi();
1212 }
1213
1214 HValue* value() { return OperandAt(0); }
1215 Token::Value op() { return op_; }
1216
1217 DECLARE_CONCRETE_INSTRUCTION(AndBranch);
1218
1219 private:
1220 HAndBranch(HValue* value, Token::Value op) : op_(op) {
1221 ASSERT(value->representation().IsSmi());
1222 SetOperandAt(0, value);
1223 }
1224
1225 Token::Value op_;
1226 };
1227
1228
1200 class HBlockEntry V8_FINAL : public HTemplateInstruction<0> { 1229 class HBlockEntry V8_FINAL : public HTemplateInstruction<0> {
1201 public: 1230 public:
1202 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 1231 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
1203 return Representation::None(); 1232 return Representation::None();
1204 } 1233 }
1205 1234
1206 DECLARE_CONCRETE_INSTRUCTION(BlockEntry) 1235 DECLARE_CONCRETE_INSTRUCTION(BlockEntry)
1207 }; 1236 };
1208 1237
1209 1238
(...skipping 2726 matching lines...) Expand 10 before | Expand all | Expand 10 after
3936 3965
3937 class HCompareGeneric V8_FINAL : public HBinaryOperation { 3966 class HCompareGeneric V8_FINAL : public HBinaryOperation {
3938 public: 3967 public:
3939 HCompareGeneric(HValue* context, 3968 HCompareGeneric(HValue* context,
3940 HValue* left, 3969 HValue* left,
3941 HValue* right, 3970 HValue* right,
3942 Token::Value token) 3971 Token::Value token)
3943 : HBinaryOperation(context, left, right, HType::Boolean()), 3972 : HBinaryOperation(context, left, right, HType::Boolean()),
3944 token_(token) { 3973 token_(token) {
3945 ASSERT(Token::IsCompareOp(token)); 3974 ASSERT(Token::IsCompareOp(token));
3946 set_representation(Representation::Tagged()); 3975 set_representation(Representation::Smi());
3947 SetAllSideEffects(); 3976 SetAllSideEffects();
3948 } 3977 }
3949 3978
3950 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 3979 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
3951 return index == 0 3980 return Representation::Tagged();
3952 ? Representation::Tagged()
3953 : representation();
3954 } 3981 }
3955 3982
3956 Token::Value token() const { return token_; } 3983 Token::Value token() const { return token_; }
3957 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; 3984 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
3958 3985
3959 DECLARE_CONCRETE_INSTRUCTION(CompareGeneric) 3986 DECLARE_CONCRETE_INSTRUCTION(CompareGeneric)
3960 3987
3961 private: 3988 private:
3962 Token::Value token_; 3989 Token::Value token_;
3963 }; 3990 };
(...skipping 3035 matching lines...) Expand 10 before | Expand all | Expand 10 after
6999 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7026 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7000 }; 7027 };
7001 7028
7002 7029
7003 #undef DECLARE_INSTRUCTION 7030 #undef DECLARE_INSTRUCTION
7004 #undef DECLARE_CONCRETE_INSTRUCTION 7031 #undef DECLARE_CONCRETE_INSTRUCTION
7005 7032
7006 } } // namespace v8::internal 7033 } } // namespace v8::internal
7007 7034
7008 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7035 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698