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

Unified Diff: src/runtime/runtime-liveedit.cc

Issue 2547483002: Store SharedFunctionInfos of a Script in a FixedArray indexed by their ID (Closed)
Patch Set: updates Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: src/runtime/runtime-liveedit.cc
diff --git a/src/runtime/runtime-liveedit.cc b/src/runtime/runtime-liveedit.cc
index a19ccaa5847140b093efb65cce16c3a031624292..7cd60d32f1fb0d453f9e30b131f7a1242503ffea 100644
--- a/src/runtime/runtime-liveedit.cc
+++ b/src/runtime/runtime-liveedit.cc
@@ -100,15 +100,31 @@ RUNTIME_FUNCTION(Runtime_LiveEditReplaceScript) {
}
}
+// Recreate the shared function infos array after changing the IDs of all
+// SharedFunctionInfos.
+RUNTIME_FUNCTION(Runtime_LiveEditFixupScript) {
+ HandleScope scope(isolate);
+ CHECK(isolate->debug()->live_edit_enabled());
+ DCHECK(args.length() == 2);
Toon Verwaest 2016/12/06 21:10:14 DCHECK_EQ
jochen (gone - plz use gerrit) 2016/12/07 15:57:01 done
+ CONVERT_ARG_CHECKED(JSValue, script_value, 0);
+ CONVERT_NUMBER_CHECKED(int, max_function_literal_id, Int32, args[1]);
jgruber 2016/12/07 08:31:27 Nit: CONVERT_INT32_ARG_CHECKED here and below.
jochen (gone - plz use gerrit) 2016/12/07 15:57:01 done
+
+ CHECK(script_value->value()->IsScript());
+ Handle<Script> script(Script::cast(script_value->value()));
+
+ LiveEdit::FixupScript(script, max_function_literal_id);
+ return isolate->heap()->undefined_value();
+}
RUNTIME_FUNCTION(Runtime_LiveEditFunctionSourceUpdated) {
HandleScope scope(isolate);
CHECK(isolate->debug()->live_edit_enabled());
- DCHECK(args.length() == 1);
+ DCHECK(args.length() == 2);
CONVERT_ARG_HANDLE_CHECKED(JSArray, shared_info, 0);
+ CONVERT_NUMBER_CHECKED(int, new_function_literal_id, Int32, args[1]);
CHECK(SharedInfoWrapper::IsInstance(shared_info));
- LiveEdit::FunctionSourceUpdated(shared_info);
+ LiveEdit::FunctionSourceUpdated(shared_info, new_function_literal_id);
return isolate->heap()->undefined_value();
}

Powered by Google App Engine
This is Rietveld 408576698