Chromium Code Reviews| 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 6658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6669 UNREACHABLE(); | 6669 UNREACHABLE(); |
| 6670 return ""; | 6670 return ""; |
| 6671 } | 6671 } |
| 6672 | 6672 |
| 6673 | 6673 |
| 6674 void PcDescriptors::PrintHeaderString() { | 6674 void PcDescriptors::PrintHeaderString() { |
| 6675 // 4 bits per hex digit + 2 for "0x". | 6675 // 4 bits per hex digit + 2 for "0x". |
| 6676 const int addr_width = (kBitsPerWord / 4) + 2; | 6676 const int addr_width = (kBitsPerWord / 4) + 2; |
| 6677 // "*" in a printf format specifier tells it to read the field width from | 6677 // "*" in a printf format specifier tells it to read the field width from |
| 6678 // the printf argument list. | 6678 // the printf argument list. |
| 6679 OS::Print("%-*s\tkind \ttid\ttok-ix\ttry/deopt-ix\n", addr_width, "pc"); | 6679 OS::Print("%-*s\tkind \tdeopt-id\ttok-ix\ttry/deopt-ix\n", |
| 6680 addr_width, "pc"); | |
| 6680 } | 6681 } |
| 6681 | 6682 |
| 6682 | 6683 |
| 6683 const char* PcDescriptors::ToCString() const { | 6684 const char* PcDescriptors::ToCString() const { |
| 6684 if (Length() == 0) { | 6685 if (Length() == 0) { |
| 6685 return "No pc descriptors\n"; | 6686 return "No pc descriptors\n"; |
| 6686 } | 6687 } |
| 6687 // 4 bits per hex digit. | 6688 // 4 bits per hex digit. |
| 6688 const int addr_width = kBitsPerWord / 4; | 6689 const int addr_width = kBitsPerWord / 4; |
| 6689 // "*" in a printf format specifier tells it to read the field width from | 6690 // "*" in a printf format specifier tells it to read the field width from |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 6720 token_pos_or_deopt_reason, | 6721 token_pos_or_deopt_reason, |
| 6721 multi_purpose_index); | 6722 multi_purpose_index); |
| 6722 } | 6723 } |
| 6723 return buffer; | 6724 return buffer; |
| 6724 } | 6725 } |
| 6725 | 6726 |
| 6726 | 6727 |
| 6727 // Verify assumptions (in debug mode only). | 6728 // Verify assumptions (in debug mode only). |
| 6728 // - No two deopt descriptors have the same deoptimization id. | 6729 // - No two deopt descriptors have the same deoptimization id. |
| 6729 // - No two ic-call descriptors have the same deoptimization id (type feedback). | 6730 // - No two ic-call descriptors have the same deoptimization id (type feedback). |
| 6730 // - No two descriptors of same kind have the same PC. | |
| 6731 // A function without unique ids is marked as non-optimizable (e.g., because of | 6731 // A function without unique ids is marked as non-optimizable (e.g., because of |
|
srdjan
2012/09/06 13:44:26
Maybe replace removed comment with what you said i
Florian Schneider
2012/09/06 13:49:30
Done.
| |
| 6732 // finally blocks). | 6732 // finally blocks). |
| 6733 void PcDescriptors::Verify(bool check_ids) const { | 6733 void PcDescriptors::Verify(bool check_ids) const { |
| 6734 #if defined(DEBUG) | 6734 #if defined(DEBUG) |
| 6735 // TODO(srdjan): Implement a more efficient way to check, currently drop | 6735 // TODO(srdjan): Implement a more efficient way to check, currently drop |
| 6736 // the check for too large number of descriptors. | 6736 // the check for too large number of descriptors. |
| 6737 if (Length() > 3000) { | 6737 if (Length() > 3000) { |
| 6738 if (FLAG_trace_compiler) { | 6738 if (FLAG_trace_compiler) { |
| 6739 OS::Print("Not checking pc decriptors, length %"Pd"\n", Length()); | 6739 OS::Print("Not checking pc decriptors, length %"Pd"\n", Length()); |
| 6740 } | 6740 } |
| 6741 return; | 6741 return; |
| 6742 } | 6742 } |
| 6743 for (intptr_t i = 0; i < Length(); i++) { | 6743 for (intptr_t i = 0; i < Length(); i++) { |
| 6744 uword pc = PC(i); | |
| 6745 PcDescriptors::Kind kind = DescriptorKind(i); | 6744 PcDescriptors::Kind kind = DescriptorKind(i); |
| 6746 // 'deopt_id' is set for kDeopt and kIcCall and must be unique for one kind. | 6745 // 'deopt_id' is set for kDeopt and kIcCall and must be unique for one kind. |
| 6747 intptr_t deopt_id = Isolate::kNoDeoptId; | 6746 intptr_t deopt_id = Isolate::kNoDeoptId; |
| 6748 if (check_ids) { | 6747 if (check_ids) { |
| 6749 if ((DescriptorKind(i) == PcDescriptors::kDeoptBefore) || | 6748 if ((DescriptorKind(i) == PcDescriptors::kDeoptBefore) || |
| 6750 (DescriptorKind(i) == PcDescriptors::kIcCall)) { | 6749 (DescriptorKind(i) == PcDescriptors::kIcCall)) { |
| 6751 deopt_id = DeoptId(i); | 6750 deopt_id = DeoptId(i); |
| 6752 } | 6751 } |
| 6753 } | 6752 } |
| 6754 for (intptr_t k = i + 1; k < Length(); k++) { | 6753 for (intptr_t k = i + 1; k < Length(); k++) { |
| 6755 if (kind == DescriptorKind(k)) { | 6754 if (kind == DescriptorKind(k)) { |
| 6756 if (deopt_id != Isolate::kNoDeoptId) { | 6755 if (deopt_id != Isolate::kNoDeoptId) { |
| 6757 ASSERT(DeoptId(k) != deopt_id); | 6756 ASSERT(DeoptId(k) != deopt_id); |
| 6758 } | 6757 } |
| 6759 ASSERT(pc != PC(k)); | |
| 6760 } | 6758 } |
| 6761 } | 6759 } |
| 6762 } | 6760 } |
| 6763 #endif // DEBUG | 6761 #endif // DEBUG |
| 6764 } | 6762 } |
| 6765 | 6763 |
| 6766 | 6764 |
| 6767 void Stackmap::SetCode(const dart::Code& code) const { | 6765 void Stackmap::SetCode(const dart::Code& code) const { |
| 6768 StorePointer(&raw_ptr()->code_, code.raw()); | 6766 StorePointer(&raw_ptr()->code_, code.raw()); |
| 6769 } | 6767 } |
| (...skipping 4429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 11199 } | 11197 } |
| 11200 return result.raw(); | 11198 return result.raw(); |
| 11201 } | 11199 } |
| 11202 | 11200 |
| 11203 | 11201 |
| 11204 const char* WeakProperty::ToCString() const { | 11202 const char* WeakProperty::ToCString() const { |
| 11205 return "_WeakProperty"; | 11203 return "_WeakProperty"; |
| 11206 } | 11204 } |
| 11207 | 11205 |
| 11208 } // namespace dart | 11206 } // namespace dart |
| OLD | NEW |