diff options
Diffstat (limited to 'deps/v8/src/mips64/macro-assembler-mips64.h')
-rw-r--r-- | deps/v8/src/mips64/macro-assembler-mips64.h | 99 |
1 files changed, 47 insertions, 52 deletions
diff --git a/deps/v8/src/mips64/macro-assembler-mips64.h b/deps/v8/src/mips64/macro-assembler-mips64.h index f2d36e22e2..5dfee07ad9 100644 --- a/deps/v8/src/mips64/macro-assembler-mips64.h +++ b/deps/v8/src/mips64/macro-assembler-mips64.h @@ -116,6 +116,13 @@ bool AreAliased(Register reg1, // ----------------------------------------------------------------------------- // Static helper functions. +#if defined(V8_TARGET_LITTLE_ENDIAN) +#define SmiWordOffset(offset) (offset + kPointerSize / 2) +#else +#define SmiWordOffset(offset) offset +#endif + + inline MemOperand ContextOperand(Register context, int index) { return MemOperand(context, Context::SlotOffset(index)); } @@ -133,9 +140,9 @@ inline MemOperand FieldMemOperand(Register object, int offset) { inline MemOperand UntagSmiMemOperand(Register rm, int offset) { - // Assumes that Smis are shifted by 32 bits and little endianness. + // Assumes that Smis are shifted by 32 bits. STATIC_ASSERT(kSmiShift == 32); - return MemOperand(rm, offset + (kSmiShift / kBitsPerByte)); + return MemOperand(rm, SmiWordOffset(offset)); } @@ -254,6 +261,8 @@ class MacroAssembler: public Assembler { void Call(Label* target); + void Move(Register dst, Smi* smi) { li(dst, Operand(smi)); } + inline void Move(Register dst, Register src) { if (!dst.is(src)) { mov(dst, src); @@ -313,6 +322,24 @@ class MacroAssembler: public Assembler { void Load(Register dst, const MemOperand& src, Representation r); void Store(Register src, const MemOperand& dst, Representation r); + void PushRoot(Heap::RootListIndex index) { + LoadRoot(at, index); + Push(at); + } + + // 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) { + LoadRoot(at, index); + Branch(if_equal, eq, with, Operand(at)); + } + + // 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) { + LoadRoot(at, index); + Branch(if_not_equal, ne, with, Operand(at)); + } + // Load an object from the root table. void LoadRoot(Register destination, Heap::RootListIndex index); @@ -662,6 +689,9 @@ class MacroAssembler: public Assembler { void Uld(Register rd, const MemOperand& rs, Register scratch = at); void Usd(Register rd, const MemOperand& rs, Register scratch = at); + void LoadWordPair(Register rd, const MemOperand& rs, Register scratch = at); + void StoreWordPair(Register rd, const MemOperand& rs, Register scratch = at); + // Load int32 in the rd register. void li(Register rd, Operand j, LiFlags mode = OPTIMIZE_SIZE); inline void li(Register rd, int64_t j, LiFlags mode = OPTIMIZE_SIZE) { @@ -778,11 +808,6 @@ class MacroAssembler: public Assembler { // into register dst. void LoadFromSafepointRegisterSlot(Register dst, Register src); - // Flush the I-cache from asm code. You should use CpuFeatures::FlushICache - // from C. - // Does not handle errors. - void FlushICache(Register address, unsigned instructions); - // MIPS64 R2 instruction macro. void Ins(Register rt, Register rs, uint16_t pos, uint16_t size); void Ext(Register rt, Register rs, uint16_t pos, uint16_t size); @@ -953,6 +978,9 @@ class MacroAssembler: public Assembler { 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 @@ -1008,15 +1036,6 @@ class MacroAssembler: public Assembler { const CallWrapper& call_wrapper); - void IsObjectJSObjectType(Register heap_object, - Register map, - Register scratch, - Label* fail); - - void IsInstanceJSObjectType(Register map, - Register scratch, - Label* fail); - void IsObjectJSStringType(Register object, Register scratch, Label* fail); @@ -1071,11 +1090,8 @@ class MacroAssembler: public Assembler { // function and jumps to the miss label if the fast checks fail. The // function register will be untouched; the other registers may be // clobbered. - void TryGetFunctionPrototype(Register function, - Register result, - Register scratch, - Label* miss, - bool miss_on_bound_function = false); + void TryGetFunctionPrototype(Register function, Register result, + Register scratch, Label* miss); void GetObjectType(Register function, Register map, @@ -1374,18 +1390,16 @@ const Operand& rt = Operand(zero_reg), BranchDelaySlot bd = PROTECT void JumpToExternalReference(const ExternalReference& builtin, BranchDelaySlot bd = PROTECT); - // Invoke specified builtin JavaScript function. Adds an entry to - // the unresolved list if the name does not resolve. - void InvokeBuiltin(Builtins::JavaScript id, - InvokeFlag flag, + // Invoke specified builtin JavaScript function. + void InvokeBuiltin(int native_context_index, InvokeFlag flag, const CallWrapper& call_wrapper = NullCallWrapper()); // Store the code object for the given builtin in the target register and // setup the function in a1. - void GetBuiltinEntry(Register target, Builtins::JavaScript id); + void GetBuiltinEntry(Register target, int native_context_index); // Store the function for the given builtin in the target register. - void GetBuiltinFunction(Register target, Builtins::JavaScript id); + void GetBuiltinFunction(Register target, int native_context_index); struct Unresolved { int pc; @@ -1571,6 +1585,9 @@ const Operand& rt = Operand(zero_reg), BranchDelaySlot bd = PROTECT // 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, Register scratch); @@ -1590,18 +1607,6 @@ const Operand& rt = Operand(zero_reg), BranchDelaySlot bd = PROTECT // ------------------------------------------------------------------------- // String utilities. - // Generate code to do a lookup in the number string cache. If the number in - // the register object is found in the cache the generated code falls through - // with the result in the result register. The object and the result register - // can be the same. If the number is not found in the cache the code jumps to - // the label not_found with only the content of register object unchanged. - void LookupNumberStringCache(Register object, - Register result, - Register scratch1, - Register scratch2, - Register scratch3, - Label* not_found); - // Checks if both instance types are sequential one-byte strings and jumps to // label if either is not. void JumpIfBothInstanceTypesAreNotSequentialOneByte( @@ -1676,20 +1681,14 @@ const Operand& rt = Operand(zero_reg), BranchDelaySlot bd = PROTECT void StubPrologue(); void Prologue(bool code_pre_aging); + // Load the type feedback vector from a JavaScript frame. + void EmitLoadTypeFeedbackVector(Register vector); + // Activation support. void EnterFrame(StackFrame::Type type); void EnterFrame(StackFrame::Type type, bool load_constant_pool_pointer_reg); void LeaveFrame(StackFrame::Type type); - // Patch the relocated value (lui/ori pair). - void PatchRelocatedValue(Register li_location, - Register scratch, - Register new_value); - // Get the relocatad value (loaded data) from the lui/ori pair. - void GetRelocatedValue(Register li_location, - Register value, - Register scratch); - // Expects object in a0 and returns map with validated enum cache // in a0. Assumes that any other register can be used as a scratch. void CheckEnumCache(Register null_value, Label* call_runtime); @@ -1758,10 +1757,6 @@ const Operand& rt = Operand(zero_reg), BranchDelaySlot bd = PROTECT InvokeFlag flag, const CallWrapper& call_wrapper); - // Get the code for the given builtin. Returns if able to resolve - // the function in the 'resolved' flag. - Handle<Code> ResolveBuiltin(Builtins::JavaScript id, bool* resolved); - void InitializeNewString(Register string, Register length, Heap::RootListIndex map_index, |