Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upModified jsglue so that it does not suffer from abi incompatibilities #9
Conversation
|
Could you explain further why the existing conversion is incompatible? I'm having trouble understanding whether this is just a symptom of the way we currently hardcode jsval representation to work for x86-64 or a more general problem that we don't hit with Gecko on ARM. |
|
AFAIK, different function signature between caller and calle can be dangerous.
According to the existing conversion, Rust side expects jsval to be returned as u64(the first option on the above), while C returns it as 64-bit composite type(second one). In this case, the stack frame between two side are different(so callee side will not get argument correctly), and C side saves return value into stack but Rust side will check r0 and r1 register. Passing argument as u64 and receiving it as jsval looks fine at least on ARM Architecture. but it can be harmful on other platforms so I also added uint64_to_jsval conversion too. |
Modified jsglue so that it does not suffer from abi incompatibilities
Update CompositionOp C bindings to fix tests
Make the GC inhibition APIs use a counter rather than a boolean.
ILyoan commentedMar 22, 2013
Convert from jsval to uint64_t and vice versa.
Rust expected uint64_t while C side code uses jsval(64bit union type) but this kind of conversion is incompatible on some platform ABIs (like ARM EABI). So I added converting code that performs the converting safely.