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

Unified Diff: runtime/vm/constants_mips.h

Issue 14284020: Adds support for debugger API 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/code_patcher_mips.cc ('k') | runtime/vm/debugger_api_impl_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/constants_mips.h
===================================================================
--- runtime/vm/constants_mips.h (revision 21950)
+++ runtime/vm/constants_mips.h (working copy)
@@ -5,6 +5,8 @@
#ifndef VM_CONSTANTS_MIPS_H_
#define VM_CONSTANTS_MIPS_H_
+#include "platform/assert.h"
+
namespace dart {
enum Register {
@@ -412,6 +414,25 @@
*reinterpret_cast<int32_t*>(this) = value;
}
+ inline void SetImmInstrBits(Opcode op, Register rs, Register rt,
+ uint16_t imm) {
+ SetInstructionBits(
+ op << kOpcodeShift |
+ rs << kRsShift |
+ rt << kRtShift |
+ imm << kImmShift);
+ }
+
+ inline void SetSpecialInstrBits(SpecialFunction f,
+ Register rs, Register rt, Register rd) {
+ SetInstructionBits(
+ SPECIAL << kOpcodeShift |
+ f << kFunctionShift |
+ rs << kRsShift |
+ rt << kRtShift |
+ rd << kRdShift);
+ }
+
// Read one particular bit out of the instruction bits.
inline int32_t Bit(int nr) const {
return (InstructionBits() >> nr) & 1;
@@ -502,6 +523,21 @@
// Use the At(pc) function to create references to Instr.
static Instr* At(uword pc) { return reinterpret_cast<Instr*>(pc); }
+#if defined(DEBUG)
+ inline void AssertIsImmInstr(Opcode op, Register rs, Register rt,
+ int32_t imm) {
+ ASSERT((OpcodeField() == op) && (RsField() == rs) && (RtField() == rt) &&
+ (SImmField() == imm));
+ }
+
+ inline void AssertIsSpecialInstr(SpecialFunction f, Register rs, Register rt,
+ Register rd) {
+ ASSERT((OpcodeField() == SPECIAL) && (FunctionField() == f) &&
+ (RsField() == rs) && (RtField() == rt) &&
+ (RdField() == rd));
+ }
+#endif // defined(DEBUG)
+
private:
DISALLOW_ALLOCATION();
DISALLOW_IMPLICIT_CONSTRUCTORS(Instr);
« no previous file with comments | « runtime/vm/code_patcher_mips.cc ('k') | runtime/vm/debugger_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698