| 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 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 int new_literal_count = compile_info_wrapper->GetLiteralCount(); | 754 int new_literal_count = compile_info_wrapper->GetLiteralCount(); |
| 755 | 755 |
| 756 // When feedback metadata changes, we have to create new array instances. | 756 // When feedback metadata changes, we have to create new array instances. |
| 757 // Since we cannot create instances when iterating heap, we should first | 757 // Since we cannot create instances when iterating heap, we should first |
| 758 // collect all functions and fix their literal arrays. | 758 // collect all functions and fix their literal arrays. |
| 759 Handle<FixedArray> function_instances = | 759 Handle<FixedArray> function_instances = |
| 760 CollectJSFunctions(shared_info, isolate); | 760 CollectJSFunctions(shared_info, isolate); |
| 761 | 761 |
| 762 for (int i = 0; i < function_instances->length(); i++) { | 762 for (int i = 0; i < function_instances->length(); i++) { |
| 763 Handle<JSFunction> fun(JSFunction::cast(function_instances->get(i))); | 763 Handle<JSFunction> fun(JSFunction::cast(function_instances->get(i))); |
| 764 fun->set_feedback_vector_cell(isolate->heap()->undefined_cell()); | 764 Handle<Cell> new_cell = isolate->factory()->NewManyClosuresCell( |
| 765 isolate->factory()->undefined_value()); |
| 766 fun->set_feedback_vector_cell(*new_cell); |
| 765 // Only create feedback vectors if we already have the metadata. | 767 // Only create feedback vectors if we already have the metadata. |
| 766 if (shared_info->is_compiled()) JSFunction::EnsureLiterals(fun); | 768 if (shared_info->is_compiled()) JSFunction::EnsureLiterals(fun); |
| 767 } | 769 } |
| 768 | 770 |
| 769 shared_info->set_num_literals(new_literal_count); | 771 shared_info->set_num_literals(new_literal_count); |
| 770 } | 772 } |
| 771 | 773 |
| 772 private: | 774 private: |
| 773 // Iterates all function instances in the HEAP that refers to the | 775 // Iterates all function instances in the HEAP that refers to the |
| 774 // provided shared_info. | 776 // provided shared_info. |
| (...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1646 scope_info_length++; | 1648 scope_info_length++; |
| 1647 | 1649 |
| 1648 current_scope = current_scope->outer_scope(); | 1650 current_scope = current_scope->outer_scope(); |
| 1649 } | 1651 } |
| 1650 | 1652 |
| 1651 return scope_info_list; | 1653 return scope_info_list; |
| 1652 } | 1654 } |
| 1653 | 1655 |
| 1654 } // namespace internal | 1656 } // namespace internal |
| 1655 } // namespace v8 | 1657 } // namespace v8 |
| OLD | NEW |