Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: src/parser.cc

Issue 1350913005: Don't crash when preparsing destructured arguments (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Always add counts Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/harmony/regress/regress-4400.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/parser.h" 5 #include "src/parser.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/ast-literal-reindexer.h" 9 #include "src/ast-literal-reindexer.h"
10 #include "src/bailout-reason.h" 10 #include "src/bailout-reason.h"
(...skipping 4178 matching lines...) Expand 10 before | Expand all | Expand 10 after
4189 // parsing if it suspect that wasn't a good idea. If so, or if we didn't 4189 // parsing if it suspect that wasn't a good idea. If so, or if we didn't
4190 // try to lazy parse in the first place, we'll have to parse eagerly. 4190 // try to lazy parse in the first place, we'll have to parse eagerly.
4191 Scanner::BookmarkScope bookmark(scanner()); 4191 Scanner::BookmarkScope bookmark(scanner());
4192 if (is_lazily_parsed) { 4192 if (is_lazily_parsed) {
4193 Scanner::BookmarkScope* maybe_bookmark = 4193 Scanner::BookmarkScope* maybe_bookmark =
4194 bookmark.Set() ? &bookmark : nullptr; 4194 bookmark.Set() ? &bookmark : nullptr;
4195 SkipLazyFunctionBody(&materialized_literal_count, 4195 SkipLazyFunctionBody(&materialized_literal_count,
4196 &expected_property_count, /*CHECK_OK*/ ok, 4196 &expected_property_count, /*CHECK_OK*/ ok,
4197 maybe_bookmark); 4197 maybe_bookmark);
4198 4198
4199 if (formals.materialized_literals_count > 0) { 4199 materialized_literal_count += formals.materialized_literals_count +
4200 materialized_literal_count += formals.materialized_literals_count; 4200 function_state.materialized_literal_count();
4201 }
4202 4201
4203 if (bookmark.HasBeenReset()) { 4202 if (bookmark.HasBeenReset()) {
4204 // Trigger eager (re-)parsing, just below this block. 4203 // Trigger eager (re-)parsing, just below this block.
4205 is_lazily_parsed = false; 4204 is_lazily_parsed = false;
4206 4205
4207 // This is probably an initialization function. Inform the compiler it 4206 // This is probably an initialization function. Inform the compiler it
4208 // should also eager-compile this function, and that we expect it to be 4207 // should also eager-compile this function, and that we expect it to be
4209 // used once. 4208 // used once.
4210 eager_compile_hint = FunctionLiteral::kShouldEagerCompile; 4209 eager_compile_hint = FunctionLiteral::kShouldEagerCompile;
4211 should_be_used_once_hint = true; 4210 should_be_used_once_hint = true;
(...skipping 2032 matching lines...) Expand 10 before | Expand all | Expand 10 after
6244 6243
6245 Expression* Parser::SpreadCallNew(Expression* function, 6244 Expression* Parser::SpreadCallNew(Expression* function,
6246 ZoneList<v8::internal::Expression*>* args, 6245 ZoneList<v8::internal::Expression*>* args,
6247 int pos) { 6246 int pos) {
6248 args->InsertAt(0, function, zone()); 6247 args->InsertAt(0, function, zone());
6249 6248
6250 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, pos); 6249 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, pos);
6251 } 6250 }
6252 } // namespace internal 6251 } // namespace internal
6253 } // namespace v8 6252 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/harmony/regress/regress-4400.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698