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

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

Issue 333403002: Cleanup: use a ZoneGrowableArray instead of Array for ICData map. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/coverage.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/compiler.h" 5 #include "vm/compiler.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 8
9 #include "vm/ast_printer.h" 9 #include "vm/ast_printer.h"
10 #include "vm/block_scheduler.h" 10 #include "vm/block_scheduler.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 isolate->set_deopt_id(0); 270 isolate->set_deopt_id(0);
271 LongJumpScope jump; 271 LongJumpScope jump;
272 if (setjmp(*jump.Set()) == 0) { 272 if (setjmp(*jump.Set()) == 0) {
273 FlowGraph* flow_graph = NULL; 273 FlowGraph* flow_graph = NULL;
274 // TimerScope needs an isolate to be properly terminated in case of a 274 // TimerScope needs an isolate to be properly terminated in case of a
275 // LongJump. 275 // LongJump.
276 { 276 {
277 TimerScope timer(FLAG_compiler_stats, 277 TimerScope timer(FLAG_compiler_stats,
278 &CompilerStats::graphbuilder_timer, 278 &CompilerStats::graphbuilder_timer,
279 isolate); 279 isolate);
280 Array& ic_data_array = Array::Handle(); 280 ZoneGrowableArray<const ICData*>* ic_data_array =
281 new(isolate) ZoneGrowableArray<const ICData*>();
281 if (optimized) { 282 if (optimized) {
282 ASSERT(function.HasCode()); 283 ASSERT(function.HasCode());
283 // Extract type feedback before the graph is built, as the graph 284 // Extract type feedback before the graph is built, as the graph
284 // builder uses it to attach it to nodes. 285 // builder uses it to attach it to nodes.
285 ASSERT(function.deoptimization_counter() < 286 ASSERT(function.deoptimization_counter() <
286 FLAG_deoptimization_counter_threshold); 287 FLAG_deoptimization_counter_threshold);
287 ic_data_array = function.RestoreICDataMap(); 288 function.RestoreICDataMap(ic_data_array);
288 } 289 }
289 290
290 // Build the flow graph. 291 // Build the flow graph.
291 FlowGraphBuilder builder(parsed_function, 292 FlowGraphBuilder builder(parsed_function,
292 ic_data_array, 293 *ic_data_array,
293 NULL, // NULL = not inlining. 294 NULL, // NULL = not inlining.
294 osr_id, 295 osr_id,
295 optimized); 296 optimized);
296 flow_graph = builder.BuildGraph(); 297 flow_graph = builder.BuildGraph();
297 } 298 }
298 299
299 if (FLAG_print_flow_graph || 300 if (FLAG_print_flow_graph ||
300 (optimized && FLAG_print_flow_graph_optimized)) { 301 (optimized && FLAG_print_flow_graph_optimized)) {
301 if (osr_id == Isolate::kNoDeoptId) { 302 if (osr_id == Isolate::kNoDeoptId) {
302 FlowGraphPrinter::PrintGraph("Before Optimizations", flow_graph); 303 FlowGraphPrinter::PrintGraph("Before Optimizations", flow_graph);
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 const Object& result = 980 const Object& result =
980 Object::Handle(isolate->object_store()->sticky_error()); 981 Object::Handle(isolate->object_store()->sticky_error());
981 isolate->object_store()->clear_sticky_error(); 982 isolate->object_store()->clear_sticky_error();
982 return result.raw(); 983 return result.raw();
983 } 984 }
984 UNREACHABLE(); 985 UNREACHABLE();
985 return Object::null(); 986 return Object::null();
986 } 987 }
987 988
988 } // namespace dart 989 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/coverage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698