OLD | NEW |
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 2631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2642 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 2642 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
2643 | 2643 |
2644 const Heap::RootListIndex index_; | 2644 const Heap::RootListIndex index_; |
2645 }; | 2645 }; |
2646 | 2646 |
2647 | 2647 |
2648 class HCheckMaps V8_FINAL : public HTemplateInstruction<2> { | 2648 class HCheckMaps V8_FINAL : public HTemplateInstruction<2> { |
2649 public: | 2649 public: |
2650 static HCheckMaps* New(Zone* zone, HValue* context, HValue* value, | 2650 static HCheckMaps* New(Zone* zone, HValue* context, HValue* value, |
2651 Handle<Map> map, CompilationInfo* info, | 2651 Handle<Map> map, CompilationInfo* info, |
2652 HValue* typecheck = NULL); | 2652 HValue *typecheck = NULL); |
2653 static HCheckMaps* New(Zone* zone, HValue* context, | 2653 static HCheckMaps* New(Zone* zone, HValue* context, |
2654 HValue* value, SmallMapList* maps, | 2654 HValue* value, SmallMapList* maps, |
2655 HValue* typecheck = NULL) { | 2655 HValue *typecheck = NULL) { |
2656 HCheckMaps* check_map = new(zone) HCheckMaps(value, zone, typecheck); | 2656 HCheckMaps* check_map = new(zone) HCheckMaps(value, zone, typecheck); |
2657 for (int i = 0; i < maps->length(); i++) { | 2657 for (int i = 0; i < maps->length(); i++) { |
2658 check_map->Add(maps->at(i), zone); | 2658 check_map->Add(maps->at(i), zone); |
2659 } | 2659 } |
2660 return check_map; | 2660 return check_map; |
2661 } | 2661 } |
2662 // HCheckMaps creation method safe for using during concurrent compilation | |
2663 // (does not dereference maps handles). | |
2664 static HCheckMaps* New(Zone* zone, HValue* context, | |
2665 HValue* value, UniqueSet<Map>* maps, | |
2666 HValue* typecheck, | |
2667 bool has_migration_target) { | |
2668 HCheckMaps* check_map = new(zone) HCheckMaps(value, zone, typecheck); | |
2669 for (int i = 0; i < maps->size(); i++) { | |
2670 check_map->map_set_.Add(maps->at(i), zone); | |
2671 } | |
2672 if (has_migration_target) { | |
2673 check_map->has_migration_target_ = true; | |
2674 check_map->SetGVNFlag(kChangesNewSpacePromotion); | |
2675 } | |
2676 return check_map; | |
2677 } | |
2678 | 2662 |
2679 bool CanOmitMapChecks() { return omit_; } | 2663 bool CanOmitMapChecks() { return omit_; } |
2680 | 2664 |
2681 virtual bool HasEscapingOperandAt(int index) V8_OVERRIDE { return false; } | 2665 virtual bool HasEscapingOperandAt(int index) V8_OVERRIDE { return false; } |
2682 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 2666 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
2683 return Representation::Tagged(); | 2667 return Representation::Tagged(); |
2684 } | 2668 } |
2685 virtual bool HandleSideEffectDominator(GVNFlag side_effect, | 2669 virtual bool HandleSideEffectDominator(GVNFlag side_effect, |
2686 HValue* dominator) V8_OVERRIDE; | 2670 HValue* dominator) V8_OVERRIDE; |
2687 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 2671 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
2688 | 2672 |
2689 HValue* value() { return OperandAt(0); } | 2673 HValue* value() { return OperandAt(0); } |
2690 HValue* typecheck() { return OperandAt(1); } | |
2691 | 2674 |
2692 Unique<Map> first_map() const { return map_set_.at(0); } | 2675 Unique<Map> first_map() const { return map_set_.at(0); } |
2693 UniqueSet<Map> map_set() const { return map_set_; } | 2676 UniqueSet<Map> map_set() const { return map_set_; } |
2694 | 2677 |
2695 bool has_migration_target() const { | 2678 bool has_migration_target() const { |
2696 return has_migration_target_; | 2679 return has_migration_target_; |
2697 } | 2680 } |
2698 | 2681 |
2699 DECLARE_CONCRETE_INSTRUCTION(CheckMaps) | 2682 DECLARE_CONCRETE_INSTRUCTION(CheckMaps) |
2700 | 2683 |
(...skipping 4742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7443 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 7426 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
7444 }; | 7427 }; |
7445 | 7428 |
7446 | 7429 |
7447 #undef DECLARE_INSTRUCTION | 7430 #undef DECLARE_INSTRUCTION |
7448 #undef DECLARE_CONCRETE_INSTRUCTION | 7431 #undef DECLARE_CONCRETE_INSTRUCTION |
7449 | 7432 |
7450 } } // namespace v8::internal | 7433 } } // namespace v8::internal |
7451 | 7434 |
7452 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7435 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |