| 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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/code_generator.h" | 8 #include "vm/code_generator.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 2803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2814 | 2814 |
| 2815 void CodeGenerator::VisitCatchClauseNode(CatchClauseNode* node) { | 2815 void CodeGenerator::VisitCatchClauseNode(CatchClauseNode* node) { |
| 2816 // NOTE: The implicit variables ':saved_context', ':exception_var' | 2816 // NOTE: The implicit variables ':saved_context', ':exception_var' |
| 2817 // and ':stacktrace_var' can never be captured variables. | 2817 // and ':stacktrace_var' can never be captured variables. |
| 2818 // Restore CTX from local variable ':saved_context'. | 2818 // Restore CTX from local variable ':saved_context'. |
| 2819 GenerateLoadVariable(CTX, node->context_var()); | 2819 GenerateLoadVariable(CTX, node->context_var()); |
| 2820 | 2820 |
| 2821 // Restore ESP from EBP as we are coming from a throw and the code for | 2821 // Restore ESP from EBP as we are coming from a throw and the code for |
| 2822 // popping arguments has not been run. | 2822 // popping arguments has not been run. |
| 2823 ASSERT(locals_space_size() >= 0); | 2823 ASSERT(locals_space_size() >= 0); |
| 2824 __ movl(ESP, EBP); | 2824 if (locals_space_size() == 0) { |
| 2825 __ subl(ESP, Immediate(locals_space_size())); | 2825 __ movl(ESP, EBP); |
| 2826 } else { |
| 2827 __ leal(ESP, Address(EBP, -locals_space_size())); |
| 2828 } |
| 2826 | 2829 |
| 2827 // The JumpToExceptionHandler trampoline code sets up | 2830 // The JumpToExceptionHandler trampoline code sets up |
| 2828 // - the exception object in EAX (kExceptionObjectReg) | 2831 // - the exception object in EAX (kExceptionObjectReg) |
| 2829 // - the stacktrace object in register EDX (kStackTraceObjectReg) | 2832 // - the stacktrace object in register EDX (kStackTraceObjectReg) |
| 2830 // We now setup the exception object and the trace object | 2833 // We now setup the exception object and the trace object |
| 2831 // so that the handler code has access to these objects. | 2834 // so that the handler code has access to these objects. |
| 2832 GenerateStoreVariable(node->exception_var(), | 2835 GenerateStoreVariable(node->exception_var(), |
| 2833 kExceptionObjectReg, | 2836 kExceptionObjectReg, |
| 2834 kNoRegister); | 2837 kNoRegister); |
| 2835 GenerateStoreVariable(node->stacktrace_var(), | 2838 GenerateStoreVariable(node->stacktrace_var(), |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2967 const Error& error = Error::Handle( | 2970 const Error& error = Error::Handle( |
| 2968 Parser::FormatError(script, token_index, "Error", format, args)); | 2971 Parser::FormatError(script, token_index, "Error", format, args)); |
| 2969 va_end(args); | 2972 va_end(args); |
| 2970 Isolate::Current()->long_jump_base()->Jump(1, error); | 2973 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 2971 UNREACHABLE(); | 2974 UNREACHABLE(); |
| 2972 } | 2975 } |
| 2973 | 2976 |
| 2974 } // namespace dart | 2977 } // namespace dart |
| 2975 | 2978 |
| 2976 #endif // defined TARGET_ARCH_IA32 | 2979 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |