OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |