| 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/compiler.h" | 5 #include "vm/compiler.h" |
| 6 | 6 |
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 | 8 |
| 9 #include "vm/ast_printer.h" | 9 #include "vm/ast_printer.h" |
| 10 #include "vm/code_generator.h" | 10 #include "vm/code_generator.h" |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 } | 546 } |
| 547 UNREACHABLE(); | 547 UNREACHABLE(); |
| 548 return Error::null(); | 548 return Error::null(); |
| 549 } | 549 } |
| 550 | 550 |
| 551 | 551 |
| 552 RawError* Compiler::CompileAllFunctions(const Class& cls) { | 552 RawError* Compiler::CompileAllFunctions(const Class& cls) { |
| 553 Error& error = Error::Handle(); | 553 Error& error = Error::Handle(); |
| 554 Array& functions = Array::Handle(cls.functions()); | 554 Array& functions = Array::Handle(cls.functions()); |
| 555 Function& func = Function::Handle(); | 555 Function& func = Function::Handle(); |
| 556 // Class dynamic lives in the vm isolate. Its array fields cannot be set to |
| 557 // an empty array. |
| 558 if (functions.IsNull()) { |
| 559 ASSERT(cls.IsDynamicClass()); |
| 560 return error.raw(); |
| 561 } |
| 556 for (int i = 0; i < functions.Length(); i++) { | 562 for (int i = 0; i < functions.Length(); i++) { |
| 557 func ^= functions.At(i); | 563 func ^= functions.At(i); |
| 558 ASSERT(!func.IsNull()); | 564 ASSERT(!func.IsNull()); |
| 559 if (!func.HasCode() && | 565 if (!func.HasCode() && |
| 560 !func.is_abstract() && | 566 !func.is_abstract() && |
| 561 !func.IsRedirectingFactory()) { | 567 !func.IsRedirectingFactory()) { |
| 562 error = CompileFunction(func); | 568 error = CompileFunction(func); |
| 563 if (!error.IsNull()) { | 569 if (!error.IsNull()) { |
| 564 return error.raw(); | 570 return error.raw(); |
| 565 } | 571 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 result = isolate->object_store()->sticky_error(); | 633 result = isolate->object_store()->sticky_error(); |
| 628 isolate->object_store()->clear_sticky_error(); | 634 isolate->object_store()->clear_sticky_error(); |
| 629 isolate->set_long_jump_base(base); | 635 isolate->set_long_jump_base(base); |
| 630 return result.raw(); | 636 return result.raw(); |
| 631 } | 637 } |
| 632 UNREACHABLE(); | 638 UNREACHABLE(); |
| 633 return Object::null(); | 639 return Object::null(); |
| 634 } | 640 } |
| 635 | 641 |
| 636 } // namespace dart | 642 } // namespace dart |
| OLD | NEW |