LoadIC_Miss builtin receives parameters on registers (see LoadWithVectorDescriptor) and tail
calls to Runtime::LoadIC_Miss.
This is how LoadIC_Miss builtin generated by CSA look like on x64 (same issues on ia32):
0 4883ec20 REX.W subq rsp,0x20
4 4c8b542420 REX.W movq r10,[rsp+0x20]
9 4c891424 REX.W movq [rsp],r10
13 4889542420 REX.W movq [rsp+0x20],rdx
18 48894c2418 REX.W movq [rsp+0x18],rcx
23 4889442410 REX.W movq [rsp+0x10],rax
28 48895c2408 REX.W movq [rsp+0x8],rbx
33 48bbb0dec00100000000 REX.W movq rbx,0x1c0deb0 ;; external reference (Runtime::LoadIC_Miss)
43 b804000000 movl rax,0x4
48 4c8bc3 REX.W movq r8,rbx
51 488bf8 REX.W movq rdi,rax
54 e9250cfdff jmp 0x1d9f49e062c0 ;; code: STUB, CEntryStub, minor: 4
59 0f0b ud2
61 0f1f00 nop
I see two issues:
1) The instructions 48-51 are unexpected here.
2) The sequence 0-28 could probably be generated in a nicer way. This is how hand-written code looks like:
0 5f pop rdi
1 52 push rdx
2 51 push rcx
3 50 push rax
4 53 push rbx
5 57 push rdi
6 b804000000 movl rax,0x4
11 48bb4071bf0100000000 REX.W movq rbx,0x1bf7140 ;; external reference (Runtime::LoadIC_Miss)
21 e96620fdff jmp 0x3a47f02075c0 ;; code: STUB, CEntryStub, minor: 4
To reproduce, add this code to any cctest.
TEST(Dump) {
Isolate* isolate(CcTest::InitIsolateOnce());
isolate->builtins()->LoadIC_Miss()->Print();
isolate->builtins()->LoadIC_Slow()->Print();
}
CCing Mircea as (1) could be a register allocator issue.