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

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

Issue 266083007: Use stability to only conditionally flush information from the map check table. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments. Created 6 years, 7 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-check-elimination.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 // 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 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after
1563 1563
1564 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; 1564 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
1565 1565
1566 static const int kNoKnownSuccessorIndex = -1; 1566 static const int kNoKnownSuccessorIndex = -1;
1567 int known_successor_index() const { return known_successor_index_; } 1567 int known_successor_index() const { return known_successor_index_; }
1568 void set_known_successor_index(int known_successor_index) { 1568 void set_known_successor_index(int known_successor_index) {
1569 known_successor_index_ = known_successor_index; 1569 known_successor_index_ = known_successor_index;
1570 } 1570 }
1571 1571
1572 Unique<Map> map() const { return map_; } 1572 Unique<Map> map() const { return map_; }
1573 bool map_is_stable() const { return map_is_stable_; }
1573 1574
1574 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 1575 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
1575 return Representation::Tagged(); 1576 return Representation::Tagged();
1576 } 1577 }
1577 1578
1578 DECLARE_CONCRETE_INSTRUCTION(CompareMap) 1579 DECLARE_CONCRETE_INSTRUCTION(CompareMap)
1579 1580
1580 protected: 1581 protected:
1581 virtual int RedefinedOperandIndex() { return 0; } 1582 virtual int RedefinedOperandIndex() { return 0; }
1582 1583
1583 private: 1584 private:
1584 HCompareMap(HValue* value, 1585 HCompareMap(HValue* value,
1585 Handle<Map> map, 1586 Handle<Map> map,
1586 HBasicBlock* true_target = NULL, 1587 HBasicBlock* true_target = NULL,
1587 HBasicBlock* false_target = NULL) 1588 HBasicBlock* false_target = NULL)
1588 : HUnaryControlInstruction(value, true_target, false_target), 1589 : HUnaryControlInstruction(value, true_target, false_target),
1589 known_successor_index_(kNoKnownSuccessorIndex), map_(Unique<Map>(map)) { 1590 known_successor_index_(kNoKnownSuccessorIndex),
1590 ASSERT(!map.is_null()); 1591 map_is_stable_(map->is_stable()),
1592 map_(Unique<Map>::CreateImmovable(map)) {
1591 set_representation(Representation::Tagged()); 1593 set_representation(Representation::Tagged());
1592 } 1594 }
1593 1595
1594 int known_successor_index_; 1596 int known_successor_index_ : 31;
1597 bool map_is_stable_ : 1;
1595 Unique<Map> map_; 1598 Unique<Map> map_;
1596 }; 1599 };
1597 1600
1598 1601
1599 class HContext V8_FINAL : public HTemplateInstruction<0> { 1602 class HContext V8_FINAL : public HTemplateInstruction<0> {
1600 public: 1603 public:
1601 static HContext* New(Zone* zone) { 1604 static HContext* New(Zone* zone) {
1602 return new(zone) HContext(); 1605 return new(zone) HContext();
1603 } 1606 }
1604 1607
(...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after
2757 HValue* typecheck = NULL) { 2760 HValue* typecheck = NULL) {
2758 UniqueSet<Map>* maps = new(zone) UniqueSet<Map>(map_list->length(), zone); 2761 UniqueSet<Map>* maps = new(zone) UniqueSet<Map>(map_list->length(), zone);
2759 for (int i = 0; i < map_list->length(); ++i) { 2762 for (int i = 0; i < map_list->length(); ++i) {
2760 maps->Add(Unique<Map>::CreateImmovable(map_list->at(i)), zone); 2763 maps->Add(Unique<Map>::CreateImmovable(map_list->at(i)), zone);
2761 } 2764 }
2762 return new(zone) HCheckMaps(value, maps, typecheck); 2765 return new(zone) HCheckMaps(value, maps, typecheck);
2763 } 2766 }
2764 2767
2765 bool IsStabilityCheck() const { return is_stability_check_; } 2768 bool IsStabilityCheck() const { return is_stability_check_; }
2766 void MarkAsStabilityCheck() { 2769 void MarkAsStabilityCheck() {
2770 maps_are_stable_ = true;
2767 has_migration_target_ = false; 2771 has_migration_target_ = false;
2768 is_stability_check_ = true; 2772 is_stability_check_ = true;
2769 ClearChangesFlag(kNewSpacePromotion); 2773 ClearChangesFlag(kNewSpacePromotion);
2770 ClearDependsOnFlag(kElementsKind); 2774 ClearDependsOnFlag(kElementsKind);
2771 ClearDependsOnFlag(kMaps); 2775 ClearDependsOnFlag(kMaps);
2772 } 2776 }
2773 2777
2774 virtual bool HasEscapingOperandAt(int index) V8_OVERRIDE { return false; } 2778 virtual bool HasEscapingOperandAt(int index) V8_OVERRIDE { return false; }
2775 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 2779 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
2776 return Representation::Tagged(); 2780 return Representation::Tagged();
(...skipping 10 matching lines...) Expand all
2787 2791
2788 bool HasMigrationTarget() const { return has_migration_target_; } 2792 bool HasMigrationTarget() const { return has_migration_target_; }
2789 2793
2790 virtual HValue* Canonicalize() V8_OVERRIDE; 2794 virtual HValue* Canonicalize() V8_OVERRIDE;
2791 2795
2792 static HCheckMaps* CreateAndInsertAfter(Zone* zone, 2796 static HCheckMaps* CreateAndInsertAfter(Zone* zone,
2793 HValue* value, 2797 HValue* value,
2794 Unique<Map> map, 2798 Unique<Map> map,
2795 bool map_is_stable, 2799 bool map_is_stable,
2796 HInstruction* instr) { 2800 HInstruction* instr) {
2797 return CreateAndInsertAfter(zone, value, new(zone) UniqueSet<Map>( 2801 return instr->Append(new(zone) HCheckMaps(
2798 map, zone), map_is_stable, instr); 2802 value, new(zone) UniqueSet<Map>(map, zone), map_is_stable));
2799 } 2803 }
2800 2804
2801 static HCheckMaps* CreateAndInsertAfter(Zone* zone, 2805 static HCheckMaps* CreateAndInsertBefore(Zone* zone,
2802 HValue* value, 2806 HValue* value,
2803 const UniqueSet<Map>* maps, 2807 const UniqueSet<Map>* maps,
2804 bool maps_are_stable, 2808 bool maps_are_stable,
2805 HInstruction* instr) { 2809 HInstruction* instr) {
2806 return instr->Append(new(zone) HCheckMaps(value, maps, maps_are_stable)); 2810 return instr->Prepend(new(zone) HCheckMaps(value, maps, maps_are_stable));
2807 } 2811 }
2808 2812
2809 DECLARE_CONCRETE_INSTRUCTION(CheckMaps) 2813 DECLARE_CONCRETE_INSTRUCTION(CheckMaps)
2810 2814
2811 protected: 2815 protected:
2812 virtual bool DataEquals(HValue* other) V8_OVERRIDE { 2816 virtual bool DataEquals(HValue* other) V8_OVERRIDE {
2813 return this->maps()->Equals(HCheckMaps::cast(other)->maps()); 2817 return this->maps()->Equals(HCheckMaps::cast(other)->maps());
2814 } 2818 }
2815 2819
2816 virtual int RedefinedOperandIndex() { return 0; } 2820 virtual int RedefinedOperandIndex() { return 0; }
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
3490 static HConstant* CreateAndInsertBefore(Zone* zone, 3494 static HConstant* CreateAndInsertBefore(Zone* zone,
3491 HValue* context, 3495 HValue* context,
3492 int32_t value, 3496 int32_t value,
3493 Representation representation, 3497 Representation representation,
3494 HInstruction* instruction) { 3498 HInstruction* instruction) {
3495 return instruction->Prepend(HConstant::New( 3499 return instruction->Prepend(HConstant::New(
3496 zone, context, value, representation)); 3500 zone, context, value, representation));
3497 } 3501 }
3498 3502
3499 static HConstant* CreateAndInsertBefore(Zone* zone, 3503 static HConstant* CreateAndInsertBefore(Zone* zone,
3500 Unique<Object> object, 3504 Unique<Map> map,
3501 bool is_not_in_new_space, 3505 bool map_is_stable,
3502 HInstruction* instruction) { 3506 HInstruction* instruction) {
3503 return instruction->Prepend(new(zone) HConstant( 3507 return instruction->Prepend(new(zone) HConstant(
3504 object, Unique<Map>(Handle<Map>::null()), false, 3508 map, Unique<Map>(Handle<Map>::null()), map_is_stable,
3505 Representation::Tagged(), HType::Tagged(), is_not_in_new_space, 3509 Representation::Tagged(), HType::Tagged(), true,
3506 false, false, kUnknownInstanceType)); 3510 false, false, MAP_TYPE));
3507 } 3511 }
3508 3512
3509 static HConstant* CreateAndInsertAfter(Zone* zone, 3513 static HConstant* CreateAndInsertAfter(Zone* zone,
3510 Unique<Map> map, 3514 Unique<Map> map,
3515 bool map_is_stable,
3511 HInstruction* instruction) { 3516 HInstruction* instruction) {
3512 return instruction->Append(new(zone) HConstant( 3517 return instruction->Append(new(zone) HConstant(
3513 map, Unique<Map>(Handle<Map>::null()), false, 3518 map, Unique<Map>(Handle<Map>::null()), map_is_stable,
3514 Representation::Tagged(), HType::Tagged(), true, 3519 Representation::Tagged(), HType::Tagged(), true,
3515 false, false, MAP_TYPE)); 3520 false, false, MAP_TYPE));
3516 } 3521 }
3517 3522
3518 Handle<Object> handle(Isolate* isolate) { 3523 Handle<Object> handle(Isolate* isolate) {
3519 if (object_.handle().is_null()) { 3524 if (object_.handle().is_null()) {
3520 // Default arguments to is_not_in_new_space depend on this heap number 3525 // Default arguments to is_not_in_new_space depend on this heap number
3521 // to be tenured so that it's guaranteed not to be located in new space. 3526 // to be tenured so that it's guaranteed not to be located in new space.
3522 object_ = Unique<Object>::CreateUninitialized( 3527 object_ = Unique<Object>::CreateUninitialized(
3523 isolate->factory()->NewNumber(double_value_, TENURED)); 3528 isolate->factory()->NewNumber(double_value_, TENURED));
(...skipping 4127 matching lines...) Expand 10 before | Expand all | Expand 10 after
7651 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7656 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7652 }; 7657 };
7653 7658
7654 7659
7655 #undef DECLARE_INSTRUCTION 7660 #undef DECLARE_INSTRUCTION
7656 #undef DECLARE_CONCRETE_INSTRUCTION 7661 #undef DECLARE_CONCRETE_INSTRUCTION
7657 7662
7658 } } // namespace v8::internal 7663 } } // namespace v8::internal
7659 7664
7660 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7665 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen-check-elimination.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698