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

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

Issue 21014004: Add equality type parameter to HCompareObjectAndBranch (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 7 years, 4 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
« 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 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 27 matching lines...) Expand all
38 #include "string-stream.h" 38 #include "string-stream.h"
39 #include "v8conversions.h" 39 #include "v8conversions.h"
40 #include "v8utils.h" 40 #include "v8utils.h"
41 #include "zone.h" 41 #include "zone.h"
42 42
43 namespace v8 { 43 namespace v8 {
44 namespace internal { 44 namespace internal {
45 45
46 // Forward declarations. 46 // Forward declarations.
47 class HBasicBlock; 47 class HBasicBlock;
48 class HContext;
48 class HEnvironment; 49 class HEnvironment;
49 class HInferRepresentationPhase; 50 class HInferRepresentationPhase;
50 class HInstruction; 51 class HInstruction;
51 class HLoopInformation; 52 class HLoopInformation;
52 class HValue; 53 class HValue;
53 class LInstruction; 54 class LInstruction;
54 class LChunkBuilder; 55 class LChunkBuilder;
55 56
56 57
57 #define HYDROGEN_ABSTRACT_INSTRUCTION_LIST(V) \ 58 #define HYDROGEN_ABSTRACT_INSTRUCTION_LIST(V) \
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 V(CheckHeapObject) \ 93 V(CheckHeapObject) \
93 V(CheckInstanceType) \ 94 V(CheckInstanceType) \
94 V(CheckMaps) \ 95 V(CheckMaps) \
95 V(CheckMapValue) \ 96 V(CheckMapValue) \
96 V(CheckPrototypeMaps) \ 97 V(CheckPrototypeMaps) \
97 V(CheckSmi) \ 98 V(CheckSmi) \
98 V(ClampToUint8) \ 99 V(ClampToUint8) \
99 V(ClassOfTestAndBranch) \ 100 V(ClassOfTestAndBranch) \
100 V(CompareNumericAndBranch) \ 101 V(CompareNumericAndBranch) \
101 V(CompareGeneric) \ 102 V(CompareGeneric) \
102 V(CompareObjectEqAndBranch) \ 103 V(CompareObjectAndBranch) \
103 V(CompareMap) \ 104 V(CompareMap) \
104 V(Constant) \ 105 V(Constant) \
105 V(Context) \ 106 V(Context) \
106 V(DateField) \ 107 V(DateField) \
107 V(DebugBreak) \ 108 V(DebugBreak) \
108 V(DeclareGlobals) \ 109 V(DeclareGlobals) \
109 V(Deoptimize) \ 110 V(Deoptimize) \
110 V(Div) \ 111 V(Div) \
111 V(DummyUse) \ 112 V(DummyUse) \
112 V(ElementsKind) \ 113 V(ElementsKind) \
(...skipping 4047 matching lines...) Expand 10 before | Expand all | Expand 10 after
4160 virtual void AddInformativeDefinitions(); 4161 virtual void AddInformativeDefinitions();
4161 4162
4162 DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch) 4163 DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch)
4163 4164
4164 private: 4165 private:
4165 Representation observed_input_representation_[2]; 4166 Representation observed_input_representation_[2];
4166 Token::Value token_; 4167 Token::Value token_;
4167 }; 4168 };
4168 4169
4169 4170
4170 class HCompareObjectEqAndBranch: public HTemplateControlInstruction<2, 2> { 4171 class HCompareObjectAndBranch: public HTemplateControlInstruction<2, 2> {
4171 public: 4172 public:
4172 HCompareObjectEqAndBranch(HValue* left, HValue* right) { 4173 HCompareObjectAndBranch(HValue* left,
4174 HValue* right,
4175 Token::Value token = Token::EQ) {
4173 SetOperandAt(0, left); 4176 SetOperandAt(0, left);
4174 SetOperandAt(1, right); 4177 SetOperandAt(1, right);
4178 ASSERT(token == Token::EQ || token == Token::NE);
4179 token_ = token;
4175 } 4180 }
4176 4181
4177 HValue* left() { return OperandAt(0); } 4182 HValue* left() { return OperandAt(0); }
4178 HValue* right() { return OperandAt(1); } 4183 HValue* right() { return OperandAt(1); }
4184 Token::Value token() const { return token_; }
4179 4185
4180 virtual void PrintDataTo(StringStream* stream); 4186 virtual void PrintDataTo(StringStream* stream);
4181 4187
4182 virtual Representation RequiredInputRepresentation(int index) { 4188 virtual Representation RequiredInputRepresentation(int index) {
4183 return Representation::Tagged(); 4189 return Representation::Tagged();
4184 } 4190 }
4185 4191
4186 virtual Representation observed_input_representation(int index) { 4192 virtual Representation observed_input_representation(int index) {
4187 return Representation::Tagged(); 4193 return Representation::Tagged();
4188 } 4194 }
4189 4195
4190 DECLARE_CONCRETE_INSTRUCTION(CompareObjectEqAndBranch) 4196 bool is_equal() const { return token_ == Token::EQ; }
4197
4198 DECLARE_CONCRETE_INSTRUCTION(CompareObjectAndBranch)
4199
4200 private:
4201 Token::Value token_;
4191 }; 4202 };
4192 4203
4193 4204
4194 class HIsObjectAndBranch: public HUnaryControlInstruction { 4205 class HIsObjectAndBranch: public HUnaryControlInstruction {
4195 public: 4206 public:
4196 explicit HIsObjectAndBranch(HValue* value) 4207 explicit HIsObjectAndBranch(HValue* value)
4197 : HUnaryControlInstruction(value, NULL, NULL) { } 4208 : HUnaryControlInstruction(value, NULL, NULL) { }
4198 4209
4199 virtual Representation RequiredInputRepresentation(int index) { 4210 virtual Representation RequiredInputRepresentation(int index) {
4200 return Representation::Tagged(); 4211 return Representation::Tagged();
(...skipping 2725 matching lines...) Expand 10 before | Expand all | Expand 10 after
6926 virtual bool IsDeletable() const { return true; } 6937 virtual bool IsDeletable() const { return true; }
6927 }; 6938 };
6928 6939
6929 6940
6930 #undef DECLARE_INSTRUCTION 6941 #undef DECLARE_INSTRUCTION
6931 #undef DECLARE_CONCRETE_INSTRUCTION 6942 #undef DECLARE_CONCRETE_INSTRUCTION
6932 6943
6933 } } // namespace v8::internal 6944 } } // namespace v8::internal
6934 6945
6935 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 6946 #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