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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 // only one OSR point per compile is allowed. | 57 // only one OSR point per compile is allowed. |
58 ASSERT(graph->osr() == NULL); | 58 ASSERT(graph->osr() == NULL); |
59 | 59 |
60 // remember this builder as the one OSR builder in the graph. | 60 // remember this builder as the one OSR builder in the graph. |
61 graph->set_osr(this); | 61 graph->set_osr(this); |
62 | 62 |
63 HBasicBlock* non_osr_entry = graph->CreateBasicBlock(); | 63 HBasicBlock* non_osr_entry = graph->CreateBasicBlock(); |
64 osr_entry_ = graph->CreateBasicBlock(); | 64 osr_entry_ = graph->CreateBasicBlock(); |
65 HValue* true_value = graph->GetConstantTrue(); | 65 HValue* true_value = graph->GetConstantTrue(); |
66 HBranch* test = new(zone) HBranch(true_value, non_osr_entry, osr_entry_); | 66 HBranch* test = new(zone) HBranch(true_value, ToBooleanStub::Types(), |
| 67 non_osr_entry, osr_entry_); |
67 builder_->current_block()->Finish(test); | 68 builder_->current_block()->Finish(test); |
68 | 69 |
69 HBasicBlock* loop_predecessor = graph->CreateBasicBlock(); | 70 HBasicBlock* loop_predecessor = graph->CreateBasicBlock(); |
70 non_osr_entry->Goto(loop_predecessor); | 71 non_osr_entry->Goto(loop_predecessor); |
71 | 72 |
72 builder_->set_current_block(osr_entry_); | 73 builder_->set_current_block(osr_entry_); |
73 osr_entry_->set_osr_entry(); | 74 osr_entry_->set_osr_entry(); |
74 BailoutId osr_entry_id = statement->OsrEntryId(); | 75 BailoutId osr_entry_id = statement->OsrEntryId(); |
75 | 76 |
76 HEnvironment *environment = builder_->environment(); | 77 HEnvironment *environment = builder_->environment(); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 115 |
115 void HOsrBuilder::FinishOsrValues() { | 116 void HOsrBuilder::FinishOsrValues() { |
116 const ZoneList<HPhi*>* phis = osr_loop_entry_->phis(); | 117 const ZoneList<HPhi*>* phis = osr_loop_entry_->phis(); |
117 for (int j = 0; j < phis->length(); j++) { | 118 for (int j = 0; j < phis->length(); j++) { |
118 HPhi* phi = phis->at(j); | 119 HPhi* phi = phis->at(j); |
119 osr_values_->at(phi->merged_index())->set_incoming_value(phi); | 120 osr_values_->at(phi->merged_index())->set_incoming_value(phi); |
120 } | 121 } |
121 } | 122 } |
122 | 123 |
123 } } // namespace v8::internal | 124 } } // namespace v8::internal |
OLD | NEW |