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/scopeinfo.h" | 7 #include "src/ast/scopeinfo.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 1891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1902 Handle<JSArray> old_shared_array, Handle<JSArray> new_shared_array, | 1902 Handle<JSArray> old_shared_array, Handle<JSArray> new_shared_array, |
1903 bool do_drop) { | 1903 bool do_drop) { |
1904 Isolate* isolate = old_shared_array->GetIsolate(); | 1904 Isolate* isolate = old_shared_array->GetIsolate(); |
1905 int len = GetArrayLength(old_shared_array); | 1905 int len = GetArrayLength(old_shared_array); |
1906 | 1906 |
1907 DCHECK(old_shared_array->HasFastElements()); | 1907 DCHECK(old_shared_array->HasFastElements()); |
1908 Handle<FixedArray> old_shared_array_elements( | 1908 Handle<FixedArray> old_shared_array_elements( |
1909 FixedArray::cast(old_shared_array->elements())); | 1909 FixedArray::cast(old_shared_array->elements())); |
1910 | 1910 |
1911 Handle<JSArray> result = isolate->factory()->NewJSArray(len); | 1911 Handle<JSArray> result = isolate->factory()->NewJSArray(len); |
| 1912 JSObject::EnsureWritableFastElements(result); |
1912 Handle<FixedArray> result_elements = | 1913 Handle<FixedArray> result_elements = |
1913 JSObject::EnsureWritableFastElements(result); | 1914 handle(FixedArray::cast(result->elements()), isolate); |
1914 | 1915 |
1915 // Fill the default values. | 1916 // Fill the default values. |
1916 for (int i = 0; i < len; i++) { | 1917 for (int i = 0; i < len; i++) { |
1917 FunctionPatchabilityStatus status = FUNCTION_AVAILABLE_FOR_PATCH; | 1918 FunctionPatchabilityStatus status = FUNCTION_AVAILABLE_FOR_PATCH; |
1918 result_elements->set(i, Smi::FromInt(status)); | 1919 result_elements->set(i, Smi::FromInt(status)); |
1919 } | 1920 } |
1920 | 1921 |
1921 // Scan the heap for active generators -- those that are either currently | 1922 // Scan the heap for active generators -- those that are either currently |
1922 // running (as we wouldn't want to restart them, because we don't know where | 1923 // running (as we wouldn't want to restart them, because we don't know where |
1923 // to restart them from) or suspended. Fail if any one corresponds to the set | 1924 // to restart them from) or suspended. Fail if any one corresponds to the set |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2037 isolate_->active_function_info_listener()->FunctionCode(code); | 2038 isolate_->active_function_info_listener()->FunctionCode(code); |
2038 } | 2039 } |
2039 | 2040 |
2040 | 2041 |
2041 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { | 2042 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { |
2042 return isolate->active_function_info_listener() != NULL; | 2043 return isolate->active_function_info_listener() != NULL; |
2043 } | 2044 } |
2044 | 2045 |
2045 } // namespace internal | 2046 } // namespace internal |
2046 } // namespace v8 | 2047 } // namespace v8 |
OLD | NEW |