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

Side by Side Diff: runtime/vm/block_scheduler.cc

Issue 70183010: Fixes a couple problems with GC of unoptimized code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/code_generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/block_scheduler.h" 5 #include "vm/block_scheduler.h"
6 6
7 #include "vm/allocation.h" 7 #include "vm/allocation.h"
8 #include "vm/code_patcher.h" 8 #include "vm/code_patcher.h"
9 #include "vm/flow_graph.h" 9 #include "vm/flow_graph.h"
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 static_cast<double>(count) / static_cast<double>(entry_count); 46 static_cast<double>(count) / static_cast<double>(entry_count);
47 jump->set_edge_weight(weight); 47 jump->set_edge_weight(weight);
48 } 48 }
49 } 49 }
50 } 50 }
51 } 51 }
52 52
53 53
54 void BlockScheduler::AssignEdgeWeights() const { 54 void BlockScheduler::AssignEdgeWeights() const {
55 const Code& unoptimized_code = Code::Handle( 55 const Code& unoptimized_code = Code::Handle(
56 flow_graph()->parsed_function().function().unoptimized_code()); 56 flow_graph()->parsed_function().code());
57 ASSERT(!unoptimized_code.IsNull());
57 58
58 intptr_t entry_count = 59 intptr_t entry_count =
59 ComputeEdgeCount(unoptimized_code, 60 ComputeEdgeCount(unoptimized_code,
60 flow_graph()->graph_entry()->normal_entry()->deopt_id()); 61 flow_graph()->graph_entry()->normal_entry()->deopt_id());
61 flow_graph()->graph_entry()->set_entry_count(entry_count); 62 flow_graph()->graph_entry()->set_entry_count(entry_count);
62 63
63 for (BlockIterator it = flow_graph()->reverse_postorder_iterator(); 64 for (BlockIterator it = flow_graph()->reverse_postorder_iterator();
64 !it.Done(); 65 !it.Done();
65 it.Advance()) { 66 it.Advance()) {
66 BlockEntryInstr* block = it.Current(); 67 BlockEntryInstr* block = it.Current();
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 for (intptr_t i = block_count - 1; i >= 0; --i) { 197 for (intptr_t i = block_count - 1; i >= 0; --i) {
197 if (chains[i]->first->block == flow_graph()->postorder()[i]) { 198 if (chains[i]->first->block == flow_graph()->postorder()[i]) {
198 for (Link* link = chains[i]->first; link != NULL; link = link->next) { 199 for (Link* link = chains[i]->first; link != NULL; link = link->next) {
199 flow_graph()->CodegenBlockOrder(true)->Add(link->block); 200 flow_graph()->CodegenBlockOrder(true)->Add(link->block);
200 } 201 }
201 } 202 }
202 } 203 }
203 } 204 }
204 205
205 } // namespace dart 206 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/code_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698