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

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

Issue 5971003: Fix GVN for polymorphic loads.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years 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
« src/hydrogen.cc ('K') | « src/hydrogen.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 2531 matching lines...) Expand 10 before | Expand all | Expand 10 after
2542 return cell_.is_identical_to(b->cell()); 2542 return cell_.is_identical_to(b->cell());
2543 } 2543 }
2544 2544
2545 private: 2545 private:
2546 Handle<JSGlobalPropertyCell> cell_; 2546 Handle<JSGlobalPropertyCell> cell_;
2547 }; 2547 };
2548 2548
2549 2549
2550 class HLoadNamedField: public HUnaryOperation { 2550 class HLoadNamedField: public HUnaryOperation {
2551 public: 2551 public:
2552 HLoadNamedField(HValue* object, bool is_in_object, int offset) 2552 HLoadNamedField(HValue* object, bool is_in_object, int offset)
Kevin Millikin (Chromium) 2010/12/20 12:34:34 I'd rather pass is_polymorphic to the constructor
2553 : HUnaryOperation(object), 2553 : HUnaryOperation(object),
2554 is_in_object_(is_in_object), 2554 is_in_object_(is_in_object),
2555 offset_(offset) { 2555 offset_(offset),
2556 is_polymorphic_(false) {
2556 set_representation(Representation::Tagged()); 2557 set_representation(Representation::Tagged());
2557 SetFlag(kUseGVN); 2558 SetFlag(kUseGVN);
2558 if (is_in_object) { 2559 if (is_in_object) {
2559 SetFlag(kDependsOnInobjectFields); 2560 SetFlag(kDependsOnInobjectFields);
2560 } else { 2561 } else {
2561 SetFlag(kDependsOnBackingStoreFields); 2562 SetFlag(kDependsOnBackingStoreFields);
2562 } 2563 }
2563 } 2564 }
2564 2565
2565 HValue* object() const { return OperandAt(0); } 2566 HValue* object() const { return OperandAt(0); }
2566 bool is_in_object() const { return is_in_object_; } 2567 bool is_in_object() const { return is_in_object_; }
2567 int offset() const { return offset_; } 2568 int offset() const { return offset_; }
2568 2569
2570 bool is_polymorphic() const { return is_polymorphic_; }
2571 void set_is_polymorphic(bool b) { is_polymorphic_ = b; }
2572
2569 virtual Representation RequiredInputRepresentation(int index) const { 2573 virtual Representation RequiredInputRepresentation(int index) const {
2570 return Representation::Tagged(); 2574 return Representation::Tagged();
2571 } 2575 }
2572 virtual void PrintDataTo(StringStream* stream) const; 2576 virtual void PrintDataTo(StringStream* stream) const;
2573 2577
2574 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load_named_field") 2578 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load_named_field")
2575 2579
2576 protected: 2580 protected:
2577 virtual bool DataEquals(HValue* other) const { 2581 virtual bool DataEquals(HValue* other) const {
2578 HLoadNamedField* b = HLoadNamedField::cast(other); 2582 HLoadNamedField* b = HLoadNamedField::cast(other);
2579 return is_in_object_ == b->is_in_object_ && offset_ == b->offset_; 2583 return is_in_object_ == b->is_in_object_ && offset_ == b->offset_;
2580 } 2584 }
2581 2585
2582 private: 2586 private:
2583 bool is_in_object_; 2587 bool is_in_object_;
2584 int offset_; 2588 int offset_;
2589 bool is_polymorphic_;
2585 }; 2590 };
2586 2591
2587 2592
2588 class HLoadNamedGeneric: public HUnaryOperation { 2593 class HLoadNamedGeneric: public HUnaryOperation {
2589 public: 2594 public:
2590 HLoadNamedGeneric(HValue* object, Handle<Object> name) 2595 HLoadNamedGeneric(HValue* object, Handle<Object> name)
2591 : HUnaryOperation(object), name_(name) { 2596 : HUnaryOperation(object), name_(name) {
2592 set_representation(Representation::Tagged()); 2597 set_representation(Representation::Tagged());
2593 SetFlagMask(AllSideEffects()); 2598 SetFlagMask(AllSideEffects());
2594 } 2599 }
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
2940 HValue* object() const { return left(); } 2945 HValue* object() const { return left(); }
2941 HValue* key() const { return right(); } 2946 HValue* key() const { return right(); }
2942 }; 2947 };
2943 2948
2944 #undef DECLARE_INSTRUCTION 2949 #undef DECLARE_INSTRUCTION
2945 #undef DECLARE_CONCRETE_INSTRUCTION 2950 #undef DECLARE_CONCRETE_INSTRUCTION
2946 2951
2947 } } // namespace v8::internal 2952 } } // namespace v8::internal
2948 2953
2949 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 2954 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« src/hydrogen.cc ('K') | « src/hydrogen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698