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

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

Issue 19541003: Consistently use HStringAdd instead of HCallStub with CodeStub::StringAdd. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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 6163 matching lines...) Expand 10 before | Expand all | Expand 10 after
6174 ElementsKind from_kind_; 6174 ElementsKind from_kind_;
6175 ElementsKind to_kind_; 6175 ElementsKind to_kind_;
6176 }; 6176 };
6177 6177
6178 6178
6179 class HStringAdd: public HBinaryOperation { 6179 class HStringAdd: public HBinaryOperation {
6180 public: 6180 public:
6181 static HInstruction* New(Zone* zone, 6181 static HInstruction* New(Zone* zone,
6182 HValue* context, 6182 HValue* context,
6183 HValue* left, 6183 HValue* left,
6184 HValue* right); 6184 HValue* right,
6185 StringAddFlags flags = NO_STRING_CHECK_IN_STUB);
6186
6187 StringAddFlags flags() const { return flags_; }
6185 6188
6186 virtual Representation RequiredInputRepresentation(int index) { 6189 virtual Representation RequiredInputRepresentation(int index) {
6187 return Representation::Tagged(); 6190 return Representation::Tagged();
6188 } 6191 }
6189 6192
6190 virtual HType CalculateInferredType() { 6193 virtual HType CalculateInferredType() {
6191 return HType::String(); 6194 return HType::String();
6192 } 6195 }
6193 6196
6194 DECLARE_CONCRETE_INSTRUCTION(StringAdd) 6197 DECLARE_CONCRETE_INSTRUCTION(StringAdd)
6195 6198
6196 protected: 6199 protected:
6197 virtual bool DataEquals(HValue* other) { return true; } 6200 virtual bool DataEquals(HValue* other) { return true; }
6198 6201
6199
6200 private: 6202 private:
6201 HStringAdd(HValue* context, HValue* left, HValue* right) 6203 HStringAdd(HValue* context, HValue* left, HValue* right, StringAddFlags flags)
6202 : HBinaryOperation(context, left, right) { 6204 : HBinaryOperation(context, left, right), flags_(flags) {
6203 set_representation(Representation::Tagged()); 6205 set_representation(Representation::Tagged());
6204 SetFlag(kUseGVN); 6206 SetFlag(kUseGVN);
6205 SetGVNFlag(kDependsOnMaps); 6207 SetGVNFlag(kDependsOnMaps);
6206 SetGVNFlag(kChangesNewSpacePromotion); 6208 SetGVNFlag(kChangesNewSpacePromotion);
6207 } 6209 }
6208 6210
6209 // TODO(svenpanne) Might be safe, but leave it out until we know for sure. 6211 // TODO(svenpanne) Might be safe, but leave it out until we know for sure.
6210 // virtual bool IsDeletable() const { return true; } 6212 // virtual bool IsDeletable() const { return true; }
6213
6214 const StringAddFlags flags_;
6211 }; 6215 };
6212 6216
6213 6217
6214 class HStringCharCodeAt: public HTemplateInstruction<3> { 6218 class HStringCharCodeAt: public HTemplateInstruction<3> {
6215 public: 6219 public:
6216 HStringCharCodeAt(HValue* context, HValue* string, HValue* index) { 6220 HStringCharCodeAt(HValue* context, HValue* string, HValue* index) {
6217 SetOperandAt(0, context); 6221 SetOperandAt(0, context);
6218 SetOperandAt(1, string); 6222 SetOperandAt(1, string);
6219 SetOperandAt(2, index); 6223 SetOperandAt(2, index);
6220 set_representation(Representation::Integer32()); 6224 set_representation(Representation::Integer32());
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
6681 virtual bool IsDeletable() const { return true; } 6685 virtual bool IsDeletable() const { return true; }
6682 }; 6686 };
6683 6687
6684 6688
6685 #undef DECLARE_INSTRUCTION 6689 #undef DECLARE_INSTRUCTION
6686 #undef DECLARE_CONCRETE_INSTRUCTION 6690 #undef DECLARE_CONCRETE_INSTRUCTION
6687 6691
6688 } } // namespace v8::internal 6692 } } // namespace v8::internal
6689 6693
6690 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 6694 #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