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

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

Issue 1418813008: This adds a mechanism to invalidate code that was generated in the background. The invalidation can… (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: sync Created 5 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/weak_code.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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 weak_property ^= dependent_code.At(i); 50 weak_property ^= dependent_code.At(i);
51 if (code.raw() == weak_property.key()) { 51 if (code.raw() == weak_property.key()) {
52 return true; 52 return true;
53 } 53 }
54 } 54 }
55 return false; 55 return false;
56 } 56 }
57 57
58 58
59 void WeakCodeReferences::DisableCode() { 59 void WeakCodeReferences::DisableCode() {
60 IncrementInvalidationGen();
60 const Array& code_objects = Array::Handle(array_.raw()); 61 const Array& code_objects = Array::Handle(array_.raw());
61 if (code_objects.IsNull()) { 62 if (code_objects.IsNull()) {
62 return; 63 return;
63 } 64 }
64 ASSERT(Compiler::allow_recompilation()); 65 ASSERT(Compiler::allow_recompilation());
65 UpdateArrayTo(Object::null_array()); 66 UpdateArrayTo(Object::null_array());
66 // Disable all code on stack. 67 // Disable all code on stack.
67 Code& code = Code::Handle(); 68 Code& code = Code::Handle();
68 { 69 {
69 DartFrameIterator iterator; 70 DartFrameIterator iterator;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 // Make non-OSR code non-entrant. 124 // Make non-OSR code non-entrant.
124 if (!code.IsDisabled()) { 125 if (!code.IsDisabled()) {
125 ReportSwitchingCode(code); 126 ReportSwitchingCode(code);
126 code.DisableDartCode(); 127 code.DisableDartCode();
127 } 128 }
128 } 129 }
129 } 130 }
130 } 131 }
131 132
132 } // namespace dart 133 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/weak_code.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698