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

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

Issue 2577063002: Reland of "Store SharedFunctionInfos of a Script in a FixedArray indexed by their ID" (Closed)
Patch Set: fix 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
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-liveedit.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-function.cc
diff --git a/src/runtime/runtime-function.cc b/src/runtime/runtime-function.cc
index 8cf21c0e8528d7adafbf3209cf8b1705c0ca181c..7413f8750ae5d69648f15ac1b3dc04ac198daa60 100644
--- a/src/runtime/runtime-function.cc
+++ b/src/runtime/runtime-function.cc
@@ -204,8 +204,13 @@ RUNTIME_FUNCTION(Runtime_SetCode) {
target_shared->set_native(was_native);
target_shared->set_profiler_ticks(source_shared->profiler_ticks());
target_shared->set_function_literal_id(source_shared->function_literal_id());
- SharedFunctionInfo::SetScript(
- target_shared, Handle<Object>(source_shared->script(), isolate));
+
+ Handle<Object> source_script(source_shared->script(), isolate);
+ if (source_script->IsScript()) {
+ SharedFunctionInfo::SetScript(source_shared,
+ isolate->factory()->undefined_value());
+ }
+ SharedFunctionInfo::SetScript(target_shared, source_script);
// Set the code of the target function.
target->ReplaceCode(source_shared->code());
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-liveedit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698