Ignore:
Timestamp:
Jul 2, 2010, 9:52:45 PM (15 years ago)
Author:
[email protected]
Message:

Clamp the number of arguments supported by function.apply
https://bugs.webkit.org/show_bug.cgi?id=41351
<rdar://problem/8142141>

Reviewed by Gavin Barraclough.

JavaScriptCore:

Add clamping logic to function.apply similar to that
enforced by firefox. We have a smaller clamp than
firefox as our calling convention means that stack
usage is proportional to argument count -- the firefox
limit is larger than you could actually call.

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::privateExecute):

  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):

  • runtime/Arguments.h:

(JSC::Arguments::):

LayoutTests:

Testcases.

  • fast/js/function-apply-many-args-expected.txt: Added.
  • fast/js/function-apply-many-args.html: Added.
  • fast/js/script-tests/function-apply-many-args.js: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/Arguments.h

    r60392 r62432  
    5656    class Arguments : public JSObject {
    5757    public:
     58        // Use an enum because otherwise gcc insists on doing a memory
     59        // read.
     60        enum { MaxArguments = 0x10000 };
     61
    5862        enum NoParametersType { NoParameters };
    5963
Note: See TracChangeset for help on using the changeset viewer.