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

Unified Diff: runtime/vm/compiler.cc

Issue 2792033002: [kernel] vm: Fix a few issues in the kernel flow graph builder, update status file for checked-mode (Closed)
Patch Set: addressed comments 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 | « pkg/kernel/lib/transformations/continuation.dart ('k') | runtime/vm/kernel_to_il.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/compiler.cc
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index 231202b57821bdcc657a92b397285952de0efd76..c7052d3cfe3e01ba08767af60228fc854552ed63 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -1692,7 +1692,6 @@ RawObject* Compiler::EvaluateStaticInitializer(const Field& field) {
// Under lazy compilation initializer has not yet been created, so create
// it now, but don't bother remembering it because it won't be used again.
ASSERT(!field.HasPrecompiledInitializer());
- Function& initializer = Function::Handle(thread->zone());
{
#if !defined(PRODUCT)
VMTagScope tagScope(thread, VMTag::kCompileUnoptimizedTagId);
@@ -1720,22 +1719,21 @@ RawObject* Compiler::EvaluateStaticInitializer(const Field& field) {
// Non-optimized code generator.
DartCompilationPipeline pipeline;
CompileParsedFunctionHelper helper(parsed_function, false, kNoOSRDeoptId);
- helper.Compile(&pipeline);
- initializer = parsed_function->function().raw();
- Code::Handle(initializer.unoptimized_code())
- .set_var_descriptors(Object::empty_var_descriptors());
+ const Code& code = Code::Handle(helper.Compile(&pipeline));
+ if (!code.IsNull()) {
+ const Function& initializer = parsed_function->function();
+ code.set_var_descriptors(Object::empty_var_descriptors());
+ // Invoke the function to evaluate the expression.
+ return DartEntry::InvokeFunction(initializer, Object::empty_array());
+ }
}
- // Invoke the function to evaluate the expression.
- return DartEntry::InvokeFunction(initializer, Object::empty_array());
- } else {
- Thread* const thread = Thread::Current();
- StackZone zone(thread);
- const Error& error = Error::Handle(thread->zone(), thread->sticky_error());
- thread->clear_sticky_error();
- return error.raw();
}
- UNREACHABLE();
- return Object::null();
+
+ Thread* const thread = Thread::Current();
+ StackZone zone(thread);
+ const Error& error = Error::Handle(thread->zone(), thread->sticky_error());
+ thread->clear_sticky_error();
+ return error.raw();
}
@@ -1798,21 +1796,19 @@ RawObject* Compiler::ExecuteOnce(SequenceNode* fragment) {
// Non-optimized code generator.
DartCompilationPipeline pipeline;
CompileParsedFunctionHelper helper(parsed_function, false, kNoOSRDeoptId);
- helper.Compile(&pipeline);
- Code::Handle(func.unoptimized_code())
- .set_var_descriptors(Object::empty_var_descriptors());
-
- const Object& result = PassiveObject::Handle(
- DartEntry::InvokeFunction(func, Object::empty_array()));
- return result.raw();
- } else {
- Thread* const thread = Thread::Current();
- const Object& result = PassiveObject::Handle(thread->sticky_error());
- thread->clear_sticky_error();
- return result.raw();
+ const Code& code = Code::Handle(helper.Compile(&pipeline));
+ if (!code.IsNull()) {
+ code.set_var_descriptors(Object::empty_var_descriptors());
+ const Object& result = PassiveObject::Handle(
+ DartEntry::InvokeFunction(func, Object::empty_array()));
+ return result.raw();
+ }
}
- UNREACHABLE();
- return Object::null();
+
+ Thread* const thread = Thread::Current();
+ const Object& result = PassiveObject::Handle(thread->sticky_error());
+ thread->clear_sticky_error();
+ return result.raw();
}
« no previous file with comments | « pkg/kernel/lib/transformations/continuation.dart ('k') | runtime/vm/kernel_to_il.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698