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

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

Issue 6708085: Enable GVN for polymorphic loads by not expanding them at the HIR level. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 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 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 V(LeaveInlined) \ 120 V(LeaveInlined) \
121 V(LoadContextSlot) \ 121 V(LoadContextSlot) \
122 V(LoadElements) \ 122 V(LoadElements) \
123 V(LoadExternalArrayPointer) \ 123 V(LoadExternalArrayPointer) \
124 V(LoadFunctionPrototype) \ 124 V(LoadFunctionPrototype) \
125 V(LoadGlobal) \ 125 V(LoadGlobal) \
126 V(LoadKeyedFastElement) \ 126 V(LoadKeyedFastElement) \
127 V(LoadKeyedGeneric) \ 127 V(LoadKeyedGeneric) \
128 V(LoadNamedField) \ 128 V(LoadNamedField) \
129 V(LoadNamedGeneric) \ 129 V(LoadNamedGeneric) \
130 V(LoadNamedFieldPolymorphic) \
130 V(LoadPixelArrayElement) \ 131 V(LoadPixelArrayElement) \
131 V(Mod) \ 132 V(Mod) \
132 V(Mul) \ 133 V(Mul) \
133 V(ObjectLiteral) \ 134 V(ObjectLiteral) \
134 V(OsrEntry) \ 135 V(OsrEntry) \
135 V(OuterContext) \ 136 V(OuterContext) \
136 V(Parameter) \ 137 V(Parameter) \
137 V(Power) \ 138 V(Power) \
138 V(PushArgument) \ 139 V(PushArgument) \
139 V(RegExpLiteral) \ 140 V(RegExpLiteral) \
(...skipping 2824 matching lines...) Expand 10 before | Expand all | Expand 10 after
2964 HLoadNamedField* b = HLoadNamedField::cast(other); 2965 HLoadNamedField* b = HLoadNamedField::cast(other);
2965 return is_in_object_ == b->is_in_object_ && offset_ == b->offset_; 2966 return is_in_object_ == b->is_in_object_ && offset_ == b->offset_;
2966 } 2967 }
2967 2968
2968 private: 2969 private:
2969 bool is_in_object_; 2970 bool is_in_object_;
2970 int offset_; 2971 int offset_;
2971 }; 2972 };
2972 2973
2973 2974
2975 class HLoadNamedFieldPolymorphic: public HUnaryOperation {
2976 public:
2977 HLoadNamedFieldPolymorphic(HValue* object,
2978 ZoneMapList* types,
2979 Handle<String> name);
2980
2981 HValue* object() { return OperandAt(0); }
2982 ZoneMapList* types() { return &types_; }
2983 Handle<String> name() { return name_; }
2984 bool need_generic() { return need_generic_; }
2985
2986 virtual Representation RequiredInputRepresentation(int index) const {
2987 return Representation::Tagged();
2988 }
2989
2990 DECLARE_CONCRETE_INSTRUCTION(LoadNamedFieldPolymorphic,
2991 "load_named_field_polymorphic")
2992
2993 static const int kMaxLoadPolymorphism = 4;
2994
2995 protected:
2996 virtual bool DataEquals(HValue* value);
2997
2998 private:
2999 ZoneMapList types_;
3000 Handle<String> name_;
3001 bool need_generic_;
3002 };
3003
3004
3005
2974 class HLoadNamedGeneric: public HBinaryOperation { 3006 class HLoadNamedGeneric: public HBinaryOperation {
2975 public: 3007 public:
2976 HLoadNamedGeneric(HValue* context, HValue* object, Handle<Object> name) 3008 HLoadNamedGeneric(HValue* context, HValue* object, Handle<Object> name)
2977 : HBinaryOperation(context, object), name_(name) { 3009 : HBinaryOperation(context, object), name_(name) {
2978 set_representation(Representation::Tagged()); 3010 set_representation(Representation::Tagged());
2979 SetAllSideEffects(); 3011 SetAllSideEffects();
2980 } 3012 }
2981 3013
2982 HValue* context() { return OperandAt(0); } 3014 HValue* context() { return OperandAt(0); }
2983 HValue* object() { return OperandAt(1); } 3015 HValue* object() { return OperandAt(1); }
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
3521 HValue* object() { return left(); } 3553 HValue* object() { return left(); }
3522 HValue* key() { return right(); } 3554 HValue* key() { return right(); }
3523 }; 3555 };
3524 3556
3525 #undef DECLARE_INSTRUCTION 3557 #undef DECLARE_INSTRUCTION
3526 #undef DECLARE_CONCRETE_INSTRUCTION 3558 #undef DECLARE_CONCRETE_INSTRUCTION
3527 3559
3528 } } // namespace v8::internal 3560 } } // namespace v8::internal
3529 3561
3530 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 3562 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698