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

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

Issue 313403004: Fix deferred library code disabling for inlined functions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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
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 "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/bootstrap.h" 9 #include "vm/bootstrap.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 void ParsedFunction::SetNodeSequence(SequenceNode* node_sequence) { 129 void ParsedFunction::SetNodeSequence(SequenceNode* node_sequence) {
130 ASSERT(node_sequence_ == NULL); 130 ASSERT(node_sequence_ == NULL);
131 ASSERT(node_sequence != NULL); 131 ASSERT(node_sequence != NULL);
132 node_sequence_ = node_sequence; 132 node_sequence_ = node_sequence;
133 } 133 }
134 134
135 135
136 void ParsedFunction::AddDeferredPrefix(const LibraryPrefix& prefix) { 136 void ParsedFunction::AddDeferredPrefix(const LibraryPrefix& prefix) {
137 ASSERT(prefix.is_deferred_load()); 137 ASSERT(prefix.is_deferred_load());
138 ASSERT(!prefix.is_loaded()); 138 ASSERT(!prefix.is_loaded());
139 if (deferred_prefixes_ == NULL) { 139 for (intptr_t i = 0; i < deferred_prefixes_->length(); i++) {
140 deferred_prefixes_ = 140 if ((*deferred_prefixes_)[i]->raw() == prefix.raw()) {
141 &GrowableObjectArray::ZoneHandle(GrowableObjectArray::New());
hausner 2014/06/06 22:07:44 We pay this price only in the rare case where we f
srdjan 2014/06/06 22:14:34 The new solution simplifies the code and makes it
142 }
143 for (intptr_t i = 0; i < deferred_prefixes_->Length(); i++) {
144 if (deferred_prefixes_->At(i) == prefix.raw()) {
145 return; 141 return;
146 } 142 }
147 } 143 }
148 deferred_prefixes_->Add(prefix); 144 deferred_prefixes_->Add(&LibraryPrefix::ZoneHandle(I, prefix.raw()));
149 } 145 }
150 146
151 147
152 void ParsedFunction::AllocateVariables() { 148 void ParsedFunction::AllocateVariables() {
153 LocalScope* scope = node_sequence()->scope(); 149 LocalScope* scope = node_sequence()->scope();
154 const intptr_t num_fixed_params = function().num_fixed_parameters(); 150 const intptr_t num_fixed_params = function().num_fixed_parameters();
155 const intptr_t num_opt_params = function().NumOptionalParameters(); 151 const intptr_t num_opt_params = function().NumOptionalParameters();
156 const intptr_t num_params = num_fixed_params + num_opt_params; 152 const intptr_t num_params = num_fixed_params + num_opt_params;
157 // Compute start indices to parameters and locals, and the number of 153 // Compute start indices to parameters and locals, and the number of
158 // parameters to copy. 154 // parameters to copy.
(...skipping 10880 matching lines...) Expand 10 before | Expand all | Expand 10 after
11039 void Parser::SkipQualIdent() { 11035 void Parser::SkipQualIdent() {
11040 ASSERT(IsIdentifier()); 11036 ASSERT(IsIdentifier());
11041 ConsumeToken(); 11037 ConsumeToken();
11042 if (CurrentToken() == Token::kPERIOD) { 11038 if (CurrentToken() == Token::kPERIOD) {
11043 ConsumeToken(); // Consume the kPERIOD token. 11039 ConsumeToken(); // Consume the kPERIOD token.
11044 ExpectIdentifier("identifier expected after '.'"); 11040 ExpectIdentifier("identifier expected after '.'");
11045 } 11041 }
11046 } 11042 }
11047 11043
11048 } // namespace dart 11044 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698