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

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

Issue 1376963002: Cleanup: we are not patching entries any longer (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Address review comments Created 5 years, 2 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 if (code.is_optimized() && (function.CurrentCode() == code.raw())) { 108 if (code.is_optimized() && (function.CurrentCode() == code.raw())) {
109 ReportSwitchingCode(code); 109 ReportSwitchingCode(code);
110 function.SwitchToUnoptimizedCode(); 110 function.SwitchToUnoptimizedCode();
111 } else if (function.unoptimized_code() == code.raw()) { 111 } else if (function.unoptimized_code() == code.raw()) {
112 ReportSwitchingCode(code); 112 ReportSwitchingCode(code);
113 function.ClearICDataArray(); 113 function.ClearICDataArray();
114 // Remove the code object from the function. The next time the 114 // Remove the code object from the function. The next time the
115 // function is invoked, it will be compiled again. 115 // function is invoked, it will be compiled again.
116 function.ClearCode(); 116 function.ClearCode();
117 // Invalidate the old code object so existing references to it 117 // Invalidate the old code object so existing references to it
118 // (from optimized code) will fail when invoked. 118 // (from optimized code) will be patched when invoked.
119 if (!CodePatcher::IsEntryPatched(code)) { 119 if (!code.IsDisabled()) {
120 CodePatcher::PatchEntry( 120 code.DisableDartCode();
121 code, Code::Handle(StubCode::FixCallersTarget_entry()->code()));
122 } 121 }
123 } else { 122 } else {
124 // Make non-OSR code non-entrant. 123 // Make non-OSR code non-entrant.
125 if (!CodePatcher::IsEntryPatched(code)) { 124 if (!code.IsDisabled()) {
126 ReportSwitchingCode(code); 125 ReportSwitchingCode(code);
127 CodePatcher::PatchEntry( 126 code.DisableDartCode();
128 code, Code::Handle(StubCode::FixCallersTarget_entry()->code()));
129 } 127 }
130 } 128 }
131 } 129 }
132 } 130 }
133 131
134 } // namespace dart 132 } // 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