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

Side by Side Diff: runtime/vm/weak_code.cc

Issue 1863733004: Fixes crashes in inliner: do not inline if icdata was cleared. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: bb Created 4 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/weak_code.h" 5 #include "vm/weak_code.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 8
9 #include "vm/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/code_patcher.h" 10 #include "vm/code_patcher.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 code.Print(); 106 code.Print();
107 continue; 107 continue;
108 } 108 }
109 109
110 // If function uses dependent code switch it to unoptimized. 110 // If function uses dependent code switch it to unoptimized.
111 if (code.is_optimized() && (function.CurrentCode() == code.raw())) { 111 if (code.is_optimized() && (function.CurrentCode() == code.raw())) {
112 ReportSwitchingCode(code); 112 ReportSwitchingCode(code);
113 function.SwitchToUnoptimizedCode(); 113 function.SwitchToUnoptimizedCode();
114 } else if (function.unoptimized_code() == code.raw()) { 114 } else if (function.unoptimized_code() == code.raw()) {
115 ReportSwitchingCode(code); 115 ReportSwitchingCode(code);
116 function.set_was_compiled(false);
116 function.ClearICDataArray(); 117 function.ClearICDataArray();
117 // Remove the code object from the function. The next time the 118 // Remove the code object from the function. The next time the
118 // function is invoked, it will be compiled again. 119 // function is invoked, it will be compiled again.
119 function.ClearCode(); 120 function.ClearCode();
120 // Invalidate the old code object so existing references to it 121 // Invalidate the old code object so existing references to it
121 // (from optimized code) will be patched when invoked. 122 // (from optimized code) will be patched when invoked.
122 if (!code.IsDisabled()) { 123 if (!code.IsDisabled()) {
123 code.DisableDartCode(); 124 code.DisableDartCode();
124 } 125 }
125 } else { 126 } else {
126 // Make non-OSR code non-entrant. 127 // Make non-OSR code non-entrant.
127 if (!code.IsDisabled()) { 128 if (!code.IsDisabled()) {
128 ReportSwitchingCode(code); 129 ReportSwitchingCode(code);
129 code.DisableDartCode(); 130 code.DisableDartCode();
130 } 131 }
131 } 132 }
132 } 133 }
133 } 134 }
134 135
135 } // namespace dart 136 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698