From 00132da7347e41570cb40d3e7ab2e51b18f711d7 Mon Sep 17 00:00:00 2001 From: "rossberg@chromium.org" Date: Thu, 11 Oct 2012 11:40:10 +0000 Subject: [PATCH] Bump variable limit further to 2^17. R=jkummerow@chromium.org BUG=151625 Review URL: https://codereview.chromium.org/11099063 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12698 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/messages.js | 2 +- src/parser.h | 2 +- test/mjsunit/limit-locals.js | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/messages.js b/src/messages.js index 1ead322..fe894b5 100644 --- a/src/messages.js +++ b/src/messages.js @@ -229,7 +229,7 @@ function FormatMessage(message) { "strict_catch_variable", ["Catch variable may not be eval or arguments in strict mode"], "too_many_arguments", ["Too many arguments in function call (only 32766 allowed)"], "too_many_parameters", ["Too many parameters in function definition (only 32766 allowed)"], - "too_many_variables", ["Too many variables declared (only 65535 allowed)"], + "too_many_variables", ["Too many variables declared (only 131071 allowed)"], "strict_param_name", ["Parameter name eval or arguments is not allowed in strict mode"], "strict_param_dupe", ["Strict mode function may not have duplicate parameter names"], "strict_var_name", ["Variable name may not be eval or arguments in strict mode"], diff --git a/src/parser.h b/src/parser.h index 46d4ec8..93fd1b8 100644 --- a/src/parser.h +++ b/src/parser.h @@ -454,7 +454,7 @@ class Parser { // construct a hashable id, so if more than 2^17 are allowed, this // should be checked. static const int kMaxNumFunctionParameters = 32766; - static const int kMaxNumFunctionLocals = 65535; + static const int kMaxNumFunctionLocals = 131071; // 2^17-1 enum Mode { PARSE_LAZILY, diff --git a/test/mjsunit/limit-locals.js b/test/mjsunit/limit-locals.js index 22f895c..21ede31 100644 --- a/test/mjsunit/limit-locals.js +++ b/test/mjsunit/limit-locals.js @@ -25,7 +25,9 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Test that there is a limit of 65535 locals. +// Test that there is a limit of 131071 locals. + +// Flags: --stack-size=721 function function_with_n_locals(n) { test_prefix = "prefix "; @@ -40,8 +42,6 @@ function function_with_n_locals(n) { assertEquals("prefix 0 suffix", function_with_n_locals(0)); assertEquals("prefix 16000 suffix", function_with_n_locals(16000)); -assertEquals("prefix 32767 suffix", function_with_n_locals(32767)); -assertEquals("prefix 65535 suffix", function_with_n_locals(65535)); +assertEquals("prefix 131071 suffix", function_with_n_locals(131071)); -assertThrows("function_with_n_locals(65536)"); -assertThrows("function_with_n_locals(100000)"); +assertThrows("function_with_n_locals(131072)"); -- 2.7.4