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

Unified Diff: runtime/vm/compiler.h

Issue 2781483005: Improve internal compiler API so that OSR code is never installed on function. (Closed)
Patch Set: cosmetics 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
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/compiler.h
diff --git a/runtime/vm/compiler.h b/runtime/vm/compiler.h
index e278a5798ca5ad885885672fac4785b2ea9c8c3c..1b0d079871ccb280013f2702ccaabb0ca13839ea 100644
--- a/runtime/vm/compiler.h
+++ b/runtime/vm/compiler.h
@@ -97,10 +97,13 @@ class Compiler : public AllStatic {
// Returns Error::null() if there is no compilation error.
static RawError* CompileClass(const Class& cls);
- // Generates code for given function and sets its code field.
+ // Generates code for given function without optimization and sets its code
+ // field.
//
+ // Returns the raw code object if compilation succeeds. Otherwise returns a
+ // RawError. Also installs the generated code on the function.
+ static RawObject* CompileFunction(Thread* thread, const Function& function);
// Returns Error::null() if there is no compilation error.
- static RawError* CompileFunction(Thread* thread, const Function& function);
static RawError* ParseFunction(Thread* thread, const Function& function);
// Generates unoptimized code if not present, current code is unchanged.
@@ -109,12 +112,13 @@ class Compiler : public AllStatic {
// Generates optimized code for function.
//
- // Returns Error::null() if there is no compilation error.
- // If 'result_code' is not NULL, then the generated code is returned but
- // not installed.
- static RawError* CompileOptimizedFunction(Thread* thread,
- const Function& function,
- intptr_t osr_id = kNoOSRDeoptId);
+ // Returns the code object if compilation succeeds. Returns an Error if
+ // there is a compilation error. If optimization fails, but there is no
+ // error, returns null. Any generated code is installed unless we are in
+ // OSR mode.
+ static RawObject* CompileOptimizedFunction(Thread* thread,
+ const Function& function,
+ intptr_t osr_id = kNoOSRDeoptId);
// Generates code for given parsed function (without parsing it again) and
// sets its code field.
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698