| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #include "hydrogen.h" | 5 #include "hydrogen.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "v8.h" | 9 #include "v8.h" |
| 10 #include "allocation-site-scopes.h" | 10 #include "allocation-site-scopes.h" |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 HConstant* HGraph::GetConstant1() { | 671 HConstant* HGraph::GetConstant1() { |
| 672 return GetConstant(&constant_1_, 1); | 672 return GetConstant(&constant_1_, 1); |
| 673 } | 673 } |
| 674 | 674 |
| 675 | 675 |
| 676 HConstant* HGraph::GetConstantMinus1() { | 676 HConstant* HGraph::GetConstantMinus1() { |
| 677 return GetConstant(&constant_minus1_, -1); | 677 return GetConstant(&constant_minus1_, -1); |
| 678 } | 678 } |
| 679 | 679 |
| 680 | 680 |
| 681 #define DEFINE_GET_CONSTANT(Name, name, htype, boolean_value) \ | 681 #define DEFINE_GET_CONSTANT(Name, name, type, htype, boolean_value) \ |
| 682 HConstant* HGraph::GetConstant##Name() { \ | 682 HConstant* HGraph::GetConstant##Name() { \ |
| 683 if (!constant_##name##_.is_set()) { \ | 683 if (!constant_##name##_.is_set()) { \ |
| 684 HConstant* constant = new(zone()) HConstant( \ | 684 HConstant* constant = new(zone()) HConstant( \ |
| 685 Unique<Object>::CreateImmovable(isolate()->factory()->name##_value()), \ | 685 Unique<Object>::CreateImmovable(isolate()->factory()->name##_value()), \ |
| 686 Unique<Map>::CreateImmovable(isolate()->factory()->type##_map()), \ |
| 687 false, \ |
| 686 Representation::Tagged(), \ | 688 Representation::Tagged(), \ |
| 687 htype, \ | 689 htype, \ |
| 688 true, \ | 690 true, \ |
| 689 boolean_value, \ | 691 boolean_value, \ |
| 690 false, \ | 692 false, \ |
| 691 ODDBALL_TYPE); \ | 693 ODDBALL_TYPE); \ |
| 692 constant->InsertAfter(entry_block()->first()); \ | 694 constant->InsertAfter(entry_block()->first()); \ |
| 693 constant_##name##_.set(constant); \ | 695 constant_##name##_.set(constant); \ |
| 694 } \ | 696 } \ |
| 695 return ReinsertConstantIfNecessary(constant_##name##_.get()); \ | 697 return ReinsertConstantIfNecessary(constant_##name##_.get()); \ |
| 696 } | 698 } |
| 697 | 699 |
| 698 | 700 |
| 699 DEFINE_GET_CONSTANT(Undefined, undefined, HType::Tagged(), false) | 701 DEFINE_GET_CONSTANT(Undefined, undefined, undefined, HType::Tagged(), false) |
| 700 DEFINE_GET_CONSTANT(True, true, HType::Boolean(), true) | 702 DEFINE_GET_CONSTANT(True, true, boolean, HType::Boolean(), true) |
| 701 DEFINE_GET_CONSTANT(False, false, HType::Boolean(), false) | 703 DEFINE_GET_CONSTANT(False, false, boolean, HType::Boolean(), false) |
| 702 DEFINE_GET_CONSTANT(Hole, the_hole, HType::Tagged(), false) | 704 DEFINE_GET_CONSTANT(Hole, the_hole, the_hole, HType::Tagged(), false) |
| 703 DEFINE_GET_CONSTANT(Null, null, HType::Tagged(), false) | 705 DEFINE_GET_CONSTANT(Null, null, null, HType::Tagged(), false) |
| 704 | 706 |
| 705 | 707 |
| 706 #undef DEFINE_GET_CONSTANT | 708 #undef DEFINE_GET_CONSTANT |
| 707 | 709 |
| 708 #define DEFINE_IS_CONSTANT(Name, name) \ | 710 #define DEFINE_IS_CONSTANT(Name, name) \ |
| 709 bool HGraph::IsConstant##Name(HConstant* constant) { \ | 711 bool HGraph::IsConstant##Name(HConstant* constant) { \ |
| 710 return constant_##name##_.is_set() && constant == constant_##name##_.get(); \ | 712 return constant_##name##_.is_set() && constant == constant_##name##_.get(); \ |
| 711 } | 713 } |
| 712 DEFINE_IS_CONSTANT(Undefined, undefined) | 714 DEFINE_IS_CONSTANT(Undefined, undefined) |
| 713 DEFINE_IS_CONSTANT(0, 0) | 715 DEFINE_IS_CONSTANT(0, 0) |
| (...skipping 10929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11643 if (ShouldProduceTraceOutput()) { | 11645 if (ShouldProduceTraceOutput()) { |
| 11644 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11646 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 11645 } | 11647 } |
| 11646 | 11648 |
| 11647 #ifdef DEBUG | 11649 #ifdef DEBUG |
| 11648 graph_->Verify(false); // No full verify. | 11650 graph_->Verify(false); // No full verify. |
| 11649 #endif | 11651 #endif |
| 11650 } | 11652 } |
| 11651 | 11653 |
| 11652 } } // namespace v8::internal | 11654 } } // namespace v8::internal |
| OLD | NEW |