OLD | NEW |
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 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 | 492 |
493 if (optimized) { | 493 if (optimized) { |
494 CodePatcher::PatchEntry(Code::Handle(function.CurrentCode())); | 494 CodePatcher::PatchEntry(Code::Handle(function.CurrentCode())); |
495 function.SetCode(code); | 495 function.SetCode(code); |
496 if (FLAG_trace_compiler) { | 496 if (FLAG_trace_compiler) { |
497 OS::Print("--> patching entry %#"Px"\n", | 497 OS::Print("--> patching entry %#"Px"\n", |
498 Code::Handle(function.unoptimized_code()).EntryPoint()); | 498 Code::Handle(function.unoptimized_code()).EntryPoint()); |
499 } | 499 } |
500 | 500 |
501 // If not yet present, allocate deoptimization history array. | 501 // If not yet present, allocate deoptimization history array. |
502 Array& deopt_history = Array::Handle(function.deopt_history()); | 502 function.EnsureDeoptHistory(); |
503 if (deopt_history.IsNull()) { | |
504 deopt_history = Array::New(FLAG_deoptimization_counter_threshold); | |
505 function.set_deopt_history(deopt_history); | |
506 } | |
507 | 503 |
508 for (intptr_t i = 0; i < guarded_fields.length(); i++) { | 504 for (intptr_t i = 0; i < guarded_fields.length(); i++) { |
509 const Field& field = *guarded_fields[i]; | 505 const Field& field = *guarded_fields[i]; |
510 field.RegisterDependentCode(code); | 506 field.RegisterDependentCode(code); |
511 } | 507 } |
512 } else { | 508 } else { |
513 function.set_unoptimized_code(code); | 509 function.set_unoptimized_code(code); |
514 function.SetCode(code); | 510 function.SetCode(code); |
515 ASSERT(CodePatcher::CodeIsPatchable(code)); | 511 ASSERT(CodePatcher::CodeIsPatchable(code)); |
516 } | 512 } |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 Object::Handle(isolate->object_store()->sticky_error()); | 864 Object::Handle(isolate->object_store()->sticky_error()); |
869 isolate->object_store()->clear_sticky_error(); | 865 isolate->object_store()->clear_sticky_error(); |
870 isolate->set_long_jump_base(base); | 866 isolate->set_long_jump_base(base); |
871 return result.raw(); | 867 return result.raw(); |
872 } | 868 } |
873 UNREACHABLE(); | 869 UNREACHABLE(); |
874 return Object::null(); | 870 return Object::null(); |
875 } | 871 } |
876 | 872 |
877 } // namespace dart | 873 } // namespace dart |
OLD | NEW |