| 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/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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 if (data->OsrPcOffset()->value() >= 0) { | 354 if (data->OsrPcOffset()->value() >= 0) { |
| 355 DCHECK(BailoutId(data->OsrAstId()->value()) == ast_id); | 355 DCHECK(BailoutId(data->OsrAstId()->value()) == ast_id); |
| 356 if (FLAG_trace_osr) { | 356 if (FLAG_trace_osr) { |
| 357 PrintF("[OSR - Entry at AST id %d, offset %d in optimized code]\n", | 357 PrintF("[OSR - Entry at AST id %d, offset %d in optimized code]\n", |
| 358 ast_id.ToInt(), data->OsrPcOffset()->value()); | 358 ast_id.ToInt(), data->OsrPcOffset()->value()); |
| 359 } | 359 } |
| 360 // TODO(titzer): this is a massive hack to make the deopt counts | 360 // TODO(titzer): this is a massive hack to make the deopt counts |
| 361 // match. Fix heuristics for reenabling optimizations! | 361 // match. Fix heuristics for reenabling optimizations! |
| 362 function->shared()->increment_deopt_count(); | 362 function->shared()->increment_deopt_count(); |
| 363 | 363 |
| 364 if (result->is_turbofanned()) { | 364 if (!result->is_turbofanned()) { |
| 365 // TurboFanned OSR code cannot be installed into the function. | |
| 366 // But the function is obviously hot, so optimize it next time. | |
| 367 function->ReplaceCode( | |
| 368 isolate->builtins()->builtin(Builtins::kCompileOptimized)); | |
| 369 } else { | |
| 370 // Crankshafted OSR code can be installed into the function. | 365 // Crankshafted OSR code can be installed into the function. |
| 371 function->ReplaceCode(*result); | 366 function->ReplaceCode(*result); |
| 372 } | 367 } |
| 373 return *result; | 368 return *result; |
| 374 } | 369 } |
| 375 } | 370 } |
| 376 | 371 |
| 377 // Failed. | 372 // Failed. |
| 378 if (FLAG_trace_osr) { | 373 if (FLAG_trace_osr) { |
| 379 PrintF("[OSR - Failed: "); | 374 PrintF("[OSR - Failed: "); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |