Index: runtime/vm/object.cc |
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
index 807f7c30ddfe922632dc989c28321bb00fef0667..0b93ca857378072d82b13d4f4be3c799361168f1 100644 |
--- a/runtime/vm/object.cc |
+++ b/runtime/vm/object.cc |
@@ -5288,11 +5288,11 @@ bool Function::HasBreakpoint() const { |
} |
-void Function::InstallOptimizedCode(const Code& code, bool is_osr) const { |
+void Function::InstallOptimizedCode(const Code& code) const { |
DEBUG_ASSERT(IsMutatorOrAtSafepoint()); |
// We may not have previous code if FLAG_precompile is set. |
// Hot-reload may have already disabled the current code. |
- if (!is_osr && HasCode() && !Code::Handle(CurrentCode()).IsDisabled()) { |
+ if (HasCode() && !Code::Handle(CurrentCode()).IsDisabled()) { |
Code::Handle(CurrentCode()).DisableDartCode(); |
} |
AttachCode(code); |
@@ -11776,21 +11776,22 @@ RawError* Library::CompileAll() { |
// Inner functions get added to the closures array. As part of compilation |
// more closures can be added to the end of the array. Compile all the |
// closures until we have reached the end of the "worklist". |
+ Object& result = Object::Handle(zone); |
const GrowableObjectArray& closures = GrowableObjectArray::Handle( |
zone, Isolate::Current()->object_store()->closure_functions()); |
Function& func = Function::Handle(zone); |
for (int i = 0; i < closures.Length(); i++) { |
func ^= closures.At(i); |
if (!func.HasCode()) { |
- error = Compiler::CompileFunction(thread, func); |
- if (!error.IsNull()) { |
- return error.raw(); |
+ result = Compiler::CompileFunction(thread, func); |
+ if (result.IsError()) { |
+ return Error::Cast(result).raw(); |
} |
func.ClearICDataArray(); |
func.ClearCode(); |
} |
} |
- return error.raw(); |
+ return Error::null(); |
} |