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

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

Issue 163263002: Allow map check hoisting in GVN for stable maps. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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 | « no previous file | test/cctest/test-deoptimization.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 // 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 1539 matching lines...) Expand 10 before | Expand all | Expand 10 after
1550 HCompareMap(HValue* value, 1550 HCompareMap(HValue* value,
1551 Handle<Map> map, 1551 Handle<Map> map,
1552 CompilationInfo* info, 1552 CompilationInfo* info,
1553 HBasicBlock* true_target = NULL, 1553 HBasicBlock* true_target = NULL,
1554 HBasicBlock* false_target = NULL) 1554 HBasicBlock* false_target = NULL)
1555 : HUnaryControlInstruction(value, true_target, false_target), 1555 : HUnaryControlInstruction(value, true_target, false_target),
1556 known_successor_index_(kNoKnownSuccessorIndex), map_(Unique<Map>(map)) { 1556 known_successor_index_(kNoKnownSuccessorIndex), map_(Unique<Map>(map)) {
1557 ASSERT(!map.is_null()); 1557 ASSERT(!map.is_null());
1558 is_stable_ = map->is_stable(); 1558 is_stable_ = map->is_stable();
1559 1559
1560 if (FLAG_check_elimination && is_stable_) { 1560 if (is_stable_) {
1561 map->AddDependentCompilationInfo( 1561 map->AddDependentCompilationInfo(
1562 DependentCode::kPrototypeCheckGroup, info); 1562 DependentCode::kPrototypeCheckGroup, info);
1563 } 1563 }
1564 } 1564 }
1565 1565
1566 int known_successor_index_; 1566 int known_successor_index_;
1567 bool is_stable_; 1567 bool is_stable_;
1568 Unique<Map> map_; 1568 Unique<Map> map_;
1569 }; 1569 };
1570 1570
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after
2693 virtual bool DataEquals(HValue* other) V8_OVERRIDE { 2693 virtual bool DataEquals(HValue* other) V8_OVERRIDE {
2694 return this->map_set_.Equals(&HCheckMaps::cast(other)->map_set_); 2694 return this->map_set_.Equals(&HCheckMaps::cast(other)->map_set_);
2695 } 2695 }
2696 2696
2697 virtual int RedefinedOperandIndex() { return 0; } 2697 virtual int RedefinedOperandIndex() { return 0; }
2698 2698
2699 private: 2699 private:
2700 void Add(Handle<Map> map, CompilationInfo* info, Zone* zone) { 2700 void Add(Handle<Map> map, CompilationInfo* info, Zone* zone) {
2701 map_set_.Add(Unique<Map>(map), zone); 2701 map_set_.Add(Unique<Map>(map), zone);
2702 is_stable_ = is_stable_ && map->is_stable(); 2702 is_stable_ = is_stable_ && map->is_stable();
2703 2703 if (is_stable_) {
2704 if (FLAG_check_elimination && is_stable_) {
2705 map->AddDependentCompilationInfo( 2704 map->AddDependentCompilationInfo(
2706 DependentCode::kPrototypeCheckGroup, info); 2705 DependentCode::kPrototypeCheckGroup, info);
2706 } else {
2707 SetDependsOnFlag(kMaps);
2708 SetDependsOnFlag(kElementsKind);
2707 } 2709 }
2708 2710
2709 if (!has_migration_target_ && map->is_migration_target()) { 2711 if (!has_migration_target_ && map->is_migration_target()) {
2710 has_migration_target_ = true; 2712 has_migration_target_ = true;
2711 SetChangesFlag(kNewSpacePromotion); 2713 SetChangesFlag(kNewSpacePromotion);
2712 } 2714 }
2713 } 2715 }
2714 2716
2715 // Clients should use one of the static New* methods above. 2717 // Clients should use one of the static New* methods above.
2716 HCheckMaps(HValue* value, Zone *zone, HValue* typecheck) 2718 HCheckMaps(HValue* value, Zone *zone, HValue* typecheck)
2717 : HTemplateInstruction<2>(value->type()), 2719 : HTemplateInstruction<2>(value->type()),
2718 omit_(false), has_migration_target_(false), is_stable_(true) { 2720 omit_(false), has_migration_target_(false), is_stable_(true) {
2719 SetOperandAt(0, value); 2721 SetOperandAt(0, value);
2720 // Use the object value for the dependency if NULL is passed. 2722 // Use the object value for the dependency if NULL is passed.
2721 SetOperandAt(1, typecheck != NULL ? typecheck : value); 2723 SetOperandAt(1, typecheck != NULL ? typecheck : value);
2722 set_representation(Representation::Tagged()); 2724 set_representation(Representation::Tagged());
2723 SetFlag(kUseGVN); 2725 SetFlag(kUseGVN);
2724 SetFlag(kTrackSideEffectDominators); 2726 SetFlag(kTrackSideEffectDominators);
2725 SetDependsOnFlag(kMaps);
2726 SetDependsOnFlag(kElementsKind);
2727 } 2727 }
2728 2728
2729 bool omit_; 2729 bool omit_;
2730 bool has_migration_target_; 2730 bool has_migration_target_;
2731 bool is_stable_; 2731 bool is_stable_;
2732 UniqueSet<Map> map_set_; 2732 UniqueSet<Map> map_set_;
2733 }; 2733 };
2734 2734
2735 2735
2736 class HCheckValue V8_FINAL : public HUnaryOperation { 2736 class HCheckValue V8_FINAL : public HUnaryOperation {
(...skipping 3762 matching lines...) Expand 10 before | Expand all | Expand 10 after
6499 void SetTransition(HConstant* map_constant, CompilationInfo* info) { 6499 void SetTransition(HConstant* map_constant, CompilationInfo* info) {
6500 ASSERT(!has_transition()); // Only set once. 6500 ASSERT(!has_transition()); // Only set once.
6501 Handle<Map> map = Handle<Map>::cast(map_constant->handle(info->isolate())); 6501 Handle<Map> map = Handle<Map>::cast(map_constant->handle(info->isolate()));
6502 if (map->CanBeDeprecated()) { 6502 if (map->CanBeDeprecated()) {
6503 map->AddDependentCompilationInfo(DependentCode::kTransitionGroup, info); 6503 map->AddDependentCompilationInfo(DependentCode::kTransitionGroup, info);
6504 } 6504 }
6505 SetOperandAt(2, map_constant); 6505 SetOperandAt(2, map_constant);
6506 has_transition_ = true; 6506 has_transition_ = true;
6507 is_stable_ = map->is_stable(); 6507 is_stable_ = map->is_stable();
6508 6508
6509 if (FLAG_check_elimination && is_stable_) { 6509 if (is_stable_) {
6510 map->AddDependentCompilationInfo( 6510 map->AddDependentCompilationInfo(
6511 DependentCode::kPrototypeCheckGroup, info); 6511 DependentCode::kPrototypeCheckGroup, info);
6512 } 6512 }
6513 } 6513 }
6514 6514
6515 bool is_stable() const { 6515 bool is_stable() const {
6516 return is_stable_; 6516 return is_stable_;
6517 } 6517 }
6518 6518
6519 bool NeedsWriteBarrier() { 6519 bool NeedsWriteBarrier() {
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
7455 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7455 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7456 }; 7456 };
7457 7457
7458 7458
7459 #undef DECLARE_INSTRUCTION 7459 #undef DECLARE_INSTRUCTION
7460 #undef DECLARE_CONCRETE_INSTRUCTION 7460 #undef DECLARE_CONCRETE_INSTRUCTION
7461 7461
7462 } } // namespace v8::internal 7462 } } // namespace v8::internal
7463 7463
7464 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7464 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-deoptimization.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698