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

Unified Diff: src/runtime.cc

Issue 246603003: Eliminate RETURN_IF_EMPTY_HANDLE macro (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Patch One. Created 6 years, 8 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/isolate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 2d4ab93015e4f8a749fc8f4b61fbfe3976933869..88bc2349ed045d0bf360ac863d7bf18a9addd469 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -8434,8 +8434,9 @@ RUNTIME_FUNCTION(MaybeObject*, RuntimeHidden_CompileUnoptimized) {
// Compile the target function.
ASSERT(function->shared()->allows_lazy_compilation());
- Handle<Code> code = Compiler::GetUnoptimizedCode(function);
- RETURN_IF_EMPTY_HANDLE(isolate, code);
+ Handle<Code> code;
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, code,
+ Compiler::GetUnoptimizedCode(function));
function->ReplaceCode(*code);
// All done. Return the compiled code.
@@ -8476,8 +8477,13 @@ RUNTIME_FUNCTION(MaybeObject*, RuntimeHidden_CompileOptimized) {
} else {
Compiler::ConcurrencyMode mode = concurrent ? Compiler::CONCURRENT
: Compiler::NOT_CONCURRENT;
- Handle<Code> code = Compiler::GetOptimizedCode(function, unoptimized, mode);
- function->ReplaceCode(code.is_null() ? *unoptimized : *code);
+ Handle<Code> code;
+ if (Compiler::GetOptimizedCode(
+ function, unoptimized, mode).ToHandle(&code)) {
+ function->ReplaceCode(*code);
+ } else {
+ function->ReplaceCode(*unoptimized);
+ }
}
ASSERT(function->code()->kind() == Code::FUNCTION ||
@@ -8798,15 +8804,16 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CompileForOnStackReplacement) {
PrintF(" at AST id %d]\n", ast_id.ToInt());
}
result = Compiler::GetConcurrentlyOptimizedCode(job);
- } else if (result.is_null() &&
- IsSuitableForOnStackReplacement(isolate, function, caller_code)) {
+ } else if (IsSuitableForOnStackReplacement(isolate, function, caller_code)) {
if (FLAG_trace_osr) {
PrintF("[OSR - Compiling: ");
function->PrintName();
PrintF(" at AST id %d]\n", ast_id.ToInt());
}
- result = Compiler::GetOptimizedCode(function, caller_code, mode, ast_id);
- if (result.is_identical_to(isolate->builtins()->InOptimizationQueue())) {
+ MaybeHandle<Code> maybe_result = Compiler::GetOptimizedCode(
+ function, caller_code, mode, ast_id);
+ if (maybe_result.ToHandle(&result) &&
+ result.is_identical_to(isolate->builtins()->InOptimizationQueue())) {
// Optimization is queued. Return to check later.
return NULL;
}
« no previous file with comments | « src/isolate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698