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 57383004: Improve implementation of HSeqStringSetChar. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Increase GVNFlags to 64bit. Add StringChars flag. Created 7 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
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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 V(BackingStoreFields) \ 201 V(BackingStoreFields) \
202 V(Calls) \ 202 V(Calls) \
203 V(ContextSlots) \ 203 V(ContextSlots) \
204 V(DoubleArrayElements) \ 204 V(DoubleArrayElements) \
205 V(DoubleFields) \ 205 V(DoubleFields) \
206 V(ElementsKind) \ 206 V(ElementsKind) \
207 V(ElementsPointer) \ 207 V(ElementsPointer) \
208 V(GlobalVars) \ 208 V(GlobalVars) \
209 V(InobjectFields) \ 209 V(InobjectFields) \
210 V(OsrEntries) \ 210 V(OsrEntries) \
211 V(ExternalMemory) 211 V(ExternalMemory) \
212 V(StringChars)
212 213
213 214
214 #define DECLARE_ABSTRACT_INSTRUCTION(type) \ 215 #define DECLARE_ABSTRACT_INSTRUCTION(type) \
215 virtual bool Is##type() const V8_FINAL V8_OVERRIDE { return true; } \ 216 virtual bool Is##type() const V8_FINAL V8_OVERRIDE { return true; } \
216 static H##type* cast(HValue* value) { \ 217 static H##type* cast(HValue* value) { \
217 ASSERT(value->Is##type()); \ 218 ASSERT(value->Is##type()); \
218 return reinterpret_cast<H##type*>(value); \ 219 return reinterpret_cast<H##type*>(value); \
219 } 220 }
220 221
221 222
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 *a = *b; 536 *a = *b;
536 *b = c; 537 *b = c;
537 } 538 }
538 539
539 HValue* base_; 540 HValue* base_;
540 int offset_; 541 int offset_;
541 int scale_; 542 int scale_;
542 }; 543 };
543 544
544 545
545 typedef EnumSet<GVNFlag> GVNFlagSet; 546 typedef EnumSet<GVNFlag, int64_t> GVNFlagSet;
546 547
547 548
548 class HValue : public ZoneObject { 549 class HValue : public ZoneObject {
549 public: 550 public:
550 static const int kNoNumber = -1; 551 static const int kNoNumber = -1;
551 552
552 enum Flag { 553 enum Flag {
553 kFlexibleRepresentation, 554 kFlexibleRepresentation,
554 kCannotBeTagged, 555 kCannotBeTagged,
555 // Participate in Global Value Numbering, i.e. elimination of 556 // Participate in Global Value Numbering, i.e. elimination of
(...skipping 6187 matching lines...) Expand 10 before | Expand all | Expand 10 after
6743 } 6744 }
6744 6745
6745 private: 6746 private:
6746 HStringCharCodeAt(HValue* context, HValue* string, HValue* index) { 6747 HStringCharCodeAt(HValue* context, HValue* string, HValue* index) {
6747 SetOperandAt(0, context); 6748 SetOperandAt(0, context);
6748 SetOperandAt(1, string); 6749 SetOperandAt(1, string);
6749 SetOperandAt(2, index); 6750 SetOperandAt(2, index);
6750 set_representation(Representation::Integer32()); 6751 set_representation(Representation::Integer32());
6751 SetFlag(kUseGVN); 6752 SetFlag(kUseGVN);
6752 SetGVNFlag(kDependsOnMaps); 6753 SetGVNFlag(kDependsOnMaps);
6754 SetGVNFlag(kDependsOnStringChars);
6753 SetGVNFlag(kChangesNewSpacePromotion); 6755 SetGVNFlag(kChangesNewSpacePromotion);
6754 } 6756 }
6755 6757
6756 // No side effects: runtime function assumes string + number inputs. 6758 // No side effects: runtime function assumes string + number inputs.
6757 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 6759 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
6758 }; 6760 };
6759 6761
6760 6762
6761 class HStringCharFromCode V8_FINAL : public HTemplateInstruction<2> { 6763 class HStringCharFromCode V8_FINAL : public HTemplateInstruction<2> {
6762 public: 6764 public:
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
7040 7042
7041 private: 7043 private:
7042 HSeqStringSetChar(String::Encoding encoding, 7044 HSeqStringSetChar(String::Encoding encoding,
7043 HValue* string, 7045 HValue* string,
7044 HValue* index, 7046 HValue* index,
7045 HValue* value) : encoding_(encoding) { 7047 HValue* value) : encoding_(encoding) {
7046 SetOperandAt(0, string); 7048 SetOperandAt(0, string);
7047 SetOperandAt(1, index); 7049 SetOperandAt(1, index);
7048 SetOperandAt(2, value); 7050 SetOperandAt(2, value);
7049 set_representation(Representation::Tagged()); 7051 set_representation(Representation::Tagged());
7052 SetGVNFlag(kChangesStringChars);
7050 } 7053 }
7051 7054
7052 String::Encoding encoding_; 7055 String::Encoding encoding_;
7053 }; 7056 };
7054 7057
7055 7058
7056 class HCheckMapValue V8_FINAL : public HTemplateInstruction<2> { 7059 class HCheckMapValue V8_FINAL : public HTemplateInstruction<2> {
7057 public: 7060 public:
7058 DECLARE_INSTRUCTION_FACTORY_P2(HCheckMapValue, HValue*, HValue*); 7061 DECLARE_INSTRUCTION_FACTORY_P2(HCheckMapValue, HValue*, HValue*);
7059 7062
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
7190 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7193 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7191 }; 7194 };
7192 7195
7193 7196
7194 #undef DECLARE_INSTRUCTION 7197 #undef DECLARE_INSTRUCTION
7195 #undef DECLARE_CONCRETE_INSTRUCTION 7198 #undef DECLARE_CONCRETE_INSTRUCTION
7196 7199
7197 } } // namespace v8::internal 7200 } } // namespace v8::internal
7198 7201
7199 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7202 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698