| 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 | 6 |
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/compiler_stats.h" | 10 #include "vm/compiler_stats.h" |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 } | 555 } |
| 556 | 556 |
| 557 | 557 |
| 558 void Parser::ParseFunction(ParsedFunction* parsed_function) { | 558 void Parser::ParseFunction(ParsedFunction* parsed_function) { |
| 559 Isolate* isolate = Isolate::Current(); | 559 Isolate* isolate = Isolate::Current(); |
| 560 // Compilation can be nested, preserve the ast node id. | 560 // Compilation can be nested, preserve the ast node id. |
| 561 const int prev_ast_node_id = isolate->ast_node_id(); | 561 const int prev_ast_node_id = isolate->ast_node_id(); |
| 562 isolate->set_ast_node_id(0); | 562 isolate->set_ast_node_id(0); |
| 563 ASSERT(parsed_function != NULL); | 563 ASSERT(parsed_function != NULL); |
| 564 const Function& func = parsed_function->function(); | 564 const Function& func = parsed_function->function(); |
| 565 const Class& cls = Class::Handle(func.owner()); | 565 const Class& cls = Class::Handle(isolate, func.owner()); |
| 566 const Script& script = Script::Handle(cls.script()); | 566 const Script& script = Script::Handle(isolate, cls.script()); |
| 567 Parser parser(script, func, func.token_index()); | 567 Parser parser(script, func, func.token_index()); |
| 568 if (FLAG_compiler_stats) { | 568 if (FLAG_compiler_stats) { |
| 569 CompilerStats::parser_timer.Start(); | 569 CompilerStats::parser_timer.Start(); |
| 570 } | 570 } |
| 571 SequenceNode* node_sequence = NULL; | 571 SequenceNode* node_sequence = NULL; |
| 572 Array& default_parameter_values = Array::Handle(); | 572 Array& default_parameter_values = Array::Handle(isolate, Array::null()); |
| 573 switch (func.kind()) { | 573 switch (func.kind()) { |
| 574 case RawFunction::kFunction: | 574 case RawFunction::kFunction: |
| 575 case RawFunction::kClosureFunction: | 575 case RawFunction::kClosureFunction: |
| 576 case RawFunction::kGetterFunction: | 576 case RawFunction::kGetterFunction: |
| 577 case RawFunction::kSetterFunction: | 577 case RawFunction::kSetterFunction: |
| 578 case RawFunction::kConstructor: | 578 case RawFunction::kConstructor: |
| 579 node_sequence = parser.ParseFunc(func, default_parameter_values); | 579 node_sequence = parser.ParseFunc(func, default_parameter_values); |
| 580 break; | 580 break; |
| 581 case RawFunction::kImplicitGetter: | 581 case RawFunction::kImplicitGetter: |
| 582 ASSERT(!func.is_static()); | 582 ASSERT(!func.is_static()); |
| (...skipping 7160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7743 } | 7743 } |
| 7744 | 7744 |
| 7745 | 7745 |
| 7746 void Parser::SkipNestedExpr() { | 7746 void Parser::SkipNestedExpr() { |
| 7747 const bool saved_mode = SetAllowFunctionLiterals(true); | 7747 const bool saved_mode = SetAllowFunctionLiterals(true); |
| 7748 SkipExpr(); | 7748 SkipExpr(); |
| 7749 SetAllowFunctionLiterals(saved_mode); | 7749 SetAllowFunctionLiterals(saved_mode); |
| 7750 } | 7750 } |
| 7751 | 7751 |
| 7752 } // namespace dart | 7752 } // namespace dart |
| OLD | NEW |