| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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/precompiler.h" | 5 #include "vm/precompiler.h" |
| 6 | 6 |
| 7 #include "vm/compiler.h" | 7 #include "vm/compiler.h" |
| 8 #include "vm/isolate.h" | 8 #include "vm/isolate.h" |
| 9 #include "vm/log.h" | 9 #include "vm/log.h" |
| 10 #include "vm/longjump.h" | 10 #include "vm/longjump.h" |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 } | 427 } |
| 428 } | 428 } |
| 429 } | 429 } |
| 430 } | 430 } |
| 431 | 431 |
| 432 | 432 |
| 433 void Precompiler::AddField(const Field& field) { | 433 void Precompiler::AddField(const Field& field) { |
| 434 if (field.is_static()) { | 434 if (field.is_static()) { |
| 435 // Potential const object. Uninitialized field will harmlessly do a | 435 // Potential const object. Uninitialized field will harmlessly do a |
| 436 // redundant add of the Null class. | 436 // redundant add of the Null class. |
| 437 const Object& value = Object::Handle(Z, field.value()); | 437 const Object& value = Object::Handle(Z, field.StaticValue()); |
| 438 const Class& cls = Class::Handle(Z, value.clazz()); | 438 const Class& cls = Class::Handle(Z, value.clazz()); |
| 439 AddClass(cls); | 439 AddClass(cls); |
| 440 | 440 |
| 441 if (field.has_initializer()) { | 441 if (field.has_initializer()) { |
| 442 if (field.initializer() != Function::null()) return; | 442 if (field.PrecompiledInitializer() != Function::null()) return; |
| 443 | 443 |
| 444 if (FLAG_trace_precompiler) { | 444 if (FLAG_trace_precompiler) { |
| 445 ISL_Print("Precompiling initializer for %s\n", field.ToCString()); | 445 ISL_Print("Precompiling initializer for %s\n", field.ToCString()); |
| 446 } | 446 } |
| 447 Compiler::CompileStaticInitializer(field); | 447 Compiler::CompileStaticInitializer(field); |
| 448 | 448 |
| 449 const Function& function = Function::Handle(Z, field.initializer()); | 449 const Function& function = |
| 450 Function::Handle(Z, field.PrecompiledInitializer()); |
| 450 AddCalleesOf(function); | 451 AddCalleesOf(function); |
| 451 } | 452 } |
| 452 } | 453 } |
| 453 } | 454 } |
| 454 | 455 |
| 455 | 456 |
| 456 void Precompiler::AddFunction(const Function& function) { | 457 void Precompiler::AddFunction(const Function& function) { |
| 457 if (function.HasCode()) return; | 458 if (function.HasCode()) return; |
| 458 | 459 |
| 459 pending_functions_.Add(function); | 460 pending_functions_.Add(function); |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 for (intptr_t j = 0; j < closures.Length(); j++) { | 632 for (intptr_t j = 0; j < closures.Length(); j++) { |
| 632 function ^= closures.At(j); | 633 function ^= closures.At(j); |
| 633 ASSERT(function.HasCode()); | 634 ASSERT(function.HasCode()); |
| 634 } | 635 } |
| 635 } | 636 } |
| 636 } | 637 } |
| 637 } | 638 } |
| 638 } | 639 } |
| 639 | 640 |
| 640 } // namespace dart | 641 } // namespace dart |
| OLD | NEW |