OLD | NEW |
---|---|
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/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/bit_vector.h" | 9 #include "vm/bit_vector.h" |
10 #include "vm/cha.h" | 10 #include "vm/cha.h" |
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
840 (registers->FpuRegisterCount() * kFpuRegisterSpillFactor); | 840 (registers->FpuRegisterCount() * kFpuRegisterSpillFactor); |
841 | 841 |
842 BitmapBuilder* bitmap = locs->stack_bitmap(); | 842 BitmapBuilder* bitmap = locs->stack_bitmap(); |
843 | 843 |
844 // An instruction may have two safepoints in deferred code. The | 844 // An instruction may have two safepoints in deferred code. The |
845 // call to RecordSafepoint has the side-effect of appending the live | 845 // call to RecordSafepoint has the side-effect of appending the live |
846 // registers to the bitmap. This is why the second call to RecordSafepoint | 846 // registers to the bitmap. This is why the second call to RecordSafepoint |
847 // with the same instruction (and same location summary) sees a bitmap that | 847 // with the same instruction (and same location summary) sees a bitmap that |
848 // is larger that StackSize(). It will never be larger than StackSize() + | 848 // is larger that StackSize(). It will never be larger than StackSize() + |
849 // live_registers_size. | 849 // live_registers_size. |
850 ASSERT(bitmap->Length() <= (spill_area_size + live_registers_size)); | |
851 // The first safepoint will grow the bitmap to be the size of | 850 // The first safepoint will grow the bitmap to be the size of |
852 // spill_area_size but the second safepoint will truncate the bitmap and | 851 // spill_area_size but the second safepoint will truncate the bitmap and |
853 // append the live registers to it again. The bitmap produced by both calls | 852 // append the live registers to it again. The bitmap produced by both calls |
854 // will be the same. | 853 // will be the same. |
855 bitmap->SetLength(spill_area_size); | 854 #if !defined(TARGET_ARCH_DBC) |
zra
2016/10/04 15:22:48
Don't you still need this line in non-DBC?
Florian Schneider
2016/10/04 17:01:04
Oops, yes of course. Thanks!
| |
855 ASSERT(bitmap->Length() <= (spill_area_size + live_registers_size)); | |
856 #else | |
857 if (bitmap->Length() <= (spill_area_size + live_registers_size)) { | |
858 bitmap->SetLength(Utils::Maximum(bitmap->Length(), spill_area_size)); | |
859 } | |
860 #endif | |
856 | 861 |
857 // Mark the bits in the stack map in the same order we push registers in | 862 // Mark the bits in the stack map in the same order we push registers in |
858 // slow path code (see FlowGraphCompiler::SaveLiveRegisters). | 863 // slow path code (see FlowGraphCompiler::SaveLiveRegisters). |
859 // | 864 // |
860 // Slow path code can have registers at the safepoint. | 865 // Slow path code can have registers at the safepoint. |
861 if (!locs->always_calls()) { | 866 if (!locs->always_calls()) { |
862 RegisterSet* regs = locs->live_registers(); | 867 RegisterSet* regs = locs->live_registers(); |
863 if (regs->FpuRegisterCount() > 0) { | 868 if (regs->FpuRegisterCount() > 0) { |
864 // Denote FPU registers with 0 bits in the stackmap. Based on the | 869 // Denote FPU registers with 0 bits in the stackmap. Based on the |
865 // assumption that there are normally few live FPU registers, this | 870 // assumption that there are normally few live FPU registers, this |
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1995 | 2000 |
1996 | 2001 |
1997 void FlowGraphCompiler::FrameStateClear() { | 2002 void FlowGraphCompiler::FrameStateClear() { |
1998 ASSERT(!is_optimizing()); | 2003 ASSERT(!is_optimizing()); |
1999 frame_state_.TruncateTo(0); | 2004 frame_state_.TruncateTo(0); |
2000 } | 2005 } |
2001 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC) | 2006 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC) |
2002 | 2007 |
2003 | 2008 |
2004 } // namespace dart | 2009 } // namespace dart |
OLD | NEW |