| 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 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1393 } | 1393 } |
| 1394 } | 1394 } |
| 1395 | 1395 |
| 1396 if (locs->out(0).IsRegister()) { | 1396 if (locs->out(0).IsRegister()) { |
| 1397 // Fixed output registers are allowed to overlap with | 1397 // Fixed output registers are allowed to overlap with |
| 1398 // temps and inputs. | 1398 // temps and inputs. |
| 1399 blocked_registers[locs->out(0).reg()] = true; | 1399 blocked_registers[locs->out(0).reg()] = true; |
| 1400 } | 1400 } |
| 1401 | 1401 |
| 1402 // Allocate all unallocated input locations. | 1402 // Allocate all unallocated input locations. |
| 1403 const bool should_pop = !instr->IsPushArgument() && !instr->IsPushTemp(); | 1403 const bool should_pop = !instr->IsPushArgument(); |
| 1404 for (intptr_t i = locs->input_count() - 1; i >= 0; i--) { | 1404 for (intptr_t i = locs->input_count() - 1; i >= 0; i--) { |
| 1405 Location loc = locs->in(i); | 1405 Location loc = locs->in(i); |
| 1406 Register reg = kNoRegister; | 1406 Register reg = kNoRegister; |
| 1407 if (loc.IsRegister()) { | 1407 if (loc.IsRegister()) { |
| 1408 reg = loc.reg(); | 1408 reg = loc.reg(); |
| 1409 } else if (loc.IsUnallocated() || loc.IsConstant()) { | 1409 } else if (loc.IsUnallocated() || loc.IsConstant()) { |
| 1410 ASSERT(loc.IsConstant() || | 1410 ASSERT(loc.IsConstant() || |
| 1411 ((loc.policy() == Location::kRequiresRegister) || | 1411 ((loc.policy() == Location::kRequiresRegister) || |
| 1412 (loc.policy() == Location::kWritableRegister) || | 1412 (loc.policy() == Location::kWritableRegister) || |
| 1413 (loc.policy() == Location::kAny))); | 1413 (loc.policy() == Location::kAny))); |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1925 | 1925 |
| 1926 #if defined(DEBUG) && !defined(TARGET_ARCH_DBC) | 1926 #if defined(DEBUG) && !defined(TARGET_ARCH_DBC) |
| 1927 // TODO(vegorov) re-enable frame state tracking on DBC. It is | 1927 // TODO(vegorov) re-enable frame state tracking on DBC. It is |
| 1928 // currently disabled because it relies on LocationSummaries and | 1928 // currently disabled because it relies on LocationSummaries and |
| 1929 // we don't use them during unoptimized compilation on DBC. | 1929 // we don't use them during unoptimized compilation on DBC. |
| 1930 void FlowGraphCompiler::FrameStateUpdateWith(Instruction* instr) { | 1930 void FlowGraphCompiler::FrameStateUpdateWith(Instruction* instr) { |
| 1931 ASSERT(!is_optimizing()); | 1931 ASSERT(!is_optimizing()); |
| 1932 | 1932 |
| 1933 switch (instr->tag()) { | 1933 switch (instr->tag()) { |
| 1934 case Instruction::kPushArgument: | 1934 case Instruction::kPushArgument: |
| 1935 case Instruction::kPushTemp: | |
| 1936 // Do nothing. | 1935 // Do nothing. |
| 1937 break; | 1936 break; |
| 1938 | 1937 |
| 1939 case Instruction::kDropTemps: | 1938 case Instruction::kDropTemps: |
| 1940 FrameStatePop(instr->locs()->input_count() + | 1939 FrameStatePop(instr->locs()->input_count() + |
| 1941 instr->AsDropTemps()->num_temps()); | 1940 instr->AsDropTemps()->num_temps()); |
| 1942 break; | 1941 break; |
| 1943 | 1942 |
| 1944 default: | 1943 default: |
| 1945 FrameStatePop(instr->locs()->input_count()); | 1944 FrameStatePop(instr->locs()->input_count()); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1994 | 1993 |
| 1995 | 1994 |
| 1996 void FlowGraphCompiler::FrameStateClear() { | 1995 void FlowGraphCompiler::FrameStateClear() { |
| 1997 ASSERT(!is_optimizing()); | 1996 ASSERT(!is_optimizing()); |
| 1998 frame_state_.TruncateTo(0); | 1997 frame_state_.TruncateTo(0); |
| 1999 } | 1998 } |
| 2000 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC) | 1999 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC) |
| 2001 | 2000 |
| 2002 | 2001 |
| 2003 } // namespace dart | 2002 } // namespace dart |
| OLD | NEW |