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

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

Issue 18055006: - Protect against icount_ overflow in the delay slot and only (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2010 matching lines...) Expand 10 before | Expand all | Expand 10 after
2021 } 2021 }
2022 pc_ += Instr::kInstrSize; 2022 pc_ += Instr::kInstrSize;
2023 } 2023 }
2024 2024
2025 2025
2026 void Simulator::ExecuteDelaySlot() { 2026 void Simulator::ExecuteDelaySlot() {
2027 ASSERT(pc_ != kEndSimulatingPC); 2027 ASSERT(pc_ != kEndSimulatingPC);
2028 delay_slot_ = true; 2028 delay_slot_ = true;
2029 icount_++; 2029 icount_++;
2030 Instr* instr = Instr::At(pc_ + Instr::kInstrSize); 2030 Instr* instr = Instr::At(pc_ + Instr::kInstrSize);
2031 if (icount_ == FLAG_stop_sim_at) { 2031 if ((FLAG_stop_sim_at != 0) && (icount_ == FLAG_stop_sim_at)) {
2032 SimulatorDebugger dbg(this); 2032 SimulatorDebugger dbg(this);
2033 dbg.Stop(instr, "Instruction count reached"); 2033 dbg.Stop(instr, "Instruction count reached");
2034 } 2034 }
2035 InstructionDecode(instr); 2035 InstructionDecode(instr);
2036 delay_slot_ = false; 2036 delay_slot_ = false;
2037 } 2037 }
2038 2038
2039 2039
2040 void Simulator::Execute() { 2040 void Simulator::Execute() {
2041 if (FLAG_stop_sim_at == 0) { 2041 if (FLAG_stop_sim_at == 0) {
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
2228 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); 2228 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception));
2229 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); 2229 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace));
2230 buf->Longjmp(); 2230 buf->Longjmp();
2231 } 2231 }
2232 2232
2233 } // namespace dart 2233 } // namespace dart
2234 2234
2235 #endif // !defined(HOST_ARCH_MIPS) 2235 #endif // !defined(HOST_ARCH_MIPS)
2236 2236
2237 #endif // defined TARGET_ARCH_MIPS 2237 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698