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

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

Issue 1590963002: Switch GetConcurrentlyOptimizedCode to MaybeHandle. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-compiler-18
Patch Set: Fix typo. Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/optimizing-compile-dispatcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-compiler.cc
diff --git a/src/runtime/runtime-compiler.cc b/src/runtime/runtime-compiler.cc
index c79616873202bfd348fc4fdc89649f449028f3b5..a8c0b5f5e251c37334026d975108e0663569893a 100644
--- a/src/runtime/runtime-compiler.cc
+++ b/src/runtime/runtime-compiler.cc
@@ -248,7 +248,6 @@ RUNTIME_FUNCTION(Runtime_CompileForOnStackReplacement) {
function->shared()->ast_node_count() > 512)
? Compiler::CONCURRENT
: Compiler::NOT_CONCURRENT;
- Handle<Code> result = Handle<Code>::null();
OptimizedCompileJob* job = NULL;
if (mode == Compiler::CONCURRENT) {
@@ -269,22 +268,24 @@ RUNTIME_FUNCTION(Runtime_CompileForOnStackReplacement) {
job = dispatcher->FindReadyOSRCandidate(function, ast_id);
}
+ MaybeHandle<Code> maybe_result;
if (job != NULL) {
if (FLAG_trace_osr) {
PrintF("[OSR - Found ready: ");
function->PrintName();
PrintF(" at AST id %d]\n", ast_id.ToInt());
}
- result = Compiler::GetConcurrentlyOptimizedCode(job);
+ maybe_result = Compiler::GetConcurrentlyOptimizedCode(job);
} else if (IsSuitableForOnStackReplacement(isolate, function)) {
if (FLAG_trace_osr) {
PrintF("[OSR - Compiling: ");
function->PrintName();
PrintF(" at AST id %d]\n", ast_id.ToInt());
}
- MaybeHandle<Code> maybe_result = Compiler::GetOptimizedCode(
+ maybe_result = Compiler::GetOptimizedCode(
function, mode, ast_id,
(mode == Compiler::NOT_CONCURRENT) ? frame : nullptr);
+ Handle<Code> result;
if (maybe_result.ToHandle(&result) &&
result.is_identical_to(isolate->builtins()->InOptimizationQueue())) {
// Optimization is queued. Return to check later.
@@ -296,7 +297,9 @@ RUNTIME_FUNCTION(Runtime_CompileForOnStackReplacement) {
BackEdgeTable::Revert(isolate, *caller_code);
// Check whether we ended up with usable optimized code.
- if (!result.is_null() && result->kind() == Code::OPTIMIZED_FUNCTION) {
+ Handle<Code> result;
+ if (maybe_result.ToHandle(&result) &&
+ result->kind() == Code::OPTIMIZED_FUNCTION) {
DeoptimizationInputData* data =
DeoptimizationInputData::cast(result->deoptimization_data());
« no previous file with comments | « src/optimizing-compile-dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698