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

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

Issue 146623006: Reland of r19102: Check elimination improvement: propagation of state through phis is supported, Che (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: The fix Created 6 years, 10 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 | « src/hydrogen-check-elimination.cc ('k') | test/mjsunit/compiler/compare-map-elim.js » ('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 2633 matching lines...) Expand 10 before | Expand all | Expand 10 after
2644 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 2644 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
2645 2645
2646 const Heap::RootListIndex index_; 2646 const Heap::RootListIndex index_;
2647 }; 2647 };
2648 2648
2649 2649
2650 class HCheckMaps V8_FINAL : public HTemplateInstruction<2> { 2650 class HCheckMaps V8_FINAL : public HTemplateInstruction<2> {
2651 public: 2651 public:
2652 static HCheckMaps* New(Zone* zone, HValue* context, HValue* value, 2652 static HCheckMaps* New(Zone* zone, HValue* context, HValue* value,
2653 Handle<Map> map, CompilationInfo* info, 2653 Handle<Map> map, CompilationInfo* info,
2654 HValue *typecheck = NULL); 2654 HValue* typecheck = NULL);
2655 static HCheckMaps* New(Zone* zone, HValue* context, 2655 static HCheckMaps* New(Zone* zone, HValue* context,
2656 HValue* value, SmallMapList* maps, 2656 HValue* value, SmallMapList* maps,
2657 HValue *typecheck = NULL) { 2657 HValue* typecheck = NULL) {
2658 HCheckMaps* check_map = new(zone) HCheckMaps(value, zone, typecheck); 2658 HCheckMaps* check_map = new(zone) HCheckMaps(value, zone, typecheck);
2659 for (int i = 0; i < maps->length(); i++) { 2659 for (int i = 0; i < maps->length(); i++) {
2660 check_map->Add(maps->at(i), zone); 2660 check_map->Add(maps->at(i), zone);
2661 } 2661 }
2662 return check_map; 2662 return check_map;
2663 } 2663 }
2664 2664
2665 bool CanOmitMapChecks() { return omit_; } 2665 bool CanOmitMapChecks() { return omit_; }
2666 2666
2667 virtual bool HasEscapingOperandAt(int index) V8_OVERRIDE { return false; } 2667 virtual bool HasEscapingOperandAt(int index) V8_OVERRIDE { return false; }
2668 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 2668 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
2669 return Representation::Tagged(); 2669 return Representation::Tagged();
2670 } 2670 }
2671 virtual bool HandleSideEffectDominator(GVNFlag side_effect, 2671 virtual bool HandleSideEffectDominator(GVNFlag side_effect,
2672 HValue* dominator) V8_OVERRIDE; 2672 HValue* dominator) V8_OVERRIDE;
2673 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; 2673 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
2674 2674
2675 HValue* value() { return OperandAt(0); } 2675 HValue* value() { return OperandAt(0); }
2676 HValue* typecheck() { return OperandAt(1); }
2676 2677
2677 Unique<Map> first_map() const { return map_set_.at(0); } 2678 Unique<Map> first_map() const { return map_set_.at(0); }
2678 UniqueSet<Map> map_set() const { return map_set_; } 2679 UniqueSet<Map> map_set() const { return map_set_; }
2679 2680
2681 void set_map_set(UniqueSet<Map>* maps, Zone *zone) {
2682 map_set_.Clear();
2683 for (int i = 0; i < maps->size(); i++) {
2684 map_set_.Add(maps->at(i), zone);
2685 }
2686 }
2687
2680 bool has_migration_target() const { 2688 bool has_migration_target() const {
2681 return has_migration_target_; 2689 return has_migration_target_;
2682 } 2690 }
2683 2691
2684 DECLARE_CONCRETE_INSTRUCTION(CheckMaps) 2692 DECLARE_CONCRETE_INSTRUCTION(CheckMaps)
2685 2693
2686 protected: 2694 protected:
2687 virtual bool DataEquals(HValue* other) V8_OVERRIDE { 2695 virtual bool DataEquals(HValue* other) V8_OVERRIDE {
2688 return this->map_set_.Equals(&HCheckMaps::cast(other)->map_set_); 2696 return this->map_set_.Equals(&HCheckMaps::cast(other)->map_set_);
2689 } 2697 }
(...skipping 4738 matching lines...) Expand 10 before | Expand all | Expand 10 after
7428 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7436 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7429 }; 7437 };
7430 7438
7431 7439
7432 #undef DECLARE_INSTRUCTION 7440 #undef DECLARE_INSTRUCTION
7433 #undef DECLARE_CONCRETE_INSTRUCTION 7441 #undef DECLARE_CONCRETE_INSTRUCTION
7434 7442
7435 } } // namespace v8::internal 7443 } } // namespace v8::internal
7436 7444
7437 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7445 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen-check-elimination.cc ('k') | test/mjsunit/compiler/compare-map-elim.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698