| 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/snapshot.h" | 5 #include "vm/snapshot.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "vm/bootstrap.h" | 8 #include "vm/bootstrap.h" |
| 9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
| 10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
| (...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 assembly_stream_.Print(".fnstart\n"); | 974 assembly_stream_.Print(".fnstart\n"); |
| 975 assembly_stream_.Print(".save {r7, lr}\n"); | 975 assembly_stream_.Print(".save {r7, lr}\n"); |
| 976 assembly_stream_.Print(".setfp r7, sp, #0\n"); | 976 assembly_stream_.Print(".setfp r7, sp, #0\n"); |
| 977 #else | 977 #else |
| 978 COMPILE_ASSERT(FP == R11); | 978 COMPILE_ASSERT(FP == R11); |
| 979 assembly_stream_.Print(".fnstart\n"); | 979 assembly_stream_.Print(".fnstart\n"); |
| 980 assembly_stream_.Print(".save {r11, lr}\n"); | 980 assembly_stream_.Print(".save {r11, lr}\n"); |
| 981 assembly_stream_.Print(".setfp r11, sp, #0\n"); | 981 assembly_stream_.Print(".setfp r11, sp, #0\n"); |
| 982 #endif | 982 #endif |
| 983 | 983 |
| 984 #elif defined(TARGET_ARCH_MIPS) | |
| 985 COMPILE_ASSERT(FP == R30); | |
| 986 COMPILE_ASSERT(RA == R31); | |
| 987 assembly_stream_.Print(".cfi_def_cfa r30, 0\n"); // CFA is fp+0 | |
| 988 assembly_stream_.Print(".cfi_offset r30, 0\n"); // saved fp is *(CFA+0) | |
| 989 assembly_stream_.Print(".cfi_offset r31, 4\n"); // saved pc is *(CFA+4) | |
| 990 // saved sp is CFA+16 | |
| 991 // Should be ".cfi_value_offset sp, 8", but requires gcc newer than late | |
| 992 // 2016 and not supported by Android's libunwind. | |
| 993 // DW_CFA_expression 0x10 | |
| 994 // uleb128 register (sp) 29 | |
| 995 // uleb128 size of operation 2 | |
| 996 // DW_OP_plus_uconst 0x23 | |
| 997 // uleb128 addend 8 | |
| 998 assembly_stream_.Print(".cfi_escape 0x10, 29, 2, 0x23, 8\n"); | |
| 999 #endif | 984 #endif |
| 1000 } | 985 } |
| 1001 | 986 |
| 1002 | 987 |
| 1003 void AssemblyImageWriter::FrameUnwindEpilogue() { | 988 void AssemblyImageWriter::FrameUnwindEpilogue() { |
| 1004 #if defined(TARGET_ARCH_ARM) | 989 #if defined(TARGET_ARCH_ARM) |
| 1005 assembly_stream_.Print(".fnend\n"); | 990 assembly_stream_.Print(".fnend\n"); |
| 1006 #endif | 991 #endif |
| 1007 assembly_stream_.Print(".cfi_endproc\n"); | 992 assembly_stream_.Print(".cfi_endproc\n"); |
| 1008 } | 993 } |
| (...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2010 *buffer_len_ = BytesWritten(); | 1995 *buffer_len_ = BytesWritten(); |
| 2011 } | 1996 } |
| 2012 } else { | 1997 } else { |
| 2013 FreeBuffer(); | 1998 FreeBuffer(); |
| 2014 ThrowException(exception_type(), exception_msg()); | 1999 ThrowException(exception_type(), exception_msg()); |
| 2015 } | 2000 } |
| 2016 } | 2001 } |
| 2017 | 2002 |
| 2018 | 2003 |
| 2019 } // namespace dart | 2004 } // namespace dart |
| OLD | NEW |