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

Side by Side Diff: runtime/vm/parser.cc

Issue 12314132: Fix bad optimization prematurely marking types as instantiated (issue 8710). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 months 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
« no previous file with comments | « runtime/vm/object.cc ('k') | tests/language/generics3_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "lib/invocation_mirror.h" 7 #include "lib/invocation_mirror.h"
8 #include "vm/bigint_operations.h" 8 #include "vm/bigint_operations.h"
9 #include "vm/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 5087 matching lines...) Expand 10 before | Expand all | Expand 10 after
5098 if (variable_name != NULL) { 5098 if (variable_name != NULL) {
5099 // Since the function type depends on the signature of the closure function, 5099 // Since the function type depends on the signature of the closure function,
5100 // it cannot be determined before the formal parameter list of the closure 5100 // it cannot be determined before the formal parameter list of the closure
5101 // function is parsed. Therefore, we set the function type to a new 5101 // function is parsed. Therefore, we set the function type to a new
5102 // parameterized type to be patched after the actual type is known. 5102 // parameterized type to be patched after the actual type is known.
5103 // We temporarily use the class of the Function interface. 5103 // We temporarily use the class of the Function interface.
5104 const Class& unknown_signature_class = Class::Handle( 5104 const Class& unknown_signature_class = Class::Handle(
5105 Type::Handle(Type::Function()).type_class()); 5105 Type::Handle(Type::Function()).type_class());
5106 function_type = Type::New( 5106 function_type = Type::New(
5107 unknown_signature_class, TypeArguments::Handle(), ident_pos); 5107 unknown_signature_class, TypeArguments::Handle(), ident_pos);
5108 function_type.set_is_finalized_instantiated(); // No finalization needed. 5108 function_type.SetIsFinalized(); // No finalization needed.
5109 5109
5110 // Add the function variable to the scope before parsing the function in 5110 // Add the function variable to the scope before parsing the function in
5111 // order to allow self reference from inside the function. 5111 // order to allow self reference from inside the function.
5112 function_variable = new LocalVariable(ident_pos, 5112 function_variable = new LocalVariable(ident_pos,
5113 *variable_name, 5113 *variable_name,
5114 function_type); 5114 function_type);
5115 function_variable->set_is_final(); 5115 function_variable->set_is_final();
5116 ASSERT(current_block_ != NULL); 5116 ASSERT(current_block_ != NULL);
5117 ASSERT(current_block_->scope != NULL); 5117 ASSERT(current_block_->scope != NULL);
5118 if (!current_block_->scope->AddVariable(function_variable)) { 5118 if (!current_block_->scope->AddVariable(function_variable)) {
(...skipping 4946 matching lines...) Expand 10 before | Expand all | Expand 10 after
10065 void Parser::SkipQualIdent() { 10065 void Parser::SkipQualIdent() {
10066 ASSERT(IsIdentifier()); 10066 ASSERT(IsIdentifier());
10067 ConsumeToken(); 10067 ConsumeToken();
10068 if (CurrentToken() == Token::kPERIOD) { 10068 if (CurrentToken() == Token::kPERIOD) {
10069 ConsumeToken(); // Consume the kPERIOD token. 10069 ConsumeToken(); // Consume the kPERIOD token.
10070 ExpectIdentifier("identifier expected after '.'"); 10070 ExpectIdentifier("identifier expected after '.'");
10071 } 10071 }
10072 } 10072 }
10073 10073
10074 } // namespace dart 10074 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | tests/language/generics3_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698