| 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/bigint_operations.h" | 10 #include "vm/bigint_operations.h" |
| (...skipping 7096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7107 } | 7107 } |
| 7108 return buffer; | 7108 return buffer; |
| 7109 } | 7109 } |
| 7110 | 7110 |
| 7111 | 7111 |
| 7112 // Verify assumptions (in debug mode only). | 7112 // Verify assumptions (in debug mode only). |
| 7113 // - No two deopt descriptors have the same deoptimization id. | 7113 // - No two deopt descriptors have the same deoptimization id. |
| 7114 // - No two ic-call descriptors have the same deoptimization id (type feedback). | 7114 // - No two ic-call descriptors have the same deoptimization id (type feedback). |
| 7115 // A function without unique ids is marked as non-optimizable (e.g., because of | 7115 // A function without unique ids is marked as non-optimizable (e.g., because of |
| 7116 // finally blocks). | 7116 // finally blocks). |
| 7117 void PcDescriptors::Verify(bool check_ids) const { | 7117 void PcDescriptors::Verify(const Function& function) const { |
| 7118 #if defined(DEBUG) | 7118 #if defined(DEBUG) |
| 7119 // TODO(srdjan): Implement a more efficient way to check, currently drop | 7119 // TODO(srdjan): Implement a more efficient way to check, currently drop |
| 7120 // the check for too large number of descriptors. | 7120 // the check for too large number of descriptors. |
| 7121 if (Length() > 3000) { | 7121 if (Length() > 3000) { |
| 7122 if (FLAG_trace_compiler) { | 7122 if (FLAG_trace_compiler) { |
| 7123 OS::Print("Not checking pc decriptors, length %"Pd"\n", Length()); | 7123 OS::Print("Not checking pc decriptors, length %"Pd"\n", Length()); |
| 7124 } | 7124 } |
| 7125 return; | 7125 return; |
| 7126 } | 7126 } |
| 7127 // Only check ids for unoptimized code that is optimizable. |
| 7128 if (!function.is_optimizable()) return; |
| 7127 for (intptr_t i = 0; i < Length(); i++) { | 7129 for (intptr_t i = 0; i < Length(); i++) { |
| 7128 PcDescriptors::Kind kind = DescriptorKind(i); | 7130 PcDescriptors::Kind kind = DescriptorKind(i); |
| 7129 // 'deopt_id' is set for kDeopt and kIcCall and must be unique for one kind. | 7131 // 'deopt_id' is set for kDeopt and kIcCall and must be unique for one kind. |
| 7130 intptr_t deopt_id = Isolate::kNoDeoptId; | 7132 intptr_t deopt_id = Isolate::kNoDeoptId; |
| 7131 if (check_ids) { | 7133 if ((DescriptorKind(i) == PcDescriptors::kDeoptBefore) || |
| 7132 if ((DescriptorKind(i) == PcDescriptors::kDeoptBefore) || | 7134 (DescriptorKind(i) == PcDescriptors::kIcCall)) { |
| 7133 (DescriptorKind(i) == PcDescriptors::kIcCall)) { | 7135 deopt_id = DeoptId(i); |
| 7134 deopt_id = DeoptId(i); | |
| 7135 } | |
| 7136 } | 7136 } |
| 7137 for (intptr_t k = i + 1; k < Length(); k++) { | 7137 for (intptr_t k = i + 1; k < Length(); k++) { |
| 7138 if (kind == DescriptorKind(k)) { | 7138 if (kind == DescriptorKind(k)) { |
| 7139 if (deopt_id != Isolate::kNoDeoptId) { | 7139 if (deopt_id != Isolate::kNoDeoptId) { |
| 7140 ASSERT(DeoptId(k) != deopt_id); | 7140 ASSERT(DeoptId(k) != deopt_id); |
| 7141 } | 7141 } |
| 7142 } | 7142 } |
| 7143 } | 7143 } |
| 7144 } | 7144 } |
| 7145 #endif // DEBUG | 7145 #endif // DEBUG |
| (...skipping 4469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11615 } | 11615 } |
| 11616 return result.raw(); | 11616 return result.raw(); |
| 11617 } | 11617 } |
| 11618 | 11618 |
| 11619 | 11619 |
| 11620 const char* WeakProperty::ToCString() const { | 11620 const char* WeakProperty::ToCString() const { |
| 11621 return "_WeakProperty"; | 11621 return "_WeakProperty"; |
| 11622 } | 11622 } |
| 11623 | 11623 |
| 11624 } // namespace dart | 11624 } // namespace dart |
| OLD | NEW |