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

Unified Diff: runtime/vm/object.cc

Issue 10832410: Give a length field to stack bitmaps. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Incorporated review comments. Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 5f8a04f5d15a96827f660812c5af312cf733e4e8..41e405c95aa8592c947336ea167d8ef42fa94c07 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -6766,18 +6766,17 @@ void Stackmap::SetBit(intptr_t bit_index, bool value) const {
}
-RawStackmap* Stackmap::New(intptr_t pc_offset,
- intptr_t length,
- BitmapBuilder* bmap) {
+RawStackmap* Stackmap::New(intptr_t pc_offset, BitmapBuilder* bmap) {
ASSERT(Object::stackmap_class() != Class::null());
ASSERT(bmap != NULL);
Stackmap& result = Stackmap::Handle();
// Guard against integer overflow of the instance size computation.
+ intptr_t length = bmap->Length();
intptr_t payload_size =
Utils::RoundUp(length, kBitsPerByte) / kBitsPerByte;
- if (payload_size < 0 ||
- payload_size >
- (kSmiMax - static_cast<intptr_t>(sizeof(RawStackmap)))) {
+ if ((payload_size < 0) ||
+ (payload_size >
+ (kSmiMax - static_cast<intptr_t>(sizeof(RawStackmap))))) {
// This should be caught before we reach here.
FATAL1("Fatal error in Stackmap::New: invalid length %" PRIdPTR "\n",
length);
@@ -6800,7 +6799,6 @@ RawStackmap* Stackmap::New(intptr_t pc_offset,
for (intptr_t i = 0; i < length; ++i) {
result.SetBit(i, bmap->Get(i));
}
- ASSERT(bmap->Maximum() < length);
return result.raw();
}
« no previous file with comments | « runtime/vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698