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/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/compilation-cache.h" | 8 #include "src/compilation-cache.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/debug/debug.h" | 10 #include "src/debug/debug.h" |
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
988 // If literal count didn't change, simply go over all functions | 988 // If literal count didn't change, simply go over all functions |
989 // and clear literal arrays. | 989 // and clear literal arrays. |
990 ClearValuesVisitor visitor; | 990 ClearValuesVisitor visitor; |
991 IterateJSFunctions(shared_info, &visitor); | 991 IterateJSFunctions(shared_info, &visitor); |
992 } else { | 992 } else { |
993 // When literal count changes, we have to create new array instances. | 993 // When literal count changes, we have to create new array instances. |
994 // Since we cannot create instances when iterating heap, we should first | 994 // Since we cannot create instances when iterating heap, we should first |
995 // collect all functions and fix their literal arrays. | 995 // collect all functions and fix their literal arrays. |
996 Handle<FixedArray> function_instances = | 996 Handle<FixedArray> function_instances = |
997 CollectJSFunctions(shared_info, isolate); | 997 CollectJSFunctions(shared_info, isolate); |
| 998 Handle<TypeFeedbackVector> vector(shared_info->feedback_vector()); |
| 999 |
998 for (int i = 0; i < function_instances->length(); i++) { | 1000 for (int i = 0; i < function_instances->length(); i++) { |
999 Handle<JSFunction> fun(JSFunction::cast(function_instances->get(i))); | 1001 Handle<JSFunction> fun(JSFunction::cast(function_instances->get(i))); |
1000 Handle<FixedArray> new_literals = | 1002 Handle<LiteralsArray> new_literals = |
1001 isolate->factory()->NewFixedArray(new_literal_count); | 1003 LiteralsArray::New(isolate, vector, new_literal_count, TENURED); |
1002 fun->set_literals(*new_literals); | 1004 fun->set_literals(*new_literals); |
1003 } | 1005 } |
1004 | 1006 |
1005 shared_info->set_num_literals(new_literal_count); | 1007 shared_info->set_num_literals(new_literal_count); |
1006 } | 1008 } |
1007 } | 1009 } |
1008 | 1010 |
1009 private: | 1011 private: |
1010 // Iterates all function instances in the HEAP that refers to the | 1012 // Iterates all function instances in the HEAP that refers to the |
1011 // provided shared_info. | 1013 // provided shared_info. |
(...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2003 isolate_->active_function_info_listener()->FunctionCode(code); | 2005 isolate_->active_function_info_listener()->FunctionCode(code); |
2004 } | 2006 } |
2005 | 2007 |
2006 | 2008 |
2007 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { | 2009 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { |
2008 return isolate->active_function_info_listener() != NULL; | 2010 return isolate->active_function_info_listener() != NULL; |
2009 } | 2011 } |
2010 | 2012 |
2011 } // namespace internal | 2013 } // namespace internal |
2012 } // namespace v8 | 2014 } // namespace v8 |
OLD | NEW |