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

Unified Diff: test/cctest/test-assembler-a64.cc

Issue 188253005: A64: Record the size of veneer pools for code offset mapping. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added pool size test and register size only with debugger support Created 6 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
« no previous file with comments | « src/debug.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-assembler-a64.cc
diff --git a/test/cctest/test-assembler-a64.cc b/test/cctest/test-assembler-a64.cc
index 7e0ad3792d900aa8402f73aa92c6c64163a27b23..79a80ff03f7db422e2b6afc6bb40c48d4dd389ad 100644
--- a/test/cctest/test-assembler-a64.cc
+++ b/test/cctest/test-assembler-a64.cc
@@ -10023,3 +10023,58 @@ TEST(abs) {
AbsHelperW(kWMinInt);
AbsHelperW(kWMaxInt);
}
+
+
+TEST(pool_size) {
+ INIT_V8();
+ SETUP();
+
+ // This test does not execute any code. It only tests that the size of the
+ // pools is read correctly from the RelocInfo.
+
+ Label exit;
+ __ b(&exit);
+
+ const unsigned constant_pool_size = 312;
+ const unsigned veneer_pool_size = 184;
+
+ __ RecordConstPool(constant_pool_size);
+ for (unsigned i = 0; i < constant_pool_size / 4; ++i) {
+ __ dc32(0);
+ }
+
+ __ RecordVeneerPool(masm.pc_offset(), veneer_pool_size);
+ for (unsigned i = 0; i < veneer_pool_size / kInstructionSize; ++i) {
+ __ nop();
+ }
+
+ __ bind(&exit);
+
+ Heap* heap = isolate->heap();
+ CodeDesc desc;
+ Object* code_object = NULL;
+ Code* code;
+ masm.GetCode(&desc);
+ MaybeObject* maybe_code = heap->CreateCode(desc, 0, masm.CodeObject());
+ maybe_code->ToObject(&code_object);
+ code = Code::cast(code_object);
+
+ unsigned pool_count = 0;
+ int pool_mask = RelocInfo::ModeMask(RelocInfo::CONST_POOL) |
+ RelocInfo::ModeMask(RelocInfo::VENEER_POOL);
+ for (RelocIterator it(code, pool_mask); !it.done(); it.next()) {
+ RelocInfo* info = it.rinfo();
+ if (RelocInfo::IsConstPool(info->rmode())) {
+ ASSERT(info->data() == constant_pool_size);
+ ++pool_count;
+ }
+ if (RelocInfo::IsVeneerPool(info->rmode())) {
+ ASSERT(info->data() == veneer_pool_size);
+ ++pool_count;
+ }
+ }
+
+ ASSERT(pool_count == 2);
+
+ TEARDOWN();
+}
« no previous file with comments | « src/debug.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698