Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/code_generator.h" | 5 #include "vm/code_generator.h" |
| 6 | 6 |
| 7 #include "vm/code_index_table.h" | 7 #include "vm/code_index_table.h" |
| 8 #include "vm/code_patcher.h" | 8 #include "vm/code_patcher.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 911 continue_at_pc); | 911 continue_at_pc); |
| 912 } | 912 } |
| 913 caller_frame->set_pc(continue_at_pc); | 913 caller_frame->set_pc(continue_at_pc); |
| 914 // Clear invocation counter so that the function gets optimized after | 914 // Clear invocation counter so that the function gets optimized after |
| 915 // types/classes have been collected. | 915 // types/classes have been collected. |
| 916 function.set_invocation_counter(0); | 916 function.set_invocation_counter(0); |
| 917 function.set_deoptimization_counter(function.deoptimization_counter() + 1); | 917 function.set_deoptimization_counter(function.deoptimization_counter() + 1); |
| 918 | 918 |
| 919 // We have to skip the following otherwise the compiler will complain | 919 // We have to skip the following otherwise the compiler will complain |
| 920 // when it attempts to install unoptimized code into a function that | 920 // when it attempts to install unoptimized code into a function that |
| 921 // was already deoptimized. | 921 // was already deoptimized. |
|
ngeoffray
2011/10/19 08:30:51
Shouldn't you also change the comment?
srdjan
2011/10/19 08:43:25
The comment is correct, the code was wrong: now we
ngeoffray
2011/10/19 08:49:40
I see, thanks. Maybe a 'If the method is deoptimiz
| |
| 922 if (!Code::Handle(function.code()).is_optimized()) { | 922 if (Code::Handle(function.code()).is_optimized()) { |
| 923 // Get unoptimized code. Compilation restores (reenables) the entry of | 923 // Get unoptimized code. Compilation restores (reenables) the entry of |
| 924 // unoptimized code. | 924 // unoptimized code. |
| 925 Compiler::CompileFunction(function); | 925 Compiler::CompileFunction(function); |
| 926 | 926 |
| 927 DisableOldCode(function, optimized_code, unoptimized_code); | 927 DisableOldCode(function, optimized_code, unoptimized_code); |
| 928 } | 928 } |
| 929 // TODO(srdjan): Handle better complex cases, e.g. when an older optimized | 929 // TODO(srdjan): Handle better complex cases, e.g. when an older optimized |
| 930 // code is alive on frame and gets deoptimized after the function was | 930 // code is alive on frame and gets deoptimized after the function was |
| 931 // optimized a second time. | 931 // optimized a second time. |
| 932 if (FLAG_trace_deopt) { | 932 if (FLAG_trace_deopt) { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1008 } | 1008 } |
| 1009 } | 1009 } |
| 1010 } | 1010 } |
| 1011 // The cache is null terminated, therefore the loop above should never | 1011 // The cache is null terminated, therefore the loop above should never |
| 1012 // terminate by itself. | 1012 // terminate by itself. |
| 1013 UNREACHABLE(); | 1013 UNREACHABLE(); |
| 1014 return Code::null(); | 1014 return Code::null(); |
| 1015 } | 1015 } |
| 1016 | 1016 |
| 1017 } // namespace dart | 1017 } // namespace dart |
| OLD | NEW |