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 1868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1879 Append(for_instantiator); | 1879 Append(for_instantiator); |
1880 return for_instantiator.value(); | 1880 return for_instantiator.value(); |
1881 } | 1881 } |
1882 if (instantiator == NULL) { | 1882 if (instantiator == NULL) { |
1883 instantiator = BuildInstantiator(); | 1883 instantiator = BuildInstantiator(); |
1884 } | 1884 } |
1885 // The instantiator is the receiver of the caller, which is not a factory. | 1885 // The instantiator is the receiver of the caller, which is not a factory. |
1886 // The receiver cannot be null; extract its AbstractTypeArguments object. | 1886 // The receiver cannot be null; extract its AbstractTypeArguments object. |
1887 // Note that in the factory case, the instantiator is the first parameter | 1887 // Note that in the factory case, the instantiator is the first parameter |
1888 // of the factory, i.e. already an AbstractTypeArguments object. | 1888 // of the factory, i.e. already an AbstractTypeArguments object. |
1889 intptr_t type_arguments_instance_field_offset = | 1889 intptr_t type_arguments_field_offset = |
1890 instantiator_class.type_arguments_instance_field_offset(); | 1890 instantiator_class.type_arguments_field_offset(); |
1891 ASSERT(type_arguments_instance_field_offset != Class::kNoTypeArguments); | 1891 ASSERT(type_arguments_field_offset != Class::kNoTypeArguments); |
1892 | 1892 |
1893 return Bind(new LoadFieldInstr( | 1893 return Bind(new LoadFieldInstr( |
1894 instantiator, | 1894 instantiator, |
1895 type_arguments_instance_field_offset, | 1895 type_arguments_field_offset, |
1896 Type::ZoneHandle())); // Not an instance, no type. | 1896 Type::ZoneHandle())); // Not an instance, no type. |
1897 } | 1897 } |
1898 | 1898 |
1899 | 1899 |
1900 Value* EffectGraphVisitor::BuildInstantiatedTypeArguments( | 1900 Value* EffectGraphVisitor::BuildInstantiatedTypeArguments( |
1901 intptr_t token_pos, | 1901 intptr_t token_pos, |
1902 const AbstractTypeArguments& type_arguments) { | 1902 const AbstractTypeArguments& type_arguments) { |
1903 if (type_arguments.IsNull() || type_arguments.IsInstantiated()) { | 1903 if (type_arguments.IsNull() || type_arguments.IsInstantiated()) { |
1904 return Bind(new ConstantInstr(type_arguments)); | 1904 return Bind(new ConstantInstr(type_arguments)); |
1905 } | 1905 } |
(...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2960 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 2960 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
2961 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 2961 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
2962 OS::SNPrint(chars, len, kFormat, function_name, reason); | 2962 OS::SNPrint(chars, len, kFormat, function_name, reason); |
2963 const Error& error = Error::Handle( | 2963 const Error& error = Error::Handle( |
2964 LanguageError::New(String::Handle(String::New(chars)))); | 2964 LanguageError::New(String::Handle(String::New(chars)))); |
2965 Isolate::Current()->long_jump_base()->Jump(1, error); | 2965 Isolate::Current()->long_jump_base()->Jump(1, error); |
2966 } | 2966 } |
2967 | 2967 |
2968 | 2968 |
2969 } // namespace dart | 2969 } // namespace dart |
OLD | NEW |