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

Unified Diff: runtime/vm/object.cc

Issue 2781483005: Improve internal compiler API so that OSR code is never installed on function. (Closed)
Patch Set: Created 3 years, 9 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
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();
}
« runtime/vm/compiler.cc ('K') | « runtime/vm/object.h ('k') | runtime/vm/unit_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698