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

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

Issue 300423003: Handle HCheckInstanceType and HIsStringAndBranch in check elimination. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 6 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
« no previous file with comments | « src/hydrogen-check-elimination.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ 5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_
6 #define V8_HYDROGEN_INSTRUCTIONS_H_ 6 #define V8_HYDROGEN_INSTRUCTIONS_H_
7 7
8 #include "v8.h" 8 #include "v8.h"
9 9
10 #include "allocation.h" 10 #include "allocation.h"
(...skipping 2889 matching lines...) Expand 10 before | Expand all | Expand 10 after
2900 UNREACHABLE(); 2900 UNREACHABLE();
2901 return HType::Tagged(); 2901 return HType::Tagged();
2902 } 2902 }
2903 2903
2904 virtual HValue* Canonicalize() V8_OVERRIDE; 2904 virtual HValue* Canonicalize() V8_OVERRIDE;
2905 2905
2906 bool is_interval_check() const { return check_ <= LAST_INTERVAL_CHECK; } 2906 bool is_interval_check() const { return check_ <= LAST_INTERVAL_CHECK; }
2907 void GetCheckInterval(InstanceType* first, InstanceType* last); 2907 void GetCheckInterval(InstanceType* first, InstanceType* last);
2908 void GetCheckMaskAndTag(uint8_t* mask, uint8_t* tag); 2908 void GetCheckMaskAndTag(uint8_t* mask, uint8_t* tag);
2909 2909
2910 Check check() const { return check_; }
2911
2910 DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType) 2912 DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType)
2911 2913
2912 protected: 2914 protected:
2913 // TODO(ager): It could be nice to allow the ommision of instance 2915 // TODO(ager): It could be nice to allow the ommision of instance
2914 // type checks if we have already performed an instance type check 2916 // type checks if we have already performed an instance type check
2915 // with a larger range. 2917 // with a larger range.
2916 virtual bool DataEquals(HValue* other) V8_OVERRIDE { 2918 virtual bool DataEquals(HValue* other) V8_OVERRIDE {
2917 HCheckInstanceType* b = HCheckInstanceType::cast(other); 2919 HCheckInstanceType* b = HCheckInstanceType::cast(other);
2918 return check_ == b->check_; 2920 return check_ == b->check_;
2919 } 2921 }
(...skipping 1496 matching lines...) Expand 10 before | Expand all | Expand 10 after
4416 DECLARE_INSTRUCTION_FACTORY_P1(HIsStringAndBranch, HValue*); 4418 DECLARE_INSTRUCTION_FACTORY_P1(HIsStringAndBranch, HValue*);
4417 DECLARE_INSTRUCTION_FACTORY_P3(HIsStringAndBranch, HValue*, 4419 DECLARE_INSTRUCTION_FACTORY_P3(HIsStringAndBranch, HValue*,
4418 HBasicBlock*, HBasicBlock*); 4420 HBasicBlock*, HBasicBlock*);
4419 4421
4420 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 4422 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
4421 return Representation::Tagged(); 4423 return Representation::Tagged();
4422 } 4424 }
4423 4425
4424 virtual bool KnownSuccessorBlock(HBasicBlock** block) V8_OVERRIDE; 4426 virtual bool KnownSuccessorBlock(HBasicBlock** block) V8_OVERRIDE;
4425 4427
4428 static const int kNoKnownSuccessorIndex = -1;
4429 int known_successor_index() const { return known_successor_index_; }
4430 void set_known_successor_index(int known_successor_index) {
4431 known_successor_index_ = known_successor_index;
4432 }
4433
4426 DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch) 4434 DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch)
4427 4435
4428 protected: 4436 protected:
4429 virtual int RedefinedOperandIndex() { return 0; } 4437 virtual int RedefinedOperandIndex() { return 0; }
4430 4438
4431 private: 4439 private:
4432 HIsStringAndBranch(HValue* value, 4440 HIsStringAndBranch(HValue* value,
4433 HBasicBlock* true_target = NULL, 4441 HBasicBlock* true_target = NULL,
4434 HBasicBlock* false_target = NULL) 4442 HBasicBlock* false_target = NULL)
4435 : HUnaryControlInstruction(value, true_target, false_target) {} 4443 : HUnaryControlInstruction(value, true_target, false_target),
4444 known_successor_index_(kNoKnownSuccessorIndex) { }
4445
4446 int known_successor_index_;
4436 }; 4447 };
4437 4448
4438 4449
4439 class HIsSmiAndBranch V8_FINAL : public HUnaryControlInstruction { 4450 class HIsSmiAndBranch V8_FINAL : public HUnaryControlInstruction {
4440 public: 4451 public:
4441 DECLARE_INSTRUCTION_FACTORY_P1(HIsSmiAndBranch, HValue*); 4452 DECLARE_INSTRUCTION_FACTORY_P1(HIsSmiAndBranch, HValue*);
4442 DECLARE_INSTRUCTION_FACTORY_P3(HIsSmiAndBranch, HValue*, 4453 DECLARE_INSTRUCTION_FACTORY_P3(HIsSmiAndBranch, HValue*,
4443 HBasicBlock*, HBasicBlock*); 4454 HBasicBlock*, HBasicBlock*);
4444 4455
4445 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch) 4456 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch)
(...skipping 3268 matching lines...) Expand 10 before | Expand all | Expand 10 after
7714 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7725 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7715 }; 7726 };
7716 7727
7717 7728
7718 #undef DECLARE_INSTRUCTION 7729 #undef DECLARE_INSTRUCTION
7719 #undef DECLARE_CONCRETE_INSTRUCTION 7730 #undef DECLARE_CONCRETE_INSTRUCTION
7720 7731
7721 } } // namespace v8::internal 7732 } } // namespace v8::internal
7722 7733
7723 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7734 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen-check-elimination.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698