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

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

Issue 7003054: Fix bug with GVN on array loads. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: fixed performance regression Created 9 years, 6 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 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 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 } 588 }
589 589
590 bool IsDefinedAfter(HBasicBlock* other) const; 590 bool IsDefinedAfter(HBasicBlock* other) const;
591 591
592 // Operands. 592 // Operands.
593 virtual int OperandCount() = 0; 593 virtual int OperandCount() = 0;
594 virtual HValue* OperandAt(int index) = 0; 594 virtual HValue* OperandAt(int index) = 0;
595 void SetOperandAt(int index, HValue* value); 595 void SetOperandAt(int index, HValue* value);
596 596
597 void DeleteAndReplaceWith(HValue* other); 597 void DeleteAndReplaceWith(HValue* other);
598 void ReplaceAllUsesWith(HValue* other);
598 bool HasNoUses() const { return use_list_ == NULL; } 599 bool HasNoUses() const { return use_list_ == NULL; }
599 bool HasMultipleUses() const { 600 bool HasMultipleUses() const {
600 return use_list_ != NULL && use_list_->tail() != NULL; 601 return use_list_ != NULL && use_list_->tail() != NULL;
601 } 602 }
602 int UseCount() const; 603 int UseCount() const;
603 void ClearOperands(); 604 void ClearOperands();
604 605
605 int flags() const { return flags_; } 606 int flags() const { return flags_; }
606 void SetFlag(Flag f) { flags_ |= (1 << f); } 607 void SetFlag(Flag f) { flags_ |= (1 << f); }
607 void ClearFlag(Flag f) { flags_ &= ~(1 << f); } 608 void ClearFlag(Flag f) { flags_ &= ~(1 << f); }
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 private: 678 private:
678 // A flag mask to mark an instruction as having arbitrary side effects. 679 // A flag mask to mark an instruction as having arbitrary side effects.
679 static int AllSideEffects() { 680 static int AllSideEffects() {
680 return ChangesFlagsMask() & ~(1 << kChangesOsrEntries); 681 return ChangesFlagsMask() & ~(1 << kChangesOsrEntries);
681 } 682 }
682 683
683 // Remove the matching use from the use list if present. Returns the 684 // Remove the matching use from the use list if present. Returns the
684 // removed list node or NULL. 685 // removed list node or NULL.
685 HUseListNode* RemoveUse(HValue* value, int index); 686 HUseListNode* RemoveUse(HValue* value, int index);
686 687
687 void ReplaceAllUsesWith(HValue* other);
688
689 void RegisterUse(int index, HValue* new_value); 688 void RegisterUse(int index, HValue* new_value);
690 689
691 HBasicBlock* block_; 690 HBasicBlock* block_;
692 691
693 // The id of this instruction in the hydrogen graph, assigned when first 692 // The id of this instruction in the hydrogen graph, assigned when first
694 // added to the graph. Reflects creation order. 693 // added to the graph. Reflects creation order.
695 int id_; 694 int id_;
696 695
697 Representation representation_; 696 Representation representation_;
698 HType type_; 697 HType type_;
(...skipping 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after
2396 DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt) 2395 DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt)
2397 2396
2398 virtual bool DataEquals(HValue* other) { return true; } 2397 virtual bool DataEquals(HValue* other) { return true; }
2399 }; 2398 };
2400 2399
2401 2400
2402 class HBoundsCheck: public HBinaryOperation { 2401 class HBoundsCheck: public HBinaryOperation {
2403 public: 2402 public:
2404 HBoundsCheck(HValue* index, HValue* length) 2403 HBoundsCheck(HValue* index, HValue* length)
2405 : HBinaryOperation(index, length) { 2404 : HBinaryOperation(index, length) {
2405 set_representation(Representation::Integer32());
2406 SetFlag(kUseGVN); 2406 SetFlag(kUseGVN);
2407 } 2407 }
2408 2408
2409 virtual Representation RequiredInputRepresentation(int index) const { 2409 virtual Representation RequiredInputRepresentation(int index) const {
2410 return Representation::Integer32(); 2410 return Representation::Integer32();
2411 } 2411 }
2412 2412
2413 #ifdef DEBUG 2413 #ifdef DEBUG
2414 virtual void Verify(); 2414 virtual void Verify();
2415 #endif 2415 #endif
(...skipping 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after
4029 4029
4030 DECLARE_CONCRETE_INSTRUCTION(In) 4030 DECLARE_CONCRETE_INSTRUCTION(In)
4031 }; 4031 };
4032 4032
4033 #undef DECLARE_INSTRUCTION 4033 #undef DECLARE_INSTRUCTION
4034 #undef DECLARE_CONCRETE_INSTRUCTION 4034 #undef DECLARE_CONCRETE_INSTRUCTION
4035 4035
4036 } } // namespace v8::internal 4036 } } // namespace v8::internal
4037 4037
4038 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 4038 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | src/hydrogen-instructions.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698