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

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

Issue 811823002: Support remaping of pair location inside materializations for slow paths. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 | Annotate | Revision Log
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 #include "vm/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/cpu.h" 8 #include "vm/cpu.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/flow_graph_allocator.h" 10 #include "vm/flow_graph_allocator.h"
(...skipping 2686 matching lines...) Expand 10 before | Expand all | Expand 10 after
2697 } 2697 }
2698 2698
2699 2699
2700 void MaterializeObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2700 void MaterializeObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2701 UNREACHABLE(); 2701 UNREACHABLE();
2702 } 2702 }
2703 2703
2704 2704
2705 // This function should be kept in sync with 2705 // This function should be kept in sync with
2706 // FlowGraphCompiler::SlowPathEnvironmentFor(). 2706 // FlowGraphCompiler::SlowPathEnvironmentFor().
2707 void MaterializeObjectInstr::RemapRegisters(intptr_t* fpu_reg_slots, 2707 void MaterializeObjectInstr::RemapRegisters(intptr_t* cpu_reg_slots,
2708 intptr_t* cpu_reg_slots) { 2708 intptr_t* fpu_reg_slots) {
2709 if (registers_remapped_) { 2709 if (registers_remapped_) {
2710 return; 2710 return;
2711 } 2711 }
2712 registers_remapped_ = true; 2712 registers_remapped_ = true;
2713 2713
2714 for (intptr_t i = 0; i < InputCount(); i++) { 2714 for (intptr_t i = 0; i < InputCount(); i++) {
2715 Location loc = LocationAt(i); 2715 locations_[i] = LocationAt(i).RemapForSlowPath(
2716 if (loc.IsRegister()) { 2716 InputAt(i)->definition(), cpu_reg_slots, fpu_reg_slots);
2717 intptr_t index = cpu_reg_slots[loc.reg()];
2718 ASSERT(index >= 0);
2719 locations_[i] = Location::StackSlot(index);
2720 } else if (loc.IsFpuRegister()) {
2721 intptr_t index = fpu_reg_slots[loc.fpu_reg()];
2722 ASSERT(index >= 0);
2723 Value* value = InputAt(i);
2724 switch (value->definition()->representation()) {
2725 case kUnboxedDouble:
2726 locations_[i] = Location::DoubleStackSlot(index);
2727 break;
2728 case kUnboxedFloat32x4:
2729 case kUnboxedInt32x4:
2730 case kUnboxedFloat64x2:
2731 locations_[i] = Location::QuadStackSlot(index);
2732 break;
2733 default:
2734 UNREACHABLE();
2735 }
2736 } else if (loc.IsPairLocation()) {
2737 UNREACHABLE();
2738 } else if (loc.IsInvalid() &&
2739 InputAt(i)->definition()->IsMaterializeObject()) {
2740 InputAt(i)->definition()->AsMaterializeObject()->RemapRegisters(
2741 fpu_reg_slots, cpu_reg_slots);
2742 }
2743 } 2717 }
2744 } 2718 }
2745 2719
2746 2720
2747 LocationSummary* CurrentContextInstr::MakeLocationSummary(Isolate* isolate, 2721 LocationSummary* CurrentContextInstr::MakeLocationSummary(Isolate* isolate,
2748 bool opt) const { 2722 bool opt) const {
2749 // Only appears in initial definitions, never in normal code. 2723 // Only appears in initial definitions, never in normal code.
2750 UNREACHABLE(); 2724 UNREACHABLE();
2751 return NULL; 2725 return NULL;
2752 } 2726 }
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
3494 case Token::kTRUNCDIV: return 0; 3468 case Token::kTRUNCDIV: return 0;
3495 case Token::kMOD: return 1; 3469 case Token::kMOD: return 1;
3496 default: UNIMPLEMENTED(); return -1; 3470 default: UNIMPLEMENTED(); return -1;
3497 } 3471 }
3498 } 3472 }
3499 3473
3500 3474
3501 #undef __ 3475 #undef __
3502 3476
3503 } // namespace dart 3477 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698