Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions lib/Runtime/Library/amd64/JavascriptFunctionA.S
Original file line number Diff line number Diff line change
Expand Up @@ -108,38 +108,39 @@ NESTED_END amd64_CallFunction, _TEXT


.balign 16
.text
C_FUNC(_ZN2Js18JavascriptFunction20DeferredParsingThunkEPNS_16RecyclableObjectENS_8CallInfoEz):
push rbp
NESTED_ENTRY _ZN2Js18JavascriptFunction20DeferredParsingThunkEPNS_16RecyclableObjectENS_8CallInfoEz, _TEXT, NoHandler
push_nonvol_reg rbp
lea rbp, [rsp]

// save argument registers used by custom calling convention
push rdi
push rsi
push_register rdi
push_register rsi

// Call
// JavascriptMethod JavascriptFunction::DeferredParse(ScriptFunction**)
//
lea rdi, [rbp + 10h] // &function, setup by custom calling convention
call C_FUNC(_ZN2Js18JavascriptFunction13DeferredParseEPPNS_14ScriptFunctionE)

pop rsi
pop rdi
pop rbp
pop_register rsi
pop_register rdi
pop_nonvol_reg rbp

jmp rax
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jianchun this needs to be moved before NESTED_END. Same applies to the one below. After that, perhaps it should just work. I don't see anything else problematic here. Didn't check the codes but interesting clang/ld etc didn't bother linking this one on Ubuntu..

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@obastemur Thanks for looking! Do you mean moving jmp rax? (Was troubled by this one. Would look fine if it were a call and ret before NESTED_END. But it is a jmp.)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying that, seems working fine after moved on Ubuntu


NESTED_END _ZN2Js18JavascriptFunction20DeferredParsingThunkEPNS_16RecyclableObjectENS_8CallInfoEz, _TEXT


// Var JavascriptFunction::DeferredDeserializeThunk(
// RecyclableObject* function, CallInfo callInfo, ...)
.balign 16
C_FUNC(_ZN2Js18JavascriptFunction24DeferredDeserializeThunkEPNS_16RecyclableObjectENS_8CallInfoEz):
push rbp
NESTED_ENTRY _ZN2Js18JavascriptFunction24DeferredDeserializeThunkEPNS_16RecyclableObjectENS_8CallInfoEz, _TEXT, NoHandler
push_nonvol_reg rbp
lea rbp, [rsp]

// save argument registers used by custom calling convention
push rdi
push rsi
push_register rdi
push_register rsi

// Call
// Js::JavascriptMethod JavascriptFunction::DeferredDeserialize(
Expand All @@ -148,8 +149,10 @@ C_FUNC(_ZN2Js18JavascriptFunction24DeferredDeserializeThunkEPNS_16RecyclableObje
// RDI == function, setup by custom calling convention
call C_FUNC(_ZN2Js18JavascriptFunction19DeferredDeserializeEPNS_14ScriptFunctionE)

pop rsi
pop rdi
pop rbp
pop_register rsi
pop_register rdi
pop_nonvol_reg rbp

jmp rax

NESTED_END _ZN2Js18JavascriptFunction24DeferredDeserializeThunkEPNS_16RecyclableObjectENS_8CallInfoEz, _TEXT