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

Unified Diff: runtime/vm/compiler_test.cc

Issue 1174173007: Expand the class id to 32 bits and size field to 16 bits on 64-bit platforms. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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/assembler_x64.cc ('k') | runtime/vm/disassembler_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/compiler_test.cc
diff --git a/runtime/vm/compiler_test.cc b/runtime/vm/compiler_test.cc
index 7b6ada791c72afb1ea9234913424168a6b481619..18a47acee897ada81b89d48c690ee72b2152719f 100644
--- a/runtime/vm/compiler_test.cc
+++ b/runtime/vm/compiler_test.cc
@@ -162,16 +162,26 @@ TEST_CASE(EvalExpressionExhaustCIDs) {
const String& expression = String::Handle(String::New("3 + 4"));
Object& val = Object::Handle();
- const intptr_t classTableSize = 1 << RawObject::kClassIdTagSize;
- for (intptr_t i = 0; i < classTableSize; i++) {
- StackZone zone(Isolate::Current());
- val = lib.Evaluate(expression, Array::empty_array(), Array::empty_array());
- }
+ // Run once to ensure everything we touch is compiled.
+ val = lib.Evaluate(expression, Array::empty_array(), Array::empty_array());
+ EXPECT(!val.IsNull());
+ EXPECT(!val.IsError());
+ EXPECT(val.IsInteger());
+ EXPECT_EQ(7, Integer::Cast(val).AsInt64Value());
+
+ intptr_t initial_class_table_size =
+ Isolate::Current()->class_table()->NumCids();
+ val = lib.Evaluate(expression, Array::empty_array(), Array::empty_array());
EXPECT(!val.IsNull());
EXPECT(!val.IsError());
EXPECT(val.IsInteger());
EXPECT_EQ(7, Integer::Cast(val).AsInt64Value());
+
+ intptr_t final_class_table_size =
+ Isolate::Current()->class_table()->NumCids();
+ // Eval should not eat into this non-renewable resource.
+ EXPECT_EQ(initial_class_table_size, final_class_table_size);
}
} // namespace dart
« no previous file with comments | « runtime/vm/assembler_x64.cc ('k') | runtime/vm/disassembler_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698