Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(766)

Side by Side Diff: src/compiler/osr.cc

Issue 2336543002: [turbofan] Solidify OSR deconstruction code a bit. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698