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/globals.h" // Needed here to get TARGET_ARCH_XXX. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX. |
6 | 6 |
7 #include "vm/flow_graph_compiler.h" | 7 #include "vm/flow_graph_compiler.h" |
8 | 8 |
9 #include "vm/cha.h" | 9 #include "vm/cha.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 StubCode::ThreeArgsOptimizedCheckInlineCacheEntryPoint(); | 527 StubCode::ThreeArgsOptimizedCheckInlineCacheEntryPoint(); |
528 break; | 528 break; |
529 default: | 529 default: |
530 UNIMPLEMENTED(); | 530 UNIMPLEMENTED(); |
531 } | 531 } |
532 ExternalLabel target_label("InlineCache", label_address); | 532 ExternalLabel target_label("InlineCache", label_address); |
533 EmitOptimizedInstanceCall(&target_label, ic_data, arguments_descriptor, | 533 EmitOptimizedInstanceCall(&target_label, ic_data, arguments_descriptor, |
534 argument_count, deopt_id, token_pos, locs); | 534 argument_count, deopt_id, token_pos, locs); |
535 return; | 535 return; |
536 } | 536 } |
| 537 |
537 if (is_optimizing()) { | 538 if (is_optimizing()) { |
538 // Megamorphic call requires one argument ICData. | 539 EmitMegamorphicInstanceCall(ic_data, arguments_descriptor, argument_count, |
539 ASSERT(ic_data.num_args_tested() == 1); | 540 deopt_id, token_pos, locs); |
540 label_address = StubCode::MegamorphicCallEntryPoint(); | 541 return; |
541 } else { | 542 } |
542 switch (ic_data.num_args_tested()) { | 543 |
543 case 1: | 544 switch (ic_data.num_args_tested()) { |
544 label_address = StubCode::OneArgCheckInlineCacheEntryPoint(); | 545 case 1: |
545 break; | 546 label_address = StubCode::OneArgCheckInlineCacheEntryPoint(); |
546 case 2: | 547 break; |
547 label_address = StubCode::TwoArgsCheckInlineCacheEntryPoint(); | 548 case 2: |
548 break; | 549 label_address = StubCode::TwoArgsCheckInlineCacheEntryPoint(); |
549 case 3: | 550 break; |
550 label_address = StubCode::ThreeArgsCheckInlineCacheEntryPoint(); | 551 case 3: |
551 break; | 552 label_address = StubCode::ThreeArgsCheckInlineCacheEntryPoint(); |
552 default: | 553 break; |
553 UNIMPLEMENTED(); | 554 default: |
554 } | 555 UNIMPLEMENTED(); |
555 } | 556 } |
556 ExternalLabel target_label("InlineCache", label_address); | 557 ExternalLabel target_label("InlineCache", label_address); |
557 EmitInstanceCall(&target_label, ic_data, arguments_descriptor, argument_count, | 558 EmitInstanceCall(&target_label, ic_data, arguments_descriptor, argument_count, |
558 deopt_id, token_pos, locs); | 559 deopt_id, token_pos, locs); |
559 } | 560 } |
560 | 561 |
561 | 562 |
562 void FlowGraphCompiler::GenerateStaticCall(intptr_t deopt_id, | 563 void FlowGraphCompiler::GenerateStaticCall(intptr_t deopt_id, |
563 intptr_t token_pos, | 564 intptr_t token_pos, |
564 const Function& function, | 565 const Function& function, |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1029 const AbstractTypeArguments& type_arguments = | 1030 const AbstractTypeArguments& type_arguments = |
1030 AbstractTypeArguments::Handle(type.arguments()); | 1031 AbstractTypeArguments::Handle(type.arguments()); |
1031 const bool is_raw_type = type_arguments.IsNull() || | 1032 const bool is_raw_type = type_arguments.IsNull() || |
1032 type_arguments.IsRaw(type_arguments.Length()); | 1033 type_arguments.IsRaw(type_arguments.Length()); |
1033 return is_raw_type; | 1034 return is_raw_type; |
1034 } | 1035 } |
1035 return true; | 1036 return true; |
1036 } | 1037 } |
1037 | 1038 |
1038 } // namespace dart | 1039 } // namespace dart |
OLD | NEW |