| 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 6771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6782 uint8_t byte_mask = 1U << bit_remainder; | 6782 uint8_t byte_mask = 1U << bit_remainder; |
| 6783 uint8_t* byte_addr = &(raw_ptr()->data_[byte_index]); | 6783 uint8_t* byte_addr = &(raw_ptr()->data_[byte_index]); |
| 6784 if (value) { | 6784 if (value) { |
| 6785 *byte_addr |= byte_mask; | 6785 *byte_addr |= byte_mask; |
| 6786 } else { | 6786 } else { |
| 6787 *byte_addr &= ~byte_mask; | 6787 *byte_addr &= ~byte_mask; |
| 6788 } | 6788 } |
| 6789 } | 6789 } |
| 6790 | 6790 |
| 6791 | 6791 |
| 6792 RawStackmap* Stackmap::New(intptr_t pc_offset, BitmapBuilder* bmap) { | 6792 RawStackmap* Stackmap::New(intptr_t pc_offset, |
| 6793 BitmapBuilder* bmap, |
| 6794 intptr_t register_bit_count) { |
| 6793 ASSERT(Object::stackmap_class() != Class::null()); | 6795 ASSERT(Object::stackmap_class() != Class::null()); |
| 6794 ASSERT(bmap != NULL); | 6796 ASSERT(bmap != NULL); |
| 6795 Stackmap& result = Stackmap::Handle(); | 6797 Stackmap& result = Stackmap::Handle(); |
| 6796 // Guard against integer overflow of the instance size computation. | 6798 // Guard against integer overflow of the instance size computation. |
| 6797 intptr_t length = bmap->Length(); | 6799 intptr_t length = bmap->Length(); |
| 6798 intptr_t payload_size = | 6800 intptr_t payload_size = |
| 6799 Utils::RoundUp(length, kBitsPerByte) / kBitsPerByte; | 6801 Utils::RoundUp(length, kBitsPerByte) / kBitsPerByte; |
| 6800 if ((payload_size < 0) || | 6802 if ((payload_size < 0) || |
| 6801 (payload_size > | 6803 (payload_size > |
| 6802 (kSmiMax - static_cast<intptr_t>(sizeof(RawStackmap))))) { | 6804 (kSmiMax - static_cast<intptr_t>(sizeof(RawStackmap))))) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 6815 result.SetLength(length); | 6817 result.SetLength(length); |
| 6816 } | 6818 } |
| 6817 // When constructing a stackmap we store the pc offset in the stackmap's | 6819 // When constructing a stackmap we store the pc offset in the stackmap's |
| 6818 // PC. StackmapTableBuilder::FinalizeStackmaps will replace it with the pc | 6820 // PC. StackmapTableBuilder::FinalizeStackmaps will replace it with the pc |
| 6819 // address. | 6821 // address. |
| 6820 ASSERT(pc_offset >= 0); | 6822 ASSERT(pc_offset >= 0); |
| 6821 result.SetPC(pc_offset); | 6823 result.SetPC(pc_offset); |
| 6822 for (intptr_t i = 0; i < length; ++i) { | 6824 for (intptr_t i = 0; i < length; ++i) { |
| 6823 result.SetBit(i, bmap->Get(i)); | 6825 result.SetBit(i, bmap->Get(i)); |
| 6824 } | 6826 } |
| 6827 result.SetRegisterBitCount(register_bit_count); |
| 6825 return result.raw(); | 6828 return result.raw(); |
| 6826 } | 6829 } |
| 6827 | 6830 |
| 6828 | 6831 |
| 6829 const char* Stackmap::ToCString() const { | 6832 const char* Stackmap::ToCString() const { |
| 6830 if (IsNull()) { | 6833 if (IsNull()) { |
| 6831 return "{null}"; | 6834 return "{null}"; |
| 6832 } else { | 6835 } else { |
| 6833 const char* kFormat = "0x%" PRIxPTR ": "; | 6836 const char* kFormat = "0x%" PRIxPTR ": "; |
| 6834 intptr_t fixed_length = OS::SNPrint(NULL, 0, kFormat, PC()) + 1; | 6837 intptr_t fixed_length = OS::SNPrint(NULL, 0, kFormat, PC()) + 1; |
| (...skipping 4345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11180 } | 11183 } |
| 11181 return result.raw(); | 11184 return result.raw(); |
| 11182 } | 11185 } |
| 11183 | 11186 |
| 11184 | 11187 |
| 11185 const char* WeakProperty::ToCString() const { | 11188 const char* WeakProperty::ToCString() const { |
| 11186 return "_WeakProperty"; | 11189 return "_WeakProperty"; |
| 11187 } | 11190 } |
| 11188 | 11191 |
| 11189 } // namespace dart | 11192 } // namespace dart |
| OLD | NEW |