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

Unified Diff: runtime/vm/code_descriptors_test.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/code_descriptors.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_descriptors_test.cc
diff --git a/runtime/vm/code_descriptors_test.cc b/runtime/vm/code_descriptors_test.cc
index a0732bf30b4eb281c7cfaa42bed6b696108a7ffa..76e96ecc2811815d0063e2b9d2eabb4073fa024d 100644
--- a/runtime/vm/code_descriptors_test.cc
+++ b/runtime/vm/code_descriptors_test.cc
@@ -62,7 +62,12 @@ CODEGEN_TEST_GENERATE(StackmapCodegen, test) {
BitmapBuilder* stack_bitmap = new BitmapBuilder();
EXPECT(stack_bitmap != NULL);
+ EXPECT_EQ(0, stack_bitmap->Length());
stack_bitmap->Set(0, true);
+ EXPECT_EQ(1, stack_bitmap->Length());
+ stack_bitmap->SetLength(kStackSlotCount);
+ EXPECT_EQ(kStackSlotCount, stack_bitmap->Length());
+
bool expectation0[kStackSlotCount] = { true };
for (intptr_t i = 0; i < kStackSlotCount; ++i) {
EXPECT_EQ(expectation0[i], stack_bitmap->Get(i));
@@ -72,9 +77,14 @@ CODEGEN_TEST_GENERATE(StackmapCodegen, test) {
stack_bitmap = new BitmapBuilder();
EXPECT(stack_bitmap != NULL);
+ EXPECT_EQ(0, stack_bitmap->Length());
stack_bitmap->Set(0, true);
stack_bitmap->Set(1, false);
stack_bitmap->Set(2, true);
+ EXPECT_EQ(3, stack_bitmap->Length());
+ stack_bitmap->SetLength(kStackSlotCount);
+ EXPECT_EQ(kStackSlotCount, stack_bitmap->Length());
+
bool expectation1[kStackSlotCount] = { true, false, true };
for (intptr_t i = 0; i < kStackSlotCount; ++i) {
EXPECT_EQ(expectation1[i], stack_bitmap->Get(i));
@@ -84,10 +94,15 @@ CODEGEN_TEST_GENERATE(StackmapCodegen, test) {
stack_bitmap = new BitmapBuilder();
EXPECT(stack_bitmap != NULL);
+ EXPECT_EQ(0, stack_bitmap->Length());
stack_bitmap->Set(0, true);
stack_bitmap->Set(1, false);
stack_bitmap->Set(2, true);
stack_bitmap->SetRange(3, 5, true);
+ EXPECT_EQ(6, stack_bitmap->Length());
+ stack_bitmap->SetLength(kStackSlotCount);
+ EXPECT_EQ(kStackSlotCount, stack_bitmap->Length());
+
bool expectation2[kStackSlotCount] =
{ true, false, true, true, true, true };
for (intptr_t i = 0; i < kStackSlotCount; ++i) {
@@ -98,12 +113,17 @@ CODEGEN_TEST_GENERATE(StackmapCodegen, test) {
stack_bitmap = new BitmapBuilder();
EXPECT(stack_bitmap != NULL);
+ EXPECT_EQ(0, stack_bitmap->Length());
stack_bitmap->Set(0, true);
stack_bitmap->Set(1, false);
stack_bitmap->Set(2, true);
stack_bitmap->SetRange(3, 5, true);
stack_bitmap->SetRange(6, 9, false);
stack_bitmap->Set(10, true);
+ EXPECT_EQ(11, stack_bitmap->Length());
+ stack_bitmap->SetLength(kStackSlotCount);
+ EXPECT_EQ(kStackSlotCount, stack_bitmap->Length());
+
bool expectation3[kStackSlotCount] =
{ true, false, true, true, true, true, false, false,
false, false, true };
« no previous file with comments | « runtime/vm/code_descriptors.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698