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

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

Issue 809333002: [turbofan] Implement OSR for outer loops. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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/objects.cc ('k') | test/cctest/cctest.gyp » ('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/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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 if (data->OsrPcOffset()->value() >= 0) { 294 if (data->OsrPcOffset()->value() >= 0) {
295 DCHECK(BailoutId(data->OsrAstId()->value()) == ast_id); 295 DCHECK(BailoutId(data->OsrAstId()->value()) == ast_id);
296 if (FLAG_trace_osr) { 296 if (FLAG_trace_osr) {
297 PrintF("[OSR - Entry at AST id %d, offset %d in optimized code]\n", 297 PrintF("[OSR - Entry at AST id %d, offset %d in optimized code]\n",
298 ast_id.ToInt(), data->OsrPcOffset()->value()); 298 ast_id.ToInt(), data->OsrPcOffset()->value());
299 } 299 }
300 // TODO(titzer): this is a massive hack to make the deopt counts 300 // TODO(titzer): this is a massive hack to make the deopt counts
301 // match. Fix heuristics for reenabling optimizations! 301 // match. Fix heuristics for reenabling optimizations!
302 function->shared()->increment_deopt_count(); 302 function->shared()->increment_deopt_count();
303 303
304 // TODO(titzer): Do not install code into the function. 304 if (result->is_turbofanned()) {
305 function->ReplaceCode(*result); 305 // TurboFanned OSR code cannot be installed into the function.
306 // But the function is obviously hot, so optimize it next time.
307 function->ReplaceCode(
308 isolate->builtins()->builtin(Builtins::kCompileOptimized));
309 } else {
310 // Crankshafted OSR code can be installed into the function.
311 function->ReplaceCode(*result);
312 }
306 return *result; 313 return *result;
307 } 314 }
308 } 315 }
309 316
310 // Failed. 317 // Failed.
311 if (FLAG_trace_osr) { 318 if (FLAG_trace_osr) {
312 PrintF("[OSR - Failed: "); 319 PrintF("[OSR - Failed: ");
313 function->PrintName(); 320 function->PrintName();
314 PrintF(" at AST id %d]\n", ast_id.ToInt()); 321 PrintF(" at AST id %d]\n", ast_id.ToInt());
315 } 322 }
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 DCHECK(args.smi_at(4) == SLOPPY || args.smi_at(4) == STRICT); 460 DCHECK(args.smi_at(4) == SLOPPY || args.smi_at(4) == STRICT);
454 StrictMode strict_mode = static_cast<StrictMode>(args.smi_at(4)); 461 StrictMode strict_mode = static_cast<StrictMode>(args.smi_at(4));
455 DCHECK(args[5]->IsSmi()); 462 DCHECK(args[5]->IsSmi());
456 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), 463 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(),
457 isolate); 464 isolate);
458 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, 465 return CompileGlobalEval(isolate, args.at<String>(1), outer_info,
459 args.at<Object>(3), strict_mode, args.smi_at(5)); 466 args.at<Object>(3), strict_mode, args.smi_at(5));
460 } 467 }
461 } 468 }
462 } // namespace v8::internal 469 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698