| 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/assembler-inl.h" | 7 #include "src/assembler-inl.h" |
| 8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/compilation-cache.h" | 10 #include "src/compilation-cache.h" |
| (...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 903 ReplaceCodeObject(old_code, | 903 ReplaceCodeObject(old_code, |
| 904 isolate->builtins()->InterpreterEntryTrampoline()); | 904 isolate->builtins()->InterpreterEntryTrampoline()); |
| 905 } else { | 905 } else { |
| 906 // Start using new FCG code everywhere. | 906 // Start using new FCG code everywhere. |
| 907 // Rely on self-healing for places that used to run bytecode. | 907 // Rely on self-healing for places that used to run bytecode. |
| 908 DCHECK(new_code->kind() == Code::FUNCTION); | 908 DCHECK(new_code->kind() == Code::FUNCTION); |
| 909 ReplaceCodeObject(old_code, new_code); | 909 ReplaceCodeObject(old_code, new_code); |
| 910 } | 910 } |
| 911 } | 911 } |
| 912 | 912 |
| 913 if (shared_info->HasDebugInfo()) { | 913 if (shared_info->HasBreakInfo()) { |
| 914 // Existing break points will be re-applied. Reset the debug info here. | 914 // Existing break points will be re-applied. Reset the debug info here. |
| 915 isolate->debug()->RemoveDebugInfoAndClearFromShared( | 915 isolate->debug()->RemoveBreakInfoAndMaybeFree( |
| 916 handle(shared_info->GetDebugInfo())); | 916 handle(shared_info->GetDebugInfo())); |
| 917 } | 917 } |
| 918 shared_info->set_scope_info(new_shared_info->scope_info()); | 918 shared_info->set_scope_info(new_shared_info->scope_info()); |
| 919 shared_info->set_outer_scope_info(new_shared_info->outer_scope_info()); | 919 shared_info->set_outer_scope_info(new_shared_info->outer_scope_info()); |
| 920 shared_info->DisableOptimization(kLiveEdit); | 920 shared_info->DisableOptimization(kLiveEdit); |
| 921 // Update the type feedback vector, if needed. | 921 // Update the type feedback vector, if needed. |
| 922 Handle<FeedbackMetadata> new_feedback_metadata( | 922 Handle<FeedbackMetadata> new_feedback_metadata( |
| 923 new_shared_info->feedback_metadata()); | 923 new_shared_info->feedback_metadata()); |
| 924 shared_info->set_feedback_metadata(*new_feedback_metadata); | 924 shared_info->set_feedback_metadata(*new_feedback_metadata); |
| 925 } else { | 925 } else { |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1066 if (info->HasBytecodeArray()) { | 1066 if (info->HasBytecodeArray()) { |
| 1067 TranslateSourcePositionTable( | 1067 TranslateSourcePositionTable( |
| 1068 Handle<AbstractCode>(AbstractCode::cast(info->bytecode_array())), | 1068 Handle<AbstractCode>(AbstractCode::cast(info->bytecode_array())), |
| 1069 position_change_array); | 1069 position_change_array); |
| 1070 } | 1070 } |
| 1071 if (info->code()->kind() == Code::FUNCTION) { | 1071 if (info->code()->kind() == Code::FUNCTION) { |
| 1072 TranslateSourcePositionTable( | 1072 TranslateSourcePositionTable( |
| 1073 Handle<AbstractCode>(AbstractCode::cast(info->code())), | 1073 Handle<AbstractCode>(AbstractCode::cast(info->code())), |
| 1074 position_change_array); | 1074 position_change_array); |
| 1075 } | 1075 } |
| 1076 if (info->HasDebugInfo()) { | 1076 if (info->HasBreakInfo()) { |
| 1077 // Existing break points will be re-applied. Reset the debug info here. | 1077 // Existing break points will be re-applied. Reset the debug info here. |
| 1078 info->GetIsolate()->debug()->RemoveDebugInfoAndClearFromShared( | 1078 info->GetIsolate()->debug()->RemoveBreakInfoAndMaybeFree( |
| 1079 handle(info->GetDebugInfo())); | 1079 handle(info->GetDebugInfo())); |
| 1080 } | 1080 } |
| 1081 } | 1081 } |
| 1082 | 1082 |
| 1083 | 1083 |
| 1084 static Handle<Script> CreateScriptCopy(Handle<Script> original) { | 1084 static Handle<Script> CreateScriptCopy(Handle<Script> original) { |
| 1085 Isolate* isolate = original->GetIsolate(); | 1085 Isolate* isolate = original->GetIsolate(); |
| 1086 | 1086 |
| 1087 Handle<String> original_source(String::cast(original->source())); | 1087 Handle<String> original_source(String::cast(original->source())); |
| 1088 Handle<Script> copy = isolate->factory()->NewScript(original_source); | 1088 Handle<Script> copy = isolate->factory()->NewScript(original_source); |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1644 scope_info_length++; | 1644 scope_info_length++; |
| 1645 | 1645 |
| 1646 current_scope = current_scope->outer_scope(); | 1646 current_scope = current_scope->outer_scope(); |
| 1647 } | 1647 } |
| 1648 | 1648 |
| 1649 return scope_info_list; | 1649 return scope_info_list; |
| 1650 } | 1650 } |
| 1651 | 1651 |
| 1652 } // namespace internal | 1652 } // namespace internal |
| 1653 } // namespace v8 | 1653 } // namespace v8 |
| OLD | NEW |