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 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
950 increment_ = HAdd::New(zone(), context_, phi_, one); | 950 increment_ = HAdd::New(zone(), context_, phi_, one); |
951 } else { | 951 } else { |
952 increment_ = HSub::New(zone(), context_, phi_, one); | 952 increment_ = HSub::New(zone(), context_, phi_, one); |
953 } | 953 } |
954 increment_->ClearFlag(HValue::kCanOverflow); | 954 increment_->ClearFlag(HValue::kCanOverflow); |
955 builder_->AddInstruction(increment_); | 955 builder_->AddInstruction(increment_); |
956 } | 956 } |
957 | 957 |
958 // Push the new increment value on the expression stack to merge into the phi. | 958 // Push the new increment value on the expression stack to merge into the phi. |
959 builder_->environment()->Push(increment_); | 959 builder_->environment()->Push(increment_); |
960 builder_->current_block()->GotoNoSimulate(header_block_); | 960 HBasicBlock* last_block = builder_->current_block(); |
961 header_block_->loop_information()->RegisterBackEdge(body_block_); | 961 last_block->GotoNoSimulate(header_block_); |
| 962 header_block_->loop_information()->RegisterBackEdge(last_block); |
962 | 963 |
963 builder_->set_current_block(exit_block_); | 964 builder_->set_current_block(exit_block_); |
964 // Pop the phi from the expression stack | 965 // Pop the phi from the expression stack |
965 builder_->environment()->Pop(); | 966 builder_->environment()->Pop(); |
966 finished_ = true; | 967 finished_ = true; |
967 } | 968 } |
968 | 969 |
969 | 970 |
970 HGraph* HGraphBuilder::CreateGraph() { | 971 HGraph* HGraphBuilder::CreateGraph() { |
971 graph_ = new(zone()) HGraph(info_); | 972 graph_ = new(zone()) HGraph(info_); |
(...skipping 8729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9701 if (ShouldProduceTraceOutput()) { | 9702 if (ShouldProduceTraceOutput()) { |
9702 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 9703 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
9703 } | 9704 } |
9704 | 9705 |
9705 #ifdef DEBUG | 9706 #ifdef DEBUG |
9706 graph_->Verify(false); // No full verify. | 9707 graph_->Verify(false); // No full verify. |
9707 #endif | 9708 #endif |
9708 } | 9709 } |
9709 | 9710 |
9710 } } // namespace v8::internal | 9711 } } // namespace v8::internal |
OLD | NEW |