| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 CompareRoot(object, Heap::kUndefinedValueRootIndex); | 909 CompareRoot(object, Heap::kUndefinedValueRootIndex); |
| 910 b(ne, not_int32); | 910 b(ne, not_int32); |
| 911 // |undefined| is truncated to 0. | 911 // |undefined| is truncated to 0. |
| 912 mov(dst, Operand(Smi::FromInt(0))); | 912 mov(dst, Operand(Smi::FromInt(0))); |
| 913 // Fall through. | 913 // Fall through. |
| 914 | 914 |
| 915 bind(&done); | 915 bind(&done); |
| 916 } | 916 } |
| 917 | 917 |
| 918 | 918 |
| 919 void MacroAssembler::Prologue(PrologueFrameMode frame_mode) { |
| 920 if (frame_mode == BUILD_STUB_FRAME) { |
| 921 stm(db_w, sp, cp.bit() | fp.bit() | lr.bit()); |
| 922 Push(Smi::FromInt(StackFrame::STUB)); |
| 923 // Adjust FP to point to saved FP. |
| 924 add(fp, sp, Operand(2 * kPointerSize)); |
| 925 } else { |
| 926 PredictableCodeSizeScope predictible_code_size_scope( |
| 927 this, kNoCodeAgeSequenceLength * Assembler::kInstrSize); |
| 928 // The following three instructions must remain together and unmodified |
| 929 // for code aging to work properly. |
| 930 if (FLAG_optimize_for_size && FLAG_age_code) { |
| 931 // Pre-age the code. |
| 932 Code* stub = Code::GetPreAgedCodeAgeStub(isolate()); |
| 933 add(r0, pc, Operand(-8)); |
| 934 ldr(pc, MemOperand(pc, -4)); |
| 935 dd(reinterpret_cast<uint32_t>(stub->instruction_start())); |
| 936 } else { |
| 937 stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); |
| 938 nop(ip.code()); |
| 939 // Adjust FP to point to saved FP. |
| 940 add(fp, sp, Operand(2 * kPointerSize)); |
| 941 } |
| 942 } |
| 943 } |
| 944 |
| 945 |
| 919 void MacroAssembler::EnterFrame(StackFrame::Type type) { | 946 void MacroAssembler::EnterFrame(StackFrame::Type type) { |
| 920 // r0-r3: preserved | 947 // r0-r3: preserved |
| 921 stm(db_w, sp, cp.bit() | fp.bit() | lr.bit()); | 948 stm(db_w, sp, cp.bit() | fp.bit() | lr.bit()); |
| 922 mov(ip, Operand(Smi::FromInt(type))); | 949 mov(ip, Operand(Smi::FromInt(type))); |
| 923 push(ip); | 950 push(ip); |
| 924 mov(ip, Operand(CodeObject())); | 951 mov(ip, Operand(CodeObject())); |
| 925 push(ip); | 952 push(ip); |
| 926 add(fp, sp, Operand(3 * kPointerSize)); // Adjust FP to point to saved FP. | 953 add(fp, sp, Operand(3 * kPointerSize)); // Adjust FP to point to saved FP. |
| 927 } | 954 } |
| 928 | 955 |
| (...skipping 2922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3851 b(ne, call_runtime); | 3878 b(ne, call_runtime); |
| 3852 | 3879 |
| 3853 ldr(r2, FieldMemOperand(r1, Map::kPrototypeOffset)); | 3880 ldr(r2, FieldMemOperand(r1, Map::kPrototypeOffset)); |
| 3854 cmp(r2, null_value); | 3881 cmp(r2, null_value); |
| 3855 b(ne, &next); | 3882 b(ne, &next); |
| 3856 } | 3883 } |
| 3857 | 3884 |
| 3858 | 3885 |
| 3859 void MacroAssembler::TestJSArrayForAllocationMemento( | 3886 void MacroAssembler::TestJSArrayForAllocationMemento( |
| 3860 Register receiver_reg, | 3887 Register receiver_reg, |
| 3861 Register scratch_reg) { | 3888 Register scratch_reg, |
| 3862 Label no_memento_available; | 3889 Label* no_memento_found) { |
| 3863 ExternalReference new_space_start = | 3890 ExternalReference new_space_start = |
| 3864 ExternalReference::new_space_start(isolate()); | 3891 ExternalReference::new_space_start(isolate()); |
| 3865 ExternalReference new_space_allocation_top = | 3892 ExternalReference new_space_allocation_top = |
| 3866 ExternalReference::new_space_allocation_top_address(isolate()); | 3893 ExternalReference::new_space_allocation_top_address(isolate()); |
| 3867 add(scratch_reg, receiver_reg, | 3894 add(scratch_reg, receiver_reg, |
| 3868 Operand(JSArray::kSize + AllocationMemento::kSize - kHeapObjectTag)); | 3895 Operand(JSArray::kSize + AllocationMemento::kSize - kHeapObjectTag)); |
| 3869 cmp(scratch_reg, Operand(new_space_start)); | 3896 cmp(scratch_reg, Operand(new_space_start)); |
| 3870 b(lt, &no_memento_available); | 3897 b(lt, no_memento_found); |
| 3871 mov(ip, Operand(new_space_allocation_top)); | 3898 mov(ip, Operand(new_space_allocation_top)); |
| 3872 ldr(ip, MemOperand(ip)); | 3899 ldr(ip, MemOperand(ip)); |
| 3873 cmp(scratch_reg, ip); | 3900 cmp(scratch_reg, ip); |
| 3874 b(gt, &no_memento_available); | 3901 b(gt, no_memento_found); |
| 3875 ldr(scratch_reg, MemOperand(scratch_reg, -AllocationMemento::kSize)); | 3902 ldr(scratch_reg, MemOperand(scratch_reg, -AllocationMemento::kSize)); |
| 3876 cmp(scratch_reg, | 3903 cmp(scratch_reg, |
| 3877 Operand(isolate()->factory()->allocation_memento_map())); | 3904 Operand(isolate()->factory()->allocation_memento_map())); |
| 3878 bind(&no_memento_available); | |
| 3879 } | 3905 } |
| 3880 | 3906 |
| 3881 | 3907 |
| 3882 Register GetRegisterThatIsNotOneOf(Register reg1, | 3908 Register GetRegisterThatIsNotOneOf(Register reg1, |
| 3883 Register reg2, | 3909 Register reg2, |
| 3884 Register reg3, | 3910 Register reg3, |
| 3885 Register reg4, | 3911 Register reg4, |
| 3886 Register reg5, | 3912 Register reg5, |
| 3887 Register reg6) { | 3913 Register reg6) { |
| 3888 RegList regs = 0; | 3914 RegList regs = 0; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3966 void CodePatcher::EmitCondition(Condition cond) { | 3992 void CodePatcher::EmitCondition(Condition cond) { |
| 3967 Instr instr = Assembler::instr_at(masm_.pc_); | 3993 Instr instr = Assembler::instr_at(masm_.pc_); |
| 3968 instr = (instr & ~kCondMask) | cond; | 3994 instr = (instr & ~kCondMask) | cond; |
| 3969 masm_.emit(instr); | 3995 masm_.emit(instr); |
| 3970 } | 3996 } |
| 3971 | 3997 |
| 3972 | 3998 |
| 3973 } } // namespace v8::internal | 3999 } } // namespace v8::internal |
| 3974 | 4000 |
| 3975 #endif // V8_TARGET_ARCH_ARM | 4001 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |