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

Unified Diff: vm/object.h

Issue 9701010: First step towards implementing stack map descriptions for the optimizing compiler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 9 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
Index: vm/object.h
===================================================================
--- vm/object.h (revision 5450)
+++ vm/object.h (working copy)
@@ -152,6 +152,7 @@
kCodeClass,
kInstructionsClass,
kPcDescriptorsClass,
+ kBitmapClass,
kLocalVarDescriptorsClass,
kExceptionHandlersClass,
kContextClass,
@@ -288,6 +289,7 @@
static RawClass* code_class() { return code_class_; }
static RawClass* instructions_class() { return instructions_class_; }
static RawClass* pc_descriptors_class() { return pc_descriptors_class_; }
+ static RawClass* bitmap_class() { return bitmap_class_; }
static RawClass* var_descriptors_class() { return var_descriptors_class_; }
static RawClass* exception_handlers_class() {
return exception_handlers_class_;
@@ -395,6 +397,7 @@
static RawClass* code_class_; // Class of the Code vm object.
static RawClass* instructions_class_; // Class of the Instructions vm object.
static RawClass* pc_descriptors_class_; // Class of PcDescriptors vm object.
+ static RawClass* bitmap_class_; // Class of BitMap vm object.
static RawClass* var_descriptors_class_; // Class of LocalVarDescriptors.
static RawClass* exception_handlers_class_; // Class of ExceptionHandlers.
static RawClass* context_class_; // Class of the Context vm object.
@@ -1984,6 +1987,46 @@
};
+class Bitmap : public Object {
+ public:
+ static const int32_t kNoMaximum = -1;
+ static const int32_t kNoMinimum = -1;
+
+ bool Get(int32_t bit_offset) const {
+ return InRange(bit_offset) && GetBit(bit_offset);
+ }
+
+ // Return the bit offset of the highest bit set.
+ int32_t Maximum() const;
srdjan 2012/03/14 17:31:32 intptr_t, here and elsewhere
siva 2012/03/14 22:54:20 Done.
+
+ // Return the bit offset of the lowest bit set.
+ int32_t Minimum() const;
+
+ static intptr_t InstanceSize() {
+ ASSERT(sizeof(RawBitmap) == OFFSET_OF(RawBitmap, data_));
+ return 0;
+ }
+ static intptr_t InstanceSize(intptr_t size) {
+ return RoundedAllocationSize(sizeof(RawBitmap) + (size * kWordSize));
+ }
+ static RawBitmap* New(intptr_t size);
+
+ private:
+ inline int32_t Size() const;
srdjan 2012/03/14 17:31:32 SizeInBits?
siva 2012/03/14 22:54:20 Done.
+
+ bool InRange(int32_t offset) const { return offset < Size(); }
+
+ bool GetBit(int32_t bit_offset) const;
+ void SetBit(int32_t bit_offset, bool value) const;
+
+ void set_size(int32_t value) const;
srdjan 2012/03/14 17:31:32 SetSizeInBits?
siva 2012/03/14 22:54:20 This size is not in bits it is just the size of th
+
+ HEAP_OBJECT_IMPLEMENTATION(Bitmap, Object);
+ friend class Class;
+ friend class BitmapBuilder;
+};
+
+
class ExceptionHandlers : public Object {
public:
intptr_t Length() const;
@@ -3834,6 +3877,11 @@
StorePointer(InstanceAddr(index), value.raw());
}
+
+int32_t Bitmap::Size() const {
+ return (Smi::Value(raw_ptr()->size_) * kBitsPerByte);
+}
+
} // namespace dart
#endif // VM_OBJECT_H_

Powered by Google App Engine
This is Rietveld 408576698