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

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

Issue 12035026: Allow removal of obsolete map checks after transitions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 11 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 | « no previous file | 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 // 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 V(UseConst) \ 186 V(UseConst) \
187 V(ValueOf) \ 187 V(ValueOf) \
188 V(ForInPrepareMap) \ 188 V(ForInPrepareMap) \
189 V(ForInCacheArray) \ 189 V(ForInCacheArray) \
190 V(CheckMapValue) \ 190 V(CheckMapValue) \
191 V(LoadFieldByIndex) \ 191 V(LoadFieldByIndex) \
192 V(DateField) \ 192 V(DateField) \
193 V(WrapReceiver) 193 V(WrapReceiver)
194 194
195 #define GVN_TRACKED_FLAG_LIST(V) \ 195 #define GVN_TRACKED_FLAG_LIST(V) \
196 V(Maps) \
196 V(NewSpacePromotion) 197 V(NewSpacePromotion)
197 198
198 #define GVN_UNTRACKED_FLAG_LIST(V) \ 199 #define GVN_UNTRACKED_FLAG_LIST(V) \
199 V(Calls) \ 200 V(Calls) \
200 V(InobjectFields) \ 201 V(InobjectFields) \
201 V(BackingStoreFields) \ 202 V(BackingStoreFields) \
202 V(ElementsKind) \ 203 V(ElementsKind) \
203 V(ElementsPointer) \ 204 V(ElementsPointer) \
204 V(ArrayElements) \ 205 V(ArrayElements) \
205 V(DoubleArrayElements) \ 206 V(DoubleArrayElements) \
206 V(SpecializedArrayElements) \ 207 V(SpecializedArrayElements) \
207 V(GlobalVars) \ 208 V(GlobalVars) \
208 V(Maps) \
209 V(ArrayLengths) \ 209 V(ArrayLengths) \
210 V(ContextSlots) \ 210 V(ContextSlots) \
211 V(OsrEntries) 211 V(OsrEntries)
212 212
213 #define DECLARE_ABSTRACT_INSTRUCTION(type) \ 213 #define DECLARE_ABSTRACT_INSTRUCTION(type) \
214 virtual bool Is##type() const { return true; } \ 214 virtual bool Is##type() const { return true; } \
215 static H##type* cast(HValue* value) { \ 215 static H##type* cast(HValue* value) { \
216 ASSERT(value->Is##type()); \ 216 ASSERT(value->Is##type()); \
217 return reinterpret_cast<H##type*>(value); \ 217 return reinterpret_cast<H##type*>(value); \
218 } 218 }
(...skipping 2022 matching lines...) Expand 10 before | Expand all | Expand 10 after
2241 class HCheckMaps: public HTemplateInstruction<2> { 2241 class HCheckMaps: public HTemplateInstruction<2> {
2242 public: 2242 public:
2243 HCheckMaps(HValue* value, Handle<Map> map, Zone* zone, 2243 HCheckMaps(HValue* value, Handle<Map> map, Zone* zone,
2244 HValue* typecheck = NULL) { 2244 HValue* typecheck = NULL) {
2245 SetOperandAt(0, value); 2245 SetOperandAt(0, value);
2246 // If callers don't depend on a typecheck, they can pass in NULL. In that 2246 // If callers don't depend on a typecheck, they can pass in NULL. In that
2247 // case we use a copy of the |value| argument as a dummy value. 2247 // case we use a copy of the |value| argument as a dummy value.
2248 SetOperandAt(1, typecheck != NULL ? typecheck : value); 2248 SetOperandAt(1, typecheck != NULL ? typecheck : value);
2249 set_representation(Representation::Tagged()); 2249 set_representation(Representation::Tagged());
2250 SetFlag(kUseGVN); 2250 SetFlag(kUseGVN);
2251 SetFlag(kTrackSideEffectDominators);
2251 SetGVNFlag(kDependsOnMaps); 2252 SetGVNFlag(kDependsOnMaps);
2252 SetGVNFlag(kDependsOnElementsKind); 2253 SetGVNFlag(kDependsOnElementsKind);
2253 map_set()->Add(map, zone); 2254 map_set()->Add(map, zone);
2254 } 2255 }
2255 HCheckMaps(HValue* value, SmallMapList* maps, Zone* zone) { 2256 HCheckMaps(HValue* value, SmallMapList* maps, Zone* zone) {
2256 SetOperandAt(0, value); 2257 SetOperandAt(0, value);
2257 SetOperandAt(1, value); 2258 SetOperandAt(1, value);
2258 set_representation(Representation::Tagged()); 2259 set_representation(Representation::Tagged());
2259 SetFlag(kUseGVN); 2260 SetFlag(kUseGVN);
2261 SetFlag(kTrackSideEffectDominators);
2260 SetGVNFlag(kDependsOnMaps); 2262 SetGVNFlag(kDependsOnMaps);
2261 SetGVNFlag(kDependsOnElementsKind); 2263 SetGVNFlag(kDependsOnElementsKind);
2262 for (int i = 0; i < maps->length(); i++) { 2264 for (int i = 0; i < maps->length(); i++) {
2263 map_set()->Add(maps->at(i), zone); 2265 map_set()->Add(maps->at(i), zone);
2264 } 2266 }
2265 map_set()->Sort(); 2267 map_set()->Sort();
2266 } 2268 }
2267 2269
2268 static HCheckMaps* NewWithTransitions(HValue* object, Handle<Map> map, 2270 static HCheckMaps* NewWithTransitions(HValue* object, Handle<Map> map,
2269 Zone* zone) { 2271 Zone* zone) {
(...skipping 14 matching lines...) Expand all
2284 map_set->Add(Handle<Map>(transitioned_map), zone); 2286 map_set->Add(Handle<Map>(transitioned_map), zone);
2285 } 2287 }
2286 }; 2288 };
2287 map_set->Sort(); 2289 map_set->Sort();
2288 return check_map; 2290 return check_map;
2289 } 2291 }
2290 2292
2291 virtual Representation RequiredInputRepresentation(int index) { 2293 virtual Representation RequiredInputRepresentation(int index) {
2292 return Representation::Tagged(); 2294 return Representation::Tagged();
2293 } 2295 }
2294 2296 virtual void SetSideEffectDominator(GVNFlag side_effect, HValue* dominator);
2295 virtual void PrintDataTo(StringStream* stream); 2297 virtual void PrintDataTo(StringStream* stream);
2296 virtual HType CalculateInferredType(); 2298 virtual HType CalculateInferredType();
2297 2299
2298 HValue* value() { return OperandAt(0); } 2300 HValue* value() { return OperandAt(0); }
2299 SmallMapList* map_set() { return &map_set_; } 2301 SmallMapList* map_set() { return &map_set_; }
2300 2302
2301 DECLARE_CONCRETE_INSTRUCTION(CheckMaps) 2303 DECLARE_CONCRETE_INSTRUCTION(CheckMaps)
2302 2304
2303 protected: 2305 protected:
2304 virtual bool DataEquals(HValue* other) { 2306 virtual bool DataEquals(HValue* other) {
(...skipping 3198 matching lines...) Expand 10 before | Expand all | Expand 10 after
5503 virtual bool IsDeletable() const { return true; } 5505 virtual bool IsDeletable() const { return true; }
5504 }; 5506 };
5505 5507
5506 5508
5507 #undef DECLARE_INSTRUCTION 5509 #undef DECLARE_INSTRUCTION
5508 #undef DECLARE_CONCRETE_INSTRUCTION 5510 #undef DECLARE_CONCRETE_INSTRUCTION
5509 5511
5510 } } // namespace v8::internal 5512 } } // namespace v8::internal
5511 5513
5512 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 5514 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698