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

Unified Diff: src/hydrogen-instructions.h

Issue 9616014: Improve polymorphic loads on single slots. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix two minor issues. Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
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)
« src/hydrogen.cc ('K') | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698