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

Side by Side Diff: src/mips/simulator-mips.h

Issue 7062014: MIPS: Added the stop() instruction with same behavior as on Arm simulator. (Closed)
Patch Set: Created 9 years, 7 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
« no previous file with comments | « src/mips/macro-assembler-mips.cc ('k') | src/mips/simulator-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 uint64_t& u64hilo, 282 uint64_t& u64hilo,
283 int32_t& next_pc, 283 int32_t& next_pc,
284 bool& do_interrupt); 284 bool& do_interrupt);
285 285
286 void DecodeTypeImmediate(Instruction* instr); 286 void DecodeTypeImmediate(Instruction* instr);
287 void DecodeTypeJump(Instruction* instr); 287 void DecodeTypeJump(Instruction* instr);
288 288
289 // Used for breakpoints and traps. 289 // Used for breakpoints and traps.
290 void SoftwareInterrupt(Instruction* instr); 290 void SoftwareInterrupt(Instruction* instr);
291 291
292 // Stop helper functions.
Søren Thygesen Gjesse 2011/05/26 07:11:50 isWatchpoint with uppercase I (two more below).
293 bool isWatchpoint(uint32_t code);
294 void PrintWatchpoint(uint32_t code);
295 void HandleStop(uint32_t code, Instruction* instr);
296 bool isStopInstruction(Instruction* instr);
297 bool isEnabledStop(uint32_t code);
298 void EnableStop(uint32_t code);
299 void DisableStop(uint32_t code);
300 void IncreaseStopCounter(uint32_t code);
301 void PrintStopInfo(uint32_t code);
302
303
292 // Executes one instruction. 304 // Executes one instruction.
293 void InstructionDecode(Instruction* instr); 305 void InstructionDecode(Instruction* instr);
294 // Execute one instruction placed in a branch delay slot. 306 // Execute one instruction placed in a branch delay slot.
295 void BranchDelayInstructionDecode(Instruction* instr) { 307 void BranchDelayInstructionDecode(Instruction* instr) {
296 if (instr->IsForbiddenInBranchDelay()) { 308 if (instr->IsForbiddenInBranchDelay()) {
297 V8_Fatal(__FILE__, __LINE__, 309 V8_Fatal(__FILE__, __LINE__,
298 "Eror:Unexpected %i opcode in a branch delay slot.", 310 "Eror:Unexpected %i opcode in a branch delay slot.",
299 instr->OpcodeValue()); 311 instr->OpcodeValue());
300 } 312 }
301 InstructionDecode(instr); 313 InstructionDecode(instr);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 int break_count_; 359 int break_count_;
348 360
349 // Icache simulation. 361 // Icache simulation.
350 v8::internal::HashMap* i_cache_; 362 v8::internal::HashMap* i_cache_;
351 363
352 v8::internal::Isolate* isolate_; 364 v8::internal::Isolate* isolate_;
353 365
354 // Registered breakpoints. 366 // Registered breakpoints.
355 Instruction* break_pc_; 367 Instruction* break_pc_;
356 Instr break_instr_; 368 Instr break_instr_;
369
370 // Stop is disabled if bit 31 is set.
371 static const uint32_t kStopDisabledBit = 1 << 31;
372
373 // A stop is enabled, meaning the simulator will stop when meeting the
374 // instruction, if bit 31 of watched_stops[code].count is unset.
375 // The value watched_stops[code].count & ~(1 << 31) indicates how many times
376 // the breakpoint was hit or gone through.
377 struct StopCountAndDesc {
378 uint32_t count;
379 char* desc;
380 };
381 StopCountAndDesc watched_stops[kMaxStopCode + 1];
357 }; 382 };
358 383
359 384
360 // When running with the simulator transition into simulated execution at this 385 // When running with the simulator transition into simulated execution at this
361 // point. 386 // point.
362 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ 387 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \
363 reinterpret_cast<Object*>(Simulator::current(Isolate::Current())->Call( \ 388 reinterpret_cast<Object*>(Simulator::current(Isolate::Current())->Call( \
364 FUNCTION_ADDR(entry), 5, p0, p1, p2, p3, p4)) 389 FUNCTION_ADDR(entry), 5, p0, p1, p2, p3, p4))
365 390
366 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7) \ 391 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7) \
(...skipping 25 matching lines...) Expand all
392 static inline void UnregisterCTryCatch() { 417 static inline void UnregisterCTryCatch() {
393 Simulator::current(Isolate::Current())->PopAddress(); 418 Simulator::current(Isolate::Current())->PopAddress();
394 } 419 }
395 }; 420 };
396 421
397 } } // namespace v8::internal 422 } } // namespace v8::internal
398 423
399 #endif // !defined(USE_SIMULATOR) 424 #endif // !defined(USE_SIMULATOR)
400 #endif // V8_MIPS_SIMULATOR_MIPS_H_ 425 #endif // V8_MIPS_SIMULATOR_MIPS_H_
401 426
OLDNEW
« no previous file with comments | « src/mips/macro-assembler-mips.cc ('k') | src/mips/simulator-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698