OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/object.h" | 5 #include "vm/object.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 2505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2516 } else if (function.unoptimized_code() == code.raw()) { | 2516 } else if (function.unoptimized_code() == code.raw()) { |
2517 ReportSwitchingCode(code); | 2517 ReportSwitchingCode(code); |
2518 // Remove the code object from the function. The next time the | 2518 // Remove the code object from the function. The next time the |
2519 // function is invoked, it will be compiled again. | 2519 // function is invoked, it will be compiled again. |
2520 function.ClearCode(); | 2520 function.ClearCode(); |
2521 // Invalidate the old code object so existing references to it | 2521 // Invalidate the old code object so existing references to it |
2522 // (from optimized code) will fail when invoked. | 2522 // (from optimized code) will fail when invoked. |
2523 if (!CodePatcher::IsEntryPatched(code)) { | 2523 if (!CodePatcher::IsEntryPatched(code)) { |
2524 CodePatcher::PatchEntry(code); | 2524 CodePatcher::PatchEntry(code); |
2525 } | 2525 } |
| 2526 } else if (!function.HasCode() && (code.GetEntryPatchPc() != 0)) { |
| 2527 // The code has already been disconnected, make it invalid. Do not |
| 2528 // bother with OSR compiled code that has no valid entry-patch. |
| 2529 ReportSwitchingCode(code); |
| 2530 if (!CodePatcher::IsEntryPatched(code)) { |
| 2531 CodePatcher::PatchEntry(code); |
| 2532 } |
2526 } | 2533 } |
2527 } | 2534 } |
2528 } | 2535 } |
2529 | 2536 |
2530 private: | 2537 private: |
2531 const Array& array_; | 2538 const Array& array_; |
2532 DISALLOW_COPY_AND_ASSIGN(WeakCodeReferences); | 2539 DISALLOW_COPY_AND_ASSIGN(WeakCodeReferences); |
2533 }; | 2540 }; |
2534 | 2541 |
2535 | 2542 |
(...skipping 16470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19006 return tag_label.ToCString(); | 19013 return tag_label.ToCString(); |
19007 } | 19014 } |
19008 | 19015 |
19009 | 19016 |
19010 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 19017 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
19011 Instance::PrintJSONImpl(stream, ref); | 19018 Instance::PrintJSONImpl(stream, ref); |
19012 } | 19019 } |
19013 | 19020 |
19014 | 19021 |
19015 } // namespace dart | 19022 } // namespace dart |
OLD | NEW |