| OLD | NEW |
| 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
| 8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
| 9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
| 10 #include "src/frames.h" | 10 #include "src/frames.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 isolate->thread_manager()->IterateArchivedThreads(&activations_finder); | 144 isolate->thread_manager()->IterateArchivedThreads(&activations_finder); |
| 145 | 145 |
| 146 if (!activations_finder.has_code_activations_) { | 146 if (!activations_finder.has_code_activations_) { |
| 147 if (function->code() == *optimized_code) { | 147 if (function->code() == *optimized_code) { |
| 148 if (FLAG_trace_deopt) { | 148 if (FLAG_trace_deopt) { |
| 149 PrintF("[removing optimized code for: "); | 149 PrintF("[removing optimized code for: "); |
| 150 function->PrintName(); | 150 function->PrintName(); |
| 151 PrintF("]\n"); | 151 PrintF("]\n"); |
| 152 } | 152 } |
| 153 function->ReplaceCode(function->shared()->code()); | 153 function->ReplaceCode(function->shared()->code()); |
| 154 // Evict optimized code for this function from the cache so that it | |
| 155 // doesn't get used for new closures. | |
| 156 function->shared()->EvictFromOptimizedCodeMap(*optimized_code, | |
| 157 "notify deoptimized"); | |
| 158 } | 154 } |
| 155 // Evict optimized code for this function from the cache so that it |
| 156 // doesn't get used for new closures. |
| 157 function->shared()->EvictFromOptimizedCodeMap(*optimized_code, |
| 158 "notify deoptimized"); |
| 159 } else { | 159 } else { |
| 160 // TODO(titzer): we should probably do DeoptimizeCodeList(code) | 160 // TODO(titzer): we should probably do DeoptimizeCodeList(code) |
| 161 // unconditionally if the code is not already marked for deoptimization. | 161 // unconditionally if the code is not already marked for deoptimization. |
| 162 // If there is an index by shared function info, all the better. | 162 // If there is an index by shared function info, all the better. |
| 163 Deoptimizer::DeoptimizeFunction(*function); | 163 Deoptimizer::DeoptimizeFunction(*function); |
| 164 } | 164 } |
| 165 | 165 |
| 166 return isolate->heap()->undefined_value(); | 166 return isolate->heap()->undefined_value(); |
| 167 } | 167 } |
| 168 | 168 |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 DCHECK(is_valid_language_mode(args.smi_at(3))); | 436 DCHECK(is_valid_language_mode(args.smi_at(3))); |
| 437 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); | 437 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); |
| 438 DCHECK(args[4]->IsSmi()); | 438 DCHECK(args[4]->IsSmi()); |
| 439 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), | 439 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), |
| 440 isolate); | 440 isolate); |
| 441 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, | 441 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, |
| 442 language_mode, args.smi_at(4)); | 442 language_mode, args.smi_at(4)); |
| 443 } | 443 } |
| 444 } // namespace internal | 444 } // namespace internal |
| 445 } // namespace v8 | 445 } // namespace v8 |
| OLD | NEW |