| 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 1751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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::ListImplementation()) && |
| 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 return kGrowableObjectArrayCid; |
| 1773 return kGrowableObjectArrayCid; | |
| 1774 } | |
| 1775 } else { | 1773 } else { |
| 1776 if (IsRecognizedConstructor(function, | 1774 if (IsRecognizedConstructor(function, |
| 1777 String::Handle(Symbols::ObjectArray())) && | 1775 String::Handle(Symbols::ObjectArray())) && |
| 1778 (node->arguments()->length() == 1)) { | 1776 (node->arguments()->length() == 1)) { |
| 1779 return kArrayCid; | 1777 return kArrayCid; |
| 1780 } else if (IsRecognizedConstructor(function, | 1778 } else if (IsRecognizedConstructor(function, |
| 1781 String::Handle(Symbols::GrowableObjectArray())) && | 1779 String::Handle(Symbols::GrowableObjectArray())) && |
| 1782 (node->arguments()->length() == 0)) { | 1780 (node->arguments()->length() == 0)) { |
| 1783 return kGrowableObjectArrayCid; | 1781 return kGrowableObjectArrayCid; |
| 1784 } | 1782 } |
| (...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2959 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 2957 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
| 2960 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 2958 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
| 2961 OS::SNPrint(chars, len, kFormat, function_name, reason); | 2959 OS::SNPrint(chars, len, kFormat, function_name, reason); |
| 2962 const Error& error = Error::Handle( | 2960 const Error& error = Error::Handle( |
| 2963 LanguageError::New(String::Handle(String::New(chars)))); | 2961 LanguageError::New(String::Handle(String::New(chars)))); |
| 2964 Isolate::Current()->long_jump_base()->Jump(1, error); | 2962 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 2965 } | 2963 } |
| 2966 | 2964 |
| 2967 | 2965 |
| 2968 } // namespace dart | 2966 } // namespace dart |
| OLD | NEW |