OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/debug/liveedit.h" | 5 #include "src/debug/liveedit.h" |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/compilation-cache.h" | 9 #include "src/compilation-cache.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 | 979 |
980 if (shared_info->is_compiled()) { | 980 if (shared_info->is_compiled()) { |
981 // Take whatever code we can get from the new shared function info. We | 981 // Take whatever code we can get from the new shared function info. We |
982 // expect activations of neither the old bytecode nor old FCG code, since | 982 // expect activations of neither the old bytecode nor old FCG code, since |
983 // the lowest activation is going to be restarted. | 983 // the lowest activation is going to be restarted. |
984 Handle<Code> old_code(shared_info->code()); | 984 Handle<Code> old_code(shared_info->code()); |
985 Handle<Code> new_code(new_shared_info->code()); | 985 Handle<Code> new_code(new_shared_info->code()); |
986 // Clear old bytecode. This will trigger self-healing if we do not install | 986 // Clear old bytecode. This will trigger self-healing if we do not install |
987 // new bytecode. | 987 // new bytecode. |
988 shared_info->ClearBytecodeArray(); | 988 shared_info->ClearBytecodeArray(); |
989 if (old_code->is_interpreter_trampoline_builtin()) { | 989 if (!shared_info->HasBaselineCode()) { |
990 // Every function from this SFI is interpreted. | 990 // Every function from this SFI is interpreted. |
991 if (new_code->is_interpreter_trampoline_builtin()) { | 991 if (!new_shared_info->HasBaselineCode()) { |
992 // We have newly compiled bytecode. Simply replace the old one. | 992 // We have newly compiled bytecode. Simply replace the old one. |
993 shared_info->set_bytecode_array(new_shared_info->bytecode_array()); | 993 shared_info->set_bytecode_array(new_shared_info->bytecode_array()); |
994 } else { | 994 } else { |
995 // Rely on self-healing for places that used to run bytecode. | 995 // Rely on self-healing for places that used to run bytecode. |
996 shared_info->ReplaceCode(*new_code); | 996 shared_info->ReplaceCode(*new_code); |
997 } | 997 } |
998 } else { | 998 } else { |
999 // Functions from this SFI can be either interpreted or running FCG. | 999 // Functions from this SFI can be either interpreted or running FCG. |
1000 DCHECK(old_code->kind() == Code::FUNCTION); | 1000 DCHECK(old_code->kind() == Code::FUNCTION); |
1001 if (new_shared_info->HasBytecodeArray()) { | 1001 if (new_shared_info->HasBytecodeArray()) { |
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1922 scope_info_length++; | 1922 scope_info_length++; |
1923 | 1923 |
1924 current_scope = current_scope->outer_scope(); | 1924 current_scope = current_scope->outer_scope(); |
1925 } | 1925 } |
1926 | 1926 |
1927 return scope_info_list; | 1927 return scope_info_list; |
1928 } | 1928 } |
1929 | 1929 |
1930 } // namespace internal | 1930 } // namespace internal |
1931 } // namespace v8 | 1931 } // namespace v8 |
OLD | NEW |