-
Notifications
You must be signed in to change notification settings - Fork 1.2k
xplat: build lib/Runtime/Library #779
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
Conversation
| } | ||
| #endif | ||
|
|
||
| // xplat-todo: This __try/__except catches AV and resumes from out of bound TypedArray access. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for now, the plan should be to disable this feature on linux. I think you should change JavascriptArrayBuffer's constructor to use malloc on linux always, and also assert that JavascriptArrayBuffer::AllocWrapper is never used on linux. Also, in TypedArray::NewInstance, compile assert virtualAllocated is false on linux.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for referring to the related virtualAlloc dependencies. From the code, IsValidVirtualBufferLength always returns false and JavascriptArrayBuffer::AllocWrapper already has Assert(false) on non _WIN64 platforms. This feature is already disabled. I'll change the comment and remove this xplat-todo.
|
Just one comment re TypedArray usage. Other than that, LGTM (modulo the arm build error 😄) |
| return __sync_sub_and_fetch(Addend, T(1)); | ||
| } | ||
|
|
||
| inline __int64 _abs64(__int64 n) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use stl llabs instead ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We haven't used any STL in chakracore for various reasons. Maybe in future we could reevaluate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't that (_abs64) already part of standard library? (MS flavored)
BTW; If I'm not mistaking, llabs, abs are already used in the project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My mistake, I thought you were talking about STL.
Yes, _abs64 is on MS system, but not on non _WIN32. I added it to non _WIN32 only.
You are right I could use llabs. I couldn't find existing usage of it in the project. Since long long doesn't guarantee to be same as __int64, a version for __int64 might be ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
abs from pal.h looks like a good candidate ? something like #define _abs64 abs
This change enables building `lib/Runtime/Library`. - Added a few unimplemented stubs into `CommonPal.h`. - Replaced a bunch of `__try/__finally(__leave)` with `TryFinally`. - `JavascriptBuiltInFunctions.cpp`: Added `BUILTIN_TEMPLATE` to work with all TypedArray types as they are template specializations and need `template<>`. - `TypedArray.cpp`: Needed to move `Is`/`FromVar` specializations forward before being used. 2 files excluded from build: - JavascriptErrorDebug.cpp: using interfaces - MathLibrary.cpp: using intrinsics conflicting with stdlib/math.h
Merge pull request #779 from jianchun:lib This change enables building `lib/Runtime/Library`. - Added a few unimplemented stubs into `CommonPal.h`. - Replaced a bunch of `__try/__finally(__leave)` with `TryFinally`. - `JavascriptBuiltInFunctions.cpp`: Added `BUILTIN_TEMPLATE` to work with all TypedArray types as they are template specializations and need `template<>`. - `TypedArray.cpp`: Needed to move `Is`/`FromVar` specializations forward before being used. 2 files excluded from build: - JavascriptErrorDebug.cpp: using interfaces - MathLibrary.cpp: using intrinsics conflicting with stdlib/math.h
This change enables building
lib/Runtime/Library.CommonPal.h.__try/__finally(__leave)withTryFinally.JavascriptBuiltInFunctions.cpp: AddedBUILTIN_TEMPLATEto work withall TypedArray types as they are template specializations and need
template<>.TypedArray.cpp: Needed to moveIs/FromVarspecializations forwardbefore being used.
TODO:
out of bound array access AV.
2 files excluded from build: