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

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

Issue 15779006: Add deoptimization history to optimized functions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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/deopt_instructions.cc » ('j') | runtime/vm/flow_graph_optimizer.cc » ('J')
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/code_generator.h" 10 #include "vm/code_generator.h"
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 graph_compiler.FinalizeStaticCallTargetsTable(code); 366 graph_compiler.FinalizeStaticCallTargetsTable(code);
367 367
368 if (optimized) { 368 if (optimized) {
369 CodePatcher::PatchEntry(Code::Handle(function.CurrentCode())); 369 CodePatcher::PatchEntry(Code::Handle(function.CurrentCode()));
370 function.SetCode(code); 370 function.SetCode(code);
371 if (FLAG_trace_compiler) { 371 if (FLAG_trace_compiler) {
372 OS::Print("--> patching entry %#"Px"\n", 372 OS::Print("--> patching entry %#"Px"\n",
373 Code::Handle(function.unoptimized_code()).EntryPoint()); 373 Code::Handle(function.unoptimized_code()).EntryPoint());
374 } 374 }
375 375
376 // If not yet present, allocate deoptimization history array.
377 const Array& deopt_history = Array::Handle(function.deopt_history());
Kevin Millikin (Google) 2013/05/24 11:39:21 You can use just one handle here. Array& deopt_hi
Florian Schneider 2013/05/24 11:53:02 Done.
378 if (deopt_history.IsNull()) {
379 const Array& array =
380 Array::Handle(Array::New(FLAG_deoptimization_counter_threshold));
381 function.set_deopt_history(array);
382 }
383
376 for (intptr_t i = 0; i < guarded_fields.length(); i++) { 384 for (intptr_t i = 0; i < guarded_fields.length(); i++) {
377 const Field& field = *guarded_fields[i]; 385 const Field& field = *guarded_fields[i];
378 field.RegisterDependentCode(code); 386 field.RegisterDependentCode(code);
379 } 387 }
380 } else { 388 } else {
381 function.set_unoptimized_code(code); 389 function.set_unoptimized_code(code);
382 function.SetCode(code); 390 function.SetCode(code);
383 ASSERT(CodePatcher::CodeIsPatchable(code)); 391 ASSERT(CodePatcher::CodeIsPatchable(code));
384 } 392 }
385 } 393 }
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 Object::Handle(isolate->object_store()->sticky_error()); 744 Object::Handle(isolate->object_store()->sticky_error());
737 isolate->object_store()->clear_sticky_error(); 745 isolate->object_store()->clear_sticky_error();
738 isolate->set_long_jump_base(base); 746 isolate->set_long_jump_base(base);
739 return result.raw(); 747 return result.raw();
740 } 748 }
741 UNREACHABLE(); 749 UNREACHABLE();
742 return Object::null(); 750 return Object::null();
743 } 751 }
744 752
745 } // namespace dart 753 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/deopt_instructions.cc » ('j') | runtime/vm/flow_graph_optimizer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698