Index: src/ia32/macro-assembler-ia32.h |
diff --git a/src/ia32/macro-assembler-ia32.h b/src/ia32/macro-assembler-ia32.h |
index dd90650f6d588d63fa260a7f8bfd43399f64b63c..f57bdb7e866eb62bb23d76216f02e7c8b6b3ad21 100644 |
--- a/src/ia32/macro-assembler-ia32.h |
+++ b/src/ia32/macro-assembler-ia32.h |
@@ -71,6 +71,16 @@ class MacroAssembler: public Assembler { |
void Load(Register dst, const Operand& src, Representation r); |
void Store(Register src, const Operand& dst, Representation r); |
+ // Load a register with a long value as efficiently as possible. |
+ void Set(Register dst, int32_t x) { |
+ if (x == 0) { |
+ xor_(dst, dst); |
+ } else { |
+ mov(dst, Immediate(x)); |
+ } |
+ } |
+ void Set(const Operand& dst, int32_t x) { mov(dst, Immediate(x)); } |
+ |
// Operations on roots in the root-array. |
void LoadRoot(Register destination, Heap::RootListIndex index); |
void StoreRoot(Register source, Register scratch, Heap::RootListIndex index); |
@@ -79,6 +89,22 @@ class MacroAssembler: public Assembler { |
// and not in new space). |
void CompareRoot(Register with, Heap::RootListIndex index); |
void CompareRoot(const Operand& with, Heap::RootListIndex index); |
+ void PushRoot(Heap::RootListIndex index); |
+ |
+ // Compare the object in a register to a value and jump if they are equal. |
+ void JumpIfRoot(Register with, Heap::RootListIndex index, Label* if_equal, |
+ Label::Distance if_equal_distance = Label::kNear) { |
+ CompareRoot(with, index); |
+ j(equal, if_equal, if_equal_distance); |
+ } |
+ |
+ // Compare the object in a register to a value and jump if they are not equal. |
+ void JumpIfNotRoot(Register with, Heap::RootListIndex index, |
+ Label* if_not_equal, |
+ Label::Distance if_not_equal_distance = Label::kNear) { |
+ CompareRoot(with, index); |
+ j(not_equal, if_not_equal, if_not_equal_distance); |
+ } |
// --------------------------------------------------------------------------- |
// GC Support |
@@ -262,6 +288,9 @@ class MacroAssembler: public Assembler { |
// Find the function context up the context chain. |
void LoadContext(Register dst, int context_chain_length); |
+ // Load the global proxy from the current context. |
+ void LoadGlobalProxy(Register dst); |
+ |
// Conditionally load the cached Array transitioned map of type |
// transitioned_kind from the native context if the map in register |
// map_in_out is the cached Array map in the native context of |
@@ -565,6 +594,9 @@ class MacroAssembler: public Assembler { |
// Abort execution if argument is not a name, enabled via --debug-code. |
void AssertName(Register object); |
+ // Abort execution if argument is not a JSFunction, enabled via --debug-code. |
+ void AssertFunction(Register object); |
+ |
// Abort execution if argument is not undefined or an AllocationSite, enabled |
// via --debug-code. |
void AssertUndefinedOrAllocationSite(Register object); |
@@ -803,8 +835,14 @@ class MacroAssembler: public Assembler { |
void Drop(int element_count); |
void Call(Label* target) { call(target); } |
+ void Call(Handle<Code> target, RelocInfo::Mode rmode) { call(target, rmode); } |
+ void Jump(Handle<Code> target, RelocInfo::Mode rmode) { jmp(target, rmode); } |
void Push(Register src) { push(src); } |
+ void Push(const Operand& src) { push(src); } |
+ void Push(Immediate value) { push(value); } |
void Pop(Register dst) { pop(dst); } |
+ void PushReturnAddressFrom(Register src) { push(src); } |
+ void PopReturnAddressTo(Register dst) { pop(dst); } |
// Non-SSE2 instructions. |
void Pextrd(Register dst, XMMRegister src, int8_t imm8); |