| 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/bit_vector.h" | 9 #include "vm/bit_vector.h" |
| 10 #include "vm/code_descriptors.h" | 10 #include "vm/code_descriptors.h" |
| (...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 | 972 |
| 973 ZoneGrowableArray<PushArgumentInstr*>* arguments = | 973 ZoneGrowableArray<PushArgumentInstr*>* arguments = |
| 974 new ZoneGrowableArray<PushArgumentInstr*>(2); | 974 new ZoneGrowableArray<PushArgumentInstr*>(2); |
| 975 arguments->Add(push_left); | 975 arguments->Add(push_left); |
| 976 arguments->Add(push_right); | 976 arguments->Add(push_right); |
| 977 const String& name = String::ZoneHandle(Symbols::New(node->Name())); | 977 const String& name = String::ZoneHandle(Symbols::New(node->Name())); |
| 978 InstanceCallInstr* call = new InstanceCallInstr(node->token_pos(), | 978 InstanceCallInstr* call = new InstanceCallInstr(node->token_pos(), |
| 979 name, | 979 name, |
| 980 node->kind(), | 980 node->kind(), |
| 981 arguments, | 981 arguments, |
| 982 Array::ZoneHandle(), | 982 Object::null_array(), |
| 983 2, | 983 2, |
| 984 owner()->ic_data_array()); | 984 owner()->ic_data_array()); |
| 985 ReturnDefinition(call); | 985 ReturnDefinition(call); |
| 986 } | 986 } |
| 987 | 987 |
| 988 | 988 |
| 989 // Special handling for AND/OR. | 989 // Special handling for AND/OR. |
| 990 void ValueGraphVisitor::VisitBinaryOpNode(BinaryOpNode* node) { | 990 void ValueGraphVisitor::VisitBinaryOpNode(BinaryOpNode* node) { |
| 991 // Operators "&&" and "||" cannot be overloaded therefore do not call | 991 // Operators "&&" and "||" cannot be overloaded therefore do not call |
| 992 // operator. | 992 // operator. |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1216 const Bool& negate = (node->kind() == Token::kISNOT) ? Bool::True() : | 1216 const Bool& negate = (node->kind() == Token::kISNOT) ? Bool::True() : |
| 1217 Bool::False(); | 1217 Bool::False(); |
| 1218 Value* negate_arg = Bind(new ConstantInstr(negate)); | 1218 Value* negate_arg = Bind(new ConstantInstr(negate)); |
| 1219 arguments->Add(PushArgument(negate_arg)); | 1219 arguments->Add(PushArgument(negate_arg)); |
| 1220 const intptr_t kNumArgsChecked = 1; | 1220 const intptr_t kNumArgsChecked = 1; |
| 1221 InstanceCallInstr* call = new InstanceCallInstr( | 1221 InstanceCallInstr* call = new InstanceCallInstr( |
| 1222 node->token_pos(), | 1222 node->token_pos(), |
| 1223 PrivateCoreLibName(Symbols::_instanceOf()), | 1223 PrivateCoreLibName(Symbols::_instanceOf()), |
| 1224 node->kind(), | 1224 node->kind(), |
| 1225 arguments, | 1225 arguments, |
| 1226 Array::ZoneHandle(), // No argument names. | 1226 Object::null_array(), // No argument names. |
| 1227 kNumArgsChecked, | 1227 kNumArgsChecked, |
| 1228 owner()->ic_data_array()); | 1228 owner()->ic_data_array()); |
| 1229 ReturnDefinition(call); | 1229 ReturnDefinition(call); |
| 1230 } | 1230 } |
| 1231 | 1231 |
| 1232 | 1232 |
| 1233 void EffectGraphVisitor::BuildTypeCast(ComparisonNode* node) { | 1233 void EffectGraphVisitor::BuildTypeCast(ComparisonNode* node) { |
| 1234 ASSERT(Token::IsTypeCastOperator(node->kind())); | 1234 ASSERT(Token::IsTypeCastOperator(node->kind())); |
| 1235 const AbstractType& type = node->right()->AsTypeNode()->type(); | 1235 const AbstractType& type = node->right()->AsTypeNode()->type(); |
| 1236 ASSERT(type.IsFinalized()); // The type in a type cast may be malformed. | 1236 ASSERT(type.IsFinalized()); // The type in a type cast may be malformed. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1286 arguments->Add(push_instantiator); | 1286 arguments->Add(push_instantiator); |
| 1287 arguments->Add(push_type_args); | 1287 arguments->Add(push_type_args); |
| 1288 Value* type_arg = Bind(new ConstantInstr(type)); | 1288 Value* type_arg = Bind(new ConstantInstr(type)); |
| 1289 arguments->Add(PushArgument(type_arg)); | 1289 arguments->Add(PushArgument(type_arg)); |
| 1290 const intptr_t kNumArgsChecked = 1; | 1290 const intptr_t kNumArgsChecked = 1; |
| 1291 InstanceCallInstr* call = new InstanceCallInstr( | 1291 InstanceCallInstr* call = new InstanceCallInstr( |
| 1292 node->token_pos(), | 1292 node->token_pos(), |
| 1293 PrivateCoreLibName(Symbols::_as()), | 1293 PrivateCoreLibName(Symbols::_as()), |
| 1294 node->kind(), | 1294 node->kind(), |
| 1295 arguments, | 1295 arguments, |
| 1296 Array::ZoneHandle(), // No argument names. | 1296 Object::null_array(), // No argument names. |
| 1297 kNumArgsChecked, | 1297 kNumArgsChecked, |
| 1298 owner()->ic_data_array()); | 1298 owner()->ic_data_array()); |
| 1299 ReturnDefinition(call); | 1299 ReturnDefinition(call); |
| 1300 } | 1300 } |
| 1301 } | 1301 } |
| 1302 | 1302 |
| 1303 | 1303 |
| 1304 // <Expression> :: Comparison { kind: Token::Kind | 1304 // <Expression> :: Comparison { kind: Token::Kind |
| 1305 // left: <Expression> | 1305 // left: <Expression> |
| 1306 // right: <Expression> } | 1306 // right: <Expression> } |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1400 PushArgumentInstr* push_value = PushArgument(for_value.value()); | 1400 PushArgumentInstr* push_value = PushArgument(for_value.value()); |
| 1401 ZoneGrowableArray<PushArgumentInstr*>* arguments = | 1401 ZoneGrowableArray<PushArgumentInstr*>* arguments = |
| 1402 new ZoneGrowableArray<PushArgumentInstr*>(1); | 1402 new ZoneGrowableArray<PushArgumentInstr*>(1); |
| 1403 arguments->Add(push_value); | 1403 arguments->Add(push_value); |
| 1404 InstanceCallInstr* call = | 1404 InstanceCallInstr* call = |
| 1405 new InstanceCallInstr(node->token_pos(), | 1405 new InstanceCallInstr(node->token_pos(), |
| 1406 String::ZoneHandle( | 1406 String::ZoneHandle( |
| 1407 Symbols::New(Token::Str(node->kind()))), | 1407 Symbols::New(Token::Str(node->kind()))), |
| 1408 node->kind(), | 1408 node->kind(), |
| 1409 arguments, | 1409 arguments, |
| 1410 Array::ZoneHandle(), | 1410 Object::null_array(), |
| 1411 1, | 1411 1, |
| 1412 owner()->ic_data_array()); | 1412 owner()->ic_data_array()); |
| 1413 ReturnDefinition(call); | 1413 ReturnDefinition(call); |
| 1414 } | 1414 } |
| 1415 | 1415 |
| 1416 | 1416 |
| 1417 void EffectGraphVisitor::VisitConditionalExprNode(ConditionalExprNode* node) { | 1417 void EffectGraphVisitor::VisitConditionalExprNode(ConditionalExprNode* node) { |
| 1418 TestGraphVisitor for_test(owner(), | 1418 TestGraphVisitor for_test(owner(), |
| 1419 temp_index(), | 1419 temp_index(), |
| 1420 node->condition()->token_pos()); | 1420 node->condition()->token_pos()); |
| (...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2519 PushArgumentInstr* push_receiver = PushArgument(for_receiver.value()); | 2519 PushArgumentInstr* push_receiver = PushArgument(for_receiver.value()); |
| 2520 ZoneGrowableArray<PushArgumentInstr*>* arguments = | 2520 ZoneGrowableArray<PushArgumentInstr*>* arguments = |
| 2521 new ZoneGrowableArray<PushArgumentInstr*>(1); | 2521 new ZoneGrowableArray<PushArgumentInstr*>(1); |
| 2522 arguments->Add(push_receiver); | 2522 arguments->Add(push_receiver); |
| 2523 const String& name = | 2523 const String& name = |
| 2524 String::ZoneHandle(Field::GetterSymbol(node->field_name())); | 2524 String::ZoneHandle(Field::GetterSymbol(node->field_name())); |
| 2525 InstanceCallInstr* call = new InstanceCallInstr( | 2525 InstanceCallInstr* call = new InstanceCallInstr( |
| 2526 node->token_pos(), | 2526 node->token_pos(), |
| 2527 name, | 2527 name, |
| 2528 Token::kGET, | 2528 Token::kGET, |
| 2529 arguments, Array::ZoneHandle(), | 2529 arguments, Object::null_array(), |
| 2530 1, | 2530 1, |
| 2531 owner()->ic_data_array()); | 2531 owner()->ic_data_array()); |
| 2532 ReturnDefinition(call); | 2532 ReturnDefinition(call); |
| 2533 } | 2533 } |
| 2534 | 2534 |
| 2535 | 2535 |
| 2536 void EffectGraphVisitor::BuildInstanceSetterArguments( | 2536 void EffectGraphVisitor::BuildInstanceSetterArguments( |
| 2537 InstanceSetterNode* node, | 2537 InstanceSetterNode* node, |
| 2538 ZoneGrowableArray<PushArgumentInstr*>* arguments, | 2538 ZoneGrowableArray<PushArgumentInstr*>* arguments, |
| 2539 bool result_is_needed) { | 2539 bool result_is_needed) { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2559 void EffectGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) { | 2559 void EffectGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) { |
| 2560 ZoneGrowableArray<PushArgumentInstr*>* arguments = | 2560 ZoneGrowableArray<PushArgumentInstr*>* arguments = |
| 2561 new ZoneGrowableArray<PushArgumentInstr*>(2); | 2561 new ZoneGrowableArray<PushArgumentInstr*>(2); |
| 2562 BuildInstanceSetterArguments(node, arguments, kResultNotNeeded); | 2562 BuildInstanceSetterArguments(node, arguments, kResultNotNeeded); |
| 2563 const String& name = | 2563 const String& name = |
| 2564 String::ZoneHandle(Field::SetterSymbol(node->field_name())); | 2564 String::ZoneHandle(Field::SetterSymbol(node->field_name())); |
| 2565 InstanceCallInstr* call = new InstanceCallInstr(node->token_pos(), | 2565 InstanceCallInstr* call = new InstanceCallInstr(node->token_pos(), |
| 2566 name, | 2566 name, |
| 2567 Token::kSET, | 2567 Token::kSET, |
| 2568 arguments, | 2568 arguments, |
| 2569 Array::ZoneHandle(), | 2569 Object::null_array(), |
| 2570 2, // Checked arg count. | 2570 2, // Checked arg count. |
| 2571 owner()->ic_data_array()); | 2571 owner()->ic_data_array()); |
| 2572 ReturnDefinition(call); | 2572 ReturnDefinition(call); |
| 2573 } | 2573 } |
| 2574 | 2574 |
| 2575 | 2575 |
| 2576 void ValueGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) { | 2576 void ValueGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) { |
| 2577 ZoneGrowableArray<PushArgumentInstr*>* arguments = | 2577 ZoneGrowableArray<PushArgumentInstr*>* arguments = |
| 2578 new ZoneGrowableArray<PushArgumentInstr*>(2); | 2578 new ZoneGrowableArray<PushArgumentInstr*>(2); |
| 2579 BuildInstanceSetterArguments(node, arguments, kResultNeeded); | 2579 BuildInstanceSetterArguments(node, arguments, kResultNeeded); |
| 2580 const String& name = | 2580 const String& name = |
| 2581 String::ZoneHandle(Field::SetterSymbol(node->field_name())); | 2581 String::ZoneHandle(Field::SetterSymbol(node->field_name())); |
| 2582 Do(new InstanceCallInstr(node->token_pos(), | 2582 Do(new InstanceCallInstr(node->token_pos(), |
| 2583 name, | 2583 name, |
| 2584 Token::kSET, | 2584 Token::kSET, |
| 2585 arguments, | 2585 arguments, |
| 2586 Array::ZoneHandle(), | 2586 Object::null_array(), |
| 2587 2, // Checked argument count. | 2587 2, // Checked argument count. |
| 2588 owner()->ic_data_array())); | 2588 owner()->ic_data_array())); |
| 2589 ReturnDefinition(BuildLoadExprTemp()); | 2589 ReturnDefinition(BuildLoadExprTemp()); |
| 2590 } | 2590 } |
| 2591 | 2591 |
| 2592 | 2592 |
| 2593 void EffectGraphVisitor::VisitStaticGetterNode(StaticGetterNode* node) { | 2593 void EffectGraphVisitor::VisitStaticGetterNode(StaticGetterNode* node) { |
| 2594 const String& getter_name = | 2594 const String& getter_name = |
| 2595 String::ZoneHandle(Field::GetterSymbol(node->field_name())); | 2595 String::ZoneHandle(Field::GetterSymbol(node->field_name())); |
| 2596 ZoneGrowableArray<PushArgumentInstr*>* arguments = | 2596 ZoneGrowableArray<PushArgumentInstr*>* arguments = |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2645 InvocationMirror::kTopLevel : | 2645 InvocationMirror::kTopLevel : |
| 2646 InvocationMirror::kStatic, | 2646 InvocationMirror::kStatic, |
| 2647 InvocationMirror::kGetter)); | 2647 InvocationMirror::kGetter)); |
| 2648 ReturnDefinition(call); | 2648 ReturnDefinition(call); |
| 2649 return; | 2649 return; |
| 2650 } | 2650 } |
| 2651 } | 2651 } |
| 2652 ASSERT(!getter_function.IsNull()); | 2652 ASSERT(!getter_function.IsNull()); |
| 2653 StaticCallInstr* call = new StaticCallInstr(node->token_pos(), | 2653 StaticCallInstr* call = new StaticCallInstr(node->token_pos(), |
| 2654 getter_function, | 2654 getter_function, |
| 2655 Array::ZoneHandle(), // No names. | 2655 Object::null_array(), // No names |
| 2656 arguments); | 2656 arguments); |
| 2657 ReturnDefinition(call); | 2657 ReturnDefinition(call); |
| 2658 } | 2658 } |
| 2659 | 2659 |
| 2660 | 2660 |
| 2661 void EffectGraphVisitor::BuildStaticSetter(StaticSetterNode* node, | 2661 void EffectGraphVisitor::BuildStaticSetter(StaticSetterNode* node, |
| 2662 bool result_is_needed) { | 2662 bool result_is_needed) { |
| 2663 const String& setter_name = | 2663 const String& setter_name = |
| 2664 String::ZoneHandle(Field::SetterSymbol(node->field_name())); | 2664 String::ZoneHandle(Field::SetterSymbol(node->field_name())); |
| 2665 ZoneGrowableArray<PushArgumentInstr*>* arguments = | 2665 ZoneGrowableArray<PushArgumentInstr*>* arguments = |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2712 Value* value = NULL; | 2712 Value* value = NULL; |
| 2713 if (result_is_needed) { | 2713 if (result_is_needed) { |
| 2714 value = Bind(BuildStoreExprTemp(for_value.value())); | 2714 value = Bind(BuildStoreExprTemp(for_value.value())); |
| 2715 } else { | 2715 } else { |
| 2716 value = for_value.value(); | 2716 value = for_value.value(); |
| 2717 } | 2717 } |
| 2718 arguments->Add(PushArgument(value)); | 2718 arguments->Add(PushArgument(value)); |
| 2719 | 2719 |
| 2720 call = new StaticCallInstr(node->token_pos(), | 2720 call = new StaticCallInstr(node->token_pos(), |
| 2721 setter_function, | 2721 setter_function, |
| 2722 Array::ZoneHandle(), // No names. | 2722 Object::null_array(), // No names. |
| 2723 arguments); | 2723 arguments); |
| 2724 } | 2724 } |
| 2725 if (result_is_needed) { | 2725 if (result_is_needed) { |
| 2726 Do(call); | 2726 Do(call); |
| 2727 ReturnDefinition(BuildLoadExprTemp()); | 2727 ReturnDefinition(BuildLoadExprTemp()); |
| 2728 } else { | 2728 } else { |
| 2729 ReturnDefinition(call); | 2729 ReturnDefinition(call); |
| 2730 } | 2730 } |
| 2731 } | 2731 } |
| 2732 | 2732 |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2933 | 2933 |
| 2934 ValueGraphVisitor for_index(owner(), temp_index()); | 2934 ValueGraphVisitor for_index(owner(), temp_index()); |
| 2935 node->index_expr()->Visit(&for_index); | 2935 node->index_expr()->Visit(&for_index); |
| 2936 Append(for_index); | 2936 Append(for_index); |
| 2937 arguments->Add(PushArgument(for_index.value())); | 2937 arguments->Add(PushArgument(for_index.value())); |
| 2938 | 2938 |
| 2939 if (super_function != NULL) { | 2939 if (super_function != NULL) { |
| 2940 // Generate static call to super operator. | 2940 // Generate static call to super operator. |
| 2941 StaticCallInstr* load = new StaticCallInstr(node->token_pos(), | 2941 StaticCallInstr* load = new StaticCallInstr(node->token_pos(), |
| 2942 *super_function, | 2942 *super_function, |
| 2943 Array::ZoneHandle(), | 2943 Object::null_array(), |
| 2944 arguments); | 2944 arguments); |
| 2945 ReturnDefinition(load); | 2945 ReturnDefinition(load); |
| 2946 } else { | 2946 } else { |
| 2947 // Generate dynamic call to index operator. | 2947 // Generate dynamic call to index operator. |
| 2948 const intptr_t checked_argument_count = 1; | 2948 const intptr_t checked_argument_count = 1; |
| 2949 InstanceCallInstr* load = new InstanceCallInstr(node->token_pos(), | 2949 InstanceCallInstr* load = new InstanceCallInstr(node->token_pos(), |
| 2950 Symbols::IndexToken(), | 2950 Symbols::IndexToken(), |
| 2951 Token::kINDEX, | 2951 Token::kINDEX, |
| 2952 arguments, | 2952 arguments, |
| 2953 Array::ZoneHandle(), | 2953 Object::null_array(), |
| 2954 checked_argument_count, | 2954 checked_argument_count, |
| 2955 owner()->ic_data_array()); | 2955 owner()->ic_data_array()); |
| 2956 ReturnDefinition(load); | 2956 ReturnDefinition(load); |
| 2957 } | 2957 } |
| 2958 } | 2958 } |
| 2959 | 2959 |
| 2960 | 2960 |
| 2961 Definition* EffectGraphVisitor::BuildStoreIndexedValues( | 2961 Definition* EffectGraphVisitor::BuildStoreIndexedValues( |
| 2962 StoreIndexedNode* node, | 2962 StoreIndexedNode* node, |
| 2963 bool result_is_needed) { | 2963 bool result_is_needed) { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3012 value = for_value.value(); | 3012 value = for_value.value(); |
| 3013 } | 3013 } |
| 3014 arguments->Add(PushArgument(value)); | 3014 arguments->Add(PushArgument(value)); |
| 3015 | 3015 |
| 3016 if (super_function != NULL) { | 3016 if (super_function != NULL) { |
| 3017 // Generate static call to super operator []=. | 3017 // Generate static call to super operator []=. |
| 3018 | 3018 |
| 3019 StaticCallInstr* store = | 3019 StaticCallInstr* store = |
| 3020 new StaticCallInstr(node->token_pos(), | 3020 new StaticCallInstr(node->token_pos(), |
| 3021 *super_function, | 3021 *super_function, |
| 3022 Array::ZoneHandle(), | 3022 Object::null_array(), |
| 3023 arguments); | 3023 arguments); |
| 3024 if (result_is_needed) { | 3024 if (result_is_needed) { |
| 3025 Do(store); | 3025 Do(store); |
| 3026 return BuildLoadExprTemp(); | 3026 return BuildLoadExprTemp(); |
| 3027 } else { | 3027 } else { |
| 3028 return store; | 3028 return store; |
| 3029 } | 3029 } |
| 3030 } else { | 3030 } else { |
| 3031 // Generate dynamic call to operator []=. | 3031 // Generate dynamic call to operator []=. |
| 3032 const intptr_t checked_argument_count = 3; | 3032 const intptr_t checked_argument_count = 3; |
| 3033 const String& name = | 3033 const String& name = |
| 3034 String::ZoneHandle(Symbols::New(Token::Str(Token::kASSIGN_INDEX))); | 3034 String::ZoneHandle(Symbols::New(Token::Str(Token::kASSIGN_INDEX))); |
| 3035 InstanceCallInstr* store = | 3035 InstanceCallInstr* store = |
| 3036 new InstanceCallInstr(node->token_pos(), | 3036 new InstanceCallInstr(node->token_pos(), |
| 3037 name, | 3037 name, |
| 3038 Token::kASSIGN_INDEX, | 3038 Token::kASSIGN_INDEX, |
| 3039 arguments, | 3039 arguments, |
| 3040 Array::ZoneHandle(), | 3040 Object::null_array(), |
| 3041 checked_argument_count, | 3041 checked_argument_count, |
| 3042 owner()->ic_data_array()); | 3042 owner()->ic_data_array()); |
| 3043 if (result_is_needed) { | 3043 if (result_is_needed) { |
| 3044 Do(store); | 3044 Do(store); |
| 3045 return BuildLoadExprTemp(); | 3045 return BuildLoadExprTemp(); |
| 3046 } else { | 3046 } else { |
| 3047 return store; | 3047 return store; |
| 3048 } | 3048 } |
| 3049 } | 3049 } |
| 3050 } | 3050 } |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3324 temp); | 3324 temp); |
| 3325 const Function& no_such_method_func = Function::ZoneHandle( | 3325 const Function& no_such_method_func = Function::ZoneHandle( |
| 3326 Resolver::ResolveDynamicAnyArgs(target_class, Symbols::NoSuchMethod())); | 3326 Resolver::ResolveDynamicAnyArgs(target_class, Symbols::NoSuchMethod())); |
| 3327 // We are guaranteed to find noSuchMethod of class Object. | 3327 // We are guaranteed to find noSuchMethod of class Object. |
| 3328 ASSERT(!no_such_method_func.IsNull()); | 3328 ASSERT(!no_such_method_func.IsNull()); |
| 3329 ZoneGrowableArray<PushArgumentInstr*>* push_arguments = | 3329 ZoneGrowableArray<PushArgumentInstr*>* push_arguments = |
| 3330 new ZoneGrowableArray<PushArgumentInstr*>(2); | 3330 new ZoneGrowableArray<PushArgumentInstr*>(2); |
| 3331 BuildPushArguments(*args, push_arguments); | 3331 BuildPushArguments(*args, push_arguments); |
| 3332 return new StaticCallInstr(args_pos, | 3332 return new StaticCallInstr(args_pos, |
| 3333 no_such_method_func, | 3333 no_such_method_func, |
| 3334 Array::ZoneHandle(), | 3334 Object::null_array(), |
| 3335 push_arguments); | 3335 push_arguments); |
| 3336 } | 3336 } |
| 3337 StaticCallInstr* EffectGraphVisitor::BuildThrowNoSuchMethodError( | 3337 StaticCallInstr* EffectGraphVisitor::BuildThrowNoSuchMethodError( |
| 3338 intptr_t token_pos, | 3338 intptr_t token_pos, |
| 3339 const Class& function_class, | 3339 const Class& function_class, |
| 3340 const String& function_name, | 3340 const String& function_name, |
| 3341 int invocation_type) { | 3341 int invocation_type) { |
| 3342 ZoneGrowableArray<PushArgumentInstr*>* arguments = | 3342 ZoneGrowableArray<PushArgumentInstr*>* arguments = |
| 3343 new ZoneGrowableArray<PushArgumentInstr*>(); | 3343 new ZoneGrowableArray<PushArgumentInstr*>(); |
| 3344 // Object receiver. | 3344 // Object receiver. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 3375 arguments->Add(PushArgument(existing_argument_names_value)); | 3375 arguments->Add(PushArgument(existing_argument_names_value)); |
| 3376 // Resolve and call NoSuchMethodError._throwNew. | 3376 // Resolve and call NoSuchMethodError._throwNew. |
| 3377 const Library& core_lib = Library::Handle(Library::CoreLibrary()); | 3377 const Library& core_lib = Library::Handle(Library::CoreLibrary()); |
| 3378 const Class& cls = Class::Handle( | 3378 const Class& cls = Class::Handle( |
| 3379 core_lib.LookupClass(Symbols::NoSuchMethodError())); | 3379 core_lib.LookupClass(Symbols::NoSuchMethodError())); |
| 3380 ASSERT(!cls.IsNull()); | 3380 ASSERT(!cls.IsNull()); |
| 3381 const Function& func = Function::ZoneHandle( | 3381 const Function& func = Function::ZoneHandle( |
| 3382 Resolver::ResolveStatic(cls, | 3382 Resolver::ResolveStatic(cls, |
| 3383 PrivateCoreLibName(Symbols::ThrowNew()), | 3383 PrivateCoreLibName(Symbols::ThrowNew()), |
| 3384 arguments->length(), | 3384 arguments->length(), |
| 3385 Array::ZoneHandle(), | 3385 Object::null_array(), |
| 3386 Resolver::kIsQualified)); | 3386 Resolver::kIsQualified)); |
| 3387 ASSERT(!func.IsNull()); | 3387 ASSERT(!func.IsNull()); |
| 3388 return new StaticCallInstr(token_pos, | 3388 return new StaticCallInstr(token_pos, |
| 3389 func, | 3389 func, |
| 3390 Array::ZoneHandle(), // No names. | 3390 Object::null_array(), // No names. |
| 3391 arguments); | 3391 arguments); |
| 3392 } | 3392 } |
| 3393 | 3393 |
| 3394 | 3394 |
| 3395 void EffectGraphVisitor::BuildThrowNode(ThrowNode* node) { | 3395 void EffectGraphVisitor::BuildThrowNode(ThrowNode* node) { |
| 3396 ValueGraphVisitor for_exception(owner(), temp_index()); | 3396 ValueGraphVisitor for_exception(owner(), temp_index()); |
| 3397 node->exception()->Visit(&for_exception); | 3397 node->exception()->Visit(&for_exception); |
| 3398 Append(for_exception); | 3398 Append(for_exception); |
| 3399 PushArgument(for_exception.value()); | 3399 PushArgument(for_exception.value()); |
| 3400 Instruction* instr = NULL; | 3400 Instruction* instr = NULL; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3511 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 3511 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
| 3512 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 3512 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
| 3513 OS::SNPrint(chars, len, kFormat, function_name, reason); | 3513 OS::SNPrint(chars, len, kFormat, function_name, reason); |
| 3514 const Error& error = Error::Handle( | 3514 const Error& error = Error::Handle( |
| 3515 LanguageError::New(String::Handle(String::New(chars)))); | 3515 LanguageError::New(String::Handle(String::New(chars)))); |
| 3516 Isolate::Current()->long_jump_base()->Jump(1, error); | 3516 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 3517 } | 3517 } |
| 3518 | 3518 |
| 3519 | 3519 |
| 3520 } // namespace dart | 3520 } // namespace dart |
| OLD | NEW |