OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ | 5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ |
6 #define V8_HYDROGEN_INSTRUCTIONS_H_ | 6 #define V8_HYDROGEN_INSTRUCTIONS_H_ |
7 | 7 |
8 #include "v8.h" | 8 #include "v8.h" |
9 | 9 |
10 #include "allocation.h" | 10 #include "allocation.h" |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 // Set after an instruction is killed. | 612 // Set after an instruction is killed. |
613 kIsDead, | 613 kIsDead, |
614 // Instructions that are allowed to produce full range unsigned integer | 614 // Instructions that are allowed to produce full range unsigned integer |
615 // values are marked with kUint32 flag. If arithmetic shift or a load from | 615 // values are marked with kUint32 flag. If arithmetic shift or a load from |
616 // EXTERNAL_UINT32_ELEMENTS array is not marked with this flag | 616 // EXTERNAL_UINT32_ELEMENTS array is not marked with this flag |
617 // it will deoptimize if result does not fit into signed integer range. | 617 // it will deoptimize if result does not fit into signed integer range. |
618 // HGraph::ComputeSafeUint32Operations is responsible for setting this | 618 // HGraph::ComputeSafeUint32Operations is responsible for setting this |
619 // flag. | 619 // flag. |
620 kUint32, | 620 kUint32, |
621 kHasNoObservableSideEffects, | 621 kHasNoObservableSideEffects, |
622 // Indicates an instruction shouldn't be replaced by optimization, this flag | |
623 // is useful to set in cases where recomputing a value is cheaper than | |
624 // extending the value's live range and spilling it. | |
625 kCantBeReplaced, | |
626 // Indicates the instruction is live during dead code elimination. | 622 // Indicates the instruction is live during dead code elimination. |
627 kIsLive, | 623 kIsLive, |
628 | 624 |
629 // HEnvironmentMarkers are deleted before dead code | 625 // HEnvironmentMarkers are deleted before dead code |
630 // elimination takes place, so they can repurpose the kIsLive flag: | 626 // elimination takes place, so they can repurpose the kIsLive flag: |
631 kEndsLiveRange = kIsLive, | 627 kEndsLiveRange = kIsLive, |
632 | 628 |
633 // TODO(everyone): Don't forget to update this! | 629 // TODO(everyone): Don't forget to update this! |
634 kLastFlag = kIsLive | 630 kLastFlag = kIsLive |
635 }; | 631 }; |
(...skipping 5618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6254 if (index == 0 && access().IsExternalMemory()) { | 6250 if (index == 0 && access().IsExternalMemory()) { |
6255 // object must be external in case of external memory access | 6251 // object must be external in case of external memory access |
6256 return Representation::External(); | 6252 return Representation::External(); |
6257 } | 6253 } |
6258 return Representation::Tagged(); | 6254 return Representation::Tagged(); |
6259 } | 6255 } |
6260 virtual Range* InferRange(Zone* zone) V8_OVERRIDE; | 6256 virtual Range* InferRange(Zone* zone) V8_OVERRIDE; |
6261 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 6257 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
6262 | 6258 |
6263 bool CanBeReplacedWith(HValue* other) const { | 6259 bool CanBeReplacedWith(HValue* other) const { |
6264 if (!CheckFlag(HValue::kCantBeReplaced)) return false; | |
6265 if (!type().Equals(other->type())) return false; | 6260 if (!type().Equals(other->type())) return false; |
6266 if (!representation().Equals(other->representation())) return false; | 6261 if (!representation().Equals(other->representation())) return false; |
6267 if (!other->IsLoadNamedField()) return true; | 6262 if (!other->IsLoadNamedField()) return true; |
6268 HLoadNamedField* that = HLoadNamedField::cast(other); | 6263 HLoadNamedField* that = HLoadNamedField::cast(other); |
6269 if (this->maps_ == that->maps_) return true; | 6264 if (this->maps_ == that->maps_) return true; |
6270 if (this->maps_ == NULL || that->maps_ == NULL) return false; | 6265 if (this->maps_ == NULL || that->maps_ == NULL) return false; |
6271 return this->maps_->IsSubset(that->maps_); | 6266 return this->maps_->IsSubset(that->maps_); |
6272 } | 6267 } |
6273 | 6268 |
6274 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField) | 6269 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField) |
(...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7713 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 7708 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
7714 }; | 7709 }; |
7715 | 7710 |
7716 | 7711 |
7717 #undef DECLARE_INSTRUCTION | 7712 #undef DECLARE_INSTRUCTION |
7718 #undef DECLARE_CONCRETE_INSTRUCTION | 7713 #undef DECLARE_CONCRETE_INSTRUCTION |
7719 | 7714 |
7720 } } // namespace v8::internal | 7715 } } // namespace v8::internal |
7721 | 7716 |
7722 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7717 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |