diff options
Diffstat (limited to 'deps/v8/src/arm/macro-assembler-arm.h')
-rw-r--r-- | deps/v8/src/arm/macro-assembler-arm.h | 104 |
1 files changed, 21 insertions, 83 deletions
diff --git a/deps/v8/src/arm/macro-assembler-arm.h b/deps/v8/src/arm/macro-assembler-arm.h index 821a1096d3..a69b918ed8 100644 --- a/deps/v8/src/arm/macro-assembler-arm.h +++ b/deps/v8/src/arm/macro-assembler-arm.h @@ -5,6 +5,7 @@ #ifndef V8_ARM_MACRO_ASSEMBLER_ARM_H_ #define V8_ARM_MACRO_ASSEMBLER_ARM_H_ +#include "src/arm/assembler-arm.h" #include "src/assembler.h" #include "src/bailout-reason.h" #include "src/frames.h" @@ -92,6 +93,9 @@ class MacroAssembler: public Assembler { MacroAssembler(Isolate* isolate, void* buffer, int size, CodeObjectRequired create_code_object); + int jit_cookie() const { return jit_cookie_; } + + Isolate* isolate() const { return isolate_; } // Returns the size of a call in instructions. Note, the value returned is // only valid as long as no entries are added to the constant pool between @@ -174,7 +178,7 @@ class MacroAssembler: public Assembler { void Pop(Register dst) { pop(dst); } // Register move. May do nothing if the registers are identical. - void Move(Register dst, Smi* smi) { mov(dst, Operand(smi)); } + void Move(Register dst, Smi* smi); void Move(Register dst, Handle<Object> value); void Move(Register dst, Register src, Condition cond = al); void Move(Register dst, const Operand& src, SBit sbit = LeaveCC, @@ -332,7 +336,7 @@ class MacroAssembler: public Assembler { // Push a handle. void Push(Handle<Object> handle); - void Push(Smi* smi) { Push(Handle<Smi>(smi, isolate())); } + void Push(Smi* smi); // Push two registers. Pushes leftmost register first (to highest address). void Push(Register src1, Register src2, Condition cond = al) { @@ -563,6 +567,7 @@ class MacroAssembler: public Assembler { void VmovExtended(const MemOperand& dst, int src_code, Register scratch); void ExtractLane(Register dst, QwNeonRegister src, NeonDataType dt, int lane); + void ExtractLane(Register dst, DwVfpRegister src, NeonDataType dt, int lane); void ExtractLane(SwVfpRegister dst, QwNeonRegister src, Register scratch, int lane); void ReplaceLane(QwNeonRegister dst, QwNeonRegister src, Register src_lane, @@ -658,11 +663,7 @@ class MacroAssembler: public Assembler { Register map, Register scratch); - void InitializeRootRegister() { - ExternalReference roots_array_start = - ExternalReference::roots_array_start(isolate()); - mov(kRootRegister, Operand(roots_array_start)); - } + void InitializeRootRegister(); // --------------------------------------------------------------------------- // JavaScript invokes @@ -711,10 +712,6 @@ class MacroAssembler: public Assembler { Register scratch, Label* fail); - void IsObjectNameType(Register object, - Register scratch, - Label* fail); - // Frame restart support void MaybeDropFrames(); @@ -884,17 +881,6 @@ class MacroAssembler: public Assembler { Label* fail, SmiCheckType smi_check_type); - - // Check if the map of an object is equal to a specified weak map and branch - // to a specified target if equal. Skip the smi check if not required - // (object is known to be a heap object) - void DispatchWeakMap(Register obj, Register scratch1, Register scratch2, - Handle<WeakCell> cell, Handle<Code> success, - SmiCheckType smi_check_type); - - // Compare the given value and the value of weak cell. - void CmpWeakValue(Register value, Handle<WeakCell> cell, Register scratch); - void GetWeakValue(Register value, Handle<WeakCell> cell); // Load the value of the weak cell in the value register. Branch to the given @@ -927,16 +913,8 @@ class MacroAssembler: public Assembler { // Returns a condition that will be enabled if the object was a string // and the passed-in condition passed. If the passed-in condition failed // then flags remain unchanged. - Condition IsObjectStringType(Register obj, - Register type, - Condition cond = al) { - ldr(type, FieldMemOperand(obj, HeapObject::kMapOffset), cond); - ldrb(type, FieldMemOperand(type, Map::kInstanceTypeOffset), cond); - tst(type, Operand(kIsNotStringMask), cond); - DCHECK_EQ(0u, kStringTag); - return eq; - } - + Condition IsObjectStringType(Register obj, Register type, + Condition cond = al); // Get the number of least significant bits from a register void GetLeastBitsFromSmi(Register dst, Register src, int num_least_bits); @@ -1151,7 +1129,6 @@ class MacroAssembler: public Assembler { // Calls Abort(msg) if the condition cond is not satisfied. // Use --debug_code to enable. void Assert(Condition cond, BailoutReason reason); - void AssertFastElements(Register elements); // Like Assert(), but always enabled. void Check(Condition cond, BailoutReason reason); @@ -1201,12 +1178,8 @@ class MacroAssembler: public Assembler { // --------------------------------------------------------------------------- // Smi utilities - void SmiTag(Register reg, SBit s = LeaveCC) { - add(reg, reg, Operand(reg), s); - } - void SmiTag(Register dst, Register src, SBit s = LeaveCC) { - add(dst, src, Operand(src), s); - } + void SmiTag(Register reg, SBit s = LeaveCC); + void SmiTag(Register dst, Register src, SBit s = LeaveCC); // Try to convert int32 to smi. If the value is to large, preserve // the original value and jump to not_a_smi. Destroys scratch and @@ -1233,40 +1206,21 @@ class MacroAssembler: public Assembler { void UntagAndJumpIfSmi(Register dst, Register src, Label* smi_case); // Test if the register contains a smi (Z == 0 (eq) if true). - inline void SmiTst(Register value) { - tst(value, Operand(kSmiTagMask)); - } - inline void NonNegativeSmiTst(Register value) { - tst(value, Operand(kSmiTagMask | kSmiSignMask)); - } + void SmiTst(Register value); + void NonNegativeSmiTst(Register value); // Jump if the register contains a smi. - inline void JumpIfSmi(Register value, Label* smi_label) { - tst(value, Operand(kSmiTagMask)); - b(eq, smi_label); - } + void JumpIfSmi(Register value, Label* smi_label); // Jump if either of the registers contain a non-smi. - inline void JumpIfNotSmi(Register value, Label* not_smi_label) { - tst(value, Operand(kSmiTagMask)); - b(ne, not_smi_label); - } + void JumpIfNotSmi(Register value, Label* not_smi_label); // Jump if either of the registers contain a non-smi. void JumpIfNotBothSmi(Register reg1, Register reg2, Label* on_not_both_smi); // Jump if either of the registers contain a smi. void JumpIfEitherSmi(Register reg1, Register reg2, Label* on_either_smi); - // Abort execution if argument is a number, enabled via --debug-code. - void AssertNotNumber(Register object); - // Abort execution if argument is a smi, enabled via --debug-code. void AssertNotSmi(Register object); void AssertSmi(Register object); - // Abort execution if argument is not a string, enabled via --debug-code. - void AssertString(Register object); - - // 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); @@ -1276,10 +1230,7 @@ class MacroAssembler: public Assembler { // Abort execution if argument is not a JSGeneratorObject, // enabled via --debug-code. - void AssertGeneratorObject(Register object); - - // Abort execution if argument is not a JSReceiver, enabled via --debug-code. - void AssertReceiver(Register object); + void AssertGeneratorObject(Register object, Register suspend_flags); // Abort execution if argument is not undefined or an AllocationSite, enabled // via --debug-code. @@ -1352,22 +1303,8 @@ class MacroAssembler: public Assembler { DecodeField<Field>(reg, reg); } - template<typename Field> - void DecodeFieldToSmi(Register dst, Register src) { - static const int shift = Field::kShift; - static const int mask = Field::kMask >> shift << kSmiTagSize; - STATIC_ASSERT((mask & (0x80000000u >> (kSmiTagSize - 1))) == 0); - STATIC_ASSERT(kSmiTag == 0); - if (shift < kSmiTagSize) { - mov(dst, Operand(src, LSL, kSmiTagSize - shift)); - and_(dst, dst, Operand(mask)); - } else if (shift > kSmiTagSize) { - mov(dst, Operand(src, LSR, shift - kSmiTagSize)); - and_(dst, dst, Operand(mask)); - } else { - and_(dst, src, Operand(mask)); - } - } + template <typename Field> + void DecodeFieldToSmi(Register dst, Register src); template<typename Field> void DecodeFieldToSmi(Register reg) { @@ -1450,15 +1387,16 @@ class MacroAssembler: public Assembler { bool generating_stub_; bool has_frame_; + Isolate* isolate_; // This handle will be patched with the code object on installation. Handle<Object> code_object_; + int jit_cookie_; // Needs access to SafepointRegisterStackIndex for compiled frame // traversal. friend class StandardFrame; }; - // The code patcher is used to patch (typically) small parts of code e.g. for // debugging and other types of instrumentation. When using the code patcher // the exact number of bytes specified must be emitted. It is not legal to emit |