| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 "src/compiler/osr.h" | 5 #include "src/compiler/osr.h" |
| 6 #include "src/ast/scopes.h" | 6 #include "src/ast/scopes.h" |
| 7 #include "src/compilation-info.h" | 7 #include "src/compilation-info.h" |
| 8 #include "src/compiler/all-nodes.h" | 8 #include "src/compiler/all-nodes.h" |
| 9 #include "src/compiler/common-operator-reducer.h" | 9 #include "src/compiler/common-operator-reducer.h" |
| 10 #include "src/compiler/common-operator.h" | 10 #include "src/compiler/common-operator.h" |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 Node* osr_loop = nullptr; | 264 Node* osr_loop = nullptr; |
| 265 | 265 |
| 266 for (Node* node : graph->start()->uses()) { | 266 for (Node* node : graph->start()->uses()) { |
| 267 if (node->opcode() == IrOpcode::kOsrLoopEntry) { | 267 if (node->opcode() == IrOpcode::kOsrLoopEntry) { |
| 268 osr_loop_entry = node; // found the OSR loop entry | 268 osr_loop_entry = node; // found the OSR loop entry |
| 269 } else if (node->opcode() == IrOpcode::kOsrNormalEntry) { | 269 } else if (node->opcode() == IrOpcode::kOsrNormalEntry) { |
| 270 osr_normal_entry = node; | 270 osr_normal_entry = node; |
| 271 } | 271 } |
| 272 } | 272 } |
| 273 | 273 |
| 274 if (osr_loop_entry == nullptr) { | 274 CHECK_NOT_NULL(osr_normal_entry); // Should have found the OSR normal entry. |
| 275 // No OSR entry found, do nothing. | 275 CHECK_NOT_NULL(osr_loop_entry); // Should have found the OSR loop entry. |
| 276 CHECK(osr_normal_entry); | |
| 277 return; | |
| 278 } | |
| 279 | 276 |
| 280 for (Node* use : osr_loop_entry->uses()) { | 277 for (Node* use : osr_loop_entry->uses()) { |
| 281 if (use->opcode() == IrOpcode::kLoop) { | 278 if (use->opcode() == IrOpcode::kLoop) { |
| 282 CHECK(!osr_loop); // should be only one OSR loop. | 279 CHECK(!osr_loop); // should be only one OSR loop. |
| 283 osr_loop = use; // found the OSR loop. | 280 osr_loop = use; // found the OSR loop. |
| 284 } | 281 } |
| 285 } | 282 } |
| 286 | 283 |
| 287 CHECK(osr_loop); // Should have found the OSR loop. | 284 CHECK(osr_loop); // Should have found the OSR loop. |
| 288 | 285 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 | 332 |
| 336 void OsrHelper::SetupFrame(Frame* frame) { | 333 void OsrHelper::SetupFrame(Frame* frame) { |
| 337 // The optimized frame will subsume the unoptimized frame. Do so by reserving | 334 // The optimized frame will subsume the unoptimized frame. Do so by reserving |
| 338 // the first spill slots. | 335 // the first spill slots. |
| 339 frame->ReserveSpillSlots(UnoptimizedFrameSlots()); | 336 frame->ReserveSpillSlots(UnoptimizedFrameSlots()); |
| 340 } | 337 } |
| 341 | 338 |
| 342 } // namespace compiler | 339 } // namespace compiler |
| 343 } // namespace internal | 340 } // namespace internal |
| 344 } // namespace v8 | 341 } // namespace v8 |
| OLD | NEW |