Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(756)

Side by Side Diff: runtime/vm/simulator_mips.cc

Issue 14289006: Implements catch on MIPS. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <math.h> // for isnan. 5 #include <math.h> // for isnan.
6 #include <setjmp.h> 6 #include <setjmp.h>
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #if defined(TARGET_ARCH_MIPS) 10 #if defined(TARGET_ARCH_MIPS)
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 int32_t zap_dvalue = icount_; 987 int32_t zap_dvalue = icount_;
988 for (int i = F0; i <= F31; i++) { 988 for (int i = F0; i <= F31; i++) {
989 set_fregister(static_cast<FRegister>(i), zap_dvalue); 989 set_fregister(static_cast<FRegister>(i), zap_dvalue);
990 } 990 }
991 991
992 // Return. Subtract to account for pc_ increment after return. 992 // Return. Subtract to account for pc_ increment after return.
993 set_pc(saved_ra - Instr::kInstrSize); 993 set_pc(saved_ra - Instr::kInstrSize);
994 } else { 994 } else {
995 // Coming via long jump from a throw. Continue to exception handler. 995 // Coming via long jump from a throw. Continue to exception handler.
996 set_top_exit_frame_info(0); 996 set_top_exit_frame_info(0);
997 // Adjust for extra pc increment.
998 set_pc(get_pc() - Instr::kInstrSize);
997 } 999 }
998 } else { 1000 } else {
999 SimulatorDebugger dbg(this); 1001 SimulatorDebugger dbg(this);
1000 dbg.Stop(instr, "breakpoint"); 1002 dbg.Stop(instr, "breakpoint");
1001 // Adjust for extra pc increment. 1003 // Adjust for extra pc increment.
1002 set_pc(get_pc() - Instr::kInstrSize); 1004 set_pc(get_pc() - Instr::kInstrSize);
1003 } 1005 }
1004 } 1006 }
1005 1007
1006 1008
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
1831 // Restore callee-saved registers with the original value. 1833 // Restore callee-saved registers with the original value.
1832 set_register(R16, r16_val); 1834 set_register(R16, r16_val);
1833 set_register(R17, r17_val); 1835 set_register(R17, r17_val);
1834 set_register(R18, r18_val); 1836 set_register(R18, r18_val);
1835 set_register(R19, r19_val); 1837 set_register(R19, r19_val);
1836 set_register(R20, r20_val); 1838 set_register(R20, r20_val);
1837 set_register(R21, r21_val); 1839 set_register(R21, r21_val);
1838 set_register(R22, r22_val); 1840 set_register(R22, r22_val);
1839 set_register(R23, r23_val); 1841 set_register(R23, r23_val);
1840 1842
1841 // Restore the SP register and return R1:R0. 1843 // Restore the SP register and return V1:V0.
1842 set_register(SP, sp_before_call); 1844 set_register(SP, sp_before_call);
1843 return Utils::LowHighTo64Bits(get_register(V0), get_register(V1)); 1845 return Utils::LowHighTo64Bits(get_register(V0), get_register(V1));
1844 } 1846 }
1845 1847
1846 1848
1847 void Simulator::Longjmp(uword pc, 1849 void Simulator::Longjmp(uword pc,
1848 uword sp, 1850 uword sp,
1849 uword fp, 1851 uword fp,
1850 RawObject* raw_exception, 1852 RawObject* raw_exception,
1851 RawObject* raw_stacktrace) { 1853 RawObject* raw_stacktrace) {
(...skipping 25 matching lines...) Expand all
1877 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); 1879 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace));
1878 } 1880 }
1879 buf->Longjmp(); 1881 buf->Longjmp();
1880 } 1882 }
1881 1883
1882 } // namespace dart 1884 } // namespace dart
1883 1885
1884 #endif // !defined(HOST_ARCH_MIPS) 1886 #endif // !defined(HOST_ARCH_MIPS)
1885 1887
1886 #endif // defined TARGET_ARCH_MIPS 1888 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698