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