Chromium Code Reviews| 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/object.h" | 5 #include "vm/object.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 10964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10975 ASSERT(hide_names.IsNull() || (hide_names.Length() > 0)); | 10975 ASSERT(hide_names.IsNull() || (hide_names.Length() > 0)); |
| 10976 const Namespace& result = Namespace::Handle(Namespace::New()); | 10976 const Namespace& result = Namespace::Handle(Namespace::New()); |
| 10977 result.StorePointer(&result.raw_ptr()->library_, library.raw()); | 10977 result.StorePointer(&result.raw_ptr()->library_, library.raw()); |
| 10978 result.StorePointer(&result.raw_ptr()->show_names_, show_names.raw()); | 10978 result.StorePointer(&result.raw_ptr()->show_names_, show_names.raw()); |
| 10979 result.StorePointer(&result.raw_ptr()->hide_names_, hide_names.raw()); | 10979 result.StorePointer(&result.raw_ptr()->hide_names_, hide_names.raw()); |
| 10980 return result.raw(); | 10980 return result.raw(); |
| 10981 } | 10981 } |
| 10982 | 10982 |
| 10983 | 10983 |
| 10984 RawError* Library::CompileAll() { | 10984 RawError* Library::CompileAll() { |
| 10985 Error& error = Error::Handle(); | 10985 Thread* thread = Thread::Current(); |
| 10986 Zone* zone = thread->zone(); | |
| 10987 Error& error = Error::Handle(zone); | |
| 10986 const GrowableObjectArray& libs = GrowableObjectArray::Handle( | 10988 const GrowableObjectArray& libs = GrowableObjectArray::Handle( |
| 10987 Isolate::Current()->object_store()->libraries()); | 10989 Isolate::Current()->object_store()->libraries()); |
| 10988 Library& lib = Library::Handle(); | 10990 Library& lib = Library::Handle(zone); |
| 10989 Class& cls = Class::Handle(); | 10991 Class& cls = Class::Handle(zone); |
| 10990 for (int i = 0; i < libs.Length(); i++) { | 10992 for (int i = 0; i < libs.Length(); i++) { |
| 10991 lib ^= libs.At(i); | 10993 lib ^= libs.At(i); |
| 10992 ClassDictionaryIterator it(lib, ClassDictionaryIterator::kIteratePrivate); | 10994 ClassDictionaryIterator it(lib, ClassDictionaryIterator::kIteratePrivate); |
| 10993 while (it.HasNext()) { | 10995 while (it.HasNext()) { |
| 10994 cls = it.GetNextClass(); | 10996 cls = it.GetNextClass(); |
| 10995 error = cls.EnsureIsFinalized(Thread::Current()); | 10997 error = cls.EnsureIsFinalized(Thread::Current()); |
|
hausner
2015/12/01 16:57:57
Use thread here.
Florian Schneider
2015/12/01 17:04:52
Done.
| |
| 10996 if (!error.IsNull()) { | 10998 if (!error.IsNull()) { |
| 10997 return error.raw(); | 10999 return error.raw(); |
| 10998 } | 11000 } |
| 10999 error = Compiler::CompileAllFunctions(cls); | 11001 error = Compiler::CompileAllFunctions(cls); |
| 11000 if (!error.IsNull()) { | 11002 if (!error.IsNull()) { |
| 11001 return error.raw(); | 11003 return error.raw(); |
| 11002 } | 11004 } |
| 11003 } | 11005 } |
| 11004 } | 11006 } |
| 11007 | |
| 11008 // Inner functions get added to the closures array. As part of compilation | |
| 11009 // more closures can be added to the end of the array. Compile all the | |
| 11010 // closures until we have reached the end of the "worklist". | |
| 11011 const GrowableObjectArray& closures = GrowableObjectArray::Handle(zone, | |
| 11012 Isolate::Current()->object_store()->closure_functions()); | |
| 11013 Function& func = Function::Handle(zone); | |
| 11014 for (int i = 0; i < closures.Length(); i++) { | |
| 11015 func ^= closures.At(i); | |
| 11016 if (!func.HasCode()) { | |
| 11017 error = Compiler::CompileFunction(thread, func); | |
| 11018 if (!error.IsNull()) { | |
| 11019 return error.raw(); | |
| 11020 } | |
| 11021 func.ClearICDataArray(); | |
| 11022 func.ClearCode(); | |
| 11023 } | |
| 11024 } | |
| 11005 return error.raw(); | 11025 return error.raw(); |
| 11006 } | 11026 } |
| 11007 | 11027 |
| 11008 | 11028 |
| 11009 // Return Function::null() if function does not exist in libs. | 11029 // Return Function::null() if function does not exist in libs. |
| 11010 RawFunction* Library::GetFunction(const GrowableArray<Library*>& libs, | 11030 RawFunction* Library::GetFunction(const GrowableArray<Library*>& libs, |
| 11011 const char* class_name, | 11031 const char* class_name, |
| 11012 const char* function_name) { | 11032 const char* function_name) { |
| 11013 Function& func = Function::Handle(); | 11033 Function& func = Function::Handle(); |
| 11014 String& class_str = String::Handle(); | 11034 String& class_str = String::Handle(); |
| (...skipping 10855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 21870 return tag_label.ToCString(); | 21890 return tag_label.ToCString(); |
| 21871 } | 21891 } |
| 21872 | 21892 |
| 21873 | 21893 |
| 21874 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 21894 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 21875 Instance::PrintJSONImpl(stream, ref); | 21895 Instance::PrintJSONImpl(stream, ref); |
| 21876 } | 21896 } |
| 21877 | 21897 |
| 21878 | 21898 |
| 21879 } // namespace dart | 21899 } // namespace dart |
| OLD | NEW |