| 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/block_scheduler.h" | 10 #include "vm/block_scheduler.h" |
| (...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 for (int i = 0; i < functions.Length(); i++) { | 863 for (int i = 0; i < functions.Length(); i++) { |
| 864 func ^= functions.At(i); | 864 func ^= functions.At(i); |
| 865 ASSERT(!func.IsNull()); | 865 ASSERT(!func.IsNull()); |
| 866 if (!func.HasCode() && | 866 if (!func.HasCode() && |
| 867 !func.is_abstract() && | 867 !func.is_abstract() && |
| 868 !func.IsRedirectingFactory()) { | 868 !func.IsRedirectingFactory()) { |
| 869 error = CompileFunction(func); | 869 error = CompileFunction(func); |
| 870 if (!error.IsNull()) { | 870 if (!error.IsNull()) { |
| 871 return error.raw(); | 871 return error.raw(); |
| 872 } | 872 } |
| 873 func.ClearCode(); |
| 873 } | 874 } |
| 874 } | 875 } |
| 875 // Inner functions get added to the closures array. As part of compilation | 876 // Inner functions get added to the closures array. As part of compilation |
| 876 // more closures can be added to the end of the array. Compile all the | 877 // more closures can be added to the end of the array. Compile all the |
| 877 // closures until we have reached the end of the "worklist". | 878 // closures until we have reached the end of the "worklist". |
| 878 GrowableObjectArray& closures = | 879 GrowableObjectArray& closures = |
| 879 GrowableObjectArray::Handle(cls.closures()); | 880 GrowableObjectArray::Handle(cls.closures()); |
| 880 if (!closures.IsNull()) { | 881 if (!closures.IsNull()) { |
| 881 for (int i = 0; i < closures.Length(); i++) { | 882 for (int i = 0; i < closures.Length(); i++) { |
| 882 func ^= closures.At(i); | 883 func ^= closures.At(i); |
| 883 if (!func.HasCode()) { | 884 if (!func.HasCode()) { |
| 884 error = CompileFunction(func); | 885 error = CompileFunction(func); |
| 885 if (!error.IsNull()) { | 886 if (!error.IsNull()) { |
| 886 return error.raw(); | 887 return error.raw(); |
| 887 } | 888 } |
| 889 func.ClearCode(); |
| 888 } | 890 } |
| 889 } | 891 } |
| 890 } | 892 } |
| 891 return error.raw(); | 893 return error.raw(); |
| 892 } | 894 } |
| 893 | 895 |
| 894 | 896 |
| 895 RawObject* Compiler::ExecuteOnce(SequenceNode* fragment) { | 897 RawObject* Compiler::ExecuteOnce(SequenceNode* fragment) { |
| 896 Isolate* isolate = Isolate::Current(); | 898 Isolate* isolate = Isolate::Current(); |
| 897 LongJumpScope jump; | 899 LongJumpScope jump; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 942 const Object& result = | 944 const Object& result = |
| 943 Object::Handle(isolate->object_store()->sticky_error()); | 945 Object::Handle(isolate->object_store()->sticky_error()); |
| 944 isolate->object_store()->clear_sticky_error(); | 946 isolate->object_store()->clear_sticky_error(); |
| 945 return result.raw(); | 947 return result.raw(); |
| 946 } | 948 } |
| 947 UNREACHABLE(); | 949 UNREACHABLE(); |
| 948 return Object::null(); | 950 return Object::null(); |
| 949 } | 951 } |
| 950 | 952 |
| 951 } // namespace dart | 953 } // namespace dart |
| OLD | NEW |