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

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

Issue 683023002: Move AST node counting to post-pass (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
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 3255 matching lines...) Expand 10 before | Expand all | Expand 10 after
3266 printf("\n"); 3266 printf("\n");
3267 3267
3268 i::Handle<i::Script> script = factory->NewScript(source); 3268 i::Handle<i::Script> script = factory->NewScript(source);
3269 i::CompilationInfoWithZone info(script); 3269 i::CompilationInfoWithZone info(script);
3270 i::Parser::ParseInfo parse_info = { 3270 i::Parser::ParseInfo parse_info = {
3271 isolate->stack_guard()->real_climit(), 3271 isolate->stack_guard()->real_climit(),
3272 isolate->heap()->HashSeed(), isolate->unicode_cache()}; 3272 isolate->heap()->HashSeed(), isolate->unicode_cache()};
3273 i::Parser parser(&info, &parse_info); 3273 i::Parser parser(&info, &parse_info);
3274 parser.set_allow_harmony_scoping(true); 3274 parser.set_allow_harmony_scoping(true);
3275 CHECK(parser.Parse()); 3275 CHECK(parser.Parse());
3276 CHECK(i::Rewriter::Rewrite(&info)); 3276 CHECK(i::Compiler::Analyze(&info));
3277 CHECK(i::Scope::Analyze(&info));
3278 CHECK(i::AstNumbering::Renumber(info.function(), info.zone()));
3279 CHECK(info.function() != NULL); 3277 CHECK(info.function() != NULL);
3280 3278
3281 i::Scope* scope = info.function()->scope(); 3279 i::Scope* scope = info.function()->scope();
3282 CHECK_EQ(scope->inner_scopes()->length(), 1); 3280 CHECK_EQ(scope->inner_scopes()->length(), 1);
3283 i::Scope* inner_scope = scope->inner_scopes()->at(0); 3281 i::Scope* inner_scope = scope->inner_scopes()->at(0);
3284 const i::AstRawString* var_name = 3282 const i::AstRawString* var_name =
3285 info.ast_value_factory()->GetOneByteString("x"); 3283 info.ast_value_factory()->GetOneByteString("x");
3286 i::Variable* var = inner_scope->Lookup(var_name); 3284 i::Variable* var = inner_scope->Lookup(var_name);
3287 bool expected = outers[i].assigned || inners[j].assigned; 3285 bool expected = outers[i].assigned || inners[j].assigned;
3288 CHECK(var != NULL); 3286 CHECK(var != NULL);
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after
4251 "for(const x = 4, y of [1,2,3]) {}", 4249 "for(const x = 4, y of [1,2,3]) {}",
4252 "for(const x = 1, y = 2 in []) {}", 4250 "for(const x = 1, y = 2 in []) {}",
4253 "for(const x,y in []) {}", 4251 "for(const x,y in []) {}",
4254 "for(const x = 1, y = 2 of []) {}", 4252 "for(const x = 1, y = 2 of []) {}",
4255 "for(const x,y of []) {}", 4253 "for(const x,y of []) {}",
4256 NULL}; 4254 NULL};
4257 static const ParserFlag always_flags[] = {kAllowHarmonyScoping}; 4255 static const ParserFlag always_flags[] = {kAllowHarmonyScoping};
4258 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, 4256 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags,
4259 arraysize(always_flags)); 4257 arraysize(always_flags));
4260 } 4258 }
OLDNEW
« src/compiler/js-inlining.cc ('K') | « test/cctest/compiler/test-pipeline.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698