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.h" | 5 #include "src/compiler.h" |
6 #include "src/compiler/all-nodes.h" | 6 #include "src/compiler/all-nodes.h" |
7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
8 #include "src/compiler/control-reducer.h" | 8 #include "src/compiler/control-reducer.h" |
9 #include "src/compiler/frame.h" | 9 #include "src/compiler/frame.h" |
10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 if (TRACE_COND) PrintF(__VA_ARGS__); \ | 37 if (TRACE_COND) PrintF(__VA_ARGS__); \ |
38 } while (false) | 38 } while (false) |
39 | 39 |
40 | 40 |
41 // Peel outer loops and rewire the graph so that control reduction can | 41 // Peel outer loops and rewire the graph so that control reduction can |
42 // produce a properly formed graph. | 42 // produce a properly formed graph. |
43 static void PeelOuterLoopsForOsr(Graph* graph, CommonOperatorBuilder* common, | 43 static void PeelOuterLoopsForOsr(Graph* graph, CommonOperatorBuilder* common, |
44 Zone* tmp_zone, Node* dead, | 44 Zone* tmp_zone, Node* dead, |
45 LoopTree* loop_tree, LoopTree::Loop* osr_loop, | 45 LoopTree* loop_tree, LoopTree::Loop* osr_loop, |
46 Node* osr_normal_entry, Node* osr_loop_entry) { | 46 Node* osr_normal_entry, Node* osr_loop_entry) { |
47 const int original_count = graph->NodeCount(); | 47 const size_t original_count = graph->NodeCount(); |
48 AllNodes all(tmp_zone, graph); | 48 AllNodes all(tmp_zone, graph); |
49 NodeVector tmp_inputs(tmp_zone); | 49 NodeVector tmp_inputs(tmp_zone); |
50 Node* sentinel = graph->NewNode(dead->op()); | 50 Node* sentinel = graph->NewNode(dead->op()); |
51 | 51 |
52 // Make a copy of the graph for each outer loop. | 52 // Make a copy of the graph for each outer loop. |
53 ZoneVector<NodeVector*> copies(tmp_zone); | 53 ZoneVector<NodeVector*> copies(tmp_zone); |
54 for (LoopTree::Loop* loop = osr_loop->parent(); loop; loop = loop->parent()) { | 54 for (LoopTree::Loop* loop = osr_loop->parent(); loop; loop = loop->parent()) { |
55 void* stuff = tmp_zone->New(sizeof(NodeVector)); | 55 void* stuff = tmp_zone->New(sizeof(NodeVector)); |
56 NodeVector* mapping = | 56 NodeVector* mapping = |
57 new (stuff) NodeVector(original_count, sentinel, tmp_zone); | 57 new (stuff) NodeVector(original_count, sentinel, tmp_zone); |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 // the first spill slots. | 348 // the first spill slots. |
349 frame->ReserveSpillSlots(UnoptimizedFrameSlots()); | 349 frame->ReserveSpillSlots(UnoptimizedFrameSlots()); |
350 // The frame needs to be adjusted by the number of unoptimized frame slots. | 350 // The frame needs to be adjusted by the number of unoptimized frame slots. |
351 frame->SetOsrStackSlotCount(static_cast<int>(UnoptimizedFrameSlots())); | 351 frame->SetOsrStackSlotCount(static_cast<int>(UnoptimizedFrameSlots())); |
352 } | 352 } |
353 | 353 |
354 | 354 |
355 } // namespace compiler | 355 } // namespace compiler |
356 } // namespace internal | 356 } // namespace internal |
357 } // namespace v8 | 357 } // namespace v8 |
OLD | NEW |