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 7337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7348 } | 7348 } |
7349 | 7349 |
7350 Representation RequiredInputRepresentation(int index) OVERRIDE { | 7350 Representation RequiredInputRepresentation(int index) OVERRIDE { |
7351 return Representation::Tagged(); | 7351 return Representation::Tagged(); |
7352 } | 7352 } |
7353 | 7353 |
7354 HValue* object() const { return OperandAt(0); } | 7354 HValue* object() const { return OperandAt(0); } |
7355 HValue* context() const { return OperandAt(1); } | 7355 HValue* context() const { return OperandAt(1); } |
7356 Unique<Map> original_map() const { return original_map_; } | 7356 Unique<Map> original_map() const { return original_map_; } |
7357 Unique<Map> transitioned_map() const { return transitioned_map_; } | 7357 Unique<Map> transitioned_map() const { return transitioned_map_; } |
7358 ElementsKind from_kind() const { return from_kind_; } | 7358 ElementsKind from_kind() const { |
7359 ElementsKind to_kind() const { return to_kind_; } | 7359 return FromElementsKindField::decode(bit_field_); |
| 7360 } |
| 7361 ElementsKind to_kind() const { |
| 7362 return ToElementsKindField::decode(bit_field_); |
| 7363 } |
| 7364 bool map_is_stable() const { return MapIsStableField::decode(bit_field_); } |
7360 | 7365 |
7361 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT | 7366 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
7362 | 7367 |
7363 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind) | 7368 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind) |
7364 | 7369 |
7365 protected: | 7370 protected: |
7366 bool DataEquals(HValue* other) OVERRIDE { | 7371 bool DataEquals(HValue* other) OVERRIDE { |
7367 HTransitionElementsKind* instr = HTransitionElementsKind::cast(other); | 7372 HTransitionElementsKind* instr = HTransitionElementsKind::cast(other); |
7368 return original_map_ == instr->original_map_ && | 7373 return original_map_ == instr->original_map_ && |
7369 transitioned_map_ == instr->transitioned_map_; | 7374 transitioned_map_ == instr->transitioned_map_; |
7370 } | 7375 } |
7371 | 7376 |
7372 int RedefinedOperandIndex() OVERRIDE { return 0; } | 7377 int RedefinedOperandIndex() OVERRIDE { return 0; } |
7373 | 7378 |
7374 private: | 7379 private: |
7375 HTransitionElementsKind(HValue* context, | 7380 HTransitionElementsKind(HValue* context, HValue* object, |
7376 HValue* object, | |
7377 Handle<Map> original_map, | 7381 Handle<Map> original_map, |
7378 Handle<Map> transitioned_map) | 7382 Handle<Map> transitioned_map) |
7379 : original_map_(Unique<Map>(original_map)), | 7383 : original_map_(Unique<Map>(original_map)), |
7380 transitioned_map_(Unique<Map>(transitioned_map)), | 7384 transitioned_map_(Unique<Map>(transitioned_map)), |
7381 from_kind_(original_map->elements_kind()), | 7385 bit_field_( |
7382 to_kind_(transitioned_map->elements_kind()) { | 7386 FromElementsKindField::encode(original_map->elements_kind()) | |
| 7387 ToElementsKindField::encode(transitioned_map->elements_kind()) | |
| 7388 MapIsStableField::encode(transitioned_map->is_stable())) { |
7383 SetOperandAt(0, object); | 7389 SetOperandAt(0, object); |
7384 SetOperandAt(1, context); | 7390 SetOperandAt(1, context); |
7385 SetFlag(kUseGVN); | 7391 SetFlag(kUseGVN); |
7386 SetChangesFlag(kElementsKind); | 7392 SetChangesFlag(kElementsKind); |
7387 if (!IsSimpleMapChangeTransition(from_kind_, to_kind_)) { | 7393 if (!IsSimpleMapChangeTransition(from_kind(), to_kind())) { |
7388 SetChangesFlag(kElementsPointer); | 7394 SetChangesFlag(kElementsPointer); |
7389 SetChangesFlag(kNewSpacePromotion); | 7395 SetChangesFlag(kNewSpacePromotion); |
7390 } | 7396 } |
7391 set_representation(Representation::Tagged()); | 7397 set_representation(Representation::Tagged()); |
7392 } | 7398 } |
7393 | 7399 |
| 7400 class FromElementsKindField : public BitField<ElementsKind, 0, 5> {}; |
| 7401 class ToElementsKindField : public BitField<ElementsKind, 5, 5> {}; |
| 7402 class MapIsStableField : public BitField<bool, 10, 1> {}; |
| 7403 |
7394 Unique<Map> original_map_; | 7404 Unique<Map> original_map_; |
7395 Unique<Map> transitioned_map_; | 7405 Unique<Map> transitioned_map_; |
7396 ElementsKind from_kind_; | 7406 uint32_t bit_field_; |
7397 ElementsKind to_kind_; | |
7398 }; | 7407 }; |
7399 | 7408 |
7400 | 7409 |
7401 class HStringAdd FINAL : public HBinaryOperation { | 7410 class HStringAdd FINAL : public HBinaryOperation { |
7402 public: | 7411 public: |
7403 static HInstruction* New(Zone* zone, | 7412 static HInstruction* New(Zone* zone, |
7404 HValue* context, | 7413 HValue* context, |
7405 HValue* left, | 7414 HValue* left, |
7406 HValue* right, | 7415 HValue* right, |
7407 PretenureFlag pretenure_flag = NOT_TENURED, | 7416 PretenureFlag pretenure_flag = NOT_TENURED, |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8029 }; | 8038 }; |
8030 | 8039 |
8031 | 8040 |
8032 | 8041 |
8033 #undef DECLARE_INSTRUCTION | 8042 #undef DECLARE_INSTRUCTION |
8034 #undef DECLARE_CONCRETE_INSTRUCTION | 8043 #undef DECLARE_CONCRETE_INSTRUCTION |
8035 | 8044 |
8036 } } // namespace v8::internal | 8045 } } // namespace v8::internal |
8037 | 8046 |
8038 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 8047 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |