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

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

Issue 1192103004: VM: New calling convention for generated code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fixed comments Created 5 years, 3 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/unit_test.h ('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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 fail when invoked.
119 if (!CodePatcher::IsEntryPatched(code)) { 119 if (!CodePatcher::IsEntryPatched(code)) {
120 CodePatcher::PatchEntry(code); 120 CodePatcher::PatchEntry(
121 code, Code::Handle(StubCode::FixCallersTarget_entry()->code()));
121 } 122 }
122 } else { 123 } else {
123 // Make non-OSR code non-entrant. 124 // Make non-OSR code non-entrant.
124 if (code.GetEntryPatchPc() != 0) { 125 if (!CodePatcher::IsEntryPatched(code)) {
125 if (!CodePatcher::IsEntryPatched(code)) { 126 ReportSwitchingCode(code);
126 ReportSwitchingCode(code); 127 CodePatcher::PatchEntry(
127 CodePatcher::PatchEntry(code); 128 code, Code::Handle(StubCode::FixCallersTarget_entry()->code()));
128 }
129 } 129 }
130 } 130 }
131 } 131 }
132 } 132 }
133 133
134 } // namespace dart 134 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/unit_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698