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_H_ | 5 #ifndef V8_HYDROGEN_H_ |
6 #define V8_HYDROGEN_H_ | 6 #define V8_HYDROGEN_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 bool IsFinished() const { return end_ != NULL; } | 87 bool IsFinished() const { return end_ != NULL; } |
88 void AddPhi(HPhi* phi); | 88 void AddPhi(HPhi* phi); |
89 void RemovePhi(HPhi* phi); | 89 void RemovePhi(HPhi* phi); |
90 void AddInstruction(HInstruction* instr, HSourcePosition position); | 90 void AddInstruction(HInstruction* instr, HSourcePosition position); |
91 bool Dominates(HBasicBlock* other) const; | 91 bool Dominates(HBasicBlock* other) const; |
92 bool EqualToOrDominates(HBasicBlock* other) const; | 92 bool EqualToOrDominates(HBasicBlock* other) const; |
93 int LoopNestingDepth() const; | 93 int LoopNestingDepth() const; |
94 | 94 |
95 void SetInitialEnvironment(HEnvironment* env); | 95 void SetInitialEnvironment(HEnvironment* env); |
96 void ClearEnvironment() { | 96 void ClearEnvironment() { |
97 ASSERT(IsFinished()); | 97 DCHECK(IsFinished()); |
98 ASSERT(end()->SuccessorCount() == 0); | 98 DCHECK(end()->SuccessorCount() == 0); |
99 last_environment_ = NULL; | 99 last_environment_ = NULL; |
100 } | 100 } |
101 bool HasEnvironment() const { return last_environment_ != NULL; } | 101 bool HasEnvironment() const { return last_environment_ != NULL; } |
102 void UpdateEnvironment(HEnvironment* env); | 102 void UpdateEnvironment(HEnvironment* env); |
103 HBasicBlock* parent_loop_header() const { return parent_loop_header_; } | 103 HBasicBlock* parent_loop_header() const { return parent_loop_header_; } |
104 | 104 |
105 void set_parent_loop_header(HBasicBlock* block) { | 105 void set_parent_loop_header(HBasicBlock* block) { |
106 ASSERT(parent_loop_header_ == NULL); | 106 DCHECK(parent_loop_header_ == NULL); |
107 parent_loop_header_ = block; | 107 parent_loop_header_ = block; |
108 } | 108 } |
109 | 109 |
110 bool HasParentLoopHeader() const { return parent_loop_header_ != NULL; } | 110 bool HasParentLoopHeader() const { return parent_loop_header_ != NULL; } |
111 | 111 |
112 void SetJoinId(BailoutId ast_id); | 112 void SetJoinId(BailoutId ast_id); |
113 | 113 |
114 int PredecessorIndexOf(HBasicBlock* predecessor) const; | 114 int PredecessorIndexOf(HBasicBlock* predecessor) const; |
115 HPhi* AddNewPhi(int merged_index); | 115 HPhi* AddNewPhi(int merged_index); |
116 HSimulate* AddNewSimulate(BailoutId ast_id, | 116 HSimulate* AddNewSimulate(BailoutId ast_id, |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 return arguments_object_.get(); | 354 return arguments_object_.get(); |
355 } | 355 } |
356 | 356 |
357 void SetArgumentsObject(HArgumentsObject* object) { | 357 void SetArgumentsObject(HArgumentsObject* object) { |
358 arguments_object_.set(object); | 358 arguments_object_.set(object); |
359 } | 359 } |
360 | 360 |
361 int GetMaximumValueID() const { return values_.length(); } | 361 int GetMaximumValueID() const { return values_.length(); } |
362 int GetNextBlockID() { return next_block_id_++; } | 362 int GetNextBlockID() { return next_block_id_++; } |
363 int GetNextValueID(HValue* value) { | 363 int GetNextValueID(HValue* value) { |
364 ASSERT(!disallow_adding_new_values_); | 364 DCHECK(!disallow_adding_new_values_); |
365 values_.Add(value, zone()); | 365 values_.Add(value, zone()); |
366 return values_.length() - 1; | 366 return values_.length() - 1; |
367 } | 367 } |
368 HValue* LookupValue(int id) const { | 368 HValue* LookupValue(int id) const { |
369 if (id >= 0 && id < values_.length()) return values_[id]; | 369 if (id >= 0 && id < values_.length()) return values_[id]; |
370 return NULL; | 370 return NULL; |
371 } | 371 } |
372 void DisallowAddingNewValues() { | 372 void DisallowAddingNewValues() { |
373 disallow_adding_new_values_ = true; | 373 disallow_adding_new_values_ = true; |
374 } | 374 } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 handle(isolate()->initial_array_prototype()->map()), | 429 handle(isolate()->initial_array_prototype()->map()), |
430 DependentCode::kElementsCantBeAddedGroup, info()); | 430 DependentCode::kElementsCantBeAddedGroup, info()); |
431 depends_on_empty_array_proto_elements_ = true; | 431 depends_on_empty_array_proto_elements_ = true; |
432 } | 432 } |
433 | 433 |
434 bool depends_on_empty_array_proto_elements() { | 434 bool depends_on_empty_array_proto_elements() { |
435 return depends_on_empty_array_proto_elements_; | 435 return depends_on_empty_array_proto_elements_; |
436 } | 436 } |
437 | 437 |
438 bool has_uint32_instructions() { | 438 bool has_uint32_instructions() { |
439 ASSERT(uint32_instructions_ == NULL || !uint32_instructions_->is_empty()); | 439 DCHECK(uint32_instructions_ == NULL || !uint32_instructions_->is_empty()); |
440 return uint32_instructions_ != NULL; | 440 return uint32_instructions_ != NULL; |
441 } | 441 } |
442 | 442 |
443 ZoneList<HInstruction*>* uint32_instructions() { | 443 ZoneList<HInstruction*>* uint32_instructions() { |
444 ASSERT(uint32_instructions_ == NULL || !uint32_instructions_->is_empty()); | 444 DCHECK(uint32_instructions_ == NULL || !uint32_instructions_->is_empty()); |
445 return uint32_instructions_; | 445 return uint32_instructions_; |
446 } | 446 } |
447 | 447 |
448 void RecordUint32Instruction(HInstruction* instr) { | 448 void RecordUint32Instruction(HInstruction* instr) { |
449 ASSERT(uint32_instructions_ == NULL || !uint32_instructions_->is_empty()); | 449 DCHECK(uint32_instructions_ == NULL || !uint32_instructions_->is_empty()); |
450 if (uint32_instructions_ == NULL) { | 450 if (uint32_instructions_ == NULL) { |
451 uint32_instructions_ = new(zone()) ZoneList<HInstruction*>(4, zone()); | 451 uint32_instructions_ = new(zone()) ZoneList<HInstruction*>(4, zone()); |
452 } | 452 } |
453 uint32_instructions_->Add(instr, zone()); | 453 uint32_instructions_->Add(instr, zone()); |
454 } | 454 } |
455 | 455 |
456 void IncrementInNoSideEffectsScope() { no_side_effects_scope_count_++; } | 456 void IncrementInNoSideEffectsScope() { no_side_effects_scope_count_++; } |
457 void DecrementInNoSideEffectsScope() { no_side_effects_scope_count_--; } | 457 void DecrementInNoSideEffectsScope() { no_side_effects_scope_count_--; } |
458 bool IsInsideNoSideEffectsScope() { return no_side_effects_scope_count_ > 0; } | 458 bool IsInsideNoSideEffectsScope() { return no_side_effects_scope_count_ > 0; } |
459 | 459 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 void BindContext(HValue* value) { | 599 void BindContext(HValue* value) { |
600 Bind(parameter_count(), value); | 600 Bind(parameter_count(), value); |
601 } | 601 } |
602 | 602 |
603 HValue* Lookup(Variable* variable) const { | 603 HValue* Lookup(Variable* variable) const { |
604 return Lookup(IndexFor(variable)); | 604 return Lookup(IndexFor(variable)); |
605 } | 605 } |
606 | 606 |
607 HValue* Lookup(int index) const { | 607 HValue* Lookup(int index) const { |
608 HValue* result = values_[index]; | 608 HValue* result = values_[index]; |
609 ASSERT(result != NULL); | 609 DCHECK(result != NULL); |
610 return result; | 610 return result; |
611 } | 611 } |
612 | 612 |
613 HValue* context() const { | 613 HValue* context() const { |
614 // Return first special. | 614 // Return first special. |
615 return Lookup(parameter_count()); | 615 return Lookup(parameter_count()); |
616 } | 616 } |
617 | 617 |
618 void Push(HValue* value) { | 618 void Push(HValue* value) { |
619 ASSERT(value != NULL); | 619 DCHECK(value != NULL); |
620 ++push_count_; | 620 ++push_count_; |
621 values_.Add(value, zone()); | 621 values_.Add(value, zone()); |
622 } | 622 } |
623 | 623 |
624 HValue* Pop() { | 624 HValue* Pop() { |
625 ASSERT(!ExpressionStackIsEmpty()); | 625 DCHECK(!ExpressionStackIsEmpty()); |
626 if (push_count_ > 0) { | 626 if (push_count_ > 0) { |
627 --push_count_; | 627 --push_count_; |
628 } else { | 628 } else { |
629 ++pop_count_; | 629 ++pop_count_; |
630 } | 630 } |
631 return values_.RemoveLast(); | 631 return values_.RemoveLast(); |
632 } | 632 } |
633 | 633 |
634 void Drop(int count); | 634 void Drop(int count); |
635 | 635 |
636 HValue* Top() const { return ExpressionStackAt(0); } | 636 HValue* Top() const { return ExpressionStackAt(0); } |
637 | 637 |
638 bool ExpressionStackIsEmpty() const; | 638 bool ExpressionStackIsEmpty() const; |
639 | 639 |
640 HValue* ExpressionStackAt(int index_from_top) const { | 640 HValue* ExpressionStackAt(int index_from_top) const { |
641 int index = length() - index_from_top - 1; | 641 int index = length() - index_from_top - 1; |
642 ASSERT(HasExpressionAt(index)); | 642 DCHECK(HasExpressionAt(index)); |
643 return values_[index]; | 643 return values_[index]; |
644 } | 644 } |
645 | 645 |
646 void SetExpressionStackAt(int index_from_top, HValue* value); | 646 void SetExpressionStackAt(int index_from_top, HValue* value); |
647 | 647 |
648 HEnvironment* Copy() const; | 648 HEnvironment* Copy() const; |
649 HEnvironment* CopyWithoutHistory() const; | 649 HEnvironment* CopyWithoutHistory() const; |
650 HEnvironment* CopyAsLoopHeader(HBasicBlock* block) const; | 650 HEnvironment* CopyAsLoopHeader(HBasicBlock* block) const; |
651 | 651 |
652 // Create an "inlined version" of this environment, where the original | 652 // Create an "inlined version" of this environment, where the original |
(...skipping 14 matching lines...) Expand all Loading... |
667 | 667 |
668 void AddIncomingEdge(HBasicBlock* block, HEnvironment* other); | 668 void AddIncomingEdge(HBasicBlock* block, HEnvironment* other); |
669 | 669 |
670 void ClearHistory() { | 670 void ClearHistory() { |
671 pop_count_ = 0; | 671 pop_count_ = 0; |
672 push_count_ = 0; | 672 push_count_ = 0; |
673 assigned_variables_.Clear(); | 673 assigned_variables_.Clear(); |
674 } | 674 } |
675 | 675 |
676 void SetValueAt(int index, HValue* value) { | 676 void SetValueAt(int index, HValue* value) { |
677 ASSERT(index < length()); | 677 DCHECK(index < length()); |
678 values_[index] = value; | 678 values_[index] = value; |
679 } | 679 } |
680 | 680 |
681 // Map a variable to an environment index. Parameter indices are shifted | 681 // Map a variable to an environment index. Parameter indices are shifted |
682 // by 1 (receiver is parameter index -1 but environment index 0). | 682 // by 1 (receiver is parameter index -1 but environment index 0). |
683 // Stack-allocated local indices are shifted by the number of parameters. | 683 // Stack-allocated local indices are shifted by the number of parameters. |
684 int IndexFor(Variable* variable) const { | 684 int IndexFor(Variable* variable) const { |
685 ASSERT(variable->IsStackAllocated()); | 685 DCHECK(variable->IsStackAllocated()); |
686 int shift = variable->IsParameter() | 686 int shift = variable->IsParameter() |
687 ? 1 | 687 ? 1 |
688 : parameter_count_ + specials_count_; | 688 : parameter_count_ + specials_count_; |
689 return variable->index() + shift; | 689 return variable->index() + shift; |
690 } | 690 } |
691 | 691 |
692 bool is_local_index(int i) const { | 692 bool is_local_index(int i) const { |
693 return i >= first_local_index() && i < first_expression_index(); | 693 return i >= first_local_index() && i < first_expression_index(); |
694 } | 694 } |
695 | 695 |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 | 865 |
866 virtual void ReturnValue(HValue* value) V8_OVERRIDE; | 866 virtual void ReturnValue(HValue* value) V8_OVERRIDE; |
867 virtual void ReturnInstruction(HInstruction* instr, | 867 virtual void ReturnInstruction(HInstruction* instr, |
868 BailoutId ast_id) V8_OVERRIDE; | 868 BailoutId ast_id) V8_OVERRIDE; |
869 virtual void ReturnControl(HControlInstruction* instr, | 869 virtual void ReturnControl(HControlInstruction* instr, |
870 BailoutId ast_id) V8_OVERRIDE; | 870 BailoutId ast_id) V8_OVERRIDE; |
871 virtual void ReturnContinuation(HIfContinuation* continuation, | 871 virtual void ReturnContinuation(HIfContinuation* continuation, |
872 BailoutId ast_id) V8_OVERRIDE; | 872 BailoutId ast_id) V8_OVERRIDE; |
873 | 873 |
874 static TestContext* cast(AstContext* context) { | 874 static TestContext* cast(AstContext* context) { |
875 ASSERT(context->IsTest()); | 875 DCHECK(context->IsTest()); |
876 return reinterpret_cast<TestContext*>(context); | 876 return reinterpret_cast<TestContext*>(context); |
877 } | 877 } |
878 | 878 |
879 Expression* condition() const { return condition_; } | 879 Expression* condition() const { return condition_; } |
880 HBasicBlock* if_true() const { return if_true_; } | 880 HBasicBlock* if_true() const { return if_true_; } |
881 HBasicBlock* if_false() const { return if_false_; } | 881 HBasicBlock* if_false() const { return if_false_; } |
882 | 882 |
883 private: | 883 private: |
884 // Build the shared core part of the translation unpacking a value into | 884 // Build the shared core part of the translation unpacking a value into |
885 // control flow. | 885 // control flow. |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 class HIfContinuation V8_FINAL { | 967 class HIfContinuation V8_FINAL { |
968 public: | 968 public: |
969 HIfContinuation() | 969 HIfContinuation() |
970 : continuation_captured_(false), | 970 : continuation_captured_(false), |
971 true_branch_(NULL), | 971 true_branch_(NULL), |
972 false_branch_(NULL) {} | 972 false_branch_(NULL) {} |
973 HIfContinuation(HBasicBlock* true_branch, | 973 HIfContinuation(HBasicBlock* true_branch, |
974 HBasicBlock* false_branch) | 974 HBasicBlock* false_branch) |
975 : continuation_captured_(true), true_branch_(true_branch), | 975 : continuation_captured_(true), true_branch_(true_branch), |
976 false_branch_(false_branch) {} | 976 false_branch_(false_branch) {} |
977 ~HIfContinuation() { ASSERT(!continuation_captured_); } | 977 ~HIfContinuation() { DCHECK(!continuation_captured_); } |
978 | 978 |
979 void Capture(HBasicBlock* true_branch, | 979 void Capture(HBasicBlock* true_branch, |
980 HBasicBlock* false_branch) { | 980 HBasicBlock* false_branch) { |
981 ASSERT(!continuation_captured_); | 981 DCHECK(!continuation_captured_); |
982 true_branch_ = true_branch; | 982 true_branch_ = true_branch; |
983 false_branch_ = false_branch; | 983 false_branch_ = false_branch; |
984 continuation_captured_ = true; | 984 continuation_captured_ = true; |
985 } | 985 } |
986 | 986 |
987 void Continue(HBasicBlock** true_branch, | 987 void Continue(HBasicBlock** true_branch, |
988 HBasicBlock** false_branch) { | 988 HBasicBlock** false_branch) { |
989 ASSERT(continuation_captured_); | 989 DCHECK(continuation_captured_); |
990 *true_branch = true_branch_; | 990 *true_branch = true_branch_; |
991 *false_branch = false_branch_; | 991 *false_branch = false_branch_; |
992 continuation_captured_ = false; | 992 continuation_captured_ = false; |
993 } | 993 } |
994 | 994 |
995 bool IsTrueReachable() { return true_branch_ != NULL; } | 995 bool IsTrueReachable() { return true_branch_ != NULL; } |
996 bool IsFalseReachable() { return false_branch_ != NULL; } | 996 bool IsFalseReachable() { return false_branch_ != NULL; } |
997 bool TrueAndFalseReachable() { | 997 bool TrueAndFalseReachable() { |
998 return IsTrueReachable() || IsFalseReachable(); | 998 return IsTrueReachable() || IsFalseReachable(); |
999 } | 999 } |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1120 } | 1120 } |
1121 | 1121 |
1122 template<class I, class P1> | 1122 template<class I, class P1> |
1123 I* New(P1 p1) { return I::New(zone(), context(), p1); } | 1123 I* New(P1 p1) { return I::New(zone(), context(), p1); } |
1124 | 1124 |
1125 template<class I, class P1> | 1125 template<class I, class P1> |
1126 HInstruction* AddUncasted(P1 p1) { | 1126 HInstruction* AddUncasted(P1 p1) { |
1127 HInstruction* result = AddInstruction(NewUncasted<I>(p1)); | 1127 HInstruction* result = AddInstruction(NewUncasted<I>(p1)); |
1128 // Specializations must have their parameters properly casted | 1128 // Specializations must have their parameters properly casted |
1129 // to avoid landing here. | 1129 // to avoid landing here. |
1130 ASSERT(!result->IsReturn() && !result->IsSimulate() && | 1130 DCHECK(!result->IsReturn() && !result->IsSimulate() && |
1131 !result->IsDeoptimize()); | 1131 !result->IsDeoptimize()); |
1132 return result; | 1132 return result; |
1133 } | 1133 } |
1134 | 1134 |
1135 template<class I, class P1> | 1135 template<class I, class P1> |
1136 I* Add(P1 p1) { | 1136 I* Add(P1 p1) { |
1137 I* result = AddInstructionTyped(New<I>(p1)); | 1137 I* result = AddInstructionTyped(New<I>(p1)); |
1138 // Specializations must have their parameters properly casted | 1138 // Specializations must have their parameters properly casted |
1139 // to avoid landing here. | 1139 // to avoid landing here. |
1140 ASSERT(!result->IsReturn() && !result->IsSimulate() && | 1140 DCHECK(!result->IsReturn() && !result->IsSimulate() && |
1141 !result->IsDeoptimize()); | 1141 !result->IsDeoptimize()); |
1142 return result; | 1142 return result; |
1143 } | 1143 } |
1144 | 1144 |
1145 template<class I, class P1, class P2> | 1145 template<class I, class P1, class P2> |
1146 HInstruction* NewUncasted(P1 p1, P2 p2) { | 1146 HInstruction* NewUncasted(P1 p1, P2 p2) { |
1147 return I::New(zone(), context(), p1, p2); | 1147 return I::New(zone(), context(), p1, p2); |
1148 } | 1148 } |
1149 | 1149 |
1150 template<class I, class P1, class P2> | 1150 template<class I, class P1, class P2> |
1151 I* New(P1 p1, P2 p2) { | 1151 I* New(P1 p1, P2 p2) { |
1152 return I::New(zone(), context(), p1, p2); | 1152 return I::New(zone(), context(), p1, p2); |
1153 } | 1153 } |
1154 | 1154 |
1155 template<class I, class P1, class P2> | 1155 template<class I, class P1, class P2> |
1156 HInstruction* AddUncasted(P1 p1, P2 p2) { | 1156 HInstruction* AddUncasted(P1 p1, P2 p2) { |
1157 HInstruction* result = AddInstruction(NewUncasted<I>(p1, p2)); | 1157 HInstruction* result = AddInstruction(NewUncasted<I>(p1, p2)); |
1158 // Specializations must have their parameters properly casted | 1158 // Specializations must have their parameters properly casted |
1159 // to avoid landing here. | 1159 // to avoid landing here. |
1160 ASSERT(!result->IsSimulate()); | 1160 DCHECK(!result->IsSimulate()); |
1161 return result; | 1161 return result; |
1162 } | 1162 } |
1163 | 1163 |
1164 template<class I, class P1, class P2> | 1164 template<class I, class P1, class P2> |
1165 I* Add(P1 p1, P2 p2) { | 1165 I* Add(P1 p1, P2 p2) { |
1166 I* result = AddInstructionTyped(New<I>(p1, p2)); | 1166 I* result = AddInstructionTyped(New<I>(p1, p2)); |
1167 // Specializations must have their parameters properly casted | 1167 // Specializations must have their parameters properly casted |
1168 // to avoid landing here. | 1168 // to avoid landing here. |
1169 ASSERT(!result->IsSimulate()); | 1169 DCHECK(!result->IsSimulate()); |
1170 return result; | 1170 return result; |
1171 } | 1171 } |
1172 | 1172 |
1173 template<class I, class P1, class P2, class P3> | 1173 template<class I, class P1, class P2, class P3> |
1174 HInstruction* NewUncasted(P1 p1, P2 p2, P3 p3) { | 1174 HInstruction* NewUncasted(P1 p1, P2 p2, P3 p3) { |
1175 return I::New(zone(), context(), p1, p2, p3); | 1175 return I::New(zone(), context(), p1, p2, p3); |
1176 } | 1176 } |
1177 | 1177 |
1178 template<class I, class P1, class P2, class P3> | 1178 template<class I, class P1, class P2, class P3> |
1179 I* New(P1 p1, P2 p2, P3 p3) { | 1179 I* New(P1 p1, P2 p2, P3 p3) { |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1628 } | 1628 } |
1629 | 1629 |
1630 void Return(HValue* value); | 1630 void Return(HValue* value); |
1631 | 1631 |
1632 private: | 1632 private: |
1633 void InitializeDontCreateBlocks(HGraphBuilder* builder); | 1633 void InitializeDontCreateBlocks(HGraphBuilder* builder); |
1634 | 1634 |
1635 HControlInstruction* AddCompare(HControlInstruction* compare); | 1635 HControlInstruction* AddCompare(HControlInstruction* compare); |
1636 | 1636 |
1637 HGraphBuilder* builder() const { | 1637 HGraphBuilder* builder() const { |
1638 ASSERT(builder_ != NULL); // Have you called "Initialize"? | 1638 DCHECK(builder_ != NULL); // Have you called "Initialize"? |
1639 return builder_; | 1639 return builder_; |
1640 } | 1640 } |
1641 | 1641 |
1642 void AddMergeAtJoinBlock(bool deopt); | 1642 void AddMergeAtJoinBlock(bool deopt); |
1643 | 1643 |
1644 void Finish(); | 1644 void Finish(); |
1645 void Finish(HBasicBlock** then_continuation, | 1645 void Finish(HBasicBlock** then_continuation, |
1646 HBasicBlock** else_continuation); | 1646 HBasicBlock** else_continuation); |
1647 | 1647 |
1648 class MergeAtJoinBlock : public ZoneObject { | 1648 class MergeAtJoinBlock : public ZoneObject { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1689 explicit LoopBuilder(HGraphBuilder* builder); // while (true) {...} | 1689 explicit LoopBuilder(HGraphBuilder* builder); // while (true) {...} |
1690 LoopBuilder(HGraphBuilder* builder, | 1690 LoopBuilder(HGraphBuilder* builder, |
1691 HValue* context, | 1691 HValue* context, |
1692 Direction direction); | 1692 Direction direction); |
1693 LoopBuilder(HGraphBuilder* builder, | 1693 LoopBuilder(HGraphBuilder* builder, |
1694 HValue* context, | 1694 HValue* context, |
1695 Direction direction, | 1695 Direction direction, |
1696 HValue* increment_amount); | 1696 HValue* increment_amount); |
1697 | 1697 |
1698 ~LoopBuilder() { | 1698 ~LoopBuilder() { |
1699 ASSERT(finished_); | 1699 DCHECK(finished_); |
1700 } | 1700 } |
1701 | 1701 |
1702 HValue* BeginBody( | 1702 HValue* BeginBody( |
1703 HValue* initial, | 1703 HValue* initial, |
1704 HValue* terminating, | 1704 HValue* terminating, |
1705 Token::Value token); | 1705 Token::Value token); |
1706 | 1706 |
1707 void BeginBody(int drop_count); | 1707 void BeginBody(int drop_count); |
1708 | 1708 |
1709 void Break(); | 1709 void Break(); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1893 HInstruction* BuildConstantMapCheck(Handle<JSObject> constant); | 1893 HInstruction* BuildConstantMapCheck(Handle<JSObject> constant); |
1894 HInstruction* BuildCheckPrototypeMaps(Handle<JSObject> prototype, | 1894 HInstruction* BuildCheckPrototypeMaps(Handle<JSObject> prototype, |
1895 Handle<JSObject> holder); | 1895 Handle<JSObject> holder); |
1896 | 1896 |
1897 HInstruction* BuildGetNativeContext(HValue* closure); | 1897 HInstruction* BuildGetNativeContext(HValue* closure); |
1898 HInstruction* BuildGetNativeContext(); | 1898 HInstruction* BuildGetNativeContext(); |
1899 HInstruction* BuildGetArrayFunction(); | 1899 HInstruction* BuildGetArrayFunction(); |
1900 | 1900 |
1901 protected: | 1901 protected: |
1902 void SetSourcePosition(int position) { | 1902 void SetSourcePosition(int position) { |
1903 ASSERT(position != RelocInfo::kNoPosition); | 1903 DCHECK(position != RelocInfo::kNoPosition); |
1904 position_.set_position(position - start_position_); | 1904 position_.set_position(position - start_position_); |
1905 } | 1905 } |
1906 | 1906 |
1907 void EnterInlinedSource(int start_position, int id) { | 1907 void EnterInlinedSource(int start_position, int id) { |
1908 if (FLAG_hydrogen_track_positions) { | 1908 if (FLAG_hydrogen_track_positions) { |
1909 start_position_ = start_position; | 1909 start_position_ = start_position; |
1910 position_.set_inlining_id(id); | 1910 position_.set_inlining_id(id); |
1911 } | 1911 } |
1912 } | 1912 } |
1913 | 1913 |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2473 | 2473 |
2474 bool IsJSObjectFieldAccessor() { | 2474 bool IsJSObjectFieldAccessor() { |
2475 int offset; // unused | 2475 int offset; // unused |
2476 return Accessors::IsJSObjectFieldAccessor<Type>(type_, name_, &offset); | 2476 return Accessors::IsJSObjectFieldAccessor<Type>(type_, name_, &offset); |
2477 } | 2477 } |
2478 | 2478 |
2479 bool GetJSObjectFieldAccess(HObjectAccess* access) { | 2479 bool GetJSObjectFieldAccess(HObjectAccess* access) { |
2480 int offset; | 2480 int offset; |
2481 if (Accessors::IsJSObjectFieldAccessor<Type>(type_, name_, &offset)) { | 2481 if (Accessors::IsJSObjectFieldAccessor<Type>(type_, name_, &offset)) { |
2482 if (type_->Is(Type::String())) { | 2482 if (type_->Is(Type::String())) { |
2483 ASSERT(String::Equals(isolate()->factory()->length_string(), name_)); | 2483 DCHECK(String::Equals(isolate()->factory()->length_string(), name_)); |
2484 *access = HObjectAccess::ForStringLength(); | 2484 *access = HObjectAccess::ForStringLength(); |
2485 } else if (type_->Is(Type::Array())) { | 2485 } else if (type_->Is(Type::Array())) { |
2486 ASSERT(String::Equals(isolate()->factory()->length_string(), name_)); | 2486 DCHECK(String::Equals(isolate()->factory()->length_string(), name_)); |
2487 *access = HObjectAccess::ForArrayLength(map()->elements_kind()); | 2487 *access = HObjectAccess::ForArrayLength(map()->elements_kind()); |
2488 } else { | 2488 } else { |
2489 *access = HObjectAccess::ForMapAndOffset(map(), offset); | 2489 *access = HObjectAccess::ForMapAndOffset(map(), offset); |
2490 } | 2490 } |
2491 return true; | 2491 return true; |
2492 } | 2492 } |
2493 return false; | 2493 return false; |
2494 } | 2494 } |
2495 | 2495 |
2496 bool has_holder() { return !holder_.is_null(); } | 2496 bool has_holder() { return !holder_.is_null(); } |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2834 tracer_ = tracer; | 2834 tracer_ = tracer; |
2835 tracer->PrintIndent(); | 2835 tracer->PrintIndent(); |
2836 tracer->trace_.Add("begin_%s\n", name); | 2836 tracer->trace_.Add("begin_%s\n", name); |
2837 tracer->indent_++; | 2837 tracer->indent_++; |
2838 } | 2838 } |
2839 | 2839 |
2840 ~Tag() { | 2840 ~Tag() { |
2841 tracer_->indent_--; | 2841 tracer_->indent_--; |
2842 tracer_->PrintIndent(); | 2842 tracer_->PrintIndent(); |
2843 tracer_->trace_.Add("end_%s\n", name_); | 2843 tracer_->trace_.Add("end_%s\n", name_); |
2844 ASSERT(tracer_->indent_ >= 0); | 2844 DCHECK(tracer_->indent_ >= 0); |
2845 tracer_->FlushToFile(); | 2845 tracer_->FlushToFile(); |
2846 } | 2846 } |
2847 | 2847 |
2848 private: | 2848 private: |
2849 HTracer* tracer_; | 2849 HTracer* tracer_; |
2850 const char* name_; | 2850 const char* name_; |
2851 }; | 2851 }; |
2852 | 2852 |
2853 void TraceLiveRange(LiveRange* range, const char* type, Zone* zone); | 2853 void TraceLiveRange(LiveRange* range, const char* type, Zone* zone); |
2854 void Trace(const char* name, HGraph* graph, LChunk* chunk); | 2854 void Trace(const char* name, HGraph* graph, LChunk* chunk); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2903 } | 2903 } |
2904 | 2904 |
2905 private: | 2905 private: |
2906 HGraphBuilder* builder_; | 2906 HGraphBuilder* builder_; |
2907 }; | 2907 }; |
2908 | 2908 |
2909 | 2909 |
2910 } } // namespace v8::internal | 2910 } } // namespace v8::internal |
2911 | 2911 |
2912 #endif // V8_HYDROGEN_H_ | 2912 #endif // V8_HYDROGEN_H_ |
OLD | NEW |