Index: src/hydrogen-instructions.h |
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
index a05fc776f848875e561e14e7c982229602b0134a..9203b3081657ffa7b60edbc8247bd64967fa573e 100644 |
--- a/src/hydrogen-instructions.h |
+++ b/src/hydrogen-instructions.h |
@@ -86,6 +86,7 @@ class LChunkBuilder; |
V(CheckFunction) \ |
V(CheckInstanceType) \ |
V(CheckMap) \ |
+ V(CheckMapSet) \ |
V(CheckNonSmi) \ |
V(CheckPrototypeMaps) \ |
V(CheckSmi) \ |
@@ -2050,6 +2051,43 @@ class HCheckMap: public HTemplateInstruction<2> { |
}; |
+class HCheckMapSet: public HTemplateInstruction<1> { |
danno
2012/03/09 11:52:58
Please merge with HCheckMap as discussed
Michael Starzinger
2012/03/12 11:37:11
Done. HCheckMap now works with a SmallMapList back
|
+ public: |
+ HCheckMapSet(HValue* value, SmallMapList* map_set) : map_set_(map_set) { |
+ map_set->Sort(); |
+ SetOperandAt(0, value); |
+ set_representation(Representation::Tagged()); |
+ SetFlag(kUseGVN); |
+ SetGVNFlag(kDependsOnMaps); |
+ SetGVNFlag(kDependsOnElementsKind); |
+ } |
+ |
+ virtual Representation RequiredInputRepresentation(int index) { |
+ return Representation::Tagged(); |
+ } |
+ virtual void PrintDataTo(StringStream* stream); |
+ |
+ HValue* value() { return OperandAt(0); } |
+ SmallMapList* map_set() const { return map_set_; } |
+ |
+ DECLARE_CONCRETE_INSTRUCTION(CheckMapSet) |
+ |
+ protected: |
+ virtual bool DataEquals(HValue* other) { |
danno
2012/03/09 11:52:58
Fast case single maps by just comparing b->map_set
Michael Starzinger
2012/03/12 11:37:11
The backing SmallMapList cannot be compared by ref
|
+ HCheckMapSet* b = HCheckMapSet::cast(other); |
+ // Relies on the fact that map_set has been sorted before. |
+ if (map_set_->length() != b->map_set()->length()) return false; |
+ for (int i = 0; i < map_set_->length(); i++) { |
+ if (!map_set_->at(i).is_identical_to(b->map_set()->at(i))) return false; |
+ } |
+ return true; |
+ } |
+ |
+ private: |
+ SmallMapList* map_set_; |
+}; |
+ |
+ |
class HCheckFunction: public HUnaryOperation { |
public: |
HCheckFunction(HValue* value, Handle<JSFunction> function) |