Chromium Code Reviews| 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 5017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5028 Array& default_parameter_values = Array::Handle(); | 5028 Array& default_parameter_values = Array::Handle(); |
| 5029 SequenceNode* statements = Parser::ParseFunc(function, | 5029 SequenceNode* statements = Parser::ParseFunc(function, |
| 5030 default_parameter_values); | 5030 default_parameter_values); |
| 5031 ASSERT(is_new_closure || (function.end_token_pos() == TokenPos())); | 5031 ASSERT(is_new_closure || (function.end_token_pos() == TokenPos())); |
| 5032 function.set_end_token_pos(TokenPos()); | 5032 function.set_end_token_pos(TokenPos()); |
| 5033 | 5033 |
| 5034 // Now that the local function has formal parameters, lookup the signature | 5034 // Now that the local function has formal parameters, lookup the signature |
| 5035 // class in the current library (but not in its imports) and only create a new | 5035 // class in the current library (but not in its imports) and only create a new |
| 5036 // canonical signature class if it does not exist yet. | 5036 // canonical signature class if it does not exist yet. |
| 5037 const String& signature = String::Handle(function.Signature()); | 5037 const String& signature = String::Handle(function.Signature()); |
| 5038 Class& signature_class = Class::ZoneHandle( | 5038 Class& signature_class = Class::ZoneHandle(function.signature_class()); |
| 5039 library_.LookupLocalClass(signature)); | 5039 if (signature_class.IsNull()) { |
|
regis
2012/11/19 19:20:32
ASSERT(is_new_closure);
or you could set the signa
hausner
2012/11/19 21:35:04
Done.
| |
| 5040 | 5040 signature_class = library_.LookupLocalClass(signature); |
| 5041 } | |
| 5041 if (signature_class.IsNull()) { | 5042 if (signature_class.IsNull()) { |
| 5042 // If we don't have a signature class yet, this must be a closure we | 5043 // If we don't have a signature class yet, this must be a closure we |
| 5043 // have not parsed before. | 5044 // have not parsed before. |
| 5044 ASSERT(is_new_closure); | 5045 ASSERT(is_new_closure); |
| 5045 signature_class = Class::NewSignatureClass(signature, | 5046 signature_class = Class::NewSignatureClass(signature, |
| 5046 function, | 5047 function, |
| 5047 script_); | 5048 script_); |
| 5048 // Record the function signature class in the current library. | 5049 // Record the function signature class in the current library. |
| 5049 library_.AddClass(signature_class); | 5050 library_.AddClass(signature_class); |
| 5050 } else if (is_new_closure) { | 5051 } else if (is_new_closure) { |
| (...skipping 4980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10031 void Parser::SkipQualIdent() { | 10032 void Parser::SkipQualIdent() { |
| 10032 ASSERT(IsIdentifier()); | 10033 ASSERT(IsIdentifier()); |
| 10033 ConsumeToken(); | 10034 ConsumeToken(); |
| 10034 if (CurrentToken() == Token::kPERIOD) { | 10035 if (CurrentToken() == Token::kPERIOD) { |
| 10035 ConsumeToken(); // Consume the kPERIOD token. | 10036 ConsumeToken(); // Consume the kPERIOD token. |
| 10036 ExpectIdentifier("identifier expected after '.'"); | 10037 ExpectIdentifier("identifier expected after '.'"); |
| 10037 } | 10038 } |
| 10038 } | 10039 } |
| 10039 | 10040 |
| 10040 } // namespace dart | 10041 } // namespace dart |
| OLD | NEW |