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

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

Issue 195793016: Remove uses of CanBeNegative() in HMod. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | 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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 // occurrences of the instruction are indeed the same. 616 // occurrences of the instruction are indeed the same.
617 kUseGVN, 617 kUseGVN,
618 // Track instructions that are dominating side effects. If an instruction 618 // Track instructions that are dominating side effects. If an instruction
619 // sets this flag, it must implement HandleSideEffectDominator() and should 619 // sets this flag, it must implement HandleSideEffectDominator() and should
620 // indicate which side effects to track by setting GVN flags. 620 // indicate which side effects to track by setting GVN flags.
621 kTrackSideEffectDominators, 621 kTrackSideEffectDominators,
622 kCanOverflow, 622 kCanOverflow,
623 kBailoutOnMinusZero, 623 kBailoutOnMinusZero,
624 kCanBeDivByZero, 624 kCanBeDivByZero,
625 kLeftCanBeMinInt, 625 kLeftCanBeMinInt,
626 kLeftCanBeNegative,
626 kAllowUndefinedAsNaN, 627 kAllowUndefinedAsNaN,
627 kIsArguments, 628 kIsArguments,
628 kTruncatingToInt32, 629 kTruncatingToInt32,
629 kAllUsesTruncatingToInt32, 630 kAllUsesTruncatingToInt32,
630 kTruncatingToSmi, 631 kTruncatingToSmi,
631 kAllUsesTruncatingToSmi, 632 kAllUsesTruncatingToSmi,
632 // Set after an instruction is killed. 633 // Set after an instruction is killed.
633 kIsDead, 634 kIsDead,
634 // Instructions that are allowed to produce full range unsigned integer 635 // Instructions that are allowed to produce full range unsigned integer
635 // values are marked with kUint32 flag. If arithmetic shift or a load from 636 // values are marked with kUint32 flag. If arithmetic shift or a load from
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 849
849 GVNFlagSet ObservableChangesFlags() const { 850 GVNFlagSet ObservableChangesFlags() const {
850 GVNFlagSet result = ChangesFlags(); 851 GVNFlagSet result = ChangesFlags();
851 result.Intersect(AllObservableSideEffectsFlagSet()); 852 result.Intersect(AllObservableSideEffectsFlagSet());
852 return result; 853 return result;
853 } 854 }
854 855
855 Range* range() const { return range_; } 856 Range* range() const { return range_; }
856 // TODO(svenpanne) We should really use the null object pattern here. 857 // TODO(svenpanne) We should really use the null object pattern here.
857 bool HasRange() const { return range_ != NULL; } 858 bool HasRange() const { return range_ != NULL; }
858 bool CanBeNegative() const { return !HasRange() || range()->CanBeNegative(); }
859 void AddNewRange(Range* r, Zone* zone); 859 void AddNewRange(Range* r, Zone* zone);
860 void RemoveLastAddedRange(); 860 void RemoveLastAddedRange();
861 void ComputeInitialRange(Zone* zone); 861 void ComputeInitialRange(Zone* zone);
862 862
863 // Escape analysis helpers. 863 // Escape analysis helpers.
864 virtual bool HasEscapingOperandAt(int index) { return true; } 864 virtual bool HasEscapingOperandAt(int index) { return true; }
865 virtual bool HasOutOfBoundsAccess(int size) { return false; } 865 virtual bool HasOutOfBoundsAccess(int size) { return false; }
866 866
867 // Representation helpers. 867 // Representation helpers.
868 virtual Representation observed_input_representation(int index) { 868 virtual Representation observed_input_representation(int index) {
(...skipping 3984 matching lines...) Expand 10 before | Expand all | Expand 10 after
4853 virtual bool DataEquals(HValue* other) V8_OVERRIDE { return true; } 4853 virtual bool DataEquals(HValue* other) V8_OVERRIDE { return true; }
4854 4854
4855 virtual Range* InferRange(Zone* zone) V8_OVERRIDE; 4855 virtual Range* InferRange(Zone* zone) V8_OVERRIDE;
4856 4856
4857 private: 4857 private:
4858 HMod(HValue* context, 4858 HMod(HValue* context,
4859 HValue* left, 4859 HValue* left,
4860 HValue* right) : HArithmeticBinaryOperation(context, left, right) { 4860 HValue* right) : HArithmeticBinaryOperation(context, left, right) {
4861 SetFlag(kCanBeDivByZero); 4861 SetFlag(kCanBeDivByZero);
4862 SetFlag(kCanOverflow); 4862 SetFlag(kCanOverflow);
4863 SetFlag(kLeftCanBeNegative);
4863 } 4864 }
4864 }; 4865 };
4865 4866
4866 4867
4867 class HDiv V8_FINAL : public HArithmeticBinaryOperation { 4868 class HDiv V8_FINAL : public HArithmeticBinaryOperation {
4868 public: 4869 public:
4869 static HInstruction* New(Zone* zone, 4870 static HInstruction* New(Zone* zone,
4870 HValue* context, 4871 HValue* context,
4871 HValue* left, 4872 HValue* left,
4872 HValue* right); 4873 HValue* right);
(...skipping 2631 matching lines...) Expand 10 before | Expand all | Expand 10 after
7504 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7505 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7505 }; 7506 };
7506 7507
7507 7508
7508 #undef DECLARE_INSTRUCTION 7509 #undef DECLARE_INSTRUCTION
7509 #undef DECLARE_CONCRETE_INSTRUCTION 7510 #undef DECLARE_CONCRETE_INSTRUCTION
7510 7511
7511 } } // namespace v8::internal 7512 } } // namespace v8::internal
7512 7513
7513 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7514 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698