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 "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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 void ParsedFunction::SetNodeSequence(SequenceNode* node_sequence) { | 128 void ParsedFunction::SetNodeSequence(SequenceNode* node_sequence) { |
129 ASSERT(node_sequence_ == NULL); | 129 ASSERT(node_sequence_ == NULL); |
130 ASSERT(node_sequence != NULL); | 130 ASSERT(node_sequence != NULL); |
131 node_sequence_ = node_sequence; | 131 node_sequence_ = node_sequence; |
132 } | 132 } |
133 | 133 |
134 | 134 |
135 void ParsedFunction::AddDeferredPrefix(const LibraryPrefix& prefix) { | 135 void ParsedFunction::AddDeferredPrefix(const LibraryPrefix& prefix) { |
136 ASSERT(prefix.is_deferred_load()); | 136 ASSERT(prefix.is_deferred_load()); |
137 ASSERT(!prefix.is_loaded()); | 137 ASSERT(!prefix.is_loaded()); |
138 if (deferred_prefixes_ == NULL) { | 138 for (intptr_t i = 0; i < deferred_prefixes_->length(); i++) { |
139 deferred_prefixes_ = | 139 if ((*deferred_prefixes_)[i]->raw() == prefix.raw()) { |
140 &GrowableObjectArray::ZoneHandle(GrowableObjectArray::New()); | |
141 } | |
142 for (intptr_t i = 0; i < deferred_prefixes_->Length(); i++) { | |
143 if (deferred_prefixes_->At(i) == prefix.raw()) { | |
144 return; | 140 return; |
145 } | 141 } |
146 } | 142 } |
147 deferred_prefixes_->Add(prefix); | 143 deferred_prefixes_->Add(&LibraryPrefix::ZoneHandle(I, prefix.raw())); |
148 } | 144 } |
149 | 145 |
150 | 146 |
151 void ParsedFunction::AllocateVariables() { | 147 void ParsedFunction::AllocateVariables() { |
152 LocalScope* scope = node_sequence()->scope(); | 148 LocalScope* scope = node_sequence()->scope(); |
153 const intptr_t num_fixed_params = function().num_fixed_parameters(); | 149 const intptr_t num_fixed_params = function().num_fixed_parameters(); |
154 const intptr_t num_opt_params = function().NumOptionalParameters(); | 150 const intptr_t num_opt_params = function().NumOptionalParameters(); |
155 const intptr_t num_params = num_fixed_params + num_opt_params; | 151 const intptr_t num_params = num_fixed_params + num_opt_params; |
156 // Compute start indices to parameters and locals, and the number of | 152 // Compute start indices to parameters and locals, and the number of |
157 // parameters to copy. | 153 // parameters to copy. |
(...skipping 10869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11027 void Parser::SkipQualIdent() { | 11023 void Parser::SkipQualIdent() { |
11028 ASSERT(IsIdentifier()); | 11024 ASSERT(IsIdentifier()); |
11029 ConsumeToken(); | 11025 ConsumeToken(); |
11030 if (CurrentToken() == Token::kPERIOD) { | 11026 if (CurrentToken() == Token::kPERIOD) { |
11031 ConsumeToken(); // Consume the kPERIOD token. | 11027 ConsumeToken(); // Consume the kPERIOD token. |
11032 ExpectIdentifier("identifier expected after '.'"); | 11028 ExpectIdentifier("identifier expected after '.'"); |
11033 } | 11029 } |
11034 } | 11030 } |
11035 | 11031 |
11036 } // namespace dart | 11032 } // namespace dart |
OLD | NEW |