| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1133 } | 1133 } |
| 1134 | 1134 |
| 1135 | 1135 |
| 1136 // Restore stack and initialize the two exception variables: | 1136 // Restore stack and initialize the two exception variables: |
| 1137 // exception and stack trace variables. | 1137 // exception and stack trace variables. |
| 1138 void FlowGraphCompiler::VisitCatchEntry(CatchEntryComp* comp) { | 1138 void FlowGraphCompiler::VisitCatchEntry(CatchEntryComp* comp) { |
| 1139 // Restore RSP from RBP as we are coming from a throw and the code for | 1139 // Restore RSP from RBP as we are coming from a throw and the code for |
| 1140 // popping arguments has not been run. | 1140 // popping arguments has not been run. |
| 1141 const intptr_t locals_space_size = StackSize() * kWordSize; | 1141 const intptr_t locals_space_size = StackSize() * kWordSize; |
| 1142 ASSERT(locals_space_size >= 0); | 1142 ASSERT(locals_space_size >= 0); |
| 1143 __ movq(RSP, RBP); | 1143 if (locals_space_size == 0) { |
| 1144 __ subq(RSP, Immediate(locals_space_size)); | 1144 __ movq(RSP, RBP); |
| 1145 } else { |
| 1146 __ leaq(RSP, Address(RBP, -locals_space_size)); |
| 1147 } |
| 1145 | 1148 |
| 1146 ASSERT(!comp->exception_var().is_captured()); | 1149 ASSERT(!comp->exception_var().is_captured()); |
| 1147 ASSERT(!comp->stacktrace_var().is_captured()); | 1150 ASSERT(!comp->stacktrace_var().is_captured()); |
| 1148 __ movq(Address(RBP, comp->exception_var().index() * kWordSize), | 1151 __ movq(Address(RBP, comp->exception_var().index() * kWordSize), |
| 1149 kExceptionObjectReg); | 1152 kExceptionObjectReg); |
| 1150 __ movq(Address(RBP, comp->stacktrace_var().index() * kWordSize), | 1153 __ movq(Address(RBP, comp->stacktrace_var().index() * kWordSize), |
| 1151 kStackTraceObjectReg); | 1154 kStackTraceObjectReg); |
| 1152 } | 1155 } |
| 1153 | 1156 |
| 1154 | 1157 |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1722 ASSERT(exception_handlers_list_ != NULL); | 1725 ASSERT(exception_handlers_list_ != NULL); |
| 1723 const ExceptionHandlers& handlers = ExceptionHandlers::Handle( | 1726 const ExceptionHandlers& handlers = ExceptionHandlers::Handle( |
| 1724 exception_handlers_list_->FinalizeExceptionHandlers(code.EntryPoint())); | 1727 exception_handlers_list_->FinalizeExceptionHandlers(code.EntryPoint())); |
| 1725 code.set_exception_handlers(handlers); | 1728 code.set_exception_handlers(handlers); |
| 1726 } | 1729 } |
| 1727 | 1730 |
| 1728 | 1731 |
| 1729 } // namespace dart | 1732 } // namespace dart |
| 1730 | 1733 |
| 1731 #endif // defined TARGET_ARCH_X64 | 1734 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |