Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any chance of recompiling to http://asmjs.org/ #3

Open
graingert opened this issue May 14, 2013 · 17 comments
Open

Any chance of recompiling to http://asmjs.org/ #3

graingert opened this issue May 14, 2013 · 17 comments

Comments

@graingert
Copy link

You might even get quite close to native speed then!

@jterrace
Copy link
Owner

Yes, some other people are working on trying to update js.js to the latest version of Emscripten and LLVM.

@graingert
Copy link
Author

Do you have a link to this?

@jterrace
Copy link
Owner

No, but I have notified the two people who are working on it with this issue. I will ask them to post here.

@steelejoe
Copy link

I am working on this now -- will post details when I get a bit closer.

@jterrace
Copy link
Owner

If you have any in-progress commits, feel free to push them to a branch. I can help you with any blockers.

@steelejoe
Copy link

Quick status update: I was able to spend a little time today. I updated build.py and conf.py to use the LLVM 3.2 and the current emscripten. Luckily I am only seeing two compile errors (lots of warnings though).

The errors are:
/home/steele/dev/latest/js.js/builder/build/mozilla-central/js/src/jsapi.cpp:355:18: error: no matching function for call to 'TryArgumentFormatter'
if (!TryArgumentFormatter(cx, &format, JS_TRUE, &sp,
^~~~~~~~~~~~~~~~~~~~
/home/steele/dev/latest/js.js/builder/build/mozilla-central/js/src/jsapi.cpp:225:1: note: candidate function not viable: no known conversion from 'int **' to 'va_list *' (aka '__builtin_va_list *') for 5th argument

In file included from /home/steele/dev/latest/js.js/builder/build/mozilla-central/js/src/jscompartment.cpp:53:
./assembler/jit/ExecutableAllocator.h:440:6: error: "The cacheFlush support is missing on this platform."
#error "The cacheFlush support is missing on this platform."
^

I am looking at the second error now, but I don't have much time tonight.

@jterrace
Copy link
Owner

The second error looks troubling because I thought we hacked the entire JIT assembler out of the code that gets compiled.

The first error is really confusing. Not sure where it's getting the int ** from, but maybe it's the wrong value for HAVE_VA_LIST_AS_ARRAY.

I can try and help you dig deeper when I get some time, let me know if you make any progress in the meantime.

@jterrace
Copy link
Owner

Do you have the updates in a branch somewhere I can check out?

@steelejoe
Copy link

I think I was able to get around both of these issues. I have the "fixes" in a local branch. I have not used github before to host my changes, I suppose I can put them up here? I will figure it out and put the info here.

@steelejoe
Copy link

Ok, I believe I successfully forked your repo and committed my changes here: https://github.com/steelejoe/js.js.git
I am a git newbie though so if you don't see any differences, I probably borked the commit. Please let me know and my apologies in advance. :)

I was able to get the compile to finish, I have not tested the output yet. The fix for the first error was pretty trivial the fix for the second seems hacky in the extreme. I realized after I committed that there are two changes that went into getting the compile to work and I am not sure which one did the trick (or if it was both). What is checked in is the hacky cast. What is not checked in is the setting of EMCC_LLVM_TARGET=i386-pc-linux-gnu which was suggested by the last question in the emscripten FAQ (https://github.com/kripken/emscripten/wiki/FAQ). I am trying again without the environment setting so I should know in a bit.

@steelejoe
Copy link

Looks like the hacky code is not needed. The EMCC_LLVM_TARGET setting does the trick although I am not sure of the performance implication for JS.

@jterrace
Copy link
Owner

I see your fork, but there are no new commits in there. Did you commit locally but forget to push?

@steelejoe
Copy link

You are right. I think it is in now.

@SunilAgrawal
Copy link

Hi, any update on this? Is the recompiled Js.js work any better, atleast on Firefox?

@jterrace
Copy link
Owner

Compiling now, but it takes a while.. I'll report back when I get a chance to try it out after it finishes.

@steelejoe
Copy link

I am trying now with the ASM JS feature turned on and -O2. Getting some more errors -- for example:
./jsdbgapi.h:296:1: error: 'JS_GetFrameReturnValue' has C-linkage specified, but returns user-defined type 'jsval' (aka 'JS::Value') which is incompatible with C [-Werror,-Wreturn-type-c-linkage]

Working my way through. BTW -- I realized my fork does not have the updated emscripten either. I need to check that in.

@steelejoe
Copy link

I updated my fork with the latest changes. I have ASM_JS building with -O0 but not with optimizations yet. I also did some script scrubbing to cleanup things that were bothering me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants