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

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

Issue 15841007: Remove HCheckSmi, LCheckSmi and rename LCheckSmiAndReturn to LCheckSmi. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use ForceRepresentation rather than directly inserting HChange Created 7 years, 6 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.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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 V(CallNew) \ 85 V(CallNew) \
86 V(CallNewArray) \ 86 V(CallNewArray) \
87 V(CallRuntime) \ 87 V(CallRuntime) \
88 V(CallStub) \ 88 V(CallStub) \
89 V(Change) \ 89 V(Change) \
90 V(CheckFunction) \ 90 V(CheckFunction) \
91 V(CheckInstanceType) \ 91 V(CheckInstanceType) \
92 V(CheckMaps) \ 92 V(CheckMaps) \
93 V(CheckNonSmi) \ 93 V(CheckNonSmi) \
94 V(CheckPrototypeMaps) \ 94 V(CheckPrototypeMaps) \
95 V(CheckSmi) \
96 V(ClampToUint8) \ 95 V(ClampToUint8) \
97 V(ClassOfTestAndBranch) \ 96 V(ClassOfTestAndBranch) \
98 V(CompareIDAndBranch) \ 97 V(CompareIDAndBranch) \
99 V(CompareGeneric) \ 98 V(CompareGeneric) \
100 V(CompareObjectEqAndBranch) \ 99 V(CompareObjectEqAndBranch) \
101 V(CompareMap) \ 100 V(CompareMap) \
102 V(CompareConstantEqAndBranch) \ 101 V(CompareConstantEqAndBranch) \
103 V(Constant) \ 102 V(Constant) \
104 V(Context) \ 103 V(Context) \
105 V(DebugBreak) \ 104 V(DebugBreak) \
(...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after
1707 }; 1706 };
1708 1707
1709 1708
1710 class HChange: public HUnaryOperation { 1709 class HChange: public HUnaryOperation {
1711 public: 1710 public:
1712 HChange(HValue* value, 1711 HChange(HValue* value,
1713 Representation to, 1712 Representation to,
1714 bool is_truncating, 1713 bool is_truncating,
1715 bool deoptimize_on_undefined) 1714 bool deoptimize_on_undefined)
1716 : HUnaryOperation(value) { 1715 : HUnaryOperation(value) {
1717 ASSERT(!value->representation().IsNone() && !to.IsNone()); 1716 ASSERT(!value->representation().IsNone());
1717 ASSERT(!to.IsNone());
1718 ASSERT(!value->representation().Equals(to)); 1718 ASSERT(!value->representation().Equals(to));
1719 set_representation(to); 1719 set_representation(to);
1720 SetFlag(kUseGVN); 1720 SetFlag(kUseGVN);
1721 if (deoptimize_on_undefined) SetFlag(kDeoptimizeOnUndefined); 1721 if (deoptimize_on_undefined) SetFlag(kDeoptimizeOnUndefined);
1722 if (is_truncating) SetFlag(kTruncatingToInt32); 1722 if (is_truncating) SetFlag(kTruncatingToInt32);
1723 if (value->representation().IsSmi() || value->type().IsSmi()) { 1723 if (value->representation().IsSmi() || value->type().IsSmi()) {
1724 set_type(HType::Smi()); 1724 set_type(HType::Smi());
1725 } else { 1725 } else {
1726 set_type(HType::TaggedNumber()); 1726 set_type(HType::TaggedNumber());
1727 if (to.IsTagged()) SetGVNFlag(kChangesNewSpacePromotion); 1727 if (to.IsTagged()) SetGVNFlag(kChangesNewSpacePromotion);
(...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after
2921 } 2921 }
2922 2922
2923 private: 2923 private:
2924 ZoneList<Handle<JSObject> > prototypes_; 2924 ZoneList<Handle<JSObject> > prototypes_;
2925 ZoneList<Handle<Map> > maps_; 2925 ZoneList<Handle<Map> > maps_;
2926 UniqueValueId first_prototype_unique_id_; 2926 UniqueValueId first_prototype_unique_id_;
2927 UniqueValueId last_prototype_unique_id_; 2927 UniqueValueId last_prototype_unique_id_;
2928 }; 2928 };
2929 2929
2930 2930
2931 class HCheckSmi: public HUnaryOperation {
2932 public:
2933 explicit HCheckSmi(HValue* value) : HUnaryOperation(value) {
2934 set_representation(Representation::Tagged());
2935 SetFlag(kUseGVN);
2936 }
2937
2938 virtual Representation RequiredInputRepresentation(int index) {
2939 return Representation::Tagged();
2940 }
2941 virtual HType CalculateInferredType();
2942
2943 #ifdef DEBUG
2944 virtual void Verify();
2945 #endif
2946
2947 DECLARE_CONCRETE_INSTRUCTION(CheckSmi)
2948
2949 protected:
2950 virtual bool DataEquals(HValue* other) { return true; }
2951 };
2952
2953
2954 class HPhi: public HValue { 2931 class HPhi: public HValue {
2955 public: 2932 public:
2956 HPhi(int merged_index, Zone* zone) 2933 HPhi(int merged_index, Zone* zone)
2957 : inputs_(2, zone), 2934 : inputs_(2, zone),
2958 merged_index_(merged_index), 2935 merged_index_(merged_index),
2959 phi_id_(-1), 2936 phi_id_(-1),
2960 is_convertible_to_integer_(true) { 2937 is_convertible_to_integer_(true) {
2961 for (int i = 0; i < Representation::kNumRepresentations; i++) { 2938 for (int i = 0; i < Representation::kNumRepresentations; i++) {
2962 non_phi_uses_[i] = 0; 2939 non_phi_uses_[i] = 0;
2963 indirect_uses_[i] = 0; 2940 indirect_uses_[i] = 0;
(...skipping 3559 matching lines...) Expand 10 before | Expand all | Expand 10 after
6523 virtual bool IsDeletable() const { return true; } 6500 virtual bool IsDeletable() const { return true; }
6524 }; 6501 };
6525 6502
6526 6503
6527 #undef DECLARE_INSTRUCTION 6504 #undef DECLARE_INSTRUCTION
6528 #undef DECLARE_CONCRETE_INSTRUCTION 6505 #undef DECLARE_CONCRETE_INSTRUCTION
6529 6506
6530 } } // namespace v8::internal 6507 } } // namespace v8::internal
6531 6508
6532 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 6509 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698