Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: runtime/vm/object.cc

Issue 10882055: Put live register bits in stackmaps. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 6774 matching lines...) Expand 10 before | Expand all | Expand 10 after
6785 uint8_t byte_mask = 1U << bit_remainder; 6785 uint8_t byte_mask = 1U << bit_remainder;
6786 uint8_t* byte_addr = &(raw_ptr()->data_[byte_index]); 6786 uint8_t* byte_addr = &(raw_ptr()->data_[byte_index]);
6787 if (value) { 6787 if (value) {
6788 *byte_addr |= byte_mask; 6788 *byte_addr |= byte_mask;
6789 } else { 6789 } else {
6790 *byte_addr &= ~byte_mask; 6790 *byte_addr &= ~byte_mask;
6791 } 6791 }
6792 } 6792 }
6793 6793
6794 6794
6795 RawStackmap* Stackmap::New(intptr_t pc_offset, BitmapBuilder* bmap) { 6795 RawStackmap* Stackmap::New(intptr_t pc_offset,
6796 BitmapBuilder* bmap,
6797 intptr_t register_count) {
6796 ASSERT(Object::stackmap_class() != Class::null()); 6798 ASSERT(Object::stackmap_class() != Class::null());
6797 ASSERT(bmap != NULL); 6799 ASSERT(bmap != NULL);
6798 Stackmap& result = Stackmap::Handle(); 6800 Stackmap& result = Stackmap::Handle();
6799 // Guard against integer overflow of the instance size computation. 6801 // Guard against integer overflow of the instance size computation.
6800 intptr_t length = bmap->Length(); 6802 intptr_t length = bmap->Length();
6801 intptr_t payload_size = 6803 intptr_t payload_size =
6802 Utils::RoundUp(length, kBitsPerByte) / kBitsPerByte; 6804 Utils::RoundUp(length, kBitsPerByte) / kBitsPerByte;
6803 if ((payload_size < 0) || 6805 if ((payload_size < 0) ||
6804 (payload_size > 6806 (payload_size >
6805 (kSmiMax - static_cast<intptr_t>(sizeof(RawStackmap))))) { 6807 (kSmiMax - static_cast<intptr_t>(sizeof(RawStackmap))))) {
(...skipping 12 matching lines...) Expand all
6818 result.SetLength(length); 6820 result.SetLength(length);
6819 } 6821 }
6820 // When constructing a stackmap we store the pc offset in the stackmap's 6822 // When constructing a stackmap we store the pc offset in the stackmap's
6821 // PC. StackmapTableBuilder::FinalizeStackmaps will replace it with the pc 6823 // PC. StackmapTableBuilder::FinalizeStackmaps will replace it with the pc
6822 // address. 6824 // address.
6823 ASSERT(pc_offset >= 0); 6825 ASSERT(pc_offset >= 0);
6824 result.SetPC(pc_offset); 6826 result.SetPC(pc_offset);
6825 for (intptr_t i = 0; i < length; ++i) { 6827 for (intptr_t i = 0; i < length; ++i) {
6826 result.SetBit(i, bmap->Get(i)); 6828 result.SetBit(i, bmap->Get(i));
6827 } 6829 }
6830 result.SetRegisterCount(register_count);
6828 return result.raw(); 6831 return result.raw();
6829 } 6832 }
6830 6833
6831 6834
6832 const char* Stackmap::ToCString() const { 6835 const char* Stackmap::ToCString() const {
6833 if (IsNull()) { 6836 if (IsNull()) {
6834 return "{null}"; 6837 return "{null}";
6835 } else { 6838 } else {
6836 const char* kFormat = "0x%" PRIxPTR ": "; 6839 const char* kFormat = "0x%" PRIxPTR ": ";
6837 intptr_t fixed_length = OS::SNPrint(NULL, 0, kFormat, PC()) + 1; 6840 intptr_t fixed_length = OS::SNPrint(NULL, 0, kFormat, PC()) + 1;
(...skipping 4345 matching lines...) Expand 10 before | Expand all | Expand 10 after
11183 } 11186 }
11184 return result.raw(); 11187 return result.raw();
11185 } 11188 }
11186 11189
11187 11190
11188 const char* WeakProperty::ToCString() const { 11191 const char* WeakProperty::ToCString() const {
11189 return "_WeakProperty"; 11192 return "_WeakProperty";
11190 } 11193 }
11191 11194
11192 } // namespace dart 11195 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698