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

Unified Diff: runtime/vm/code_generator.cc

Issue 1107663002: Fix http://dartbug.com/23290 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 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 | « no previous file | runtime/vm/compiler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator.cc
===================================================================
--- runtime/vm/code_generator.cc (revision 45386)
+++ runtime/vm/code_generator.cc (working copy)
@@ -1439,14 +1439,21 @@
void DeoptimizeAt(const Code& optimized_code, uword pc) {
ASSERT(optimized_code.is_optimized());
+ Thread* thread = Thread::Current();
+ Zone* zone = thread->zone();
ICData::DeoptReasonId deopt_reason = ICData::kDeoptUnknown;
uint32_t deopt_flags = 0;
- const TypedData& deopt_info = TypedData::Handle(
+ const TypedData& deopt_info = TypedData::Handle(zone,
optimized_code.GetDeoptInfoAtPc(pc, &deopt_reason, &deopt_flags));
ASSERT(!deopt_info.IsNull());
- const Function& function = Function::Handle(optimized_code.function());
- Compiler::EnsureUnoptimizedCode(Thread::Current(), function);
- const Code& unoptimized_code = Code::Handle(function.unoptimized_code());
+ const Function& function = Function::Handle(zone, optimized_code.function());
+ const Error& error =
+ Error::Handle(zone, Compiler::EnsureUnoptimizedCode(thread, function));
+ if (!error.IsNull()) {
+ Exceptions::PropagateError(error);
+ }
+ const Code& unoptimized_code =
+ Code::Handle(zone, function.unoptimized_code());
ASSERT(!unoptimized_code.IsNull());
// The switch to unoptimized code may have already occurred.
if (function.HasOptimizedCode()) {
@@ -1457,7 +1464,7 @@
uword lazy_deopt_jump = optimized_code.GetLazyDeoptPc();
ASSERT(lazy_deopt_jump != 0);
const Instructions& instrs =
- Instructions::Handle(optimized_code.instructions());
+ Instructions::Handle(zone, optimized_code.instructions());
{
WritableInstructionsScope writable(instrs.EntryPoint(), instrs.size());
CodePatcher::InsertCallAt(pc, lazy_deopt_jump);
« no previous file with comments | « no previous file | runtime/vm/compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698