OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 | 664 |
665 | 665 |
666 DEFINE_GET_CONSTANT(True, true, HType::Boolean(), true) | 666 DEFINE_GET_CONSTANT(True, true, HType::Boolean(), true) |
667 DEFINE_GET_CONSTANT(False, false, HType::Boolean(), false) | 667 DEFINE_GET_CONSTANT(False, false, HType::Boolean(), false) |
668 DEFINE_GET_CONSTANT(Hole, the_hole, HType::Tagged(), false) | 668 DEFINE_GET_CONSTANT(Hole, the_hole, HType::Tagged(), false) |
669 DEFINE_GET_CONSTANT(Null, null, HType::Tagged(), false) | 669 DEFINE_GET_CONSTANT(Null, null, HType::Tagged(), false) |
670 | 670 |
671 | 671 |
672 #undef DEFINE_GET_CONSTANT | 672 #undef DEFINE_GET_CONSTANT |
673 | 673 |
| 674 #define DEFINE_IS_CONSTANT(Name, name) \ |
| 675 bool HGraph::IsConstant##Name(HConstant* constant) { \ |
| 676 return constant_##name##_.is_set() && constant == constant_##name##_.get(); \ |
| 677 } |
| 678 DEFINE_IS_CONSTANT(Undefined, undefined) |
| 679 DEFINE_IS_CONSTANT(0, 0) |
| 680 DEFINE_IS_CONSTANT(1, 1) |
| 681 DEFINE_IS_CONSTANT(Minus1, minus1) |
| 682 DEFINE_IS_CONSTANT(True, true) |
| 683 DEFINE_IS_CONSTANT(False, false) |
| 684 DEFINE_IS_CONSTANT(Hole, the_hole) |
| 685 DEFINE_IS_CONSTANT(Null, null) |
| 686 |
| 687 #undef DEFINE_IS_CONSTANT |
| 688 |
674 | 689 |
675 HConstant* HGraph::GetInvalidContext() { | 690 HConstant* HGraph::GetInvalidContext() { |
676 return GetConstant(&constant_invalid_context_, 0xFFFFC0C7); | 691 return GetConstant(&constant_invalid_context_, 0xFFFFC0C7); |
677 } | 692 } |
678 | 693 |
679 | 694 |
680 bool HGraph::IsStandardConstant(HConstant* constant) { | 695 bool HGraph::IsStandardConstant(HConstant* constant) { |
681 if (constant == GetConstantUndefined()) return true; | 696 if (IsConstantUndefined(constant)) return true; |
682 if (constant == GetConstant0()) return true; | 697 if (IsConstant0(constant)) return true; |
683 if (constant == GetConstant1()) return true; | 698 if (IsConstant1(constant)) return true; |
684 if (constant == GetConstantMinus1()) return true; | 699 if (IsConstantMinus1(constant)) return true; |
685 if (constant == GetConstantTrue()) return true; | 700 if (IsConstantTrue(constant)) return true; |
686 if (constant == GetConstantFalse()) return true; | 701 if (IsConstantFalse(constant)) return true; |
687 if (constant == GetConstantHole()) return true; | 702 if (IsConstantHole(constant)) return true; |
688 if (constant == GetConstantNull()) return true; | 703 if (IsConstantNull(constant)) return true; |
689 return false; | 704 return false; |
690 } | 705 } |
691 | 706 |
692 | 707 |
693 HGraphBuilder::IfBuilder::IfBuilder(HGraphBuilder* builder, int position) | 708 HGraphBuilder::IfBuilder::IfBuilder(HGraphBuilder* builder, int position) |
694 : builder_(builder), | 709 : builder_(builder), |
695 position_(position), | 710 position_(position), |
696 finished_(false), | 711 finished_(false), |
697 deopt_then_(false), | 712 deopt_then_(false), |
698 deopt_else_(false), | 713 deopt_else_(false), |
(...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2106 uint32_instructions_(NULL), | 2121 uint32_instructions_(NULL), |
2107 osr_(NULL), | 2122 osr_(NULL), |
2108 info_(info), | 2123 info_(info), |
2109 zone_(info->zone()), | 2124 zone_(info->zone()), |
2110 is_recursive_(false), | 2125 is_recursive_(false), |
2111 use_optimistic_licm_(false), | 2126 use_optimistic_licm_(false), |
2112 has_soft_deoptimize_(false), | 2127 has_soft_deoptimize_(false), |
2113 depends_on_empty_array_proto_elements_(false), | 2128 depends_on_empty_array_proto_elements_(false), |
2114 type_change_checksum_(0), | 2129 type_change_checksum_(0), |
2115 maximum_environment_size_(0), | 2130 maximum_environment_size_(0), |
2116 no_side_effects_scope_count_(0) { | 2131 no_side_effects_scope_count_(0), |
| 2132 disallow_adding_new_values_(false) { |
2117 if (info->IsStub()) { | 2133 if (info->IsStub()) { |
2118 HydrogenCodeStub* stub = info->code_stub(); | 2134 HydrogenCodeStub* stub = info->code_stub(); |
2119 CodeStubInterfaceDescriptor* descriptor = | 2135 CodeStubInterfaceDescriptor* descriptor = |
2120 stub->GetInterfaceDescriptor(isolate_); | 2136 stub->GetInterfaceDescriptor(isolate_); |
2121 start_environment_ = | 2137 start_environment_ = |
2122 new(zone_) HEnvironment(zone_, descriptor->environment_length()); | 2138 new(zone_) HEnvironment(zone_, descriptor->environment_length()); |
2123 } else { | 2139 } else { |
2124 start_environment_ = | 2140 start_environment_ = |
2125 new(zone_) HEnvironment(NULL, info->scope(), info->closure(), zone_); | 2141 new(zone_) HEnvironment(NULL, info->scope(), info->closure(), zone_); |
2126 } | 2142 } |
(...skipping 7567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9694 if (ShouldProduceTraceOutput()) { | 9710 if (ShouldProduceTraceOutput()) { |
9695 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 9711 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
9696 } | 9712 } |
9697 | 9713 |
9698 #ifdef DEBUG | 9714 #ifdef DEBUG |
9699 graph_->Verify(false); // No full verify. | 9715 graph_->Verify(false); // No full verify. |
9700 #endif | 9716 #endif |
9701 } | 9717 } |
9702 | 9718 |
9703 } } // namespace v8::internal | 9719 } } // namespace v8::internal |
OLD | NEW |