Reviewers: Jakob,
Description:
Bump variable limit further to 2^17.
[email protected]
BUG=151625
Please review this at https://codereview.chromium.org/11099063/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/messages.js
M src/parser.h
M test/mjsunit/limit-locals.js
Index: src/messages.js
diff --git a/src/messages.js b/src/messages.js
index
1ead322ec1a9d9105435576f84667ab36837db94..fe894b578fdb0833151a1709ae348225deec50bb
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"],
Index: src/parser.h
diff --git a/src/parser.h b/src/parser.h
index
46d4ec86ef8ba7650e153aa719315a966d634faa..93fd1b8aa95f326141e548c1967054341113388b
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,
Index: test/mjsunit/limit-locals.js
diff --git a/test/mjsunit/limit-locals.js b/test/mjsunit/limit-locals.js
index
22f895c71492365bbdf69ef4d037bd05fc297bfc..21ede31ea8214975b6503e3495a08c3ba0400366
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)");
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev