Closed Bug 559706 Opened 14 years ago Closed 14 years ago

Use of <algorithm> in jsworkers.cpp breaks android build

Categories

(Core :: JavaScript Engine, defect)

All
Android
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: mwu, Assigned: vlad)

References

Details

(Keywords: regression)

Attachments

(2 files)

Bionic doesn't provide algorithm.
We'll need a workaround here for merging, even before we get stlport or something similar in the tree.
Oh right, this is just in shell workers... we can probably just disable shell workers on Android temporarily.
We can disable this for android temporarily, until we get a version of STL in-tree.
Assignee: general → vladimir
Attachment #445469 - Flags: review?(jorendorff)
Comment on attachment 445469 [details] [diff] [review]
disable shell workers for android for now

Well ... all right, but I think I'd rather see jsworkers.cpp grow a portable implementation of reverse() and stop including <algorithm>. It might go like this:

template <class T>
void swap(T &a, T &b)
{
    T tmp = a;
    a = b;
    b = tmp;
}

template <class It>
void reverse(It begin, It end)
{
    while (begin != end) {
        swap(*begin, *end);
        if (++begin == end)
            break;
        --end;
    }
}
Attachment #445469 - Flags: review?(jorendorff) → review+
mrbkap points out that this reverse() implementation has an off-by-one error: it needs to decrement end before the first swap.
Attached patch betterSplinter Review
Ok, this implements a local reverse() impl.  Tested this by running jstests.py with -j 20 -- is that sufficient?  Wasn't sure how to exercise the implementation.
Attachment #448140 - Flags: review?(jorendorff)
Hm, or maybe that's not enough, because -j doesn't seem to be jsworkers but separate instances of js.exe (the --help docs say "WORKER_COUNT"!).  How can I test this?
Comment on attachment 448140 [details] [diff] [review]
better

Thanks.
Attachment #448140 - Flags: review?(jorendorff) → review+
wontfixing this -- we'll have workarounds for STL in android (initially an alternate ndk, eventually an in-tree STL).
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: