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 1719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1730 node->type_arguments())); | 1730 node->type_arguments())); |
1731 arguments->Add(push_type_arguments); | 1731 arguments->Add(push_type_arguments); |
1732 ASSERT(arguments->length() == 1); | 1732 ASSERT(arguments->length() == 1); |
1733 BuildPushArguments(*node->arguments(), arguments); | 1733 BuildPushArguments(*node->arguments(), arguments); |
1734 StaticCallInstr* call = | 1734 StaticCallInstr* call = |
1735 new StaticCallInstr(node->token_pos(), | 1735 new StaticCallInstr(node->token_pos(), |
1736 node->constructor(), | 1736 node->constructor(), |
1737 node->arguments()->names(), | 1737 node->arguments()->names(), |
1738 arguments); | 1738 arguments); |
1739 // List factories return kArrayCid or kGrowableObjectArrayCid. | 1739 // List factories return kArrayCid or kGrowableObjectArrayCid. |
1740 call->set_result_cid(GetResultCidOfConstructor(node)); | 1740 const intptr_t result_cid = GetResultCidOfConstructor(node); |
| 1741 call->set_result_cid(result_cid); |
| 1742 call->set_is_known_constructor(result_cid != kDynamicCid); |
1741 ReturnDefinition(call); | 1743 ReturnDefinition(call); |
1742 return; | 1744 return; |
1743 } | 1745 } |
1744 // t_n contains the allocated and initialized object. | 1746 // t_n contains the allocated and initialized object. |
1745 // t_n <- AllocateObject(class) | 1747 // t_n <- AllocateObject(class) |
1746 // t_n+1 <- ctor-arg | 1748 // t_n+1 <- ctor-arg |
1747 // t_n+2... <- constructor arguments start here | 1749 // t_n+2... <- constructor arguments start here |
1748 // StaticCall(constructor, t_n+1, t_n+2, ...) | 1750 // StaticCall(constructor, t_n+1, t_n+2, ...) |
1749 // No need to preserve allocated value (simpler than in ValueGraphVisitor). | 1751 // No need to preserve allocated value (simpler than in ValueGraphVisitor). |
1750 Value* allocated_value = BuildObjectAllocation(node); | 1752 Value* allocated_value = BuildObjectAllocation(node); |
(...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2846 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 2848 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
2847 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 2849 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
2848 OS::SNPrint(chars, len, kFormat, function_name, reason); | 2850 OS::SNPrint(chars, len, kFormat, function_name, reason); |
2849 const Error& error = Error::Handle( | 2851 const Error& error = Error::Handle( |
2850 LanguageError::New(String::Handle(String::New(chars)))); | 2852 LanguageError::New(String::Handle(String::New(chars)))); |
2851 Isolate::Current()->long_jump_base()->Jump(1, error); | 2853 Isolate::Current()->long_jump_base()->Jump(1, error); |
2852 } | 2854 } |
2853 | 2855 |
2854 | 2856 |
2855 } // namespace dart | 2857 } // namespace dart |
OLD | NEW |