Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: src/liveedit.cc

Issue 998253005: Debugger: deduplicate shared function info when setting script break points. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixed nit Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/debug.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5
6 #include "src/v8.h" 6 #include "src/v8.h"
7 7
8 #include "src/liveedit.h" 8 #include "src/liveedit.h"
9 9
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after
1215 shared_info_array->GetIsolate()->compilation_cache()->Remove(shared_info); 1215 shared_info_array->GetIsolate()->compilation_cache()->Remove(shared_info);
1216 } 1216 }
1217 1217
1218 1218
1219 void LiveEdit::SetFunctionScript(Handle<JSValue> function_wrapper, 1219 void LiveEdit::SetFunctionScript(Handle<JSValue> function_wrapper,
1220 Handle<Object> script_handle) { 1220 Handle<Object> script_handle) {
1221 Handle<SharedFunctionInfo> shared_info = 1221 Handle<SharedFunctionInfo> shared_info =
1222 UnwrapSharedFunctionInfoFromJSValue(function_wrapper); 1222 UnwrapSharedFunctionInfoFromJSValue(function_wrapper);
1223 CHECK(script_handle->IsScript() || script_handle->IsUndefined()); 1223 CHECK(script_handle->IsScript() || script_handle->IsUndefined());
1224 shared_info->set_script(*script_handle); 1224 shared_info->set_script(*script_handle);
1225 shared_info->DisableOptimization(kLiveEdit);
1225 1226
1226 function_wrapper->GetIsolate()->compilation_cache()->Remove(shared_info); 1227 function_wrapper->GetIsolate()->compilation_cache()->Remove(shared_info);
1227 } 1228 }
1228 1229
1229 1230
1230 // For a script text change (defined as position_change_array), translates 1231 // For a script text change (defined as position_change_array), translates
1231 // position in unchanged text to position in changed text. 1232 // position in unchanged text to position in changed text.
1232 // Text change is a set of non-overlapping regions in text, that have changed 1233 // Text change is a set of non-overlapping regions in text, that have changed
1233 // their contents and length. It is specified as array of groups of 3 numbers: 1234 // their contents and length. It is specified as array of groups of 3 numbers:
1234 // (change_begin, change_end, change_end_new_position). 1235 // (change_begin, change_end, change_end_new_position).
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
2054 void LiveEditFunctionTracker::RecordRootFunctionInfo(Handle<Code> code) { 2055 void LiveEditFunctionTracker::RecordRootFunctionInfo(Handle<Code> code) {
2055 isolate_->active_function_info_listener()->FunctionCode(code); 2056 isolate_->active_function_info_listener()->FunctionCode(code);
2056 } 2057 }
2057 2058
2058 2059
2059 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { 2060 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) {
2060 return isolate->active_function_info_listener() != NULL; 2061 return isolate->active_function_info_listener() != NULL;
2061 } 2062 }
2062 2063
2063 } } // namespace v8::internal 2064 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/debug.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698