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

Side by Side Diff: src/runtime/runtime-compiler.cc

Issue 2730323002: [deoptimizer] When deoptimizing code, unlink all functions referring to that code. (Closed)
Patch Set: Fix typo Created 3 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/log.cc ('k') | test/mjsunit/regress/regress-unlink-closures-on-deopt.js » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/asmjs/asm-js.h" 8 #include "src/asmjs/asm-js.h"
9 #include "src/compiler-dispatcher/optimizing-compile-dispatcher.h" 9 #include "src/compiler-dispatcher/optimizing-compile-dispatcher.h"
10 #include "src/compiler.h" 10 #include "src/compiler.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 206
207 // Search for other activations of the same optimized code. 207 // Search for other activations of the same optimized code.
208 // At this point {it} is at the topmost frame of all the frames materialized 208 // At this point {it} is at the topmost frame of all the frames materialized
209 // by the deoptimizer. Note that this frame does not necessarily represent 209 // by the deoptimizer. Note that this frame does not necessarily represent
210 // an activation of {function} because of potential inlined tail-calls. 210 // an activation of {function} because of potential inlined tail-calls.
211 ActivationsFinder activations_finder(*optimized_code); 211 ActivationsFinder activations_finder(*optimized_code);
212 activations_finder.VisitFrames(&it); 212 activations_finder.VisitFrames(&it);
213 isolate->thread_manager()->IterateArchivedThreads(&activations_finder); 213 isolate->thread_manager()->IterateArchivedThreads(&activations_finder);
214 214
215 if (!activations_finder.has_code_activations_) { 215 if (!activations_finder.has_code_activations_) {
216 if (function->code() == *optimized_code) { 216 Deoptimizer::UnlinkOptimizedCode(*optimized_code,
217 if (FLAG_trace_deopt) { 217 function->context()->native_context());
218 PrintF("[removing optimized code for: "); 218
219 function->PrintName();
220 PrintF("]\n");
221 }
222 function->ReplaceCode(function->shared()->code());
223 }
224 // Evict optimized code for this function from the cache so that it 219 // Evict optimized code for this function from the cache so that it
225 // doesn't get used for new closures. 220 // doesn't get used for new closures.
226 function->shared()->EvictFromOptimizedCodeMap(*optimized_code, 221 function->shared()->EvictFromOptimizedCodeMap(*optimized_code,
227 "notify deoptimized"); 222 "notify deoptimized");
228 } else { 223 } else {
229 // TODO(titzer): we should probably do DeoptimizeCodeList(code) 224 // TODO(titzer): we should probably do DeoptimizeCodeList(code)
230 // unconditionally if the code is not already marked for deoptimization. 225 // unconditionally if the code is not already marked for deoptimization.
231 // If there is an index by shared function info, all the better. 226 // If there is an index by shared function info, all the better.
232 Deoptimizer::DeoptimizeFunction(*function); 227 Deoptimizer::DeoptimizeFunction(*function);
233 } 228 }
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 DCHECK(is_valid_language_mode(args.smi_at(3))); 470 DCHECK(is_valid_language_mode(args.smi_at(3)));
476 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); 471 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3));
477 DCHECK(args[4]->IsSmi()); 472 DCHECK(args[4]->IsSmi());
478 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), 473 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(),
479 isolate); 474 isolate);
480 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, 475 return CompileGlobalEval(isolate, args.at<String>(1), outer_info,
481 language_mode, args.smi_at(4), args.smi_at(5)); 476 language_mode, args.smi_at(4), args.smi_at(5));
482 } 477 }
483 } // namespace internal 478 } // namespace internal
484 } // namespace v8 479 } // namespace v8
OLDNEW
« no previous file with comments | « src/log.cc ('k') | test/mjsunit/regress/regress-unlink-closures-on-deopt.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698