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 <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/v8.h" | 10 #include "src/v8.h" |
(...skipping 2698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2709 return index_ == b->index_; | 2709 return index_ == b->index_; |
2710 } | 2710 } |
2711 | 2711 |
2712 private: | 2712 private: |
2713 explicit HLoadRoot(Heap::RootListIndex index, HType type = HType::Tagged()) | 2713 explicit HLoadRoot(Heap::RootListIndex index, HType type = HType::Tagged()) |
2714 : HTemplateInstruction<0>(type), index_(index) { | 2714 : HTemplateInstruction<0>(type), index_(index) { |
2715 SetFlag(kUseGVN); | 2715 SetFlag(kUseGVN); |
2716 // TODO(bmeurer): We'll need kDependsOnRoots once we add the | 2716 // TODO(bmeurer): We'll need kDependsOnRoots once we add the |
2717 // corresponding HStoreRoot instruction. | 2717 // corresponding HStoreRoot instruction. |
2718 SetDependsOnFlag(kCalls); | 2718 SetDependsOnFlag(kCalls); |
| 2719 set_representation(Representation::Tagged()); |
2719 } | 2720 } |
2720 | 2721 |
2721 virtual bool IsDeletable() const OVERRIDE { return true; } | 2722 virtual bool IsDeletable() const OVERRIDE { return true; } |
2722 | 2723 |
2723 const Heap::RootListIndex index_; | 2724 const Heap::RootListIndex index_; |
2724 }; | 2725 }; |
2725 | 2726 |
2726 | 2727 |
2727 class HCheckMaps FINAL : public HTemplateInstruction<2> { | 2728 class HCheckMaps FINAL : public HTemplateInstruction<2> { |
2728 public: | 2729 public: |
(...skipping 3637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6366 return access_.representation(); | 6367 return access_.representation(); |
6367 } | 6368 } |
6368 | 6369 |
6369 const UniqueSet<Map>* maps() const { return maps_; } | 6370 const UniqueSet<Map>* maps() const { return maps_; } |
6370 | 6371 |
6371 virtual bool HasEscapingOperandAt(int index) OVERRIDE { return false; } | 6372 virtual bool HasEscapingOperandAt(int index) OVERRIDE { return false; } |
6372 virtual bool HasOutOfBoundsAccess(int size) OVERRIDE { | 6373 virtual bool HasOutOfBoundsAccess(int size) OVERRIDE { |
6373 return !access().IsInobject() || access().offset() >= size; | 6374 return !access().IsInobject() || access().offset() >= size; |
6374 } | 6375 } |
6375 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 6376 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
6376 if (index == 0 && access().IsExternalMemory()) { | 6377 if (index == 0) { |
6377 // object must be external in case of external memory access | 6378 // object must be external in case of external memory access |
6378 return Representation::External(); | 6379 return access().IsExternalMemory() ? Representation::External() |
| 6380 : Representation::Tagged(); |
6379 } | 6381 } |
6380 return Representation::Tagged(); | 6382 DCHECK(index == 1); |
| 6383 return Representation::None(); |
6381 } | 6384 } |
6382 virtual Range* InferRange(Zone* zone) OVERRIDE; | 6385 virtual Range* InferRange(Zone* zone) OVERRIDE; |
6383 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT | 6386 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
6384 | 6387 |
6385 bool CanBeReplacedWith(HValue* other) const { | 6388 bool CanBeReplacedWith(HValue* other) const { |
6386 if (!CheckFlag(HValue::kCantBeReplaced)) return false; | 6389 if (!CheckFlag(HValue::kCantBeReplaced)) return false; |
6387 if (!type().Equals(other->type())) return false; | 6390 if (!type().Equals(other->type())) return false; |
6388 if (!representation().Equals(other->representation())) return false; | 6391 if (!representation().Equals(other->representation())) return false; |
6389 if (!other->IsLoadNamedField()) return true; | 6392 if (!other->IsLoadNamedField()) return true; |
6390 HLoadNamedField* that = HLoadNamedField::cast(other); | 6393 HLoadNamedField* that = HLoadNamedField::cast(other); |
(...skipping 1502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7893 }; | 7896 }; |
7894 | 7897 |
7895 | 7898 |
7896 | 7899 |
7897 #undef DECLARE_INSTRUCTION | 7900 #undef DECLARE_INSTRUCTION |
7898 #undef DECLARE_CONCRETE_INSTRUCTION | 7901 #undef DECLARE_CONCRETE_INSTRUCTION |
7899 | 7902 |
7900 } } // namespace v8::internal | 7903 } } // namespace v8::internal |
7901 | 7904 |
7902 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7905 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |