| 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_RUNTIME | 8 #ifndef DART_PRECOMPILED_RUNTIME |
| 9 | 9 |
| 10 #include "lib/invocation_mirror.h" | 10 #include "lib/invocation_mirror.h" |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 isolate()->IncrLoadingInvalidationGen(); | 507 isolate()->IncrLoadingInvalidationGen(); |
| 508 } | 508 } |
| 509 }; | 509 }; |
| 510 | 510 |
| 511 | 511 |
| 512 void Parser::ParseCompilationUnit(const Library& library, | 512 void Parser::ParseCompilationUnit(const Library& library, |
| 513 const Script& script) { | 513 const Script& script) { |
| 514 Thread* thread = Thread::Current(); | 514 Thread* thread = Thread::Current(); |
| 515 ASSERT(thread->long_jump_base()->IsSafeToJump()); | 515 ASSERT(thread->long_jump_base()->IsSafeToJump()); |
| 516 CSTAT_TIMER_SCOPE(thread, parser_timer); | 516 CSTAT_TIMER_SCOPE(thread, parser_timer); |
| 517 #ifndef PRODUCT |
| 517 VMTagScope tagScope(thread, VMTag::kCompileTopLevelTagId); | 518 VMTagScope tagScope(thread, VMTag::kCompileTopLevelTagId); |
| 518 #ifndef PRODUCT | |
| 519 TimelineDurationScope tds(thread, | 519 TimelineDurationScope tds(thread, |
| 520 Timeline::GetCompilerStream(), | 520 Timeline::GetCompilerStream(), |
| 521 "CompileTopLevel"); | 521 "CompileTopLevel"); |
| 522 if (tds.enabled()) { | 522 if (tds.enabled()) { |
| 523 tds.SetNumArguments(1); | 523 tds.SetNumArguments(1); |
| 524 tds.CopyArgument(0, "script", String::Handle(script.url()).ToCString()); | 524 tds.CopyArgument(0, "script", String::Handle(script.url()).ToCString()); |
| 525 } | 525 } |
| 526 #endif | 526 #endif |
| 527 | 527 |
| 528 TopLevelParsingScope scope(thread); | 528 TopLevelParsingScope scope(thread); |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 982 return false; | 982 return false; |
| 983 } | 983 } |
| 984 | 984 |
| 985 | 985 |
| 986 void Parser::ParseFunction(ParsedFunction* parsed_function) { | 986 void Parser::ParseFunction(ParsedFunction* parsed_function) { |
| 987 Thread* thread = parsed_function->thread(); | 987 Thread* thread = parsed_function->thread(); |
| 988 ASSERT(thread == Thread::Current()); | 988 ASSERT(thread == Thread::Current()); |
| 989 Zone* zone = thread->zone(); | 989 Zone* zone = thread->zone(); |
| 990 CSTAT_TIMER_SCOPE(thread, parser_timer); | 990 CSTAT_TIMER_SCOPE(thread, parser_timer); |
| 991 INC_STAT(thread, num_functions_parsed, 1); | 991 INC_STAT(thread, num_functions_parsed, 1); |
| 992 #ifndef PRODUCT |
| 992 VMTagScope tagScope(thread, VMTag::kCompileParseFunctionTagId, | 993 VMTagScope tagScope(thread, VMTag::kCompileParseFunctionTagId, |
| 993 FLAG_profile_vm); | 994 FLAG_profile_vm); |
| 994 #ifndef PRODUCT | |
| 995 TimelineDurationScope tds(thread, | 995 TimelineDurationScope tds(thread, |
| 996 Timeline::GetCompilerStream(), | 996 Timeline::GetCompilerStream(), |
| 997 "ParseFunction"); | 997 "ParseFunction"); |
| 998 #endif // !PRODUCT | 998 #endif // !PRODUCT |
| 999 ASSERT(thread->long_jump_base()->IsSafeToJump()); | 999 ASSERT(thread->long_jump_base()->IsSafeToJump()); |
| 1000 ASSERT(parsed_function != NULL); | 1000 ASSERT(parsed_function != NULL); |
| 1001 const Function& func = parsed_function->function(); | 1001 const Function& func = parsed_function->function(); |
| 1002 const Script& script = Script::Handle(zone, func.script()); | 1002 const Script& script = Script::Handle(zone, func.script()); |
| 1003 Parser parser(script, parsed_function, func.token_pos()); | 1003 Parser parser(script, parsed_function, func.token_pos()); |
| 1004 #ifndef PRODUCT | 1004 #ifndef PRODUCT |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1227 current_block_->statements->Add(ret); | 1227 current_block_->statements->Add(ret); |
| 1228 return CloseBlock(); | 1228 return CloseBlock(); |
| 1229 } | 1229 } |
| 1230 | 1230 |
| 1231 | 1231 |
| 1232 ParsedFunction* Parser::ParseStaticFieldInitializer(const Field& field) { | 1232 ParsedFunction* Parser::ParseStaticFieldInitializer(const Field& field) { |
| 1233 ASSERT(field.is_static()); | 1233 ASSERT(field.is_static()); |
| 1234 Thread* thread = Thread::Current(); | 1234 Thread* thread = Thread::Current(); |
| 1235 // TODO(koda): Should there be a StackZone here? | 1235 // TODO(koda): Should there be a StackZone here? |
| 1236 Zone* zone = thread->zone(); | 1236 Zone* zone = thread->zone(); |
| 1237 #ifndef PRODUCT |
| 1238 VMTagScope tagScope(thread, VMTag::kCompileParseFunctionTagId, |
| 1239 FLAG_profile_vm); |
| 1240 TimelineDurationScope tds(thread, Timeline::GetCompilerStream(), |
| 1241 "ParseStaticFieldInitializer"); |
| 1242 #endif // !PRODUCT |
| 1237 | 1243 |
| 1238 const String& field_name = String::Handle(zone, field.name()); | 1244 const String& field_name = String::Handle(zone, field.name()); |
| 1239 String& init_name = String::Handle(zone, | 1245 String& init_name = String::Handle(zone, |
| 1240 Symbols::FromConcat(thread, Symbols::InitPrefix(), field_name)); | 1246 Symbols::FromConcat(thread, Symbols::InitPrefix(), field_name)); |
| 1241 | 1247 |
| 1242 const Script& script = Script::Handle(zone, field.Script()); | 1248 const Script& script = Script::Handle(zone, field.Script()); |
| 1243 Object& initializer_owner = Object::Handle(field.Owner()); | 1249 Object& initializer_owner = Object::Handle(field.Owner()); |
| 1244 initializer_owner = | 1250 initializer_owner = |
| 1245 PatchClass::New(Class::Handle(field.Owner()), script); | 1251 PatchClass::New(Class::Handle(field.Owner()), script); |
| 1246 | 1252 |
| (...skipping 13287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14534 const ArgumentListNode& function_args, | 14540 const ArgumentListNode& function_args, |
| 14535 const LocalVariable* temp_for_last_arg, | 14541 const LocalVariable* temp_for_last_arg, |
| 14536 bool is_super_invocation) { | 14542 bool is_super_invocation) { |
| 14537 UNREACHABLE(); | 14543 UNREACHABLE(); |
| 14538 return NULL; | 14544 return NULL; |
| 14539 } | 14545 } |
| 14540 | 14546 |
| 14541 } // namespace dart | 14547 } // namespace dart |
| 14542 | 14548 |
| 14543 #endif // DART_PRECOMPILED_RUNTIME | 14549 #endif // DART_PRECOMPILED_RUNTIME |
| OLD | NEW |