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

Side by Side Diff: test/cctest/test-parsing.cc

Issue 2373443003: Revert of Preparse inner functions (new try) (Closed)
Patch Set: Created 4 years, 2 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 | « src/parsing/preparser.cc ('k') | test/mjsunit/debug-function-scopes.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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 20 matching lines...) Expand all
31 31
32 #include <memory> 32 #include <memory>
33 33
34 #include "src/v8.h" 34 #include "src/v8.h"
35 35
36 #include "src/ast/ast-numbering.h" 36 #include "src/ast/ast-numbering.h"
37 #include "src/ast/ast-value-factory.h" 37 #include "src/ast/ast-value-factory.h"
38 #include "src/ast/ast.h" 38 #include "src/ast/ast.h"
39 #include "src/compiler.h" 39 #include "src/compiler.h"
40 #include "src/execution.h" 40 #include "src/execution.h"
41 #include "src/flags.h"
42 #include "src/isolate.h" 41 #include "src/isolate.h"
43 #include "src/objects.h" 42 #include "src/objects.h"
44 #include "src/parsing/parse-info.h" 43 #include "src/parsing/parse-info.h"
45 #include "src/parsing/parser.h" 44 #include "src/parsing/parser.h"
46 #include "src/parsing/preparser.h" 45 #include "src/parsing/preparser.h"
47 #include "src/parsing/rewriter.h" 46 #include "src/parsing/rewriter.h"
48 #include "src/parsing/scanner-character-streams.h" 47 #include "src/parsing/scanner-character-streams.h"
49 #include "src/parsing/token.h" 48 #include "src/parsing/token.h"
50 #include "src/utils.h" 49 #include "src/utils.h"
51 50
(...skipping 3358 matching lines...) Expand 10 before | Expand all | Expand 10 after
3410 i::Scope* scope = info.literal()->scope(); 3409 i::Scope* scope = info.literal()->scope();
3411 i::Scope* inner_scope = scope->inner_scope(); 3410 i::Scope* inner_scope = scope->inner_scope();
3412 DCHECK_NOT_NULL(inner_scope); 3411 DCHECK_NOT_NULL(inner_scope);
3413 DCHECK_NULL(inner_scope->sibling()); 3412 DCHECK_NULL(inner_scope->sibling());
3414 const i::AstRawString* var_name = 3413 const i::AstRawString* var_name =
3415 info.ast_value_factory()->GetOneByteString("x"); 3414 info.ast_value_factory()->GetOneByteString("x");
3416 i::Variable* var = inner_scope->Lookup(var_name); 3415 i::Variable* var = inner_scope->Lookup(var_name);
3417 bool expected = outers[i].assigned || inners[j].assigned; 3416 bool expected = outers[i].assigned || inners[j].assigned;
3418 CHECK(var != NULL); 3417 CHECK(var != NULL);
3419 CHECK(var->is_used() || !expected); 3418 CHECK(var->is_used() || !expected);
3420 bool is_maybe_assigned = var->maybe_assigned() == i::kMaybeAssigned; 3419 CHECK((var->maybe_assigned() == i::kMaybeAssigned) == expected);
3421 if (i::FLAG_lazy_inner_functions) {
3422 // If we parse inner functions lazily, allow being pessimistic about
3423 // maybe_assigned.
3424 CHECK(is_maybe_assigned || (is_maybe_assigned == expected));
3425 } else {
3426 CHECK(is_maybe_assigned == expected);
3427 }
3428 } 3420 }
3429 } 3421 }
3430 } 3422 }
3431 } 3423 }
3432 3424
3433 namespace { 3425 namespace {
3434 3426
3435 int* global_use_counts = NULL; 3427 int* global_use_counts = NULL;
3436 3428
3437 void MockUseCounterCallback(v8::Isolate* isolate, 3429 void MockUseCounterCallback(v8::Isolate* isolate,
(...skipping 4893 matching lines...) Expand 10 before | Expand all | Expand 10 after
8331 const char* data[] = { 8323 const char* data[] = {
8332 "const arguments = 1", 8324 "const arguments = 1",
8333 "let arguments", 8325 "let arguments",
8334 "var arguments", 8326 "var arguments",
8335 NULL 8327 NULL
8336 }; 8328 };
8337 // clang-format on 8329 // clang-format on
8338 RunParserSyncTest(context_data, data, kSuccess); 8330 RunParserSyncTest(context_data, data, kSuccess);
8339 } 8331 }
8340 } 8332 }
OLDNEW
« no previous file with comments | « src/parsing/preparser.cc ('k') | test/mjsunit/debug-function-scopes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698