How to write tests for v8?

29 views
Skip to first unread message

Zhao Jiazhong

unread,
Jun 12, 2020, 6:05:04 AM6/12/20
to v8-dev
Hi!

I'm working on a CL: https://chromium-review.googlesource.com/c/v8/v8/+/2095645, which fixes a bug on mips platform, and now I need to add a test for the bug, but I'm not familiar with it. 

The bug is: on mips, TurboAssembler::Call may emit a trampoline after the jump instruction, which leading to a wrong record in SafepointTable.

I think I need a test to invoke the TurboAssembler::Call, and then invoke SafepointeTable::FindEntry, if the bug occurs, FindEntry would fail. But I have no idea how to implement it. Anyone have some tips or some related documents to learn?

Thanks in advance!

Georg Neis

unread,
Jun 16, 2020, 7:27:28 AM6/16/20
to v8-...@googlegroups.com
I can see two approaches of writing a test for the bug: 1) generate
code such that its safepoint table is faulty and then manually inspect
its safepoint table, or 2) generate code such that its safepoint table
is faulty and running it will trigger a GC or deopt at the problematic
pc, and run this code. (1) will probably require you to expose some
internals for testing. We can discuss details in the code review tool.

Best,
Georg
Reply all
Reply to author
Forward
0 new messages