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

Unified Diff: src/mips/macro-assembler-mips.h

Issue 9372063: MIPS: Enable serialization for MIPS architecture. (Closed)
Patch Set: Rework on serialization handling of root references. Created 8 years, 9 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
Index: src/mips/macro-assembler-mips.h
diff --git a/src/mips/macro-assembler-mips.h b/src/mips/macro-assembler-mips.h
index 6ae8657e1e6399114a0ebddbb62f2421d7ed8dcd..0be5df2cd1eb51a8c42dfa6b564f0c4564e2ceef 100644
--- a/src/mips/macro-assembler-mips.h
+++ b/src/mips/macro-assembler-mips.h
@@ -81,6 +81,16 @@ enum BranchDelaySlot {
PROTECT
};
+// Flags used for the li macro-assembler function.
+enum LiFlags {
+ // If the constant value can be represented in just 16 bits, then
+ // optimize the li to use a single instruction, rather than lui/ori pair.
+ OPTIMIZE_SIZE = 0,
+ // Always use 2 instructions (lui/ori pair), even if the constant could
+ // be loaded with just one, so that this value is patchable later.
+ CONSTANT_SIZE = 1
+};
+
enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET };
enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK };
@@ -184,6 +194,9 @@ class MacroAssembler: public Assembler {
Ret(cond, rs, rt, bd);
}
+ void Branch(Label* L, Condition cond, Register rs, Heap::RootListIndex index,
+ BranchDelaySlot bdslot = PROTECT);
+
#undef COND_ARGS
// Emit code to discard a non-negative number of pointer-sized elements
@@ -237,7 +250,7 @@ class MacroAssembler: public Assembler {
Branch(L);
}
-
+ int FindRootIndex(Object* heap_object);
Erik Corry 2012/03/17 02:49:18 I got rid of this.
// Load an object from the root table.
void LoadRoot(Register destination,
Heap::RootListIndex index);
@@ -568,12 +581,13 @@ class MacroAssembler: public Assembler {
void mov(Register rd, Register rt) { or_(rd, rt, zero_reg); }
// Load int32 in the rd register.
- void li(Register rd, Operand j, bool gen2instr = false);
- inline void li(Register rd, int32_t j, bool gen2instr = false) {
- li(rd, Operand(j), gen2instr);
+ void li(Register rd, Operand j, LiFlags mode = OPTIMIZE_SIZE);
+ inline void li(Register rd, int32_t j, LiFlags mode = OPTIMIZE_SIZE) {
+ li(rd, Operand(j), mode);
}
- inline void li(Register dst, Handle<Object> value, bool gen2instr = false) {
- li(dst, Operand(value), gen2instr);
+ inline void li(Register dst, Handle<Object> value,
+ LiFlags mode = OPTIMIZE_SIZE) {
+ li(dst, Operand(value), mode);
}
// Push multiple registers on the stack.

Powered by Google App Engine
This is Rietveld 408576698