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/flow_graph_builder.h" | 5 #include "vm/flow_graph_builder.h" |
6 | 6 |
7 #include "vm/ast_printer.h" | 7 #include "vm/ast_printer.h" |
8 #include "vm/code_descriptors.h" | 8 #include "vm/code_descriptors.h" |
9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
10 #include "vm/flags.h" | 10 #include "vm/flags.h" |
(...skipping 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1756 static intptr_t GetResultCidOfConstructor(ConstructorCallNode* node) { | 1756 static intptr_t GetResultCidOfConstructor(ConstructorCallNode* node) { |
1757 const Function& function = node->constructor(); | 1757 const Function& function = node->constructor(); |
1758 const Class& function_class = Class::Handle(function.Owner()); | 1758 const Class& function_class = Class::Handle(function.Owner()); |
1759 const Library& core_lib = Library::Handle(Library::CoreLibrary()); | 1759 const Library& core_lib = Library::Handle(Library::CoreLibrary()); |
1760 | 1760 |
1761 if (function_class.library() != core_lib.raw()) { | 1761 if (function_class.library() != core_lib.raw()) { |
1762 return kDynamicCid; | 1762 return kDynamicCid; |
1763 } | 1763 } |
1764 | 1764 |
1765 if (node->constructor().IsFactory()) { | 1765 if (node->constructor().IsFactory()) { |
1766 if ((function_class.Name() == Symbols::ListImplementation()) && | 1766 if ((function_class.Name() == Symbols::List()) && |
1767 (function.name() == Symbols::ListFactory())) { | 1767 (function.name() == Symbols::ListFactory())) { |
1768 // If there are no arguments then the result is guaranteed to be a | 1768 // If there are no arguments then the result is guaranteed to be a |
1769 // GrowableObjectArray. However if there is an argument the result | 1769 // GrowableObjectArray. However if there is an argument the result |
1770 // is not guaranteed to be a fixed size array because the argument | 1770 // is not guaranteed to be a fixed size array because the argument |
1771 // can be null. | 1771 // can be null. |
1772 if (node->arguments()->length() == 0) { | 1772 if (node->arguments()->length() == 0) { |
1773 return kGrowableObjectArrayCid; | 1773 return kGrowableObjectArrayCid; |
1774 } | 1774 } |
1775 } else { | 1775 } else { |
1776 if (IsRecognizedConstructor(function, | 1776 if (IsRecognizedConstructor(function, |
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2959 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 2959 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
2960 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 2960 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
2961 OS::SNPrint(chars, len, kFormat, function_name, reason); | 2961 OS::SNPrint(chars, len, kFormat, function_name, reason); |
2962 const Error& error = Error::Handle( | 2962 const Error& error = Error::Handle( |
2963 LanguageError::New(String::Handle(String::New(chars)))); | 2963 LanguageError::New(String::Handle(String::New(chars)))); |
2964 Isolate::Current()->long_jump_base()->Jump(1, error); | 2964 Isolate::Current()->long_jump_base()->Jump(1, error); |
2965 } | 2965 } |
2966 | 2966 |
2967 | 2967 |
2968 } // namespace dart | 2968 } // namespace dart |
OLD | NEW |