| 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 #include "vm/flags.h" | 6 #include "vm/flags.h" |
| 7 | 7 |
| 8 #ifndef DART_PRECOMPILED_RUNTIME | 8 #ifndef DART_PRECOMPILED_RUNTIME |
| 9 | 9 |
| 10 #include "lib/invocation_mirror.h" | 10 #include "lib/invocation_mirror.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 // finalized yet. | 154 // finalized yet. |
| 155 return a.raw(); | 155 return a.raw(); |
| 156 } | 156 } |
| 157 | 157 |
| 158 | 158 |
| 159 void ParsedFunction::AddToGuardedFields(const Field* field) const { | 159 void ParsedFunction::AddToGuardedFields(const Field* field) const { |
| 160 if ((field->guarded_cid() == kDynamicCid) || | 160 if ((field->guarded_cid() == kDynamicCid) || |
| 161 (field->guarded_cid() == kIllegalCid)) { | 161 (field->guarded_cid() == kIllegalCid)) { |
| 162 return; | 162 return; |
| 163 } | 163 } |
| 164 |
| 164 for (intptr_t j = 0; j < guarded_fields_->length(); j++) { | 165 for (intptr_t j = 0; j < guarded_fields_->length(); j++) { |
| 165 if ((*guarded_fields_)[j]->raw() == field->raw()) { | 166 const Field* other = (*guarded_fields_)[j]; |
| 167 if (field->Original() == other->Original()) { |
| 168 // Abort background compilation early if the guarded state of this field |
| 169 // has changed during compilation. We will not be able to commit |
| 170 // the resulting code anyway. |
| 171 if (Compiler::IsBackgroundCompilation()) { |
| 172 if (!other->IsConsistentWith(*field)) { |
| 173 Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId, |
| 174 "Field's guarded state changed during compilation"); |
| 175 } |
| 176 } |
| 166 return; | 177 return; |
| 167 } | 178 } |
| 168 } | 179 } |
| 169 guarded_fields_->Add(&Field::ZoneHandle(Z, field->Original())); | 180 |
| 181 // Note: the list of guarded fields must contain copies during background |
| 182 // compilation because we will look at their guarded_cid when copying |
| 183 // the array of guarded fields from callee into the caller during |
| 184 // inlining. |
| 185 ASSERT(!field->IsOriginal() || Thread::Current()->IsMutatorThread()); |
| 186 guarded_fields_->Add(&Field::ZoneHandle(Z, field->raw())); |
| 170 } | 187 } |
| 171 | 188 |
| 172 | 189 |
| 173 LocalVariable* ParsedFunction::EnsureExpressionTemp() { | 190 LocalVariable* ParsedFunction::EnsureExpressionTemp() { |
| 174 if (!has_expression_temp_var()) { | 191 if (!has_expression_temp_var()) { |
| 175 LocalVariable* temp = | 192 LocalVariable* temp = |
| 176 new (Z) LocalVariable(function_.token_pos(), | 193 new (Z) LocalVariable(function_.token_pos(), |
| 177 Symbols::ExprTemp(), | 194 Symbols::ExprTemp(), |
| 178 Object::dynamic_type()); | 195 Object::dynamic_type()); |
| 179 ASSERT(temp != NULL); | 196 ASSERT(temp != NULL); |
| (...skipping 14320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14500 const ArgumentListNode& function_args, | 14517 const ArgumentListNode& function_args, |
| 14501 const LocalVariable* temp_for_last_arg, | 14518 const LocalVariable* temp_for_last_arg, |
| 14502 bool is_super_invocation) { | 14519 bool is_super_invocation) { |
| 14503 UNREACHABLE(); | 14520 UNREACHABLE(); |
| 14504 return NULL; | 14521 return NULL; |
| 14505 } | 14522 } |
| 14506 | 14523 |
| 14507 } // namespace dart | 14524 } // namespace dart |
| 14508 | 14525 |
| 14509 #endif // DART_PRECOMPILED_RUNTIME | 14526 #endif // DART_PRECOMPILED_RUNTIME |
| OLD | NEW |