OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/parser.h" | 5 #include "vm/parser.h" |
6 #include "vm/flags.h" | 6 #include "vm/flags.h" |
7 | 7 |
8 #ifndef DART_PRECOMPILED | 8 #ifndef DART_PRECOMPILED |
9 | 9 |
10 #include "lib/invocation_mirror.h" | 10 #include "lib/invocation_mirror.h" |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 token_kind_ = Token::kILLEGAL; | 446 token_kind_ = Token::kILLEGAL; |
447 } | 447 } |
448 | 448 |
449 | 449 |
450 void Parser::ParseCompilationUnit(const Library& library, | 450 void Parser::ParseCompilationUnit(const Library& library, |
451 const Script& script) { | 451 const Script& script) { |
452 Thread* thread = Thread::Current(); | 452 Thread* thread = Thread::Current(); |
453 ASSERT(thread->long_jump_base()->IsSafeToJump()); | 453 ASSERT(thread->long_jump_base()->IsSafeToJump()); |
454 CSTAT_TIMER_SCOPE(thread, parser_timer); | 454 CSTAT_TIMER_SCOPE(thread, parser_timer); |
455 VMTagScope tagScope(thread, VMTag::kCompileTopLevelTagId); | 455 VMTagScope tagScope(thread, VMTag::kCompileTopLevelTagId); |
| 456 TimelineDurationScope tds(thread, |
| 457 thread->isolate()->GetCompilerStream(), |
| 458 "CompileTopLevel"); |
| 459 if (tds.enabled()) { |
| 460 tds.SetNumArguments(1); |
| 461 tds.CopyArgument( |
| 462 0, |
| 463 "script", |
| 464 const_cast<char*>(String::Handle(script.url()).ToCString())); |
| 465 } |
| 466 |
456 Parser parser(script, library, 0); | 467 Parser parser(script, library, 0); |
457 parser.ParseTopLevel(); | 468 parser.ParseTopLevel(); |
458 } | 469 } |
459 | 470 |
460 | 471 |
461 void Parser::ComputeCurrentToken() { | 472 void Parser::ComputeCurrentToken() { |
462 ASSERT(token_kind_ == Token::kILLEGAL); | 473 ASSERT(token_kind_ == Token::kILLEGAL); |
463 token_kind_ = tokens_iterator_.CurrentTokenKind(); | 474 token_kind_ = tokens_iterator_.CurrentTokenKind(); |
464 if (token_kind_ == Token::kERROR) { | 475 if (token_kind_ == Token::kERROR) { |
465 ReportError(TokenPos(), "%s", CurrentLiteral()->ToCString()); | 476 ReportError(TokenPos(), "%s", CurrentLiteral()->ToCString()); |
(...skipping 13984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14450 const ArgumentListNode& function_args, | 14461 const ArgumentListNode& function_args, |
14451 const LocalVariable* temp_for_last_arg, | 14462 const LocalVariable* temp_for_last_arg, |
14452 bool is_super_invocation) { | 14463 bool is_super_invocation) { |
14453 UNREACHABLE(); | 14464 UNREACHABLE(); |
14454 return NULL; | 14465 return NULL; |
14455 } | 14466 } |
14456 | 14467 |
14457 } // namespace dart | 14468 } // namespace dart |
14458 | 14469 |
14459 #endif // DART_PRECOMPILED | 14470 #endif // DART_PRECOMPILED |
OLD | NEW |