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

Unified Diff: runtime/vm/debugger.cc

Issue 64173005: Deoptimize closure functions in DeoptimizeWorld. This was causing (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger.cc
===================================================================
--- runtime/vm/debugger.cc (revision 30061)
+++ runtime/vm/debugger.cc (working copy)
@@ -949,20 +949,45 @@
const ClassTable& class_table = *isolate_->class_table();
Class& cls = Class::Handle();
Array& functions = Array::Handle();
+ GrowableObjectArray& closures = GrowableObjectArray::Handle();
Function& function = Function::Handle();
intptr_t num_classes = class_table.NumCids();
for (intptr_t i = 1; i < num_classes; i++) {
if (class_table.HasValidClassAt(i)) {
cls = class_table.At(i);
+
+ // Disable optimized functions.
functions = cls.functions();
- intptr_t num_functions = functions.IsNull() ? 0 : functions.Length();
- for (intptr_t f = 0; f < num_functions; f++) {
- function ^= functions.At(f);
- ASSERT(!function.IsNull());
- if (function.HasOptimizedCode()) {
- function.SwitchToUnoptimizedCode();
+ if (!functions.IsNull()) {
+ intptr_t num_functions = functions.Length();
+ for (intptr_t pos = 0; pos < num_functions; pos++) {
+ function ^= functions.At(pos);
+ ASSERT(!function.IsNull());
+ if (function.HasOptimizedCode()) {
+ function.SwitchToUnoptimizedCode();
+ }
+ // Also disable any optimized implicit closure functions.
+ if (function.HasImplicitClosureFunction()) {
+ function = function.ImplicitClosureFunction();
+ if (function.HasOptimizedCode()) {
+ function.SwitchToUnoptimizedCode();
+ }
+ }
}
}
+
+ // Disable other optimized closure functions.
+ closures = cls.closures();
+ if (!closures.IsNull()) {
+ intptr_t num_closures = closures.Length();
+ for (intptr_t pos = 0; pos < num_closures; pos++) {
+ function ^= closures.At(pos);
+ ASSERT(!function.IsNull());
+ if (function.HasOptimizedCode()) {
+ function.SwitchToUnoptimizedCode();
+ }
+ }
+ }
}
}
}
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698