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 2792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2803 PushArgumentInstr* push_receiver = PushArgument(for_receiver.value()); | 2803 PushArgumentInstr* push_receiver = PushArgument(for_receiver.value()); |
2804 | 2804 |
2805 // Allocate the arguments and pass them into the construction | 2805 // Allocate the arguments and pass them into the construction |
2806 // of the InvocationMirror. | 2806 // of the InvocationMirror. |
2807 const intptr_t args_pos = method_arguments->token_pos(); | 2807 const intptr_t args_pos = method_arguments->token_pos(); |
2808 ArgumentListNode* arguments = new ArgumentListNode(args_pos); | 2808 ArgumentListNode* arguments = new ArgumentListNode(args_pos); |
2809 // The first argument is the original method name. | 2809 // The first argument is the original method name. |
2810 arguments->Add(new LiteralNode(args_pos, method_name)); | 2810 arguments->Add(new LiteralNode(args_pos, method_name)); |
2811 // The second argument is an array containing the original method arguments. | 2811 // The second argument is an array containing the original method arguments. |
2812 ArrayNode* args_array = | 2812 ArrayNode* args_array = |
2813 new ArrayNode(args_pos, Type::ZoneHandle(Type::ListInterface())); | 2813 new ArrayNode(args_pos, Type::ZoneHandle(Type::ArrayType())); |
2814 for (intptr_t i = 0; i < method_arguments->length(); i++) { | 2814 for (intptr_t i = 0; i < method_arguments->length(); i++) { |
2815 args_array->AddElement(method_arguments->NodeAt(i)); | 2815 args_array->AddElement(method_arguments->NodeAt(i)); |
2816 } | 2816 } |
2817 arguments->Add(args_array); | 2817 arguments->Add(args_array); |
2818 ZoneGrowableArray<PushArgumentInstr*>* allocation_args = | 2818 ZoneGrowableArray<PushArgumentInstr*>* allocation_args = |
2819 new ZoneGrowableArray<PushArgumentInstr*>(arguments->length()); | 2819 new ZoneGrowableArray<PushArgumentInstr*>(arguments->length()); |
2820 BuildPushArguments(*arguments, allocation_args); | 2820 BuildPushArguments(*arguments, allocation_args); |
2821 StaticCallInstr* allocation = new StaticCallInstr(args_pos, | 2821 StaticCallInstr* allocation = new StaticCallInstr(args_pos, |
2822 allocation_function, | 2822 allocation_function, |
2823 Array::ZoneHandle(), | 2823 Array::ZoneHandle(), |
(...skipping 135 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 |