Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: runtime/vm/flow_graph_allocator.cc

Issue 2987323003: [VM DBC compiler and simulator] Support reified generic functions. (Closed)
Patch Set: address comments Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/dart_entry.h ('k') | runtime/vm/flow_graph_compiler_dbc.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 #if !defined(DART_PRECOMPILED_RUNTIME) 5 #if !defined(DART_PRECOMPILED_RUNTIME)
6 6
7 #include "vm/flow_graph_allocator.h" 7 #include "vm/flow_graph_allocator.h"
8 8
9 #include "vm/bit_vector.h" 9 #include "vm/bit_vector.h"
10 #include "vm/flow_graph.h" 10 #include "vm/flow_graph.h"
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 ConvertAllUses(range); 697 ConvertAllUses(range);
698 return; 698 return;
699 } 699 }
700 #endif // defined(TARGET_ARCH_DBC) 700 #endif // defined(TARGET_ARCH_DBC)
701 range->set_assigned_location( 701 range->set_assigned_location(
702 Location::StackSlot(slot_index, param->base_reg())); 702 Location::StackSlot(slot_index, param->base_reg()));
703 range->set_spill_slot(Location::StackSlot(slot_index, param->base_reg())); 703 range->set_spill_slot(Location::StackSlot(slot_index, param->base_reg()));
704 704
705 } else if (defn->IsSpecialParameter()) { 705 } else if (defn->IsSpecialParameter()) {
706 SpecialParameterInstr* param = defn->AsSpecialParameter(); 706 SpecialParameterInstr* param = defn->AsSpecialParameter();
707 Location loc;
708 #if defined(TARGET_ARCH_DBC)
709 intptr_t slot_index = flow_graph_.num_copied_params();
710 ASSERT(-flow_graph_.parsed_function().first_stack_local_index() - 1 ==
711 slot_index);
712 if ((param->kind() == SpecialParameterInstr::kContext) &&
713 (flow_graph_.parsed_function().function_type_arguments() != NULL)) {
714 // The first slot is used for function type arguments, either as their
715 // permanent location or as their temporary location when captured.
716 // So use the next one for the context.
717 slot_index++;
regis 2017/08/14 23:29:19 If I remove this special handling on lines 712-718
Vyacheslav Egorov (Google) 2017/08/15 12:31:00 Actually if you change stuff here you need also to
regis 2017/08/15 22:01:53 That was it. Thanks! Yes, we have very few tests f
718 }
719 loc = Location::RegisterLocation(slot_index);
720 #else
707 if (param->kind() == SpecialParameterInstr::kContext) { 721 if (param->kind() == SpecialParameterInstr::kContext) {
708 #if !defined(TARGET_ARCH_DBC) 722 loc = Location::RegisterLocation(CTX);
709 const Register context_reg = CTX; 723 } else {
710 #else 724 ASSERT(param->kind() == SpecialParameterInstr::kTypeArgs);
711 const intptr_t context_reg = flow_graph_.num_copied_params(); 725 loc = Location::StackSlot(flow_graph_.num_copied_params(), FPREG);
712 #endif 726 range->set_assigned_location(loc);
727 range->set_spill_slot(loc);
728 }
729 #endif // defined(TARGET_ARCH_DBC)
713 730
731 if (loc.IsRegister()) {
714 AssignSafepoints(defn, range); 732 AssignSafepoints(defn, range);
715 range->finger()->Initialize(range); 733 range->set_assigned_location(loc);
716 range->set_assigned_location(Location::RegisterLocation(context_reg));
717 if (range->End() > kNormalEntryPos) { 734 if (range->End() > kNormalEntryPos) {
718 LiveRange* tail = range->SplitAt(kNormalEntryPos); 735 LiveRange* tail = range->SplitAt(kNormalEntryPos);
719 CompleteRange(tail, Location::kRegister); 736 CompleteRange(tail, Location::kRegister);
720 } 737 }
721 ConvertAllUses(range); 738 ConvertAllUses(range);
722 return; 739 return;
723 } 740 }
724 ASSERT(param->kind() == SpecialParameterInstr::kTypeArgs);
725 #if defined(TARGET_ARCH_DBC)
726 UNIMPLEMENTED();
727 #endif
728 const intptr_t slot_index = flow_graph_.num_copied_params();
729 range->set_assigned_location(Location::StackSlot(slot_index, FPREG));
730 range->set_spill_slot(Location::StackSlot(slot_index, FPREG));
731 } else { 741 } else {
732 ConstantInstr* constant = defn->AsConstant(); 742 ConstantInstr* constant = defn->AsConstant();
733 ASSERT(constant != NULL); 743 ASSERT(constant != NULL);
734 range->set_assigned_location(Location::Constant(constant)); 744 range->set_assigned_location(Location::Constant(constant));
735 range->set_spill_slot(Location::Constant(constant)); 745 range->set_spill_slot(Location::Constant(constant));
736 } 746 }
737 AssignSafepoints(defn, range); 747 AssignSafepoints(defn, range);
738 range->finger()->Initialize(range); 748 range->finger()->Initialize(range);
739 UsePosition* use = 749 UsePosition* use =
740 range->finger()->FirstRegisterBeneficialUse(block->start_pos()); 750 range->finger()->FirstRegisterBeneficialUse(block->start_pos());
(...skipping 2272 matching lines...) Expand 10 before | Expand all | Expand 10 after
3013 printer.PrintBlocks(); 3023 printer.PrintBlocks();
3014 #endif 3024 #endif
3015 } 3025 }
3016 THR_Print("----------------------------------------------\n"); 3026 THR_Print("----------------------------------------------\n");
3017 } 3027 }
3018 } 3028 }
3019 3029
3020 } // namespace dart 3030 } // namespace dart
3021 3031
3022 #endif // !defined(DART_PRECOMPILED_RUNTIME) 3032 #endif // !defined(DART_PRECOMPILED_RUNTIME)
OLDNEW
« no previous file with comments | « runtime/vm/dart_entry.h ('k') | runtime/vm/flow_graph_compiler_dbc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698