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 "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
8 #include "vm/ast_printer.h" | 8 #include "vm/ast_printer.h" |
9 #include "vm/code_descriptors.h" | 9 #include "vm/code_descriptors.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 1987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1998 const Class& function_class = Class::Handle(function.Owner()); | 1998 const Class& function_class = Class::Handle(function.Owner()); |
1999 const Library& core_lib = Library::Handle(Library::CoreLibrary()); | 1999 const Library& core_lib = Library::Handle(Library::CoreLibrary()); |
2000 | 2000 |
2001 if (function_class.library() != core_lib.raw()) { | 2001 if (function_class.library() != core_lib.raw()) { |
2002 return kDynamicCid; | 2002 return kDynamicCid; |
2003 } | 2003 } |
2004 | 2004 |
2005 if (node->constructor().IsFactory()) { | 2005 if (node->constructor().IsFactory()) { |
2006 if ((function_class.Name() == Symbols::List().raw()) && | 2006 if ((function_class.Name() == Symbols::List().raw()) && |
2007 (function.name() == Symbols::ListFactory().raw())) { | 2007 (function.name() == Symbols::ListFactory().raw())) { |
2008 return kGrowableObjectArrayCid; | 2008 if (node->arguments()->length() == 0) { |
Florian Schneider
2013/02/27 12:26:55
style suggestion:
return (node->arguments()->leng
| |
2009 } else if ((function_class.Name() == Symbols::List().raw()) && | 2009 return kGrowableObjectArrayCid; |
2010 (function.name() == Symbols::ListFixedLengthFactory().raw())) { | 2010 } |
2011 return kArrayCid; | 2011 return kArrayCid; |
2012 } else { | 2012 } else { |
2013 if (IsRecognizedConstructor(function, Symbols::ObjectArray()) && | 2013 if (IsRecognizedConstructor(function, Symbols::ObjectArray()) && |
2014 (node->arguments()->length() == 1)) { | 2014 (node->arguments()->length() == 1)) { |
2015 return kArrayCid; | 2015 return kArrayCid; |
2016 } else if (IsRecognizedConstructor(function, | 2016 } else if (IsRecognizedConstructor(function, |
2017 Symbols::GrowableObjectArray()) && | 2017 Symbols::GrowableObjectArray()) && |
2018 (node->arguments()->length() == 0)) { | 2018 (node->arguments()->length() == 0)) { |
2019 return kGrowableObjectArrayCid; | 2019 return kGrowableObjectArrayCid; |
2020 } | 2020 } |
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3264 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 3264 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
3265 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 3265 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
3266 OS::SNPrint(chars, len, kFormat, function_name, reason); | 3266 OS::SNPrint(chars, len, kFormat, function_name, reason); |
3267 const Error& error = Error::Handle( | 3267 const Error& error = Error::Handle( |
3268 LanguageError::New(String::Handle(String::New(chars)))); | 3268 LanguageError::New(String::Handle(String::New(chars)))); |
3269 Isolate::Current()->long_jump_base()->Jump(1, error); | 3269 Isolate::Current()->long_jump_base()->Jump(1, error); |
3270 } | 3270 } |
3271 | 3271 |
3272 | 3272 |
3273 } // namespace dart | 3273 } // namespace dart |
OLD | NEW |